From 3544f85db2bb067a747b06251102cb8466021fbf Mon Sep 17 00:00:00 2001 From: martinprobst Date: Fri, 16 Nov 2018 08:00:56 -0800 Subject: [PATCH 001/316] Disallow TypeScript-producing rules as srcs in ts_library and ng_module. Previously, it was possible to write a TypeScript rule depending on another TypeScript rule: ts_library(name = "a", srcs = ["a.ts"]) ts_library(name = "b", srcs = [":a"]) Because the default "files" output of "a" above is "a.d.ts", "b" will accept this input and treat it as a regular ".d.ts" source file. That's very confusing, but also wrong on multiple levels: it'll treat the symbols from the .d.ts file as external, preventing renaming and generating externs. It also has a change to subtly break module resolution, and generally confuse tsickle. PiperOrigin-RevId: 221794400 --- internal/common/compilation.bzl | 10 ++++++++++ package.bzl | 6 +++--- package.json | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index e6584202..06f3093c 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -227,6 +227,16 @@ def compile_ts( # Sources can be in sub-folders, but not in sub-packages. fail("Sources must be in the same package as the ts_library rule, " + "but %s is not in %s" % (src.label, ctx.label.package), "srcs") + if hasattr(src, "typescript"): + # Guard against users accidentally putting deps into srcs by + # rejecting all srcs values that have a TypeScript provider. + # TS rules produce a ".d.ts" file, which is a valid input in "srcs", + # and will then be compiled as a source .d.ts file would, creating + # externs etc. + fail( + "must not reference any TypeScript rules - did you mean deps?", + "srcs", + ) for f in src.files: has_sources = True diff --git a/package.bzl b/package.bzl index 9b726d6b..d32f6afa 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.21.0" +VERSION = "0.20.3" def rules_typescript_dependencies(): """ @@ -38,8 +38,8 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.1.zip"], - strip_prefix = "rules_nodejs-0.16.1", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.0.zip"], + strip_prefix = "rules_nodejs-0.16.0", ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.json b/package.json index 703eed8a..641b98f8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.21.0", + "version": "0.20.3", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", From 7db266301954e61750bbcedfefbaeb8f34aa3155 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Mon, 19 Nov 2018 07:23:00 -0800 Subject: [PATCH 002/316] Do not create empty BUILD files in packages that do not contain any TS. In a previous change, we changed taze not to track whether it made changes to the BUILD file, but rather just make the changes and compare the BUILD file(s) for equality after the fact. That change had a bug where it'd always create a (potentially empty) BUILD file, even if non previously existed and the package does not contain any TypeScript. This change fixes the problem by treating a newly created empty BUILD file as equivalent to no BUILD file at all, and not writing the file in that case. PiperOrigin-RevId: 222072180 --- ts_auto_deps/updater/updater.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 01f85a69..3a41b109 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -445,13 +445,18 @@ func (upd *Updater) maybeWriteBUILD(ctx context.Context, path string, bld *build platform.Infof("Formatted %s: %s\n", path, ri) newContent := build.Format(bld) oldContent, err := platform.ReadFile(ctx, path) - if err != nil && !os.IsNotExist(err) { - return false, err - } else if err == nil { - // i.e. not a not exist error => compare contents, only update if changed. - if bytes.Equal(oldContent, newContent) { + if err != nil { + if !os.IsNotExist(err) { + return false, err + } else if len(newContent) == 0 { + // The BUILD file does not exist, and the newly created file has no content. + // Treat this as equivalent, and do not create a new BUILD file. return false, nil } + // Fall through to write a new file. + } else if bytes.Equal(oldContent, newContent) { + // Compare contents, only update if changed. + return false, nil } if err := upd.updateFile(ctx, path, string(newContent)); err != nil { return false, fmt.Errorf("failed to update %q: %v", path, err) From 59b658f5538e02a048ccf92ff43c2e0575667caf Mon Sep 17 00:00:00 2001 From: evanm Date: Tue, 20 Nov 2018 16:08:45 -0800 Subject: [PATCH 003/316] adjust code to reflect renamed tsickle field PiperOrigin-RevId: 222322952 --- internal/tsc_wrapped/compiler_host.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 86115ba8..cb1b1fce 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -82,6 +82,8 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { isJsTranspilation: boolean; provideExternalModuleDtsNamespace: boolean; options: BazelTsOptions; + moduleResolutionHost: ts.ModuleResolutionHost = this; + // TODO(evanm): delete this once tsickle is updated. host: ts.ModuleResolutionHost = this; private allowActionInputReads = true; From 5e2a7381791a0674fe74b9392953871af523a8c1 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 29 Nov 2018 13:37:43 -0800 Subject: [PATCH 004/316] Ensure that taze doesn't modify BUILDs with no TypeScript. PiperOrigin-RevId: 223402465 --- ts_auto_deps/updater/updater.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 3a41b109..83d1ddb6 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -517,6 +517,10 @@ func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFil } platform.Infof("Updating sources") + if len(srcs) == 0 && len(allTSRules(bld)) == 0 { + // No TypeScript rules/sources, no need to update anything + return false, nil + } updateSources(bld, srcs) return upd.maybeWriteBUILD(ctx, buildFilePath, bld) From cd91a8c4079db2185d56474ba1b61503962d15b2 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 29 Nov 2018 14:32:05 -0800 Subject: [PATCH 005/316] Update buildifier to the latest version PiperOrigin-RevId: 223412432 --- package.bzl | 6 +++--- ts_auto_deps/updater/updater.go | 2 +- ts_auto_deps/updater/updater_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.bzl b/package.bzl index d32f6afa..2cb87c2c 100644 --- a/package.bzl +++ b/package.bzl @@ -73,9 +73,9 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "com_github_bazelbuild_buildtools", - url = "https://github.com/bazelbuild/buildtools/archive/0.12.0.zip", - strip_prefix = "buildtools-0.12.0", - sha256 = "ec495cbd19238c9dc488fd65ca1fee56dcb1a8d6d56ee69a49f2ebe69826c261", + url = "https://github.com/bazelbuild/buildtools/archive/0.19.2.1.zip", + strip_prefix = "buildtools-0.19.2.1", + sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79", ) ############################################### diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 83d1ddb6..82eb960f 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -212,7 +212,7 @@ func readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build data, err := platform.ReadFile(ctx, buildFilePath) if err != nil { if os.IsNotExist(err) { - return &build.File{Path: normalizedG3Path, Build: true}, nil + return &build.File{Path: normalizedG3Path, Type: build.TypeBuild}, nil } return nil, fmt.Errorf("reading %q: %s", buildFilePath, err) } diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index f4b59ed1..14803445 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -491,7 +491,7 @@ func TestWebAssetReferredByColon(t *testing.T) { } func TestAbsoluteBazelTarget(t *testing.T) { - bld := &build.File{Path: "foo/bar/BUILD", Build: true} + bld := &build.File{Path: "foo/bar/BUILD", Type: build.TypeBuild} tests := []struct{ target, expected string }{ {"//foo/bar:bar", "//foo/bar:bar"}, {":bar", "//foo/bar:bar"}, From 37259c30489971f66124bf068eaf9644e6a66603 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 3 Dec 2018 02:07:31 -0800 Subject: [PATCH 006/316] When transpiling JS with the TS compiler, use a custom JS module resolver that is significantly simpler than TypeScript's module resolver. Specifically, it does no inference and does not look at the file system. It accepts relative path imports, and workspace-rooted import paths (i.e. google3/foo/bar.js). This change builds on top of https://github.com/angular/tsickle/pull/948 PiperOrigin-RevId: 223763346 --- internal/tsc_wrapped/compiler_host.ts | 8 +-- internal/tsc_wrapped/tsc_wrapped.ts | 70 ++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index cb1b1fce..f914eb9c 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -52,7 +52,7 @@ function validateBazelOptions(bazelOpts: BazelOptions) { } } -const TS_EXT = /(\.d)?\.tsx?$/; +const SOURCE_EXT = /((\.d)?\.tsx?|\.js)$/; /** * CompilerHost that knows how to cache parsed files to improve compile times. @@ -258,7 +258,7 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { } if (resolvedPath) { // Strip file extensions. - importPath = resolvedPath.replace(TS_EXT, ''); + importPath = resolvedPath.replace(SOURCE_EXT, ''); // Make sure all module names include the workspace name. if (importPath.indexOf(this.bazelOpts.workspaceName) !== 0) { importPath = path.posix.join(this.bazelOpts.workspaceName, importPath); @@ -302,7 +302,7 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { if (!this.shouldNameModule(sf.fileName)) return undefined; // /build/work/bazel-out/local-fastbuild/bin/path/to/file.ts // -> path/to/file - let fileName = this.rootDirsRelative(sf.fileName).replace(TS_EXT, ''); + let fileName = this.rootDirsRelative(sf.fileName).replace(SOURCE_EXT, ''); let workspace = this.bazelOpts.workspaceName; @@ -325,7 +325,7 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { const relativeFileName = path.posix.relative(this.bazelOpts.package, fileName); if (!relativeFileName.startsWith('..')) { if (this.bazelOpts.moduleRoot && - this.bazelOpts.moduleRoot.replace(TS_EXT, '') === + this.bazelOpts.moduleRoot.replace(SOURCE_EXT, '') === relativeFileName) { return this.bazelOpts.moduleName; } diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 259f7d7e..f2bb9aba 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -190,8 +190,12 @@ function runFromOptions( const compilerHostDelegate = ts.createCompilerHost({target: ts.ScriptTarget.ES5}); + const moduleResolver = bazelOpts.isJsTranspilation ? + makeJsModuleResolver(bazelOpts.workspaceName) : + ts.resolveModuleName; const compilerHost = new CompilerHost( - files, options, bazelOpts, compilerHostDelegate, fileLoader); + files, options, bazelOpts, compilerHostDelegate, fileLoader, + moduleResolver); const oldProgram = cache.getProgram(bazelOpts.target); @@ -332,6 +336,70 @@ function mkdirp(base: string, subdir: string) { } +/** + * Resolve module filenames for JS modules. + * + * JS module resolution needs to be different because when transpiling JS we + * do not pass in any dependencies, so the TS module resolver will not resolve + * any files. + * + * Fortunately, JS module resolution is very simple. The imported module name + * must either a relative path, or the workspace root (i.e. 'google3'), + * so we can perform module resolution entirely based on file names, without + * looking at the filesystem. + */ +function makeJsModuleResolver(workspaceName: string) { + // The literal '/' here is cross-platform safe because it's matching on + // import specifiers, not file names. + const workspaceModuleSpecifierPrefix = `${workspaceName}/`; + const workspaceDir = `${path.sep}${workspaceName}${path.sep}`; + function jsModuleResolver( + moduleName: string, containingFile: string, + compilerOptions: ts.CompilerOptions, host: ts.ModuleResolutionHost): + ts.ResolvedModuleWithFailedLookupLocations { + let resolvedFileName; + if (containingFile === '') { + // In tsickle we resolve the filename against '' to get the goog module + // name of a sourcefile. + resolvedFileName = moduleName; + } else if (moduleName.startsWith(workspaceModuleSpecifierPrefix)) { + // Given a workspace name of 'foo', we want to resolve import specifiers + // like: 'foo/project/file.js' to the absolute filesystem path of + // project/file.js within the workspace. + const workspaceDirLocation = containingFile.indexOf(workspaceDir); + if (workspaceDirLocation < 0) { + return {resolvedModule: undefined}; + } + const absolutePathToWorkspaceDir = + containingFile.slice(0, workspaceDirLocation); + resolvedFileName = path.join(absolutePathToWorkspaceDir, moduleName); + } else { + if (!moduleName.startsWith('./') && !moduleName.startsWith('../')) { + throw new Error( + `Unsupported module import specifier: ${ + JSON.stringify(moduleName)}.\n` + + `JS module imports must either be relative paths ` + + `(beginning with '.' or '..'), ` + + `or they must begin with '${workspaceName}/'.`); + } + resolvedFileName = path.join(path.dirname(containingFile), moduleName); + } + return { + resolvedModule: { + resolvedFileName, + extension: ts.Extension.Js, // js can only import js + // These two fields are cargo culted from what ts.resolveModuleName + // seems to return. + packageId: undefined, + isExternalLibraryImport: false, + } + }; + } + + return jsModuleResolver; +} + + if (require.main === module) { // Do not call process.exit(), as that terminates the binary before // completing pending operations, such as writing to stdout or emitting the From f9d6edb0ea3e28ae4957ed65e16465d373f13fc6 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 3 Dec 2018 16:54:47 -0800 Subject: [PATCH 007/316] fix: do not return empty struct if there is no compile action Currently if there is no action for a `ts_library` that just declares `.d.ts` files, the `replay_params` will be set to an empty struct. Design-wise this does not make any sense because there is nothing to be "replayed". This fixes an issue where the Angular Bazel rules throw an exception if there are "replay_params", but are referring to a struct that does not include the "outputs" property. ``` target.typescript.replay_params.outputs struct' object has no attribute 'outputs' ``` Closes #326 PiperOrigin-RevId: 223888797 --- internal/build_defs.bzl | 2 +- package.bzl | 6 +++--- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index 7602db65..51d15b18 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -94,7 +94,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description # A ts_library that has only .d.ts inputs will have no outputs, # therefore there are no actions to execute if not action_outputs: - return struct() + return None action_inputs.extend(_filter_ts_inputs(ctx.files.node_modules)) diff --git a/package.bzl b/package.bzl index 2cb87c2c..34dbd529 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.20.3" +VERSION = "0.21.0" def rules_typescript_dependencies(): """ @@ -38,8 +38,8 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.0.zip"], - strip_prefix = "rules_nodejs-0.16.0", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.1.zip"], + strip_prefix = "rules_nodejs-0.16.1", ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.json b/package.json index 641b98f8..703eed8a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.20.3", + "version": "0.21.0", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", From 676567c7369bc45470ea244b2bfd387e3411da87 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 4 Dec 2018 07:08:59 -0800 Subject: [PATCH 008/316] internal change PiperOrigin-RevId: 223970795 --- internal/common/tsconfig.bzl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 971bd83b..7bf1f2dc 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -69,6 +69,10 @@ def create_tsconfig( if p ]) workspace_path = "/".join([".."] * len(tsconfig_dir.split("/"))) + + # Sourcemaps should be relative to workspace_root. Reuse the tsconfig_dir, but take out the bin_dir. + sourcemap_root = "/".join([".."] * (len(tsconfig_dir.split("/")) - len(ctx.bin_dir.path.split("/")))) + if module_path_prefixes == None: module_path_prefixes = [ "", @@ -251,6 +255,7 @@ def create_tsconfig( # Embed source maps and sources in .js outputs "inlineSourceMap": True, "inlineSources": True, + "sourceRoot": sourcemap_root, # Implied by inlineSourceMap: True "sourceMap": False, } From 2205863bfc3d553913272b167d1529b76aa78adf Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 4 Dec 2018 17:04:06 -0800 Subject: [PATCH 009/316] Update handling of rules_nodejs transitive deps BREAKING CHANGES: rules_typescript_dependencies() will no longer install transitive dependencies of build_bazel_rules_nodejs. User WORKSPACE files will now need to install rules_nodejs transitive deps directly: ``` load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") rules_nodejs_dependencies() ``` Closes #328 PiperOrigin-RevId: 224072359 --- README.md | 6 +++++- WORKSPACE | 4 ++++ package.bzl | 13 ------------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6a7d25b5..803d0a36 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,14 @@ http_archive( strip_prefix = "rules_typescript-0.20.3", ) -# Fetch our Bazel dependencies that aren't distributed on npm +# Fetch transitive Bazel dependencies of build_bazel_rules_typescript load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +# Fetch transitive Bazel dependencies of build_bazel_rules_nodejs +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + # Setup TypeScript toolchain load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/WORKSPACE b/WORKSPACE index d3bfd5b5..cba0f4a9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -23,6 +23,10 @@ load( rules_typescript_dependencies() rules_typescript_dev_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") # Use a bazel-managed npm dependency, allowing us to test resolution to these paths diff --git a/package.bzl b/package.bzl index 34dbd529..08c90f6b 100644 --- a/package.bzl +++ b/package.bzl @@ -78,19 +78,6 @@ def rules_typescript_dependencies(): sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79", ) - ############################################### - # Repeat the dependencies of rules_nodejs here! - # We can't load() from rules_nodejs yet, because we've only just fetched it. - # But we also don't want to make users load and call the rules_nodejs_dependencies - # function because we can do that for them, mostly hiding the transitive dependency. - _maybe( - http_archive, - name = "bazel_skylib", - url = "https://github.com/bazelbuild/bazel-skylib/archive/0.5.0.zip", - strip_prefix = "bazel-skylib-0.5.0", - sha256 = "ca4e3b8e4da9266c3a9101c8f4704fe2e20eb5625b2a6a7d2d7d45e3dd4efffd", - ) - def rules_typescript_dev_dependencies(): """ Fetch dependencies needed for local development, but not needed by users. From 45bf41a7c6346e066eb47219a14be1e610b1a139 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 7 Dec 2018 16:18:40 -0800 Subject: [PATCH 010/316] fix: use Buffer.from instead of the deprecated Buffer constructor Fixes https://github.com/bazelbuild/rules_typescript/issues/313 PiperOrigin-RevId: 224595491 --- internal/karma/index.ts | 2 +- .../tests/ban_expect_truthy_promise/BUILD | 60 +++++++++++++++++ .../tests/ban_promise_as_condition/BUILD | 56 ++++++++++++++++ .../tsetse/tests/check_return_value/BUILD | 67 +++++++++++++++++++ internal/tsetse/tests/equals_nan/BUILD | 43 ++++++++++++ internal/tsetse/tests/must_use_promises/BUILD | 37 ++++++++++ 6 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 internal/tsetse/tests/ban_expect_truthy_promise/BUILD create mode 100644 internal/tsetse/tests/ban_promise_as_condition/BUILD create mode 100644 internal/tsetse/tests/check_return_value/BUILD create mode 100644 internal/tsetse/tests/equals_nan/BUILD create mode 100644 internal/tsetse/tests/must_use_promises/BUILD diff --git a/internal/karma/index.ts b/internal/karma/index.ts index 7c47734a..74c47500 100644 --- a/internal/karma/index.ts +++ b/internal/karma/index.ts @@ -55,7 +55,7 @@ function initConcatJs(logger, emitter, basePath) { } }); - bundleFile.sha = sha1(new Buffer(bundleFile.content)); + bundleFile.sha = sha1(Buffer.from(bundleFile.content)); bundleFile.mtime = new Date(); included.unshift(bundleFile); diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD new file mode 100644 index 00000000..969e29b1 --- /dev/null +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -0,0 +1,60 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +load("//internal:defaults.bzl", "ts_library") + +error_message = "error TS21224: Value passed.*" + +ts_library( + name = "jasmine", + testonly = 1, + srcs = [ + "jasmine_types.ts", + ], +) + +ts_library( + name = "positives", + testonly = 1, + tsconfig = "//internal/tsetse:tsconfig.json", + srcs = [ + "positives.ts", + ], + expected_diagnostics = [ + "\(29,5\).*" + error_message, + "\(30,5\).*" + error_message, + "\(31,5\).*" + error_message, + "\(32,5\).*" + error_message, + "\(33,5\).*" + error_message, + "\(34,5\).*" + error_message, + "\(35,5\).*" + error_message, + ], + deps = [ + ":jasmine", + ], +) + +ts_library( + name = "negatives", + testonly = 1, + tsconfig = "//internal/tsetse:tsconfig.json", + srcs = [ + "negatives.ts", + ], + deps = [ + ":jasmine", + ], +) diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD new file mode 100644 index 00000000..90ac9d02 --- /dev/null +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -0,0 +1,56 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +load("//internal:defaults.bzl", "ts_library") + +error_message = "error TS21226: Found a thenable.*" + +ts_library( + name = "jasmine", + testonly = 1, +) + +ts_library( + name = "positives", + testonly = 1, + tsconfig = "//internal/tsetse:tsconfig.json", + srcs = [ + "positives.ts", + ], + expected_diagnostics = [ + "\(7,7\).*" + error_message, + "\(15,7\).*" + error_message, + "\(23,19\).*" + error_message, + "\(25,10\).*" + error_message, + "\(30,34\).*" + error_message, + "\(31,34\).*" + error_message, + "\(37,19\).*" + error_message, + "\(39,10\).*" + error_message, + "\(44,34\).*" + error_message, + "\(45,34\).*" + error_message, + ], + deps = [ + ], +) + +ts_library( + name = "negatives", + testonly = 1, + tsconfig = "//internal/tsetse:tsconfig.json", + srcs = ["negatives.ts"], + deps = [ + ], +) diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD new file mode 100644 index 00000000..bd084947 --- /dev/null +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -0,0 +1,67 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +load("//internal:defaults.bzl", "ts_library") + + +error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" + +ts_library( + name = "no_expected_diagnostics_test", + testonly = 1, + srcs = ["no_expected_diagnostics.ts"], + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", +) + +ts_library( + name = "expected_diagnostics_test", + testonly = 1, + srcs = ["expected_diagnostics.ts"], + expected_diagnostics = [ + "\(6,1\).*" + error_message, + "\(8,1\).*" + error_message, + "\(12,1\).*" + error_message, + "\(16,1\).*" + error_message, + "\(19,1\).*" + error_message, + ], + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", +) + +ts_library( + name = "user_defined_check_return_value", + testonly = 1, + srcs = ["user_defined_check_return_value.ts"], + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", +) + +ts_library( + name = "unused_return_value_user_defined_function", + testonly = 1, + srcs = ["unused_return_value_user_defined_function.ts"], + expected_diagnostics = [ + "\(4,1\).*" + error_message, + "\(5,1\).*" + error_message, + "\(7,1\).*" + error_message, + "\(9,1\).*" + error_message, + "\(15,1\).*" + error_message, + "\(16,1\).*" + error_message, + ], + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + deps = [ + ":user_defined_check_return_value", + "@npm//@types/jasmine", + ], +) diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD new file mode 100644 index 00000000..dd086120 --- /dev/null +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -0,0 +1,43 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +load("//internal:defaults.bzl", "ts_library") + + +ts_library( + name = "positives", + testonly = 1, + srcs = [ + "positives.ts", + ], + expected_diagnostics = [ + "\(2,19\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", + "\(6,5\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", + "\(7,5\): error TS21223: x == NaN is always false; use isNaN\(x\) instead", + "\(8,5\): error TS21223: x !== NaN is always true; use !isNaN\(x\) instead", + "\(9,5\): error TS21223: x != NaN is always true; use !isNaN\(x\) instead", + "\(11,1\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", + "\(12,1\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", + ], +) + +ts_library( + name = "negatives", + testonly = 1, + srcs = [ + "negatives.ts", + ], +) diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD new file mode 100644 index 00000000..c0331e4c --- /dev/null +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -0,0 +1,37 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache 2.0 + +load("//internal:defaults.bzl", "ts_library") + + +error_message = "TS21225: All Promises in async functions must either be awaited or used in an expression." + +ts_library( + name = "positives", + testonly = 1, + srcs = [ + "positives.ts", + ], + tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + expected_diagnostics = [ + "\(29,3\)" + error_message, + "\(30,3\)" + error_message, + "\(31,3\)" + error_message, + "\(32,3\)" + error_message, + "\(34,3\)" + error_message, + ], + deps = ["//third_party/javascript/node_modules/typescript:es2015.promise"], +) From 41fb7f01c9b1b8abc017a16bf08b236a65187213 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Mon, 10 Dec 2018 09:22:54 -0800 Subject: [PATCH 011/316] Fix commenting style to adhere to the TS style guide. PiperOrigin-RevId: 224825397 --- internal/tsc_wrapped/compiler_host.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index f914eb9c..a62474a6 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -345,8 +345,10 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { return path.posix.join(workspace, fileName); } - // Resolves the typings file from a package at the specified path. - // Helper function to `resolveTypeReferenceDirectives`. + /** + * Resolves the typings file from a package at the specified path. Helper + * function to `resolveTypeReferenceDirectives`. + */ private resolveTypingFromDirectory(typePath: string, primary: boolean): ts.ResolvedTypeReferenceDirective | undefined { // Looks for the `typings` attribute in a package.json file // if it exists @@ -374,10 +376,12 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { return undefined; } - // Override the default typescript resolveTypeReferenceDirectives function. - // Resolves /// directives under bazel. - // The default typescript secondary search behavior needs to be overridden - // to support looking under `bazelOpts.nodeModulesPrefix` + /** + * Override the default typescript resolveTypeReferenceDirectives function. + * Resolves /// directives under bazel. The default + * typescript secondary search behavior needs to be overridden to support + * looking under `bazelOpts.nodeModulesPrefix` + */ resolveTypeReferenceDirectives(names: string[], containingFile: string): (ts.ResolvedTypeReferenceDirective | undefined)[] { let result: (ts.ResolvedTypeReferenceDirective | undefined)[] = [] names.forEach(name => { @@ -519,10 +523,10 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { return this.knownFiles.has(filePath); } - // Since we override getDefaultLibFileName below, we must also provide the - // directory containing the file. - // Otherwise TypeScript looks in C:\lib.xxx.d.ts for the default lib. getDefaultLibLocation(): string { + // Since we override getDefaultLibFileName below, we must also provide the + // directory containing the file. + // Otherwise TypeScript looks in C:\lib.xxx.d.ts for the default lib. return path.dirname( this.getDefaultLibFileName({target: ts.ScriptTarget.ES5})); } From 4bb7a3c8e408fc924295042cbe0df1fe59f5b100 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 10 Dec 2018 13:14:33 -0800 Subject: [PATCH 012/316] Call gatherDiagnostics to perform syntax/semantic/type checks This was accidentally removed in recent refactoring https://github.com/bazelbuild/rules_typescript/commit/1b33eba25c49d2249945374255579818dc0e94df which caused TS compilations to incorrectly succeed when the code contains errors. Restore missing tests which would have caught the regression; these were also accidentally disabled when Bazel BUILD files were refactored. PiperOrigin-RevId: 224869541 --- internal/BUILD.bazel | 3 ++- internal/tsc_wrapped/tsc_wrapped.ts | 24 +++++++++++++++++++ .../tests/ban_expect_truthy_promise/BUILD | 4 ++-- .../tests/ban_promise_as_condition/BUILD | 9 ++----- .../tsetse/tests/check_return_value/BUILD | 9 ++++--- internal/tsetse/tests/must_use_promises/BUILD | 5 ++-- internal/tsetse/tsconfig.json | 1 - 7 files changed, 37 insertions(+), 18 deletions(-) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 3762b8cd..4d3b30eb 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -17,11 +17,11 @@ package(default_visibility = ["//visibility:public"]) exports_files([ - "tsconfig.json", # Exported to be consumed for generating skydoc. "build_defs.bzl", "ts_config.bzl", "ts_repositories.bzl", + "tsetse/tsconfig.json", ]) load("//internal:defaults.bzl", "ts_library") @@ -98,6 +98,7 @@ ts_library( ":tsc_wrapped", "@npm//@types/jasmine", "@npm//@types/node", + "@npm//tsickle", "@npm//typescript", ], ) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index f2bb9aba..eb8bcbb5 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -205,6 +205,30 @@ function runFromOptions( compilerHost.inputFiles, options, compilerHost, oldProgram)); cache.putProgram(bazelOpts.target, program); + if (!bazelOpts.isJsTranspilation) { + // If there are any TypeScript type errors abort now, so the error + // messages refer to the original source. After any subsequent passes + // (decorator downleveling or tsickle) we do not type check. + let diagnostics = + gatherDiagnostics(options, bazelOpts, program, disabledTsetseRules); + if (!expectDiagnosticsWhitelist.length || + expectDiagnosticsWhitelist.some(p => bazelOpts.target.startsWith(p))) { + diagnostics = bazelDiagnostics.filterExpected( + bazelOpts, diagnostics, bazelDiagnostics.uglyFormat); + } else if (bazelOpts.expectedDiagnostics.length > 0) { + console.error( + `Only targets under ${ + expectDiagnosticsWhitelist.join(', ')} can use ` + + 'expected_diagnostics, but got', + bazelOpts.target); + } + + if (diagnostics.length > 0) { + console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); + debug('compilation failed at', new Error().stack!); + return false; + } + } const compilationTargets = program.getSourceFiles().filter( fileName => isCompilationTarget(bazelOpts, fileName)); diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index 969e29b1..dc328a10 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -29,7 +29,7 @@ ts_library( ts_library( name = "positives", testonly = 1, - tsconfig = "//internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", srcs = [ "positives.ts", ], @@ -50,7 +50,7 @@ ts_library( ts_library( name = "negatives", testonly = 1, - tsconfig = "//internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", srcs = [ "negatives.ts", ], diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 90ac9d02..5907da5a 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -18,15 +18,10 @@ load("//internal:defaults.bzl", "ts_library") error_message = "error TS21226: Found a thenable.*" -ts_library( - name = "jasmine", - testonly = 1, -) - ts_library( name = "positives", testonly = 1, - tsconfig = "//internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", srcs = [ "positives.ts", ], @@ -49,7 +44,7 @@ ts_library( ts_library( name = "negatives", testonly = 1, - tsconfig = "//internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", srcs = ["negatives.ts"], deps = [ ], diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index bd084947..be2414a3 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -23,7 +23,7 @@ ts_library( name = "no_expected_diagnostics_test", testonly = 1, srcs = ["no_expected_diagnostics.ts"], - tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", ) ts_library( @@ -37,14 +37,14 @@ ts_library( "\(16,1\).*" + error_message, "\(19,1\).*" + error_message, ], - tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", ) ts_library( name = "user_defined_check_return_value", testonly = 1, srcs = ["user_defined_check_return_value.ts"], - tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", ) ts_library( @@ -57,9 +57,8 @@ ts_library( "\(7,1\).*" + error_message, "\(9,1\).*" + error_message, "\(15,1\).*" + error_message, - "\(16,1\).*" + error_message, ], - tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", deps = [ ":user_defined_check_return_value", "@npm//@types/jasmine", diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index c0331e4c..16dddf47 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -25,7 +25,7 @@ ts_library( srcs = [ "positives.ts", ], - tsconfig = "//third_party/bazel_rules/rules_typescript/internal/tsetse:tsconfig.json", + tsconfig = "//internal:tsetse/tsconfig.json", expected_diagnostics = [ "\(29,3\)" + error_message, "\(30,3\)" + error_message, @@ -33,5 +33,6 @@ ts_library( "\(32,3\)" + error_message, "\(34,3\)" + error_message, ], - deps = ["//third_party/javascript/node_modules/typescript:es2015.promise"], + deps = [ + ], ) diff --git a/internal/tsetse/tsconfig.json b/internal/tsetse/tsconfig.json index cbcca143..f83ea7ff 100644 --- a/internal/tsetse/tsconfig.json +++ b/internal/tsetse/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "strict": true, "types": [ - "node" ], "lib": [ "dom", From b9fbb844080826006c8d0e1b9b9f8bbdd9b30980 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 10 Dec 2018 13:24:22 -0800 Subject: [PATCH 013/316] rel: 0.22.0 --- package.bzl | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.bzl b/package.bzl index 08c90f6b..b350bf5f 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.21.0" +VERSION = "0.22.0" def rules_typescript_dependencies(): """ diff --git a/package.json b/package.json index 703eed8a..a21b63ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.21.0", + "version": "0.22.0", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", From dd903d216e2eefe3b8e0121bca52d00421113d01 Mon Sep 17 00:00:00 2001 From: clydin <19598772+clydin@users.noreply.github.com> Date: Tue, 11 Dec 2018 09:54:51 -0800 Subject: [PATCH 014/316] refactor(tsetse): optimize equals-nan rule `getText()` should be avoid as it as an expensive call; favor node 'isXYZ' checks and direct `text` property access. simplify rule registration method overloads uses type property directly to remove the need for specialized overloads for each TS node type cleanup ban-expect-truthy-promise rule Closes #346 PiperOrigin-RevId: 225020913 --- internal/tsetse/checker.ts | 30 +----------- .../rules/ban_expect_truthy_promise_rule.ts | 27 +++++------ internal/tsetse/rules/equals_nan_rule.ts | 46 ++++++++++++++----- package.bzl | 2 +- package.json | 2 +- 5 files changed, 51 insertions(+), 56 deletions(-) diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 5e8b6d38..72fdbaa4 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -47,36 +47,8 @@ export class Checker { * `nodeKind` node in `nodeHandlersMap` map. After all rules register their * handlers, the source file AST will be traversed. */ - on(nodeKind: ts.SyntaxKind.BinaryExpression, - handlerFunction: (checker: Checker, node: ts.BinaryExpression) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.ConditionalExpression, - handlerFunction: - (checker: Checker, node: ts.ConditionalExpression) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.WhileStatement, - handlerFunction: (checker: Checker, node: ts.WhileStatement) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.IfStatement, - handlerFunction: (checker: Checker, node: ts.IfStatement) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.CallExpression, - handlerFunction: (checker: Checker, node: ts.CallExpression) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.PropertyDeclaration, - handlerFunction: (checker: Checker, node: ts.PropertyDeclaration) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.ElementAccessExpression, - handlerFunction: (checker: Checker, node: ts.ElementAccessExpression) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind.ImportDeclaration, - handlerFunction: (checker: Checker, node: ts.ImportDeclaration) => void, - code: number): void; - on(nodeKind: ts.SyntaxKind, - handlerFunction: (checker: Checker, node: ts.Node) => void, - code: number): void; on( - nodeKind: ts.SyntaxKind, + nodeKind: T['kind'], handlerFunction: (checker: Checker, node: T) => void, code: number) { const newHandler: Handler = {handlerFunction, code}; const registeredHandlers: Handler[]|undefined = diff --git a/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts b/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts index 6f852aee..fbbefd96 100644 --- a/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts +++ b/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts @@ -21,23 +21,27 @@ export class Rule extends AbstractRule { } } -function checkForTruthy(checker: Checker, node: ts.Node) { - const tc = checker.typeChecker; +function checkForTruthy(checker: Checker, node: ts.PropertyAccessExpression) { + if (node.name.text !== 'toBeTruthy') { + return; + } - if (!tsutils.isPropertyAccessExpression(node)) { + const expectCallNode = getLeftmostNode(node); + if (!ts.isCallExpression(expectCallNode)) { return; } - if (node.name.getText() !== 'toBeTruthy') { + if (!ts.isIdentifier(expectCallNode.expression) || expectCallNode.expression.text !== 'expect') { return; } - const expectCallNode = getLeftmostNode(tc, node); - if (!ts.isCallExpression(expectCallNode)) { + if (expectCallNode.arguments.length === 0 || ts.isAwaitExpression(expectCallNode.arguments[0])) { return; } - const signature = checker.typeChecker.getResolvedSignature(expectCallNode); + const tc = checker.typeChecker; + + const signature = tc.getResolvedSignature(expectCallNode); if (signature === undefined) { return; } @@ -48,13 +52,11 @@ function checkForTruthy(checker: Checker, node: ts.Node) { } // Only look for methods named expect that return a Matchers - if (!((symbol.name === 'Matchers') && - expectCallNode.expression.getText() === 'expect')) { + if (symbol.name !== 'Matchers') { return; } - if (!tsutils.isThenableType(tc, expectCallNode.arguments[0]) || - tsutils.isAwaitExpression(expectCallNode.arguments[0])) { + if (!tsutils.isThenableType(tc, expectCallNode.arguments[0])) { return; } @@ -67,8 +69,7 @@ function checkForTruthy(checker: Checker, node: ts.Node) { `\n\tSee http://tsetse.info/ban-expect-truthy-promise`); } -function getLeftmostNode( - tc: ts.TypeChecker, node: ts.PropertyAccessExpression) { +function getLeftmostNode(node: ts.PropertyAccessExpression) { let current: ts.LeftHandSideExpression|undefined = node; while (ts.isPropertyAccessExpression(current)) { current = current.expression; diff --git a/internal/tsetse/rules/equals_nan_rule.ts b/internal/tsetse/rules/equals_nan_rule.ts index da8f7fec..38b01d50 100644 --- a/internal/tsetse/rules/equals_nan_rule.ts +++ b/internal/tsetse/rules/equals_nan_rule.ts @@ -20,19 +20,41 @@ export class Rule extends AbstractRule { } function checkBinaryExpression(checker: Checker, node: ts.BinaryExpression) { - if (node.left.getText() === 'NaN' || node.right.getText() === 'NaN') { - const operator = node.operatorToken; - if (operator.kind == ts.SyntaxKind.EqualsEqualsToken || - operator.kind === ts.SyntaxKind.EqualsEqualsEqualsToken) { + const isLeftNaN = ts.isIdentifier(node.left) && node.left.text === 'NaN'; + const isRightNaN = ts.isIdentifier(node.right) && node.right.text === 'NaN'; + if (!isLeftNaN && !isRightNaN) { + return; + } + + // We avoid calling getText() on the node.operatorToken because it's slow. + // Instead, manually map back from the kind to the string form of the operator + switch (node.operatorToken.kind) { + case ts.SyntaxKind.EqualsEqualsToken: + checker.addFailureAtNode( + node, + `x == NaN is always false; use isNaN(x) instead`, + ); + break; + case ts.SyntaxKind.EqualsEqualsEqualsToken: + checker.addFailureAtNode( + node, + `x === NaN is always false; use isNaN(x) instead`, + ); + break; + case ts.SyntaxKind.ExclamationEqualsToken: checker.addFailureAtNode( - node, - `x ${operator.getText()} NaN is always false; use isNaN(x) instead`); - } - if (operator.kind === ts.SyntaxKind.ExclamationEqualsEqualsToken || - operator.kind === ts.SyntaxKind.ExclamationEqualsToken) { + node, + `x != NaN is always true; use !isNaN(x) instead`, + ); + break; + case ts.SyntaxKind.ExclamationEqualsEqualsToken: checker.addFailureAtNode( - node, - `x ${operator.getText()} NaN is always true; use !isNaN(x) instead`); - } + node, + `x !== NaN is always true; use !isNaN(x) instead`, + ); + break; + default: + // We don't care about other operators acting on NaN + break; } } diff --git a/package.bzl b/package.bzl index b350bf5f..08c90f6b 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.22.0" +VERSION = "0.21.0" def rules_typescript_dependencies(): """ diff --git a/package.json b/package.json index a21b63ef..703eed8a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.22.0", + "version": "0.21.0", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", From 37807e2c4eef0c0566fe3eb274ff9bd112c54279 Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Tue, 11 Dec 2018 16:50:41 -0800 Subject: [PATCH 015/316] feat(ts_library): bump default target to es2015 Closes #217 PiperOrigin-RevId: 225095761 --- examples/devmode_consumer/BUILD.bazel | 15 +++++++++++++++ .../devmode_consumer.bzl} | 8 ++++---- .../devmode_consumer_test.sh} | 7 +++++++ examples/es5_output/BUILD.bazel | 15 --------------- examples/googmodule/BUILD.bazel | 8 ++++---- internal/build_defs.bzl | 4 ++++ 6 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 examples/devmode_consumer/BUILD.bazel rename examples/{es5_output/es5_consumer.bzl => devmode_consumer/devmode_consumer.bzl} (89%) rename examples/{es5_output/es5_output_test.sh => devmode_consumer/devmode_consumer_test.sh} (95%) delete mode 100644 examples/es5_output/BUILD.bazel diff --git a/examples/devmode_consumer/BUILD.bazel b/examples/devmode_consumer/BUILD.bazel new file mode 100644 index 00000000..78d6a463 --- /dev/null +++ b/examples/devmode_consumer/BUILD.bazel @@ -0,0 +1,15 @@ +load(":devmode_consumer.bzl", "devmode_consumer") + +devmode_consumer( + name = "devmode_consumer", + deps = ["//examples:bar_ts_library"], +) + +sh_test( + name = "devmode_consumer_test", + srcs = ["devmode_consumer_test.sh"], + data = [ + ":devmode_consumer", + "@bazel_tools//tools/bash/runfiles", + ], +) diff --git a/examples/es5_output/es5_consumer.bzl b/examples/devmode_consumer/devmode_consumer.bzl similarity index 89% rename from examples/es5_output/es5_consumer.bzl rename to examples/devmode_consumer/devmode_consumer.bzl index 05d406c7..0d29ca92 100644 --- a/examples/es5_output/es5_consumer.bzl +++ b/examples/devmode_consumer/devmode_consumer.bzl @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Example of a rule that requires ES5 (devmode) inputs. +"""Example of a rule that requires es2015 (devmode) inputs. """ load("@build_bazel_rules_nodejs//internal:node.bzl", "sources_aspect") -def _es5_consumer(ctx): +def _devmode_consumer(ctx): files = depset() # Since we apply the sources_aspect to our deps below, we can iterate through @@ -32,8 +32,8 @@ def _es5_consumer(ctx): runfiles = ctx.runfiles(files.to_list()), )] -es5_consumer = rule( - implementation = _es5_consumer, +devmode_consumer = rule( + implementation = _devmode_consumer, attrs = { "deps": attr.label_list(aspects = [sources_aspect]), }, diff --git a/examples/es5_output/es5_output_test.sh b/examples/devmode_consumer/devmode_consumer_test.sh similarity index 95% rename from examples/es5_output/es5_output_test.sh rename to examples/devmode_consumer/devmode_consumer_test.sh index ab58ce59..096f4d55 100755 --- a/examples/es5_output/es5_output_test.sh +++ b/examples/devmode_consumer/devmode_consumer_test.sh @@ -79,3 +79,10 @@ if [[ "$FOO_JS" != *"define(\"build_bazel_rules_typescript/examples/foo\""* ]]; echo "$FOO_JS" exit 1 fi + +# should produce es2015 classes +if [[ "$FOO_JS" != *"class Greeter"* ]]; then + echo "Expected foo.js produce a es2015, but was" + echo "$FOO_JS" + exit 1 +fi \ No newline at end of file diff --git a/examples/es5_output/BUILD.bazel b/examples/es5_output/BUILD.bazel deleted file mode 100644 index 5bc709f8..00000000 --- a/examples/es5_output/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load(":es5_consumer.bzl", "es5_consumer") - -es5_consumer( - name = "es5_output", - deps = ["//examples:bar_ts_library"], -) - -sh_test( - name = "es5_output_test", - srcs = ["es5_output_test.sh"], - data = [ - ":es5_output", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel index 89beb257..b4092226 100644 --- a/examples/googmodule/BUILD.bazel +++ b/examples/googmodule/BUILD.bazel @@ -6,10 +6,10 @@ ts_library( tsconfig = "tsconfig.json", ) -load("//examples/es5_output:es5_consumer.bzl", "es5_consumer") +load("//examples/devmode_consumer:devmode_consumer.bzl", "devmode_consumer") -es5_consumer( - name = "es5_output", +devmode_consumer( + name = "devmode_output", deps = [":googmodule"], ) @@ -19,7 +19,7 @@ jasmine_node_test( name = "googmodule_output_test", srcs = ["googmodule_output_test.js"], data = [ - ":es5_output", + ":devmode_output", "@npm//jasmine", ], ) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index 51d15b18..5981c81b 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -187,6 +187,10 @@ def tsc_wrapped_tsconfig( ) config["bazelOptions"]["nodeModulesPrefix"] = node_modules_root + # Override the target so we use es2015 for devmode + # Since g3 isn't ready to do this yet + config["compilerOptions"]["target"] = "es2015" + # If the user gives a tsconfig attribute, the generated file should extend # from the user's tsconfig. # See https://github.com/Microsoft/TypeScript/issues/9876 From 2c9741c753740bcbb068410b9782e33235255a09 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 11 Dec 2018 17:19:13 -0800 Subject: [PATCH 016/316] Make it an error to run taze on or under a directory with ts_libraries that reference sources in subdirectories. PiperOrigin-RevId: 225100010 --- devserver/BUILD.bazel | 18 ------ ts_auto_deps/updater/updater.go | 90 +++++++++++++++++++++++++++- ts_auto_deps/updater/updater_test.go | 53 ++++++++++++++++ 3 files changed, 142 insertions(+), 19 deletions(-) delete mode 100644 devserver/BUILD.bazel diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel deleted file mode 100644 index 54fe5ea2..00000000 --- a/devserver/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_library( - name = "go_default_library", - srcs = ["main.go"], - importpath = "github.com/bazelbuild/rules_typescript/devserver", - visibility = ["//visibility:private"], - deps = [ - "//devserver/concatjs:go_default_library", - "//devserver/devserver:go_default_library", - ], -) - -go_binary( - name = "devserver", - embed = [":go_default_library"], - visibility = ["//visibility:public"], -) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 82eb960f..c5592364 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -509,6 +509,80 @@ func isTazeDisabled(ctx context.Context, g3root string, buildFilePath string, bl return false } +// SubdirectorySourcesError is returned when ts_auto_deps detects a BUILD file +// that references sources in another directory, either in the directory +// being ts_auto_depsd, or in a super directory. +type SubdirectorySourcesError struct{} + +func (a *SubdirectorySourcesError) Error() string { + return "ts_auto_deps doesn't handle referencing sources in another directory " + + "- to use ts_auto_deps, migrate to having a BUILD file in every directory. " + + "For more details, see go/ts_auto_deps#subdirectory-sources" +} + +// hasSubdirectorySources checks if the BUILD file has ts_libraries that contain +// source files from subdirectories of the directory with the BUILD. ie foo/BUILD +// has a src foo/bar/baz.ts, in the subdirectory foo/bar. +func hasSubdirectorySources(bld *build.File) bool { + for _, rule := range buildRules(bld, "ts_library") { + srcs := rule.AttrStrings("srcs") + if srcs != nil { + for _, s := range srcs { + if strings.Contains(s, "/") { + return true + } + } + } else { + // srcs wasn't a list, check for a glob over subdirectory soruces + srcExp := rule.Attr("srcs") + call, ok := srcExp.(*build.CallExpr) + if ok { + callName, ok := call.X.(*build.Ident) + if ok { + if callName.Name == "glob" { + for _, arg := range call.List { + strArg, ok := arg.(*build.StringExpr) + if ok && strings.Contains(strArg.Value, "/") { + return true + } + } + } + } + } + } + // TODO(b/120783741): + // This only handles a lists of files, and a single glob, there are other + // cases such as a glob + a list of files that it doesn't handle, but that's + // ok since, this is only meant as a caution to the user. + } + + return false +} + +// directoryOrAncestorHasSubdirectorySources checks for ts_libraries referencing sources in subdirectories. +// It checks the current directory's BUILD if it exists, otherwise it checks the nearest +// ancestor package. +func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root string, buildFilePath string, bld *build.File) (bool, error) { + if _, err := platform.Stat(ctx, buildFilePath); err != nil && os.IsNotExist(err) { + // Make sure the next closest ancestor package doesn't reference sources in a subdirectory. + ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(bld.Path)) + if _, ok := err.(*noAncestorBUILDError); ok { + // couldn't find an ancestor BUILD, so there aren't an subdirectory sources + return false, nil + } else if err != nil { + return false, err + } else if hasSubdirectorySources(ancestor) { + return true, nil + } + } + + if hasSubdirectorySources(bld) { + return true, nil + } + + return false, nil +} + func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFilePath string, bld *build.File) (bool, error) { platform.Infof("Globbing TS sources in %s", path) srcs, err := globSources(ctx, path, []string{"ts", "tsx"}) @@ -628,6 +702,14 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update return false, nil } + hasSubdirSrcs, err := directoryOrAncestorHasSubdirectorySources(ctx, g3root, buildFilePath, bld) + if err != nil { + return false, err + } + if hasSubdirSrcs { + return false, &SubdirectorySourcesError{} + } + changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld) if err != nil { return false, err @@ -1133,12 +1215,18 @@ func ResolvePackages(paths []string) error { return nil } +type noAncestorBUILDError struct{} + +func (nabe *noAncestorBUILDError) Error() string { + return "no ancestor BUILD file found" +} + // FindBUILDFile searches for the closest parent BUILD file above pkg. It // returns the parsed BUILD file, or an error if none can be found. func FindBUILDFile(ctx context.Context, pkgToBUILD map[string]*build.File, workspaceRoot string, packagePath string) (*build.File, error) { if packagePath == "." || packagePath == "/" { - return nil, fmt.Errorf("no ancestor BUILD file found") + return nil, &noAncestorBUILDError{} } if bld, ok := pkgToBUILD[packagePath]; ok { return bld, nil diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index 14803445..f587baf9 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -526,3 +526,56 @@ func TestFindBUILDFileCacheOnError(t *testing.T) { t.Fatalf("cache contained BUILD file for package") } } + +func TestHasSubdirectorySources(t *testing.T) { + tests := []struct { + name string + buildFile string + expected bool + }{ + { + name: "LocalSources", + buildFile: `ts_library(name = "lib", srcs = ["foo.ts", "bar.ts"])`, + expected: false, + }, + { + name: "SubdirectorySources", + buildFile: `ts_library(name = "lib", srcs = ["subdir/foo.ts", "subdir/bar.ts"])`, + expected: true, + }, + { + name: "LocalNgModuleSources", + buildFile: `ng_module(name = "lib", srcs = ["foo.ts", "bar.ts"])`, + expected: false, + }, + { + name: "SubdirectoryNgModuleSources", + buildFile: `ng_module(name = "lib", srcs = ["subdir/foo.ts", "subdir/bar.ts"])`, + expected: true, + }, + { + name: "LocalGlob", + buildFile: `ts_library(name = "lib", srcs = glob("*.ts"))`, + expected: false, + }, + { + name: "SubdirectoryGlob", + buildFile: `ts_library(name = "lib", srcs = glob("**/*.ts"))`, + expected: true, + }, + } + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + bld, err := build.ParseBuild("foo/bar/BUILD", + []byte(test.buildFile)) + if err != nil { + t.Fatalf("parse failure: %v", err) + } + + actual := hasSubdirectorySources(bld) + if actual != test.expected { + t.Errorf("got hasSubdirectorySouces() = %v, expected %v", actual, test.expected) + } + }) + } +} From a0d23c753bd1071b6f658062cd68fa6f31912737 Mon Sep 17 00:00:00 2001 From: Minko Gechev Date: Wed, 12 Dec 2018 15:22:45 -0800 Subject: [PATCH 017/316] feat: depend on devserver binaries Depend on devserver binaries instead of compiling from source. This won't require compilation of the go compiler when we start the dev server. Closes #347 PiperOrigin-RevId: 225265288 --- BUILD.bazel | 22 +++++ README.md | 4 + devserver/BUILD.bazel | 97 +++++++++++++++++++ internal/BUILD.bazel | 40 ++++++++ internal/devserver/BUILD | 29 ++++++ internal/devserver/README.md | 2 +- internal/devserver/ts_devserver.bzl | 7 +- internal/karma/BUILD.bazel | 13 +++ internal/protobufjs/BUILD.bazel | 13 +++ .../bazel/src/main/protobuf/BUILD.bazel | 13 +++ 10 files changed, 238 insertions(+), 2 deletions(-) create mode 100644 devserver/BUILD.bazel diff --git a/BUILD.bazel b/BUILD.bazel index d52ad791..997940e4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -20,6 +20,7 @@ # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") # ts_library defaults to this label in the top-level package. # Point to where the file actually lives. @@ -70,3 +71,24 @@ nodejs_binary( templated_args = ["--node_options=--expose-gc"], visibility = ["//visibility:public"], ) + +# Produces the release we publish to GitHub. Users download this starlark package +# to get the @build_bazel_rules_typescript workspace. +# It's the companion of the @bazel/typescript, @bazel/karma, etc npm packages. +pkg_tar( + name = "release", + extension = "tgz", + srcs = [ + "BUILD.bazel", + "AUTHORS", + "defs.bzl", + "LICENSE", + "package.bzl", + "WORKSPACE", + ], + deps = [ + "//devserver:package", + "//internal:package", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:package", + ], +) diff --git a/README.md b/README.md index 803d0a36..a1a344b5 100644 --- a/README.md +++ b/README.md @@ -345,5 +345,9 @@ rule is that minors are breaking changes and patches are new features). 1. `npm config set tag-version-prefix ''` 1. `npm version minor -m 'rel: %s'` (replace `minor` with `patch` if no breaking changes) 1. Build npm packages and publish them: `bazel run //internal:npm_package.publish && bazel run //internal/karma:npm_package.publish` +1. `bazel build :release` 1. `git push && git push --tags` +1. (Manual for now) go to the [releases] page, edit the new release, and attach the `bazel-bin/release.tgz` file 1. (Temporary): submit a google3 CL to update the versions in package.bzl and package.json + +[releases]: https://github.com/bazelbuild/rules_typescript/releases diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel new file mode 100644 index 00000000..7b83af1b --- /dev/null +++ b/devserver/BUILD.bazel @@ -0,0 +1,97 @@ +package(default_visibility = ["//visibility:public"]) + +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") + +go_library( + name = "go_default_library", + srcs = ["main.go"], + importpath = "github.com/bazelbuild/rules_typescript/devserver", + visibility = ["//visibility:private"], + deps = [ + "//devserver/concatjs:go_default_library", + "//devserver/devserver:go_default_library", + ], +) + +go_binary( + name = "devserver", + embed = [":go_default_library"], + visibility = ["//visibility:public"], +) + +config_setting( + name = "darwin_amd64", + constraint_values = [ + "@bazel_tools//platforms:osx", + "@bazel_tools//platforms:x86_64", + ] +) + +config_setting( + name = "linux_amd64", + constraint_values = [ + "@bazel_tools//platforms:linux", + "@bazel_tools//platforms:x86_64", + ] +) + +config_setting( + name = "windows_amd64", + constraint_values = [ + "@bazel_tools//platforms:windows", + "@bazel_tools//platforms:x86_64", + ] +) + +filegroup( + name = "server", + srcs = select({ + ":darwin_amd64": ["devserver-darwin_amd64"], + ":linux_amd64": ["devserver-linux_amd64"], + ":windows_amd64": ["devserver-windows_amd64.exe"], + }), + # Don't build on CI + tags = ["manual"], +) + +go_binary( + name = "devserver-windows", + goarch = "amd64", + goos = "windows", + pure = "on", + out = "devserver-windows_amd64.exe", + embed = [":go_default_library"], + visibility = ["//visibility:public"], +) + +go_binary( + name = "devserver-darwin", + goarch = "amd64", + goos = "darwin", + pure = "on", + out = "devserver-darwin_amd64", + embed = [":go_default_library"], + visibility = ["//visibility:public"], +) + +go_binary( + name = "devserver-linux", + goarch = "amd64", + goos = "linux", + pure = "on", + out = "devserver-linux_amd64", + embed = [":go_default_library"], + visibility = ["//visibility:public"], +) + +pkg_tar( + name = "package", + srcs = [ + ":devserver-windows", + ":devserver-darwin", + ":devserver-linux", + "BUILD.bazel", + ], + package_dir = "devserver", +) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 4d3b30eb..eb0fb54b 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -26,6 +26,7 @@ exports_files([ load("//internal:defaults.bzl", "ts_library") load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "jasmine_node_test", "npm_package") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") # Vanilla typescript compiler: run the tsc.js binary distributed by TypeScript nodejs_binary( @@ -150,3 +151,42 @@ npm_package( ":worker_protocol_copy", ], ) + +pkg_tar( + name = "tsc_wrapped_pkg", + srcs = glob([ + "tsc_wrapped/**", + ]), + package_dir = "tsc_wrapped", +) + +pkg_tar( + name = "common_pkg", + srcs = [ + "common/compilation.bzl", + "common/json_marshal.bzl", + "common/module_mappings.bzl", + "common/tsconfig.bzl", + ], + package_dir = "common", +) + +pkg_tar( + name = "package", + srcs = [ + "build_defs.bzl", + "ts_config.bzl", + "ts_repositories.bzl", + "BUILD.bazel", + "yarn.lock", + "package.json", + ], + package_dir = "internal", + deps = [ + ":tsc_wrapped_pkg", + ":common_pkg", + "//internal/karma:package", + "//internal/protobufjs:package", + "//internal/devserver:package", + ] +) diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD index bddd4122..0f72ac37 100644 --- a/internal/devserver/BUILD +++ b/internal/devserver/BUILD @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") + licenses(["notice"]) # Apache 2.0 package(default_visibility = [ @@ -27,3 +29,30 @@ filegroup( name = "source_tree", srcs = glob(["**/*"]), ) + +# Do a simple replacement needed to make the local development differ from how +# our release is used. +# NB: doesn't work on Windows, so we have to release from Mac/Linux for now. +genrule( + name = "patched_devserver_bzl", + srcs = ["ts_devserver.bzl"], + outs = ["patched/ts_devserver.bzl"], + cmd = """sed 's#"//devserver:devserver"#"//devserver:server"#' < $< > $@""", +) + +# Remove the "patched/" directory prefix so that the ts_devserver.bzl ends up in +# the same path in the final tar as it had in our local repo. +pkg_tar( + name = "strip_workaround", + srcs = [":patched_devserver_bzl"], +) + +pkg_tar( + name = "package", + srcs = [ + "BUILD", + ], + package_dir = "devserver", + deps = ["strip_workaround"], + visibility = ["//internal:__pkg__"], +) diff --git a/internal/devserver/README.md b/internal/devserver/README.md index 86e920df..7000c251 100644 --- a/internal/devserver/README.md +++ b/internal/devserver/README.md @@ -6,4 +6,4 @@ develop against your real frontend server instead. This devserver includes the "concatjs" bundling strategy. If you use a different frontend server, you should port this library to whatever language you run in. -Contributions of such libraries are welcome. + diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index b8fc54d0..1cafabfa 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -164,7 +164,12 @@ ts_devserver = rule( ), "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//node_modules/requirejs:require.js")), "_devserver": attr.label( - default = Label("//devserver"), + # For local development in rules_typescript, we build the devserver from sources. + # This requires that we have the go toolchain available. + # NB: this value is replaced by "//devserver:server" in the packaged distro + # //devserver:server is the pre-compiled binary. + # That means that our users don't need the go toolchain. + default = Label("//devserver:devserver"), executable = True, cfg = "host", ), diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 2c5bb4a2..17264652 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -1,4 +1,5 @@ package(default_visibility = ["//visibility:public"]) +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") exports_files([ "test-main.js", @@ -69,3 +70,15 @@ npm_package( ":license_copy", ], ) + +pkg_tar( + name = "package", + srcs = [ + "ts_web_test.bzl", + "BUILD.bazel", + "yarn.lock", + "package.json", + ], + package_dir = "karma" +) + diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel index 8cb2f77b..60085a74 100644 --- a/internal/protobufjs/BUILD.bazel +++ b/internal/protobufjs/BUILD.bazel @@ -1,6 +1,7 @@ package(default_visibility = ["//visibility:public"]) load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") exports_files([ "node_modules/protobufjs/dist/minimal/protobuf.min.js", @@ -53,3 +54,15 @@ nodejs_binary( entry_point = "protobufjs/bin/pbts", install_source_map_support = False, ) + +pkg_tar( + name = "package", + srcs = [ + "ts_proto_library.bzl", + "BUILD.bazel", + "yarn.lock", + "package.json", + ], + package_dir = "protobufjs" +) + diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel index 69a478b3..3b835fdb 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel @@ -1,5 +1,8 @@ +package(default_visibility = ["//:__pkg__"]) + load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") licenses(["notice"]) # Apache 2.0 @@ -25,3 +28,13 @@ go_library( importpath = "github.com/bazelbuild/rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf", visibility = ["//visibility:public"], ) + +pkg_tar( + name = "package", + srcs = [ + "BUILD.bazel", + "worker_protocol.proto", + ], + package_dir = "third_party/github.com/bazelbuild/bazel/src/main/protobuf", +) + From fd488e9869da61b18b1b1fb97437a041c18669c7 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Thu, 13 Dec 2018 11:51:32 +0000 Subject: [PATCH 018/316] internal change PiperOrigin-RevId: 225346377 --- internal/common/tsconfig.bzl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 7bf1f2dc..971bd83b 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -69,10 +69,6 @@ def create_tsconfig( if p ]) workspace_path = "/".join([".."] * len(tsconfig_dir.split("/"))) - - # Sourcemaps should be relative to workspace_root. Reuse the tsconfig_dir, but take out the bin_dir. - sourcemap_root = "/".join([".."] * (len(tsconfig_dir.split("/")) - len(ctx.bin_dir.path.split("/")))) - if module_path_prefixes == None: module_path_prefixes = [ "", @@ -255,7 +251,6 @@ def create_tsconfig( # Embed source maps and sources in .js outputs "inlineSourceMap": True, "inlineSources": True, - "sourceRoot": sourcemap_root, # Implied by inlineSourceMap: True "sourceMap": False, } From a9eb7167bf9de2fe5ec9343e7301cc55968cc1a6 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 13 Dec 2018 22:39:06 +0000 Subject: [PATCH 019/316] docs: add community documentation This PR introduces: 1. Issue templates for bug reports and feature requests 1. Pull request template 1. Code of conduct, which reuses the content from angular/angular 1. Guidelines for contributing to the project 1. A development document which explains how to get started with fixing issues/implementing new rules. There's more work here, this is just the initial draft 1. Update of the readme to introduce project scope Closes #334 PiperOrigin-RevId: 225438111 --- .github/ISSUE_TEMPLATE/bug_report.md | 75 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 47 ++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 43 +++++++++++++ CODE_OF_CONDUCT.md | 15 +++++ CONTRIBUTING.md | 11 +++- DEVELOPING.md | 25 ++++++++ README.md | 28 +++------ 7 files changed, 223 insertions(+), 21 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 DEVELOPING.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..b7c861b9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,75 @@ +--- +name: "\U0001F41EBug report" +about: Report a bug in rules_typescript +--- + + + +# 🐞 bug report + +### Affected Rule + + + The issue is caused by the rule: + + +### Is this a regression? + + + Yes, the previous version in which this bug was not present was: .... + + +### Description + + A clear and concise description of the problem... + + +## 🔬 Minimal Reproduction + + + +## 🔥 Exception or Error + +

+
+
+
+
+ + +## 🌍 Your Environment + +**Operating System:** + +
+  
+
+  
+
+ +**Output of `bazel version`:** + +
+  
+
+  
+
+ +**Rules version (SHA):** + +
+  
+
+  
+
+ +**Anything else relevant?** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..be9fa49c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,47 @@ +--- +name: "\U0001F680Feature request" +about: Suggest a feature for rules_typescript + +--- + + + +# 🚀 feature request + +### Relevant Rules + + + + + +### Description + + A clear and concise description of the problem or missing capability... + + +### Describe the solution you'd like + + If you have a solution in mind, please describe it. + + +### Describe alternatives you've considered + + Have you considered any alternative solutions or workarounds? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..1f8ff5ec --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,43 @@ +## PR Checklist + +Please check if your PR fulfills the following requirements: + +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Docs have been added / updated (for bug fixes / features) + + +## PR Type + +What kind of change does this PR introduce? + + + +- [ ] Bugfix +- [ ] Feature (please, look at the "Scope of the project" section in the README.md file) +- [ ] Code style update (formatting, local variables) +- [ ] Refactoring (no functional changes, no api changes) +- [ ] Build related changes +- [ ] CI related changes +- [ ] Documentation content changes +- [ ] Other... Please describe: + + +## What is the current behavior? + + +Issue Number: N/A + + +## What is the new behavior? + + +## Does this PR introduce a breaking change? + +- [ ] Yes +- [ ] No + + + + + +## Other information diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..b21a3955 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,15 @@ +# Contributor Code of Conduct + +The project is currently maintained by a subset of the Angular team. This means that the collaborators and the maintainers of `rules_typescript` should be familiar with, and follow, the Angular's code of conduct. + +## Version 0.3b-angular + +As contributors and maintainers of the `rules_typescript` project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities. + +Communication through any of the channels (GitHub, Gitter, IRC, mailing lists, Google+, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. + +We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the project to do the same. + +If any member of the community violates this code of conduct, the maintainers of the project project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate. + +If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [conduct@angular.io](mailto:conduct@angular.io). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 745cbdcb..fde88d28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,7 @@ Want to contribute? Great! First, read this page (including the small print at the end). ### Before you contribute + **Before we can use your code, you must sign the [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1) (CLA)**, which you can do online. @@ -17,11 +18,19 @@ Before you start working on a larger contribution, you should get in touch with us first. Use the issue tracker to explain your idea so we can help and possibly guide you. +**Before starting a complex contribution we strongly encourage you to share a design document**. + +[Here](https://goo.gl/YCQttR) you can find a document template. + ### Code reviews and other contributions. + **All submissions, including submissions by project members, require review.** -TODO(alexeagle): document how external contributions are handled. +We use GitHub's code review system to suggest changes, then merge the changes +to master when the PR is green and reviewed. The changes will then be in the +next release. ### The small print + Contributions made by corporations are covered by a different agreement than the one above, the [Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). diff --git a/DEVELOPING.md b/DEVELOPING.md new file mode 100644 index 00000000..66ec8fb9 --- /dev/null +++ b/DEVELOPING.md @@ -0,0 +1,25 @@ +# For Developers + +We strongly encourage you to review the project's scope described in the `README.md` file before working on new features. For large changes, consider writing a design document using [this template](https://goo.gl/YCQttR). + +### Releasing + +Start from a clean checkout at master/HEAD. Check if there are any breaking +changes since the last tag - if so, this will be a minor, if not, it's a patch. +(This may not sound like semver - but since our major version is a zero, the +rule is that minors are breaking changes and patches are new features). + +1. Re-generate the API docs: `yarn skydoc` +1. May be necessary if Go code has changed though probably it was already necessary to run this to keep CI green: `bazel run :gazelle` +1. If we depend on a newer rules_nodejs, update the `check_rules_nodejs_version` in `ts_repositories.bzl` +1. `git commit -a -m 'Update docs for release'` +1. `npm config set tag-version-prefix ''` +1. `npm version minor -m 'rel: %s'` (replace `minor` with `patch` if no breaking changes) +1. Build npm packages and publish them: `bazel run //internal:npm_package.publish && bazel run //internal/karma:npm_package.publish` +1. `bazel build :release` +1. `git push && git push --tags` +1. (Manual for now) go to the [releases] page, edit the new release, and attach the `bazel-bin/release.tgz` file +1. (Temporary): submit a google3 CL to update the versions in package.bzl and package.json + +[releases]: https://github.com/bazelbuild/rules_typescript/releases + diff --git a/README.md b/README.md index a1a344b5..2eba1cce 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,14 @@ browser_repositories( ) ``` +# Scope of the project + +This repository contains an orthogonal set of rules which covers an opinionated toolchain for TypeScript development. When requesting a new rule, describe your use case, why it's important, and why you can't do it with the existing rules. This is because we have limited resources to maintain additional rules. + +The repository accepts contributions in terms of bug fixes or implementing new features in existing rules. If you're planning to implement a new rule, please strongly consider opening a [feature request](https://github.com/bazelbuild/rules_typescript/issues/new) first so the project's maintainers can decide if it belongs to the scope of this project or not. + +For rules outside of the scope of the projects we recommend hosting them in your GitHub account or the one of your organization. + # Self-managed npm dependencies We recommend you use Bazel managed dependencies but if you would like @@ -331,23 +339,3 @@ your editor, so that you get useful syntax highlighting. [gazelle]: https://github.com/bazelbuild/rules_go/tree/master/go/tools/gazelle -### Releasing - -Start from a clean checkout at master/HEAD. Check if there are any breaking -changes since the last tag - if so, this will be a minor, if not, it's a patch. -(This may not sound like semver - but since our major version is a zero, the -rule is that minors are breaking changes and patches are new features). - -1. Re-generate the API docs: `yarn skydoc` -1. May be necessary if Go code has changed though probably it was already necessary to run this to keep CI green: `bazel run :gazelle` -1. If we depend on a newer rules_nodejs, update the `check_rules_nodejs_version` in `ts_repositories.bzl` -1. `git commit -a -m 'Update docs for release'` -1. `npm config set tag-version-prefix ''` -1. `npm version minor -m 'rel: %s'` (replace `minor` with `patch` if no breaking changes) -1. Build npm packages and publish them: `bazel run //internal:npm_package.publish && bazel run //internal/karma:npm_package.publish` -1. `bazel build :release` -1. `git push && git push --tags` -1. (Manual for now) go to the [releases] page, edit the new release, and attach the `bazel-bin/release.tgz` file -1. (Temporary): submit a google3 CL to update the versions in package.bzl and package.json - -[releases]: https://github.com/bazelbuild/rules_typescript/releases From d489eefa7e43851e2e675e423ea8df0cc857cdd0 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 13 Dec 2018 22:42:53 +0000 Subject: [PATCH 020/316] Ignore MPEG transport stream ".ts" files. PiperOrigin-RevId: 225438754 --- ts_auto_deps/platform/file.go | 13 +++++++++++++ ts_auto_deps/updater/updater.go | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/ts_auto_deps/platform/file.go b/ts_auto_deps/platform/file.go index 493b35e3..7df93d03 100644 --- a/ts_auto_deps/platform/file.go +++ b/ts_auto_deps/platform/file.go @@ -19,6 +19,19 @@ func ReadFile(ctx context.Context, name string) ([]byte, error) { return ioutil.ReadFile(name) } +// ReadBytesFromFile reads bytes into the buffer provided, stopping when the +// buffer is full. +func ReadBytesFromFile(ctx context.Context, name string, buffer []byte) (int, error) { + f, err := os.Open(name) + if err != nil { + return 0, err + } + defer f.Close() + + n, err := f.Read(buffer) + return n, err +} + // WriteFile writes data to filename. func WriteFile(ctx context.Context, filename string, data []byte) error { return ioutil.WriteFile(filename, data, filePerms) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index c5592364..cb80b50d 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -7,6 +7,7 @@ import ( "bytes" "context" "fmt" + "io" "os" "path/filepath" "regexp" @@ -249,6 +250,13 @@ func globSources(ctx context.Context, path string, extensions []string) (srcSet, if err != nil { return nil, fmt.Errorf("cannot stat platform.Glob result %q: %v", p, err) } + isMpeg, err := isMpegTS(ctx, p) + if err != nil { + return nil, err + } + if isMpeg { + continue + } p, err := filepath.Rel(path, p) if err != nil { return nil, fmt.Errorf("filepath.Rel(%s, %s): %v", path, p, err) @@ -258,6 +266,20 @@ func globSources(ctx context.Context, path string, extensions []string) (srcSet, return srcs, nil } +// isMpegTS checks if a ".ts" file is an MPEG transport stream. Taze shouldn't +// treat them as TypeScript files. +func isMpegTS(ctx context.Context, path string) (bool, error) { + var content [200]byte + n, err := platform.ReadBytesFromFile(ctx, path, content[:]) + if err != nil && err != io.EOF { + return false, err + } + + // MPEG TS' frame format starts with 0x47 every 189 bytes - detect that and return. + isMpeg := n > 188 && content[0] == 0x47 && content[188] == 0x47 + return isMpeg, nil +} + func isTempFile(fileName string) bool { return strings.HasPrefix(fileName, ".") || strings.HasSuffix(fileName, ".swp") || strings.HasSuffix(fileName, "~") From 3783082839a27edcf1cdf207fc370a242f0f9a59 Mon Sep 17 00:00:00 2001 From: Laurent Le Brun Date: Fri, 14 Dec 2018 10:29:08 +0100 Subject: [PATCH 021/316] Update dependencies (#343) * Update dependencies Fix a few other incompatible issues at the same time Tested: `bazel test //... --all_incompatible_changes --incompatible_disable_deprecated_attr_params=false --incompatible_disallow_old_style_args_add=false --incompatible_depset_union=false --incompatible_depset_is_not_iterable=false --incompatible_no_support_tools_in_action_inputs=false` In other words, there are still a few fixes to do. * Remove unused load --- examples/es6_output/es6_consumer.bzl | 2 +- internal/build_defs.bzl | 1 - internal/common/compilation.bzl | 4 ++-- internal/common/module_mappings.bzl | 2 -- package.bzl | 27 ++++++++++++++------------- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/examples/es6_output/es6_consumer.bzl b/examples/es6_output/es6_consumer.bzl index 2ea1317f..2e4e824f 100644 --- a/examples/es6_output/es6_consumer.bzl +++ b/examples/es6_output/es6_consumer.bzl @@ -15,7 +15,7 @@ """Example of a rule that requires ES6 inputs. """ -load("@build_bazel_rules_nodejs//:internal/collect_es6_sources.bzl", "collect_es6_sources") +load("@build_bazel_rules_nodejs//internal:collect_es6_sources.bzl", "collect_es6_sources") def _es6_consumer(ctx): es6_sources = collect_es6_sources(ctx) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index 5981c81b..81557744 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -296,7 +296,6 @@ ts_library = rule( the compiler attribute manually. """, default = Label(_DEFAULT_COMPILER), - single_file = False, allow_files = True, executable = True, cfg = "host", diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 06f3093c..5c2e569f 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -214,7 +214,7 @@ def compile_ts( ### Collect srcs and outputs. srcs = srcs if srcs != None else ctx.attr.srcs deps = deps if deps != None else ctx.attr.deps - srcs_files = [f for t in srcs for f in t.files] + srcs_files = [f for t in srcs for f in t.files.to_list()] src_declarations = [] # d.ts found in inputs. tsickle_externs = [] # externs.js generated by tsickle, if any. has_sources = False @@ -238,7 +238,7 @@ def compile_ts( "srcs", ) - for f in src.files: + for f in src.files.to_list(): has_sources = True if not is_library and not f.path.endswith(".d.ts"): fail("srcs must contain only type declarations (.d.ts files), " + diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index 06bca052..a28b3279 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -22,7 +22,6 @@ """Module mappings. """ - def _get_deps(attrs, names): return [ d @@ -34,7 +33,6 @@ def _get_deps(attrs, names): # Traverse 'srcs' in addition so that we can go across a genrule _MODULE_MAPPINGS_DEPS_NAMES = ["deps", "srcs", "_helpers"] - _DEBUG = False def debug(msg, values = ()): diff --git a/package.bzl b/package.bzl index 08c90f6b..b4189e55 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,9 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.1.zip"], - strip_prefix = "rules_nodejs-0.16.1", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.2.zip"], + strip_prefix = "rules_nodejs-0.16.2", + sha256 = "9b72bb0aea72d7cbcfc82a01b1e25bf3d85f791e790ddec16c65e2d906382ee0", ) # ts_web_test depends on the web testing rules to provision browsers. @@ -56,17 +57,17 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "io_bazel_rules_go", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.0/rules_go-0.16.0.tar.gz", - sha256 = "ee5fe78fe417c685ecb77a0a725dc9f6040ae5beb44a0ba4ddb55453aad23a8a", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.3/rules_go-0.16.3.tar.gz", + # sha256 = "ee5fe78fe417c685ecb77a0a725dc9f6040ae5beb44a0ba4ddb55453aad23a8a", ) # go_repository is defined in bazel_gazelle _maybe( http_archive, name = "bazel_gazelle", - urls = ["https://github.com/bazelbuild/bazel-gazelle/archive/109bcfd6880aac2517a1a2d48987226da6337e11.zip"], - strip_prefix = "bazel-gazelle-109bcfd6880aac2517a1a2d48987226da6337e11", - sha256 = "8f80ce0f7a6f8a3fee1fb863c9a23e1de99d678c1cf3c6f0a128f3b883168208", + urls = ["https://github.com/bazelbuild/bazel-gazelle/archive/c0880f7f9d7048b45be5d36115ec2bf444e723c4.zip"], # 2018-12-05 + strip_prefix = "bazel-gazelle-c0880f7f9d7048b45be5d36115ec2bf444e723c4", + sha256 = "d9980ae0c91d90aaf9131170adfec4e87464d53e58ce2eb01b350a53e93a87c7", ) # ts_auto_deps depends on com_github_bazelbuild_buildtools @@ -99,16 +100,16 @@ def rules_typescript_dev_dependencies(): http_archive( name = "io_bazel_rules_sass", - urls = ["https://github.com/bazelbuild/rules_sass/archive/1.13.4.zip"], - strip_prefix = "rules_sass-1.13.4", - sha256 = "5ddde0d3df96978fa537f76e766538c031dee4d29f91a895f4b1345b5e3f9b16", + urls = ["https://github.com/bazelbuild/rules_sass/archive/8ccf4f1c351928b55d5dddf3672e3667f6978d60.zip"], # 2018-11-23 + strip_prefix = "rules_sass-8ccf4f1c351928b55d5dddf3672e3667f6978d60", + sha256 = "894d7928df8da85e263d743c8434d4c10ab0a3f0708fed0d53394e688e3faf70", ) http_archive( name = "io_bazel_skydoc", - url = "https://github.com/bazelbuild/skydoc/archive/77e5399258f6d91417d23634fce97d73b40cf337.zip", - strip_prefix = "skydoc-77e5399258f6d91417d23634fce97d73b40cf337", - sha256 = "4e9bd9ef65af54dedd997b408fa26c2e70c30ee8e078bcc1b51a33cf7d7f9d7e", + url = "https://github.com/bazelbuild/skydoc/archive/9bbdf62c03b5c3fed231604f78d3976f47753d79.zip", # 2018-11-20 + strip_prefix = "skydoc-9bbdf62c03b5c3fed231604f78d3976f47753d79", + sha256 = "07ae937026cb56000fb268d4986b220e868c1bdfe6aac27ecada4b4b3dae246f", ) def _maybe(repo_rule, name, **kwargs): From 445e210b915360572b229c6ba616bf0bf5285e22 Mon Sep 17 00:00:00 2001 From: Laurent Le Brun Date: Fri, 14 Dec 2018 07:41:54 -0800 Subject: [PATCH 022/316] Update dependencies Fix a few other incompatible issues at the same time Tested: `bazel test //... --all_incompatible_changes --incompatible_disable_deprecated_attr_params=false --incompatible_disallow_old_style_args_add=false --incompatible_depset_union=false --incompatible_depset_is_not_iterable=false --incompatible_no_support_tools_in_action_inputs=false` In other words, there are still a few fixes to do. Closes #343 PiperOrigin-RevId: 225539980 --- internal/common/module_mappings.bzl | 2 ++ package.bzl | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index a28b3279..06bca052 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -22,6 +22,7 @@ """Module mappings. """ + def _get_deps(attrs, names): return [ d @@ -33,6 +34,7 @@ def _get_deps(attrs, names): # Traverse 'srcs' in addition so that we can go across a genrule _MODULE_MAPPINGS_DEPS_NAMES = ["deps", "srcs", "_helpers"] + _DEBUG = False def debug(msg, values = ()): diff --git a/package.bzl b/package.bzl index b4189e55..eb559ee7 100644 --- a/package.bzl +++ b/package.bzl @@ -79,6 +79,18 @@ def rules_typescript_dependencies(): sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79", ) + ############################################### + # Repeat the dependencies of rules_nodejs here! + # We can't load() from rules_nodejs yet, because we've only just fetched it. + # But we also don't want to make users load and call the rules_nodejs_dependencies + # function because we can do that for them, mostly hiding the transitive dependency. + _maybe( + http_archive, + name = "bazel_skylib", + url = "https://github.com/bazelbuild/bazel-skylib/archive/d7c5518fa061ae18a20d00b14082705d3d2d885d.zip", + strip_prefix = "bazel-skylib-d7c5518fa061ae18a20d00b14082705d3d2d885d", + ) + def rules_typescript_dev_dependencies(): """ Fetch dependencies needed for local development, but not needed by users. From b7dba1e9aafc90577b1f4a3b2e0bdbf6a3b74cb6 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Fri, 14 Dec 2018 10:37:19 -0800 Subject: [PATCH 023/316] Update @bazel/typescript and @bazel/karma version check to use semver to match only major & minor version against bazel package version Closes #352 PiperOrigin-RevId: 225565487 --- internal/BUILD.bazel | 1 - internal/karma/BUILD.bazel | 1 - internal/karma/package.json | 1 + internal/karma/yarn.lock | 2488 ----------------------------------- internal/package.json | 1 + internal/yarn.lock | 311 ----- package.bzl | 2 +- package.json | 2 +- tools/check_version.js | 46 +- 9 files changed, 32 insertions(+), 2821 deletions(-) delete mode 100644 internal/karma/yarn.lock delete mode 100644 internal/yarn.lock diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index eb0fb54b..3d7b93f0 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -178,7 +178,6 @@ pkg_tar( "ts_config.bzl", "ts_repositories.bzl", "BUILD.bazel", - "yarn.lock", "package.json", ], package_dir = "internal", diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 17264652..50f80bdc 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -76,7 +76,6 @@ pkg_tar( srcs = [ "ts_web_test.bzl", "BUILD.bazel", - "yarn.lock", "package.json", ], package_dir = "karma" diff --git a/internal/karma/package.json b/internal/karma/package.json index 9380ca59..c5bf6d9a 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -23,6 +23,7 @@ "karma-sourcemap-loader": "0.3.7", "karma-requirejs": "1.1.0", "requirejs": "2.3.5", + "semver": "5.6.0", "tmp": "0.0.33" }, "scripts": { diff --git a/internal/karma/yarn.lock b/internal/karma/yarn.lock deleted file mode 100644 index a3c6e8b7..00000000 --- a/internal/karma/yarn.lock +++ /dev/null @@ -1,2488 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -addressparser@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" - -adm-zip@0.4.11, adm-zip@~0.4.3: - version "0.4.11" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a" - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - -agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce" - dependencies: - es6-promisify "^5.0.0" - -ajv@^5.1.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -amqplib@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63" - dependencies: - bitsyntax "~0.0.4" - bluebird "^3.4.6" - buffer-more-ints "0.0.2" - readable-stream "1.x >=1.1.9" - safe-buffer "^5.0.1" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - -archiver-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174" - dependencies: - glob "^7.0.0" - graceful-fs "^4.1.0" - lazystream "^1.0.0" - lodash "^4.8.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - -archiver@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-1.3.0.tgz#4f2194d6d8f99df3f531e6881f14f15d55faaf22" - dependencies: - archiver-utils "^1.3.0" - async "^2.0.0" - buffer-crc32 "^0.2.1" - glob "^7.0.0" - lodash "^4.8.0" - readable-stream "^2.0.0" - tar-stream "^1.5.0" - walkdir "^0.0.11" - zip-stream "^1.1.0" - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - -arr-flatten@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - -asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - -ast-types@0.x.x: - version "0.11.5" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.5.tgz#9890825d660c03c28339f315e9fa0a360e31ec28" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - -async@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.0.1.tgz#b709cc0280a9c36f09f4536be823c838a9049e25" - dependencies: - lodash "^4.8.0" - -async@^2.0.0, async@^2.1.2, async@~2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - dependencies: - lodash "^4.17.10" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - -aws4@^1.2.1, aws4@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" - -axios@^0.15.3: - version "0.15.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" - dependencies: - follow-redirects "1.0.0" - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - -bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" - dependencies: - tweetnacl "^0.14.3" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" - -bitsyntax@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82" - dependencies: - buffer-more-ints "0.0.2" - -bl@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" - dependencies: - readable-stream "~2.0.5" - -blob@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" - -bluebird@^3.3.0, bluebird@^3.4.6: - version "3.5.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" - -body-parser@^1.16.1: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - dependencies: - hoek "2.x.x" - -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - dependencies: - expand-range "^0.1.0" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -buffer-alloc-unsafe@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-0.1.1.tgz#ffe1f67551dd055737de253337bfe853dfab1a6a" - -buffer-alloc@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.1.0.tgz#05514d33bf1656d3540c684f65b1202e90eca303" - dependencies: - buffer-alloc-unsafe "^0.1.0" - buffer-fill "^0.1.0" - -buffer-crc32@^0.2.1: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - -buffer-fill@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-0.1.1.tgz#76d825c4d6e50e06b7a31eb520c04d08cc235071" - -buffer-more-ints@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c" - -buildmail@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" - dependencies: - addressparser "1.0.1" - libbase64 "0.1.0" - libmime "3.0.0" - libqp "1.1.0" - nodemailer-fetch "1.6.0" - nodemailer-shared "1.1.0" - punycode "1.4.1" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -chalk@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chokidar@^1.4.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chownr@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" - -circular-json@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.4.tgz#ff1ad2f2e392eeb8a5172d4d985fa846ed8ad656" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -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" - -colors@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.0.tgz#5f20c9fef6945cb1134260aab33bfbdc8295e04e" - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - dependencies: - lodash "^4.5.0" - -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - dependencies: - delayed-stream "~1.0.0" - -commander@^2.9.0: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - -component-emitter@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - -compress-commons@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f" - dependencies: - buffer-crc32 "^0.2.1" - crc32-stream "^2.0.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - -core-js@^2.2.0: - version "2.5.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -crc32-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4" - dependencies: - crc "^3.4.4" - readable-stream "^2.0.0" - -crc@^3.4.4: - version "3.5.0" - resolved "https://registry.yarnpkg.com/crc/-/crc-3.5.0.tgz#98b8ba7d489665ba3979f59b21381374101a1964" - -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - dependencies: - boom "2.x.x" - -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - dependencies: - assert-plus "^1.0.0" - -data-uri-to-buffer@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - -debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@~2.6.4, debug@~2.6.6: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -debug@3.1.0, debug@^3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -degenerator@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" - dependencies: - ast-types "0.x.x" - escodegen "1.x.x" - esprima "3.x.x" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - -ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - dependencies: - jsbn "~0.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - -end-of-stream@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - dependencies: - once "^1.4.0" - -engine.io-client@~3.1.0: - version "3.1.6" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.6.tgz#5bdeb130f8b94a50ac5cbeb72583e7a4a063ddfd" - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196" - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.4" - has-binary2 "~1.0.2" - -engine.io@~3.1.0: - version "3.1.5" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845" - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - optionalDependencies: - uws "~9.14.0" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - -es6-promise@^4.0.3: - version "4.2.4" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29" - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - -escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escodegen@1.x.x: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@3.x.x, esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - -extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - -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" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -file-uri-to-path@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -follow-redirects@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" - dependencies: - debug "^2.2.0" - -follow-redirects@^1.0.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.0.tgz#234f49cf770b7f35b40e790f636ceba0c3a0ab77" - dependencies: - debug "^3.1.0" - -for-in@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.11" - -form-data@~2.3.0, form-data@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - dependencies: - asynckit "^0.4.0" - combined-stream "1.0.6" - mime-types "^2.1.12" - -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - dependencies: - null-check "^1.0.0" - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -fsevents@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -ftp@~0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -get-uri@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.2.tgz#5c795e71326f6ca1286f2fc82575cd2bab2af578" - dependencies: - data-uri-to-buffer "1" - debug "2" - extend "3" - file-uri-to-path "1" - ftp "~0.3.10" - readable-stream "2" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - dependencies: - assert-plus "^1.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.0, graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - -hipchat-notifier@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e" - dependencies: - lodash "^4.0.0" - request "^2.0.0" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - -http-errors@1.6.3, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - dependencies: - agent-base "4" - debug "3.1.0" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -http-signature@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -httpntlm@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2" - dependencies: - httpreq ">=0.4.22" - underscore "~1.7.0" - -httpreq@>=0.4.22: - version "0.4.24" - resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.15: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - -iconv-lite@0.4.23, iconv-lite@^0.4.4: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - dependencies: - minimatch "^3.0.4" - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - -inflection@~1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" - -inflection@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -ip@^1.1.2, ip@^1.1.4, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - -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" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" - -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" - -is-my-json-valid@^2.12.4: - version "2.17.2" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz#6b2103a288e94ef3de5cf15d29dd85fc4b78d65c" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - -isbinaryfile@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - -json-stringify-safe@5.0.x, 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" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - -karma-jasmine@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" - -karma-requirejs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" - -karma-sauce-launcher@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz#6f2558ddef3cf56879fa27540c8ae9f8bfd16bca" - dependencies: - q "^1.5.0" - sauce-connect-launcher "^1.2.2" - saucelabs "^1.4.0" - wd "^1.4.0" - -karma-sourcemap-loader@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" - dependencies: - graceful-fs "^4.1.2" - -karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: - version "1.7.1" - resolved "https://codeload.github.com/alexeagle/karma/tar.gz/fa1a84ac881485b5657cb669e9b4e5da77b79f0a" - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^1.4.1" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^2.3.9" - mime "^1.3.4" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.0.4" - source-map "^0.6.1" - tmp "0.0.33" - useragent "^2.1.12" - -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - dependencies: - readable-stream "^2.0.5" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -libbase64@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6" - -libmime@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6" - dependencies: - iconv-lite "0.4.15" - libbase64 "0.1.0" - libqp "1.1.0" - -libqp@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" - -lodash@4.16.2: - version "4.16.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.2.tgz#3e626db827048a699281a8a125226326cfc0e652" - -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.5.0, lodash@^4.8.0: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - -log4js@^2.3.9: - version "2.7.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.7.0.tgz#adbf21cc70927644e3cc86669a0225acbc230971" - dependencies: - circular-json "^0.5.4" - date-format "^1.2.0" - debug "^3.1.0" - semver "^5.5.0" - streamroller "0.7.0" - optionalDependencies: - amqplib "^0.5.2" - axios "^0.15.3" - hipchat-notifier "^1.1.0" - loggly "^1.1.0" - mailgun-js "^0.18.0" - nodemailer "^2.5.0" - redis "^2.7.1" - slack-node "~0.2.0" - -loggly@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee" - dependencies: - json-stringify-safe "5.0.x" - request "2.75.x" - timespan "2.3.x" - -lru-cache@4.1.x, lru-cache@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -mailcomposer@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4" - dependencies: - buildmail "4.0.1" - libmime "3.0.0" - -mailgun-js@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.0.tgz#81fed0c66a411d3ff6c4354861ad21387afcfaaa" - dependencies: - async "~2.6.0" - debug "~3.1.0" - form-data "~2.3.0" - inflection "~1.12.0" - is-stream "^1.1.0" - path-proxy "~1.0.0" - promisify-call "^2.0.2" - proxy-agent "~3.0.0" - tsscmp "~1.0.0" - -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" - dependencies: - mime-db "~1.33.0" - -mime@^1.3.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - -minipass@^2.2.1, minipass@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" - dependencies: - minipass "^2.2.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -nan@^2.9.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - -needle@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - -netmask@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" - -node-pre-gyp@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.0" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.1.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - -nodemailer-direct-transport@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86" - dependencies: - nodemailer-shared "1.1.0" - smtp-connection "2.12.0" - -nodemailer-fetch@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4" - -nodemailer-shared@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0" - dependencies: - nodemailer-fetch "1.6.0" - -nodemailer-smtp-pool@2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-smtp-transport@2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-wellknown@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5" - -nodemailer@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9" - dependencies: - libmime "3.0.0" - mailcomposer "4.0.1" - nodemailer-direct-transport "3.3.2" - nodemailer-shared "1.1.0" - nodemailer-smtp-pool "2.8.2" - nodemailer-smtp-transport "2.7.2" - socks "1.1.9" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" - -npm-packlist@^1.1.6: - version "1.1.10" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -oauth-sign@~0.8.1, oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optionator@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - 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" - -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" - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -pac-proxy-agent@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-2.0.2.tgz#90d9f6730ab0f4d2607dcdcd4d3d641aa26c3896" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - get-uri "^2.0.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - pac-resolver "^3.0.0" - raw-body "^2.2.0" - socks-proxy-agent "^3.0.0" - -pac-resolver@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-3.0.0.tgz#6aea30787db0a891704deb7800a722a7615a6f26" - dependencies: - co "^4.6.0" - degenerator "^1.0.4" - ip "^1.1.5" - netmask "^1.0.6" - thunkify "^2.1.2" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-proxy@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e" - dependencies: - inflection "~1.3.0" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -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" - -promisify-call@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba" - dependencies: - with-callback "^1.0.2" - -proxy-agent@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.0.tgz#f6768e202889b2285d39906d3a94768416f8f713" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" - pac-proxy-agent "^2.0.1" - proxy-from-env "^1.0.0" - socks-proxy-agent "^3.0.0" - -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -punycode@1.4.1, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -q@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" - -q@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - -qs@6.5.2, qs@~6.5.1: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - -randomatic@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - -raw-body@2.3.3, raw-body@^2.2.0: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.1.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@1.1.x, "readable-stream@1.x >=1.1.9": - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - -redis-commands@^1.2.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2" - -redis-parser@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" - -redis@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" - dependencies: - double-ended-queue "^2.1.0-0" - redis-commands "^1.2.0" - redis-parser "^2.6.0" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - -repeat-string@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -request@2.75.x: - version "2.75.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.0.0" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - -request@2.85.0: - version "2.85.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -request@^2.0.0, request@^2.74.0: - version "2.87.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -requestretry@^1.2.2: - version "1.13.0" - resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94" - dependencies: - extend "^3.0.0" - lodash "^4.15.0" - request "^2.74.0" - when "^3.7.7" - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -safe-buffer@^5.0.1, safe-buffer@^5.1.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" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - -sauce-connect-launcher@^1.2.2: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^2.2.1" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.4.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - dependencies: - https-proxy-agent "^2.2.1" - -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - -semver@^5.3.0, semver@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -slack-node@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30" - dependencies: - requestretry "^1.2.2" - -smart-buffer@^1.0.13, smart-buffer@^1.0.4: - version "1.1.15" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" - -smtp-connection@2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" - dependencies: - httpntlm "1.6.1" - nodemailer-shared "1.1.0" - -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - dependencies: - hoek "2.x.x" - -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - dependencies: - hoek "4.x.x" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - -socket.io-client@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e" - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~2.6.4" - engine.io-client "~3.1.0" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.1.1" - to-array "0.1.4" - -socket.io-parser@~3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e" - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - has-binary2 "~1.0.2" - isarray "2.0.1" - -socket.io@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014" - dependencies: - debug "~2.6.6" - engine.io "~3.1.0" - socket.io-adapter "~1.1.0" - socket.io-client "2.0.4" - socket.io-parser "~3.1.1" - -socks-proxy-agent@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz#2eae7cf8e2a82d34565761539a7f9718c5617659" - dependencies: - agent-base "^4.1.0" - socks "^1.1.10" - -socks@1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" - dependencies: - ip "^1.1.2" - smart-buffer "^1.0.4" - -socks@^1.1.10: - version "1.1.10" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" - dependencies: - ip "^1.1.4" - smart-buffer "^1.0.13" - -source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -sprintf-js@^1.0.3: - version "1.1.1" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.1.tgz#36be78320afe5801f6cea3ee78b6e5aab940ea0c" - -sshpk@^1.7.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - dependencies: - safe-buffer "~5.1.0" - -stringstream@~0.0.4, stringstream@~0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -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" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -tar-stream@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" - dependencies: - bl "^1.0.0" - buffer-alloc "^1.1.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.0" - xtend "^4.0.0" - -tar@^4: - version "4.4.4" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" - dependencies: - chownr "^1.0.1" - fs-minipass "^1.2.5" - minipass "^2.3.3" - minizlib "^1.1.0" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -thunkify@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" - -timespan@2.3.x: - version "2.3.0" - resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" - -tmp@0.0.33, tmp@0.0.x: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - -to-buffer@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - -tough-cookie@~2.3.0, tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - -tsscmp@~1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.5.tgz#7dc4a33af71581ab4337da91d85ca5427ebd9a97" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - dependencies: - safe-buffer "^5.0.1" - -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - -underscore.string@3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-3.3.4.tgz#2c2a3f9f83e64762fdc45e6ceac65142864213db" - dependencies: - sprintf-js "^1.0.3" - util-deprecate "^1.0.2" - -underscore@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - -useragent@^2.1.12: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - -util-deprecate@^1.0.2, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - -uuid@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" - -uws@~9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95" - -vargs@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/vargs/-/vargs-0.1.0.tgz#6b6184da6520cc3204ce1b407cac26d92609ebff" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - -walkdir@^0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.0.11.tgz#a16d025eb931bd03b52f308caed0f40fcebe9532" - -wd@^1.4.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/wd/-/wd-1.7.0.tgz#8974c7290db173b1aef35f81ecca4ffb619d41f3" - dependencies: - archiver "1.3.0" - async "2.0.1" - lodash "4.16.2" - mkdirp "^0.5.1" - q "1.4.1" - request "2.85.0" - underscore.string "3.3.4" - vargs "0.1.0" - -when@^3.7.7: - version "3.7.8" - resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82" - -which@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - dependencies: - string-width "^1.0.2 || 2" - -with-callback@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/with-callback/-/with-callback-1.0.2.tgz#a09629b9a920028d721404fb435bdcff5c91bc21" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - -zip-stream@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04" - dependencies: - archiver-utils "^1.3.0" - compress-commons "^1.2.0" - lodash "^4.8.0" - readable-stream "^2.0.0" diff --git a/internal/package.json b/internal/package.json index 64fa3ecc..3387c544 100644 --- a/internal/package.json +++ b/internal/package.json @@ -15,6 +15,7 @@ }, "dependencies": { "protobufjs": "5.0.3", + "semver": "5.6.0", "source-map-support": "0.5.9", "tsutils": "2.27.2" }, diff --git a/internal/yarn.lock b/internal/yarn.lock deleted file mode 100644 index d733e357..00000000 --- a/internal/yarn.lock +++ /dev/null @@ -1,311 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -"@types/tmp@0.0.33": - version "0.0.33" - resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.0.33.tgz#1073c4bc824754ae3d10cfab88ab0237ba964e4d" - integrity sha1-EHPEvIJHVK49EM+riKsCN7qWTk0= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^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= - -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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -source-map-support@0.5.9, source-map-support@^0.5.0: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -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" - -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - integrity sha512-cb/Z4NlKMPGiIIbgmklfBJIxDl4EQoYqC+0/BnPxZWzWcUvikeOHFkkkEmabJVqKh47jUqOwU/uMAu6UvhicZg== - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@2.7.2: - version "2.7.2" - resolved "http://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/package.bzl b/package.bzl index eb559ee7..544e5a86 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.21.0" +VERSION = "0.22.0" def rules_typescript_dependencies(): """ diff --git a/package.json b/package.json index 703eed8a..a21b63ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.21.0", + "version": "0.22.0", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", diff --git a/tools/check_version.js b/tools/check_version.js index 501949e2..bff8a101 100644 --- a/tools/check_version.js +++ b/tools/check_version.js @@ -28,11 +28,7 @@ const path = require('path'); const fs = require('fs'); - -// Version in package.bzl should match the npm package version -// but this should be tolerant of development stamped versions such as -// "0.17.0-7-g76dc057" -const npmPackageVersion = process.env.npm_package_version.split('-')[0]; +const semver = require('semver'); // If this is a bazel managed deps yarn_install or npm_install then the // cwd is $(bazel info @@ -52,8 +48,8 @@ if (isBazelManagedDeps()) { let contents; try { // If this is a yarn_install or npm_install then the cwd is $(bazel info - // output_base)/external//node_modules/@bazel/pkg so we can look for - // the package.bzl file under $(bazel info + // output_base)/external//node_modules/@bazel/ + // so we can look for the package.bzl file under $(bazel info // output_base)/external/build_bazel_rules_typescript/package.bzl const packagePath = path.resolve( process.cwd(), '../../../../build_bazel_rules_typescript/package.bzl'); @@ -62,22 +58,36 @@ if (isBazelManagedDeps()) { throw new Error( 'The build_bazel_rules_typescript repository is not installed in your Bazel WORKSPACE file'); } + + // Sanity check that this is build_bazel_rules_typescript since + // other repos will follow the same pattern and have a VERSION + // in a root pacakge.bzl file if (!contents.includes('def rules_typescript_dependencies():')) { throw new Error('Invalid package.bzl in build_bazel_rules_typescript'); - } else if (!contents.includes(`VERSION = "${npmPackageVersion}"`)) { - // TODO: we might need to support a range here. - // For example, if you end up with @bazel/typescript@1.0.0 and - // @bazel/typescript@1.0.1 both installed one of the postinstalls is - // guaranteed to fail since there's only one version of - // build_bazel_rules_typescript - throw new Error(`Expected build_bazel_rules_typescript to be version ${ - npmPackageVersion}`); + } + + const matchVersion = contents.match(/VERSION \= \"([0-9\.]*)\"/); + if (!matchVersion) { + throw new Error('Invalid package.bzl in build_bazel_rules_typescript'); + } + + const bazelPackageVersion = matchVersion[1]; + const bazelPackageVersionRange = `${semver.major(bazelPackageVersion)}.${semver.minor(bazelPackageVersion)}.x`; // should match patch version + + // Should be tolerant of development stamped versions such as "0.17.0-7-g76dc057" + const npmPackageVersion = process.env.npm_package_version.split('-')[0]; + + if (!semver.satisfies(npmPackageVersion, bazelPackageVersionRange)) { + throw new Error( + `Expected ${process.env.npm_package_name} version ${npmPackageVersion} to satisfy ${bazelPackageVersionRange}. ` + + `Please update the build_bazel_rules_typescript version in WORKSPACE file to match ${npmPackageVersion} or ` + + `update the ${process.env.npm_package_name} version in your package.json to satisfy ${bazelPackageVersionRange}.`); } } else { // No version check console.warn( `WARNING: With self managed deps you must ensure the @bazel/typescript -npm package version matches the build_bazel_rules_typescript repository version. -Use yarn_install or npm_install for this version to be checked automatically. -`); +and @bazel/karma npm package versions match the build_bazel_rules_typescript +repository version. Use yarn_install or npm_install for this version to be checked +automatically.`); } From 21c51084d07aef598800c96f8e795a9fbf885601 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Mon, 17 Dec 2018 11:21:58 -0800 Subject: [PATCH 024/316] Do TseTse checks with typechecker later The typechecker is known to be slow to create due to https://github.com/Microsoft/TypeScript/issues/27997 By moving the non-typechecker checks earlier in the process, I was able to observe significant savings in the `perfTrace.wrap` total times: - `CheckReturnValueRule`: 1,036ms, down from 2,102ms - `MustUsePromisesRule`: 119ms, down from 1,174ms Closes #359 PiperOrigin-RevId: 225844645 --- internal/tsetse/rules/check_return_value_rule.ts | 9 ++++++--- internal/tsetse/rules/must_use_promises_rule.ts | 13 +++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/tsetse/rules/check_return_value_rule.ts b/internal/tsetse/rules/check_return_value_rule.ts index 59dbd808..8ba125c3 100644 --- a/internal/tsetse/rules/check_return_value_rule.ts +++ b/internal/tsetse/rules/check_return_value_rule.ts @@ -55,6 +55,12 @@ export class Rule extends AbstractRule { } function checkCallExpression(checker: Checker, node: ts.CallExpression) { + // Short-circuit before using the typechecker if possible, as its expensive. + // Workaround for https://github.com/Microsoft/TypeScript/issues/27997 + if (tsutils.isExpressionValueUsed(node)) { + return; + } + // Check if this CallExpression is one of the well-known functions and returns // a non-void value that is unused. const signature = checker.typeChecker.getResolvedSignature(node); @@ -70,9 +76,6 @@ function checkCallExpression(checker: Checker, node: ts.CallExpression) { !hasCheckReturnValueJsDoc(node, checker.typeChecker)) { return; } - if (tsutils.isExpressionValueUsed(node)) { - return; - } checker.addFailureAtNode(node, FAILURE_STRING); } diff --git a/internal/tsetse/rules/must_use_promises_rule.ts b/internal/tsetse/rules/must_use_promises_rule.ts index eab2f63c..5c39fe50 100644 --- a/internal/tsetse/rules/must_use_promises_rule.ts +++ b/internal/tsetse/rules/must_use_promises_rule.ts @@ -24,6 +24,12 @@ export class Rule extends AbstractRule { } function checkCallExpression(checker: Checker, node: ts.CallExpression) { + // Short-circuit before using the typechecker if possible, as its expensive. + // Workaround for https://github.com/Microsoft/TypeScript/issues/27997 + if (tsutils.isExpressionValueUsed(node) || !inAsyncFunction(node)) { + return; + } + const signature = checker.typeChecker.getResolvedSignature(node); if (signature === undefined) { return; @@ -34,12 +40,7 @@ function checkCallExpression(checker: Checker, node: ts.CallExpression) { return; } - if (tsutils.isExpressionValueUsed(node)) { - return; - } - - if (inAsyncFunction(node) && - tsutils.isThenableType(checker.typeChecker, node)) { + if (tsutils.isThenableType(checker.typeChecker, node)) { checker.addFailureAtNode(node, FAILURE_STRING); } } From 3ea073279a7112ecd0bf9b11835e52aa310e8eaf Mon Sep 17 00:00:00 2001 From: mgechev Date: Mon, 17 Dec 2018 20:56:43 +0000 Subject: [PATCH 025/316] Support for building ts_library with typescript 3.1 Closes #348 PiperOrigin-RevId: 225874243 --- .bazelignore | 11 + .circleci/config.yml | 2 +- DEVELOPING.md | 49 ++- README.md | 9 - WORKSPACE | 38 +-- internal/e2e/default_tsconfig_test.js | 127 +++++--- internal/e2e/package_karma/WORKSPACE | 3 + internal/e2e/package_typescript_2.7/WORKSPACE | 3 + .../e2e/package_typescript_2.7/main.spec.ts | 5 + internal/e2e/package_typescript_2.7/yarn.lock | 28 +- internal/e2e/package_typescript_2.8/WORKSPACE | 3 + .../e2e/package_typescript_2.8/main.spec.ts | 5 + internal/e2e/package_typescript_2.8/yarn.lock | 28 +- internal/e2e/package_typescript_2.9/WORKSPACE | 3 + .../e2e/package_typescript_2.9/main.spec.ts | 5 + internal/e2e/package_typescript_2.9/yarn.lock | 28 +- internal/e2e/package_typescript_3.0/WORKSPACE | 3 + .../e2e/package_typescript_3.0/main.spec.ts | 5 + internal/e2e/package_typescript_3.0/yarn.lock | 28 +- internal/e2e/package_typescript_3.1/.bazelrc | 6 + .../e2e/package_typescript_3.1/BUILD.bazel | 41 +++ internal/e2e/package_typescript_3.1/WORKSPACE | 40 +++ .../e2e/package_typescript_3.1/main.spec.ts | 31 ++ internal/e2e/package_typescript_3.1/main.ts | 3 + .../e2e/package_typescript_3.1/package.json | 9 + .../tsconfig.json} | 0 internal/e2e/package_typescript_3.1/yarn.lock | 250 +++++++++++++++ .../package_typescript_3.1_no_npm/.bazelrc | 6 + .../package_typescript_3.1_no_npm/BUILD.bazel | 44 +++ .../package_typescript_3.1_no_npm/WORKSPACE | 40 +++ .../main.spec.ts | 22 ++ .../e2e/package_typescript_3.1_no_npm/main.ts | 3 + .../package.json | 12 + .../tsconfig.json | 0 .../package_typescript_3.1_no_npm/yarn.lock | 301 ++++++++++++++++++ .../e2e/package_typescript_karma/WORKSPACE | 3 + internal/e2e/ts_auto_deps/WORKSPACE | 6 +- internal/e2e/ts_auto_deps/tsconfig.json | 0 internal/ts_repositories.bzl | 3 +- internal/tsc_wrapped/cache.ts | 2 +- internal/tsc_wrapped/compiler_host.ts | 17 +- internal/tsetse/language_service_plugin.ts | 13 +- .../rules/ban_promise_as_condition_rule.ts | 7 + package.json | 4 +- 44 files changed, 1042 insertions(+), 204 deletions(-) create mode 100644 .bazelignore create mode 100644 internal/e2e/package_typescript_3.1/.bazelrc create mode 100644 internal/e2e/package_typescript_3.1/BUILD.bazel create mode 100644 internal/e2e/package_typescript_3.1/WORKSPACE create mode 100644 internal/e2e/package_typescript_3.1/main.spec.ts create mode 100644 internal/e2e/package_typescript_3.1/main.ts create mode 100644 internal/e2e/package_typescript_3.1/package.json rename internal/e2e/{ts_auto_deps/tsconfig.json.oss => package_typescript_3.1/tsconfig.json} (100%) create mode 100644 internal/e2e/package_typescript_3.1/yarn.lock create mode 100644 internal/e2e/package_typescript_3.1_no_npm/.bazelrc create mode 100644 internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel create mode 100644 internal/e2e/package_typescript_3.1_no_npm/WORKSPACE create mode 100644 internal/e2e/package_typescript_3.1_no_npm/main.spec.ts create mode 100644 internal/e2e/package_typescript_3.1_no_npm/main.ts create mode 100644 internal/e2e/package_typescript_3.1_no_npm/package.json create mode 100644 internal/e2e/package_typescript_3.1_no_npm/tsconfig.json create mode 100644 internal/e2e/package_typescript_3.1_no_npm/yarn.lock create mode 100644 internal/e2e/ts_auto_deps/tsconfig.json diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 00000000..d4962ded --- /dev/null +++ b/.bazelignore @@ -0,0 +1,11 @@ +node_modules +internal/e2e/ts_auto_deps +internal/e2e/package_karma +internal/e2e/package_typescript_2.7 +internal/e2e/package_typescript_2.8 +internal/e2e/package_typescript_2.9 +internal/e2e/package_typescript_3.0 +internal/e2e/package_typescript_3.1 +internal/e2e/package_typescript_3.1_no_npm +internal/e2e/package_typescript_karma +internal/e2e/disable_tsetse_for_external diff --git a/.circleci/config.yml b/.circleci/config.yml index 50afdee1..33b33181 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,7 +103,7 @@ jobs: # Run yarn as e2e tests depend on self managed node_modules - run: bazel run @nodejs//:bin/yarn # Don't occupy the bazel server, as this test wants to run Bazel itself - - run: bazel run @nodejs//:yarn e2e --script_path=yarn_e2e.sh + - run: bazel run @nodejs//:bin/yarn e2e --script_path=yarn_e2e.sh - run: xvfb-run -a ./yarn_e2e.sh lint: diff --git a/DEVELOPING.md b/DEVELOPING.md index 66ec8fb9..684835fa 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -2,7 +2,54 @@ We strongly encourage you to review the project's scope described in the `README.md` file before working on new features. For large changes, consider writing a design document using [this template](https://goo.gl/YCQttR). -### Releasing +## Testing changing downstream + +By default, downstream projects use both an `http_archive` of `build_bazel_rules_typescript` and the released `@bazel/typescript` and `@bazel/karma` npm packages. `postinstall` steps in these npm packages check that the version of the `build_bazel_rules_typescript` is compatible with the version of the npm package(s). + +For example, if a downstream `WORKSPACE` contain: + +```python +http_archive( + name = "build_bazel_rules_typescript", + url = "https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip", + strip_prefix = "rules_typescript-0.21.0", +) +``` + +that that project's `package.json` would contain the matching: + +```json +"@bazel/typescript": "0.21.0", +"@bazel/karma": "0.21.0", +``` + +When authoring changes and testing downstream, depending on the `@bazel/typescript` and `@bazel/karma` npm packages makes the workflow confusing and difficult. +To make authoring and testing changes downstream easier, it is recommended that you override the default `compiler` attribute of `ts_library` if making changes +to `ts_library` and the default `karma` attribute of `ts_web_test_suite`/`ts_web_test` if making changes to those rules. + +For example, in `/internal/build_defs.bzl`, change + +```python +"compiler": attr.label( + default = Label(_DEFAULT_COMPILER), +``` + +to + +```python +"compiler": attr.label( + default = Label("@build_bazel_rules_typescript//internal:tsc_wrapped_bin"), +``` + +The correct defaults to use so that you are not depending on the npm package downstream are in `/internal/defaults.bzl`. Note, your downstream +workspace will also need the correct `@npm` dependencies available to build these targets (see `internal/e2e/package_typescript_3.1_no_npm/package.json`). +In the case of the `angular` workspace, some `@npm` dependencies in this repository will also need to be changed to `@ngdeps` since `angular` does not have +an `@npm` workspace with npm dependencies. + +Note, with this workflow the downstream version of `@npm//typescript` will be used to compile the `ts_library` targets in `build_bazel_rules_typescript`. +An example of this can be found under `internal/e2e/package_typescript_3.1_no_npm`. + +## Releasing Start from a clean checkout at master/HEAD. Check if there are any breaking changes since the last tag - if so, this will be a minor, if not, it's a patch. diff --git a/README.md b/README.md index 2eba1cce..4ee41fe7 100644 --- a/README.md +++ b/README.md @@ -91,14 +91,6 @@ browser_repositories( ) ``` -# Scope of the project - -This repository contains an orthogonal set of rules which covers an opinionated toolchain for TypeScript development. When requesting a new rule, describe your use case, why it's important, and why you can't do it with the existing rules. This is because we have limited resources to maintain additional rules. - -The repository accepts contributions in terms of bug fixes or implementing new features in existing rules. If you're planning to implement a new rule, please strongly consider opening a [feature request](https://github.com/bazelbuild/rules_typescript/issues/new) first so the project's maintainers can decide if it belongs to the scope of this project or not. - -For rules outside of the scope of the projects we recommend hosting them in your GitHub account or the one of your organization. - # Self-managed npm dependencies We recommend you use Bazel managed dependencies but if you would like @@ -338,4 +330,3 @@ In the meantime, we suggest associating the `.bazel` extension with Python in your editor, so that you get useful syntax highlighting. [gazelle]: https://github.com/bazelbuild/rules_go/tree/master/go/tools/gazelle - diff --git a/WORKSPACE b/WORKSPACE index cba0f4a9..65ca04a9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -167,43 +167,7 @@ platform_http_file( ) # Tell Bazel where the nested local repositories are that are -# used for tests. This is necessary so that `bazel ...` -# doesn't traverse into nested local repositories. -local_repository( - name = "ts_auto_deps_e2e", - path = "internal/e2e/ts_auto_deps", -) - -local_repository( - name = "package_karma_e2e", - path = "internal/e2e/package_karma", -) - -local_repository( - name = "package_typescript_27_e2e", - path = "internal/e2e/package_typescript_2.7", -) - -local_repository( - name = "package_typescript_28_e2e", - path = "internal/e2e/package_typescript_2.8", -) - -local_repository( - name = "package_typescript_29_e2e", - path = "internal/e2e/package_typescript_2.9", -) - -local_repository( - name = "package_typescript_30_e2e", - path = "internal/e2e/package_typescript_3.0", -) - -local_repository( - name = "package_typescript_karma_e2e", - path = "internal/e2e/package_typescript_karma", -) - +# used for tests local_repository( name = "disable_tsetse_for_external_test", path = "internal/e2e/disable_tsetse_for_external", diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index 40fb6427..2dfbda3b 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -28,6 +28,8 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories() yarn_install( @@ -42,10 +44,11 @@ ts_setup_workspace() const PACKAGE_JSON = `{ "devDependencies": { "@types/node": "7.0.18", - "protobufjs": "5.0.0", - "tsickle": "0.32.1", - "tsutils": "2.22.0", - "typescript": "2.7.x" + "protobufjs": "5.0.3", + "source-map-support": "0.5.9", + "tsickle": "0.33.1", + "tsutils": "2.27.2", + "typescript": "~2.9.1" } } `; @@ -58,14 +61,17 @@ const YARN_LOCK = "@types/node@7.0.18": version "7.0.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ascli@~1: version "1.0.1" resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= dependencies: colour "~0.7.1" optjs "~3.2.2" @@ -73,10 +79,12 @@ ascli@~1: balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -84,20 +92,24 @@ brace-expansion@^1.1.7: buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== bytebuffer@~5: version "5.0.1" resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= dependencies: long "~3" camelcase@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= cliui@^3.0.3: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -106,36 +118,44 @@ cliui@^3.0.3: 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= colour@~0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -diff@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -glob@^5.0.10: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" +glob@^7.0.5: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: + fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "2 || 3" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -143,89 +163,99 @@ inflight@^1.0.4: inherits@2: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" -jasmine-diff@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/jasmine-diff/-/jasmine-diff-0.1.3.tgz#93ccc2dcc41028c5ddd4606558074839f2deeaa8" - dependencies: - diff "^3.2.0" - lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= dependencies: invert-kv "^1.0.0" long@~3: version "3.2.0" resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= -"minimatch@2 || 3": +minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.2.0: version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= mkdirp@^0.5.1: version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" optjs@~3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= os-locale@^1.4.0: version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= dependencies: lcid "^1.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= -protobufjs@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1" +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== dependencies: ascli "~1" bytebuffer "~5" - glob "^5.0.10" + glob "^7.0.5" yargs "^3.10.0" -source-map-support@^0.5.0: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -233,10 +263,17 @@ source-map-support@^0.5.0: source-map@^0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" @@ -245,40 +282,45 @@ string-width@^1.0.1: strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" -tsickle@0.32.1: - version "0.32.1" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5" +tsickle@0.33.1: + version "0.33.1" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" + integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== dependencies: - jasmine-diff "^0.1.3" minimist "^1.2.0" mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" + source-map "^0.7.3" tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== -tsutils@2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3" +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== dependencies: tslib "^1.8.1" -typescript@2.7.x: - version "2.7.2" - resolved "http://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" +typescript@~2.9.1: + version "2.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" + integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== window-size@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= wrap-ansi@^2.0.0: version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -286,14 +328,17 @@ wrap-ansi@^2.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= y18n@^3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= yargs@^3.10.0: version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= dependencies: camelcase "^2.0.1" cliui "^3.0.3" diff --git a/internal/e2e/package_karma/WORKSPACE b/internal/e2e/package_karma/WORKSPACE index 4a31a245..beeeec5d 100644 --- a/internal/e2e/package_karma/WORKSPACE +++ b/internal/e2e/package_karma/WORKSPACE @@ -22,6 +22,9 @@ local_repository( load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.7/WORKSPACE b/internal/e2e/package_typescript_2.7/WORKSPACE index 4fa645ae..7cc306d1 100644 --- a/internal/e2e/package_typescript_2.7/WORKSPACE +++ b/internal/e2e/package_typescript_2.7/WORKSPACE @@ -22,6 +22,9 @@ local_repository( load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.7/main.spec.ts b/internal/e2e/package_typescript_2.7/main.spec.ts index 790b562a..bef817ea 100644 --- a/internal/e2e/package_typescript_2.7/main.spec.ts +++ b/internal/e2e/package_typescript_2.7/main.spec.ts @@ -1,4 +1,5 @@ import * as main from './main'; +import * as ts from 'typescript'; describe('main', () => { it('should compile and run with @bazel/typescript npm package', () => { @@ -14,6 +15,10 @@ describe('main', () => { } }); + it('runtime version of typescript should be correct', () => { + expect(ts.version).toEqual('2.7.2'); + }); + it('should successfully require built-in node module \'os\'', () => { try { const os = require('os'); diff --git a/internal/e2e/package_typescript_2.7/yarn.lock b/internal/e2e/package_typescript_2.7/yarn.lock index cc8c6f0e..474a2b8f 100644 --- a/internal/e2e/package_typescript_2.7/yarn.lock +++ b/internal/e2e/package_typescript_2.7/yarn.lock @@ -3,11 +3,10 @@ "@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.20.3-1-g3eb0c59" + version "0.22.0-1-g1e6d07d" dependencies: protobufjs "5.0.3" source-map-support "0.5.9" - tsickle "0.28.0" tsutils "2.27.2" "@types/jasmine@2.8.2": @@ -146,20 +145,6 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -193,7 +178,7 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" -source-map-support@0.5.9, source-map-support@^0.5.0: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" dependencies: @@ -218,15 +203,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" diff --git a/internal/e2e/package_typescript_2.8/WORKSPACE b/internal/e2e/package_typescript_2.8/WORKSPACE index c454aced..e383ed45 100644 --- a/internal/e2e/package_typescript_2.8/WORKSPACE +++ b/internal/e2e/package_typescript_2.8/WORKSPACE @@ -22,6 +22,9 @@ local_repository( load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.8/main.spec.ts b/internal/e2e/package_typescript_2.8/main.spec.ts index 790b562a..99e2d47b 100644 --- a/internal/e2e/package_typescript_2.8/main.spec.ts +++ b/internal/e2e/package_typescript_2.8/main.spec.ts @@ -1,4 +1,5 @@ import * as main from './main'; +import * as ts from 'typescript'; describe('main', () => { it('should compile and run with @bazel/typescript npm package', () => { @@ -14,6 +15,10 @@ describe('main', () => { } }); + it('runtime version of typescript should be correct', () => { + expect(ts.version).toEqual('2.8.4'); + }); + it('should successfully require built-in node module \'os\'', () => { try { const os = require('os'); diff --git a/internal/e2e/package_typescript_2.8/yarn.lock b/internal/e2e/package_typescript_2.8/yarn.lock index 6ca59ba9..cc4f619d 100644 --- a/internal/e2e/package_typescript_2.8/yarn.lock +++ b/internal/e2e/package_typescript_2.8/yarn.lock @@ -3,11 +3,10 @@ "@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.20.3-1-g3eb0c59" + version "0.22.0-1-g1e6d07d" dependencies: protobufjs "5.0.3" source-map-support "0.5.9" - tsickle "0.28.0" tsutils "2.27.2" "@types/jasmine@2.8.2": @@ -146,20 +145,6 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -193,7 +178,7 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" -source-map-support@0.5.9, source-map-support@^0.5.0: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" dependencies: @@ -218,15 +203,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" diff --git a/internal/e2e/package_typescript_2.9/WORKSPACE b/internal/e2e/package_typescript_2.9/WORKSPACE index 053cfba2..64fb5996 100644 --- a/internal/e2e/package_typescript_2.9/WORKSPACE +++ b/internal/e2e/package_typescript_2.9/WORKSPACE @@ -22,6 +22,9 @@ local_repository( load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.9/main.spec.ts b/internal/e2e/package_typescript_2.9/main.spec.ts index 790b562a..1c4a0b24 100644 --- a/internal/e2e/package_typescript_2.9/main.spec.ts +++ b/internal/e2e/package_typescript_2.9/main.spec.ts @@ -1,4 +1,5 @@ import * as main from './main'; +import * as ts from 'typescript'; describe('main', () => { it('should compile and run with @bazel/typescript npm package', () => { @@ -14,6 +15,10 @@ describe('main', () => { } }); + it('runtime version of typescript should be correct', () => { + expect(ts.version).toEqual('2.9.2'); + }); + it('should successfully require built-in node module \'os\'', () => { try { const os = require('os'); diff --git a/internal/e2e/package_typescript_2.9/yarn.lock b/internal/e2e/package_typescript_2.9/yarn.lock index 0dc9962f..abb04b31 100644 --- a/internal/e2e/package_typescript_2.9/yarn.lock +++ b/internal/e2e/package_typescript_2.9/yarn.lock @@ -3,11 +3,10 @@ "@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.20.3-1-g3eb0c59" + version "0.22.0-1-g1e6d07d" dependencies: protobufjs "5.0.3" source-map-support "0.5.9" - tsickle "0.28.0" tsutils "2.27.2" "@types/jasmine@2.8.2": @@ -146,20 +145,6 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -193,7 +178,7 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" -source-map-support@0.5.9, source-map-support@^0.5.0: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" dependencies: @@ -218,15 +203,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" diff --git a/internal/e2e/package_typescript_3.0/WORKSPACE b/internal/e2e/package_typescript_3.0/WORKSPACE index 54c2b864..dcda2485 100644 --- a/internal/e2e/package_typescript_3.0/WORKSPACE +++ b/internal/e2e/package_typescript_3.0/WORKSPACE @@ -22,6 +22,9 @@ local_repository( load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_3.0/main.spec.ts b/internal/e2e/package_typescript_3.0/main.spec.ts index 790b562a..05923c3c 100644 --- a/internal/e2e/package_typescript_3.0/main.spec.ts +++ b/internal/e2e/package_typescript_3.0/main.spec.ts @@ -1,4 +1,5 @@ import * as main from './main'; +import * as ts from 'typescript'; describe('main', () => { it('should compile and run with @bazel/typescript npm package', () => { @@ -14,6 +15,10 @@ describe('main', () => { } }); + it('runtime version of typescript should be correct', () => { + expect(ts.version).toEqual('3.0.3'); + }); + it('should successfully require built-in node module \'os\'', () => { try { const os = require('os'); diff --git a/internal/e2e/package_typescript_3.0/yarn.lock b/internal/e2e/package_typescript_3.0/yarn.lock index 0e03ecae..f2b74f8d 100644 --- a/internal/e2e/package_typescript_3.0/yarn.lock +++ b/internal/e2e/package_typescript_3.0/yarn.lock @@ -3,11 +3,10 @@ "@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.20.3-1-g3eb0c59" + version "0.22.0-1-g1e6d07d" dependencies: protobufjs "5.0.3" source-map-support "0.5.9" - tsickle "0.28.0" tsutils "2.27.2" "@types/jasmine@2.8.2": @@ -146,20 +145,6 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -193,7 +178,7 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" -source-map-support@0.5.9, source-map-support@^0.5.0: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" dependencies: @@ -218,15 +203,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" diff --git a/internal/e2e/package_typescript_3.1/.bazelrc b/internal/e2e/package_typescript_3.1/.bazelrc new file mode 100644 index 00000000..178af0a3 --- /dev/null +++ b/internal/e2e/package_typescript_3.1/.bazelrc @@ -0,0 +1,6 @@ +# Don't create symlinks like bazel-out in the project. +# These cause VSCode to traverse a massive tree, opening file handles and +# eventually a surprising failure with auto-discovery of the C++ toolchain in +# MacOS High Sierra. +# See https://github.com/bazelbuild/bazel/issues/4603 +build --symlink_prefix=/ diff --git a/internal/e2e/package_typescript_3.1/BUILD.bazel b/internal/e2e/package_typescript_3.1/BUILD.bazel new file mode 100644 index 00000000..3c9602c3 --- /dev/null +++ b/internal/e2e/package_typescript_3.1/BUILD.bazel @@ -0,0 +1,41 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") + +ts_library( + name = "main", + srcs = ["main.ts"], +) + +ts_library( + name = "test_lib", + testonly = True, + srcs = glob(["*.spec.ts"]), + deps = [ + ":main", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//@bazel/typescript", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "@npm//jasmine", + ], +) diff --git a/internal/e2e/package_typescript_3.1/WORKSPACE b/internal/e2e/package_typescript_3.1/WORKSPACE new file mode 100644 index 00000000..dcda2485 --- /dev/null +++ b/internal/e2e/package_typescript_3.1/WORKSPACE @@ -0,0 +1,40 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "package_typescript_30_e2e") + +local_repository( + name = "build_bazel_rules_typescript", + path = "../../..", +) + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +rules_typescript_dependencies() + +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories(preserve_symlinks = True) + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/package_typescript_3.1/main.spec.ts b/internal/e2e/package_typescript_3.1/main.spec.ts new file mode 100644 index 00000000..c164e66a --- /dev/null +++ b/internal/e2e/package_typescript_3.1/main.spec.ts @@ -0,0 +1,31 @@ +import * as main from './main'; +import * as ts from 'typescript'; + +describe('main', () => { + it('should compile and run with @bazel/typescript npm package', () => { + expect(main.test()).toEqual('test'); + }); + + it('should successfully require @bazel/typescript', () => { + try { + const {debug} = require('@bazel/typescript'); + debug('test'); + } catch (e) { + fail(e.toString()) + } + }); + + it('runtime version of typescript should be correct', () => { + expect(ts.version).toEqual('3.1.6'); + }); + + it('should successfully require built-in node module \'os\'', () => { + try { + const os = require('os'); + console.log('Platform: ' + os.platform()); + console.log('Architecture: ' + os.arch()); + } catch (e) { + fail(e.toString()) + } + }); +}); diff --git a/internal/e2e/package_typescript_3.1/main.ts b/internal/e2e/package_typescript_3.1/main.ts new file mode 100644 index 00000000..36f3fab5 --- /dev/null +++ b/internal/e2e/package_typescript_3.1/main.ts @@ -0,0 +1,3 @@ +export function test() { + return 'test'; +} \ No newline at end of file diff --git a/internal/e2e/package_typescript_3.1/package.json b/internal/e2e/package_typescript_3.1/package.json new file mode 100644 index 00000000..fb560b50 --- /dev/null +++ b/internal/e2e/package_typescript_3.1/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@types/jasmine": "2.8.2", + "@types/node": "7.0.18", + "jasmine": "2.8.0", + "typescript": "3.1.x" + } +} diff --git a/internal/e2e/ts_auto_deps/tsconfig.json.oss b/internal/e2e/package_typescript_3.1/tsconfig.json similarity index 100% rename from internal/e2e/ts_auto_deps/tsconfig.json.oss rename to internal/e2e/package_typescript_3.1/tsconfig.json diff --git a/internal/e2e/package_typescript_3.1/yarn.lock b/internal/e2e/package_typescript_3.1/yarn.lock new file mode 100644 index 00000000..9033fe3e --- /dev/null +++ b/internal/e2e/package_typescript_3.1/yarn.lock @@ -0,0 +1,250 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": + version "0.22.0-1-g1e6d07d" + dependencies: + protobufjs "5.0.3" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +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" + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + +os-locale@^1.4.0: + version "1.4.0" + resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.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" + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + dependencies: + tslib "^1.8.1" + +typescript@3.1.x: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yargs@^3.10.0: + version "3.32.0" + resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/package_typescript_3.1_no_npm/.bazelrc b/internal/e2e/package_typescript_3.1_no_npm/.bazelrc new file mode 100644 index 00000000..178af0a3 --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/.bazelrc @@ -0,0 +1,6 @@ +# Don't create symlinks like bazel-out in the project. +# These cause VSCode to traverse a massive tree, opening file handles and +# eventually a surprising failure with auto-discovery of the C++ toolchain in +# MacOS High Sierra. +# See https://github.com/bazelbuild/bazel/issues/4603 +build --symlink_prefix=/ diff --git a/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel b/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel new file mode 100644 index 00000000..c5047f74 --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel @@ -0,0 +1,44 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") + +ts_library( + name = "main", + srcs = ["main.ts"], + compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", +) + +ts_library( + name = "test_lib", + testonly = True, + srcs = glob(["*.spec.ts"]), + deps = [ + ":main", + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//typescript", + ], + compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "@npm//jasmine", + "@npm//typescript", + ], +) diff --git a/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE b/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE new file mode 100644 index 00000000..dcda2485 --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE @@ -0,0 +1,40 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "package_typescript_30_e2e") + +local_repository( + name = "build_bazel_rules_typescript", + path = "../../..", +) + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +rules_typescript_dependencies() + +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories(preserve_symlinks = True) + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/package_typescript_3.1_no_npm/main.spec.ts b/internal/e2e/package_typescript_3.1_no_npm/main.spec.ts new file mode 100644 index 00000000..5ad3f758 --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/main.spec.ts @@ -0,0 +1,22 @@ +import * as main from './main'; +import * as ts from 'typescript'; + +describe('main', () => { + it('should compile and run without npm package', () => { + expect(main.test()).toEqual('test'); + }); + + it('runtime version of typescript should be correct', () => { + expect(ts.version).toEqual('3.1.6'); + }); + + it('should successfully require built-in node module \'os\'', () => { + try { + const os = require('os'); + console.log('Platform: ' + os.platform()); + console.log('Architecture: ' + os.arch()); + } catch (e) { + fail(e.toString()) + } + }); +}); diff --git a/internal/e2e/package_typescript_3.1_no_npm/main.ts b/internal/e2e/package_typescript_3.1_no_npm/main.ts new file mode 100644 index 00000000..36f3fab5 --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/main.ts @@ -0,0 +1,3 @@ +export function test() { + return 'test'; +} \ No newline at end of file diff --git a/internal/e2e/package_typescript_3.1_no_npm/package.json b/internal/e2e/package_typescript_3.1_no_npm/package.json new file mode 100644 index 00000000..44bb87ec --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/package.json @@ -0,0 +1,12 @@ +{ + "dependencies": { + "@types/jasmine": "2.8.2", + "@types/node": "7.0.18", + "jasmine": "2.8.0", + "protobufjs": "5.0.3", + "source-map-support": "0.5.9", + "tsickle": "0.33.1", + "tsutils": "2.27.2", + "typescript": "3.1.x" + } +} diff --git a/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json b/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_3.1_no_npm/yarn.lock b/internal/e2e/package_typescript_3.1_no_npm/yarn.lock new file mode 100644 index 00000000..90e09d9c --- /dev/null +++ b/internal/e2e/package_typescript_3.1_no_npm/yarn.lock @@ -0,0 +1,301 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +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" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.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" + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +tsickle@0.33.1: + version "0.33.1" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" + integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== + dependencies: + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map "^0.7.3" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +typescript@3.1.x: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/package_typescript_karma/WORKSPACE b/internal/e2e/package_typescript_karma/WORKSPACE index 0353feba..0412d910 100644 --- a/internal/e2e/package_typescript_karma/WORKSPACE +++ b/internal/e2e/package_typescript_karma/WORKSPACE @@ -22,6 +22,9 @@ local_repository( load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() + load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/ts_auto_deps/WORKSPACE b/internal/e2e/ts_auto_deps/WORKSPACE index 0e78b84d..71364b05 100644 --- a/internal/e2e/ts_auto_deps/WORKSPACE +++ b/internal/e2e/ts_auto_deps/WORKSPACE @@ -19,8 +19,12 @@ local_repository( path = "../../..", ) -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies", "rules_typescript_dev_dependencies") rules_typescript_dependencies() +rules_typescript_dev_dependencies() + +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/ts_auto_deps/tsconfig.json b/internal/e2e/ts_auto_deps/tsconfig.json new file mode 100644 index 00000000..e69de29b diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index dbb1a961..afefa442 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -27,7 +27,8 @@ def ts_setup_workspace(): # 0.14.0: @bazel_tools//tools/bash/runfiles is required # 0.15.0: "data" attributes don't need 'cfg = "data"' # 0.17.1: allow @ in package names is required for fine grained deps - check_bazel_version("0.17.1") + # 0.18.0: support for .bazelignore + check_bazel_version("0.18.0") go_repository( name = "com_github_kylelemons_godebug", diff --git a/internal/tsc_wrapped/cache.ts b/internal/tsc_wrapped/cache.ts index a5f6fdd0..9b3b61b9 100644 --- a/internal/tsc_wrapped/cache.ts +++ b/internal/tsc_wrapped/cache.ts @@ -127,7 +127,7 @@ class Cache { } } -interface SourceFileEntry { +export interface SourceFileEntry { digest: string; // blaze's opaque digest of the file value: ts.SourceFile; } diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index a62474a6..c6140615 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -382,8 +382,8 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { * typescript secondary search behavior needs to be overridden to support * looking under `bazelOpts.nodeModulesPrefix` */ - resolveTypeReferenceDirectives(names: string[], containingFile: string): (ts.ResolvedTypeReferenceDirective | undefined)[] { - let result: (ts.ResolvedTypeReferenceDirective | undefined)[] = [] + resolveTypeReferenceDirectives(names: string[], containingFile: string): (ts.ResolvedTypeReferenceDirective)[] { + let result: (ts.ResolvedTypeReferenceDirective)[] = [] names.forEach(name => { let resolved: ts.ResolvedTypeReferenceDirective | undefined; @@ -406,7 +406,16 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { debug(`Failed to resolve type reference directive '${name}'`); } - result.push(resolved); + // In typescript 2.x the return type for this function + // is `(ts.ResolvedTypeReferenceDirective | undefined)[]` thus we actually + // do allow returning `undefined` in the array but the function is typed + // `(ts.ResolvedTypeReferenceDirective)[]` to compile with both typescript + // 2.x and 3.0/3.1 without error. Typescript 3.0/3.1 do handle the `undefined` + // values in the array correctly despite the return signature. + // It looks like the return type change was a mistake because + // it was changed back to include `| undefined` recently: + // https://github.com/Microsoft/TypeScript/pull/28059. + result.push(resolved as ts.ResolvedTypeReferenceDirective); }); return result; } @@ -440,7 +449,7 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { writeFile( fileName: string, content: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, - sourceFiles: ReadonlyArray): void { + sourceFiles: ReadonlyArray | undefined): void { perfTrace.wrap( `writeFile ${fileName}`, () => this.writeFileImpl( diff --git a/internal/tsetse/language_service_plugin.ts b/internal/tsetse/language_service_plugin.ts index 01b82b63..d20343a1 100644 --- a/internal/tsetse/language_service_plugin.ts +++ b/internal/tsetse/language_service_plugin.ts @@ -1,4 +1,3 @@ -import * as fs from 'fs'; import * as ts from 'typescript/lib/tsserverlibrary'; import * as pluginApi from '../tsc_wrapped/plugin_api'; @@ -13,7 +12,15 @@ function init() { return { create(info: ts.server.PluginCreateInfo) { const oldService = info.languageService; - const checker = new Checker(oldService.getProgram()); + const program = oldService.getProgram(); + + // Signature of `getProgram` is `getProgram(): Program | undefined;` in ts 3.1 + // so we must check if the return value is valid to compile with ts 3.1. + if (!program) { + throw new Error('Failed to initialize tsetse language_service_plugin: program is undefined'); + } + + const checker = new Checker(program); // Add disabledRules to tsconfig to disable specific rules // "plugins": [ @@ -25,7 +32,7 @@ function init() { proxy.getSemanticDiagnostics = (fileName: string) => { const result = [...oldService.getSemanticDiagnostics(fileName)]; result.push( - ...checker.execute(oldService.getProgram().getSourceFile(fileName)!) + ...checker.execute(program.getSourceFile(fileName)!) .map(failure => failure.toDiagnostic())); return result; }; diff --git a/internal/tsetse/rules/ban_promise_as_condition_rule.ts b/internal/tsetse/rules/ban_promise_as_condition_rule.ts index ee0d8acd..a58461a8 100644 --- a/internal/tsetse/rules/ban_promise_as_condition_rule.ts +++ b/internal/tsetse/rules/ban_promise_as_condition_rule.ts @@ -95,6 +95,13 @@ function addFailureIfThenableCallExpression( const typeChecker = checker.typeChecker; const signature = typeChecker.getResolvedSignature(callExpression); + + // Return value of getResolvedSignature is `Signature | undefined` in ts 3.1 + // so we must check if the return value is valid to compile with ts 3.1. + if (!signature) { + throw new Error('Unexpected undefined signature for call expression'); + } + const returnType = typeChecker.getReturnTypeOfSignature(signature); if (isNonFalsyThenableType(typeChecker, callExpression, returnType)) { diff --git a/package.json b/package.json index a21b63ef..2dd30611 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,13 @@ "e2e-examples-protobuf-devserver": "concurrently \"bazel run examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-examples-protobuf-prodserver": "concurrently \"bazel run examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-package_karma": "cd internal/e2e/package_karma; bazel test ...", - "e2e-package_typescript": "yarn e2e-package_typescript_2.7 && yarn e2e-package_typescript_2.8 && yarn e2e-package_typescript_2.9 && yarn e2e-package_typescript_3.0", + "e2e-package_typescript": "yarn e2e-package_typescript_2.7 && yarn e2e-package_typescript_2.8 && yarn e2e-package_typescript_2.9 && yarn e2e-package_typescript_3.0 && yarn e2e-package_typescript_3.1 && yarn e2e-package_typescript_3.1_no_npm", "e2e-package_typescript_2.7": "cd internal/e2e/package_typescript_2.7; bazel test ...", "e2e-package_typescript_2.8": "cd internal/e2e/package_typescript_2.8; bazel test ...", "e2e-package_typescript_2.9": "cd internal/e2e/package_typescript_2.9; bazel test ...", "e2e-package_typescript_3.0": "cd internal/e2e/package_typescript_3.0; bazel test ...", + "e2e-package_typescript_3.1": "cd internal/e2e/package_typescript_3.1; bazel test ...", + "e2e-package_typescript_3.1_no_npm": "cd internal/e2e/package_typescript_3.1_no_npm; bazel test ...", "e2e-package_typescript_karma": "cd internal/e2e/package_typescript_karma; bazel test ...", "e2e-ts_auto_deps": "cd internal/e2e/ts_auto_deps; bazel run @build_bazel_rules_typescript//ts_auto_deps -- -recursive && bazel build simple", "preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint", From 2afddf1086e7bd2578638bcfc744882e4ded53aa Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 17 Dec 2018 18:03:10 -0800 Subject: [PATCH 026/316] ts_devserver support for injecting script tags Closes #332 PiperOrigin-RevId: 225922286 --- internal/devserver/ts_devserver.bzl | 29 ++++++++++++++++++++++++++++- package.bzl | 6 +++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index 1cafabfa..fe4d2548 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -22,6 +22,10 @@ load( "@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim", ) +load( + "@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", + "html_asset_inject", +) def _ts_devserver(ctx): files = depset() @@ -76,6 +80,17 @@ def _ts_devserver(ctx): devserver_runfiles += ctx.files.static_files devserver_runfiles += script_files + if ctx.file.index_html: + injected_index = ctx.actions.declare_file("index.html") + html_asset_inject( + ctx.file.index_html, + ctx.actions, + ctx.executable._injector, + [f.path for f in ctx.files.static_files] + [ctx.attr.serving_path], + injected_index, + ) + devserver_runfiles += [injected_index] + serving_arg = "" if ctx.attr.serving_path: serving_arg = "-serving_path=%s" % ctx.attr.serving_path @@ -127,13 +142,20 @@ ts_devserver = rule( aspects = [sources_aspect], ), "serving_path": attr.string( + default = "/_ts_scripts.js", doc = """The path you can request from the client HTML which serves the JavaScript bundle. - If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js""", + If you don't specify one, the JavaScript can be loaded at /_ts_scripts.js""", ), "data": attr.label_list( doc = "Dependencies that can be require'd while the server is running", allow_files = True, ), + "index_html": attr.label( + allow_single_file = True, + doc = """An index.html file, we'll inject the script tag for the bundle, + as well as script tags for .js static_files and link tags for .css + static_files""", + ), "static_files": attr.label_list( doc = """Arbitrary files which to be served, such as index.html. They are served relative to the package where this rule is declared.""", @@ -173,6 +195,11 @@ ts_devserver = rule( executable = True, cfg = "host", ), + "_injector": attr.label( + default = "@build_bazel_rules_nodejs//internal/web_package:injector", + executable = True, + cfg = "host", + ), }, outputs = { "manifest": "%{name}.MF", diff --git a/package.bzl b/package.bzl index 544e5a86..dcc75a35 100644 --- a/package.bzl +++ b/package.bzl @@ -38,9 +38,9 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.2.zip"], - strip_prefix = "rules_nodejs-0.16.2", - sha256 = "9b72bb0aea72d7cbcfc82a01b1e25bf3d85f791e790ddec16c65e2d906382ee0", + # TODO(alexeagle): update after next release + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/5efe8067c83ce81273dbd1f69303ad8cee88e5de.zip"], + strip_prefix = "rules_nodejs-5efe8067c83ce81273dbd1f69303ad8cee88e5de", ) # ts_web_test depends on the web testing rules to provision browsers. From d53748ce14074543b265803c1b7a2eaea4f03271 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 18 Dec 2018 12:33:41 -0800 Subject: [PATCH 027/316] Make powershell.exe available at build time After flipping --experimental_strict_action_env, we need to pass --action_env=PATH to make sure some specific tools are available on Windows. Fixing https://buildkite.com/bazel/bazel-at-head-plus-disabled/builds/4#a868eb9b-dc52-4ce1-8adb-0da82e8a407b PiperOrigin-RevId: 226040594 --- .bazelci/presubmit.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 855be682..86b7f3b0 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -40,8 +40,12 @@ platforms: run_targets: - "//:gazelle" - "@nodejs//:yarn" + build_flags: + - "--action_env=PATH" build_targets: - "..." - "@disable_tsetse_for_external_test//..." + test_flags: + - "--test_env=PATH" test_targets: - "..." From b9ad536789b089d56045372e27fbb488d272323e Mon Sep 17 00:00:00 2001 From: alexeagle Date: Tue, 18 Dec 2018 15:35:36 -0800 Subject: [PATCH 028/316] feat(ts_library): bump default target to es2015 Closes #217 PiperOrigin-RevId: 226071736 --- examples/devmode_consumer/BUILD.bazel | 15 --------------- examples/es5_output/BUILD.bazel | 15 +++++++++++++++ .../es5_consumer.bzl} | 8 ++++---- .../es5_output_test.sh} | 7 ------- examples/googmodule/BUILD.bazel | 8 ++++---- internal/build_defs.bzl | 4 ---- 6 files changed, 23 insertions(+), 34 deletions(-) delete mode 100644 examples/devmode_consumer/BUILD.bazel create mode 100644 examples/es5_output/BUILD.bazel rename examples/{devmode_consumer/devmode_consumer.bzl => es5_output/es5_consumer.bzl} (89%) rename examples/{devmode_consumer/devmode_consumer_test.sh => es5_output/es5_output_test.sh} (95%) diff --git a/examples/devmode_consumer/BUILD.bazel b/examples/devmode_consumer/BUILD.bazel deleted file mode 100644 index 78d6a463..00000000 --- a/examples/devmode_consumer/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load(":devmode_consumer.bzl", "devmode_consumer") - -devmode_consumer( - name = "devmode_consumer", - deps = ["//examples:bar_ts_library"], -) - -sh_test( - name = "devmode_consumer_test", - srcs = ["devmode_consumer_test.sh"], - data = [ - ":devmode_consumer", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/examples/es5_output/BUILD.bazel b/examples/es5_output/BUILD.bazel new file mode 100644 index 00000000..5bc709f8 --- /dev/null +++ b/examples/es5_output/BUILD.bazel @@ -0,0 +1,15 @@ +load(":es5_consumer.bzl", "es5_consumer") + +es5_consumer( + name = "es5_output", + deps = ["//examples:bar_ts_library"], +) + +sh_test( + name = "es5_output_test", + srcs = ["es5_output_test.sh"], + data = [ + ":es5_output", + "@bazel_tools//tools/bash/runfiles", + ], +) diff --git a/examples/devmode_consumer/devmode_consumer.bzl b/examples/es5_output/es5_consumer.bzl similarity index 89% rename from examples/devmode_consumer/devmode_consumer.bzl rename to examples/es5_output/es5_consumer.bzl index 0d29ca92..05d406c7 100644 --- a/examples/devmode_consumer/devmode_consumer.bzl +++ b/examples/es5_output/es5_consumer.bzl @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Example of a rule that requires es2015 (devmode) inputs. +"""Example of a rule that requires ES5 (devmode) inputs. """ load("@build_bazel_rules_nodejs//internal:node.bzl", "sources_aspect") -def _devmode_consumer(ctx): +def _es5_consumer(ctx): files = depset() # Since we apply the sources_aspect to our deps below, we can iterate through @@ -32,8 +32,8 @@ def _devmode_consumer(ctx): runfiles = ctx.runfiles(files.to_list()), )] -devmode_consumer = rule( - implementation = _devmode_consumer, +es5_consumer = rule( + implementation = _es5_consumer, attrs = { "deps": attr.label_list(aspects = [sources_aspect]), }, diff --git a/examples/devmode_consumer/devmode_consumer_test.sh b/examples/es5_output/es5_output_test.sh similarity index 95% rename from examples/devmode_consumer/devmode_consumer_test.sh rename to examples/es5_output/es5_output_test.sh index 096f4d55..ab58ce59 100755 --- a/examples/devmode_consumer/devmode_consumer_test.sh +++ b/examples/es5_output/es5_output_test.sh @@ -79,10 +79,3 @@ if [[ "$FOO_JS" != *"define(\"build_bazel_rules_typescript/examples/foo\""* ]]; echo "$FOO_JS" exit 1 fi - -# should produce es2015 classes -if [[ "$FOO_JS" != *"class Greeter"* ]]; then - echo "Expected foo.js produce a es2015, but was" - echo "$FOO_JS" - exit 1 -fi \ No newline at end of file diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel index b4092226..89beb257 100644 --- a/examples/googmodule/BUILD.bazel +++ b/examples/googmodule/BUILD.bazel @@ -6,10 +6,10 @@ ts_library( tsconfig = "tsconfig.json", ) -load("//examples/devmode_consumer:devmode_consumer.bzl", "devmode_consumer") +load("//examples/es5_output:es5_consumer.bzl", "es5_consumer") -devmode_consumer( - name = "devmode_output", +es5_consumer( + name = "es5_output", deps = [":googmodule"], ) @@ -19,7 +19,7 @@ jasmine_node_test( name = "googmodule_output_test", srcs = ["googmodule_output_test.js"], data = [ - ":devmode_output", + ":es5_output", "@npm//jasmine", ], ) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index 81557744..f83c3791 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -187,10 +187,6 @@ def tsc_wrapped_tsconfig( ) config["bazelOptions"]["nodeModulesPrefix"] = node_modules_root - # Override the target so we use es2015 for devmode - # Since g3 isn't ready to do this yet - config["compilerOptions"]["target"] = "es2015" - # If the user gives a tsconfig attribute, the generated file should extend # from the user's tsconfig. # See https://github.com/Microsoft/TypeScript/issues/9876 From b52232b97de03f8febd39175d3ac558532377982 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Wed, 19 Dec 2018 10:00:14 -0800 Subject: [PATCH 029/316] Update rules_nodejs deps to 0.16.4 rules_nodejs 0.16.4 introduced web_package rule. See https://github.com/bazelbuild/rules_nodejs/releases/tag/0.16.4 Closes #362 PiperOrigin-RevId: 226189547 --- package.bzl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.bzl b/package.bzl index dcc75a35..86bf207a 100644 --- a/package.bzl +++ b/package.bzl @@ -38,9 +38,8 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - # TODO(alexeagle): update after next release - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/5efe8067c83ce81273dbd1f69303ad8cee88e5de.zip"], - strip_prefix = "rules_nodejs-5efe8067c83ce81273dbd1f69303ad8cee88e5de", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.4.zip"], + strip_prefix = "rules_nodejs-0.16.4", ) # ts_web_test depends on the web testing rules to provision browsers. From 7b3e927fffdc47fde5a9508629be82820b1cadd4 Mon Sep 17 00:00:00 2001 From: Wassim Chegham Date: Wed, 19 Dec 2018 14:42:25 -0800 Subject: [PATCH 030/316] fix: enforce buildifier lint on CI Closes #357 PiperOrigin-RevId: 226236465 --- BUILD.bazel | 25 ++++--- WORKSPACE | 20 +++--- defs.bzl | 10 +-- devserver/BUILD.bazel | 28 ++++---- examples/BUILD.bazel | 4 +- examples/app/BUILD.bazel | 5 +- examples/es6_output/BUILD.bazel | 4 +- examples/googmodule/BUILD.bazel | 5 +- examples/protocol_buffers/BUILD.bazel | 5 +- examples/some_library/BUILD.bazel | 4 +- examples/some_module/BUILD.bazel | 4 +- examples/testing/BUILD.bazel | 2 +- examples/tsconfig_extends/BUILD.bazel | 4 +- internal/BUILD.bazel | 50 +++++++------- internal/build_defs.bzl | 59 +++++++++-------- internal/common/compilation.bzl | 56 ++++++++-------- internal/devserver/BUILD | 2 +- internal/devserver/ts_devserver.bzl | 66 +++++++++---------- internal/e2e/absolute_imports/BUILD.bazel | 4 +- .../disable_tsetse_for_external/BUILD.bazel | 4 +- internal/e2e/errorchecks/BUILD.bazel | 4 +- internal/e2e/package_karma/WORKSPACE | 12 ++-- .../e2e/package_typescript_2.7/BUILD.bazel | 2 +- internal/e2e/package_typescript_2.7/WORKSPACE | 8 ++- .../e2e/package_typescript_2.8/BUILD.bazel | 2 +- internal/e2e/package_typescript_2.8/WORKSPACE | 8 ++- .../e2e/package_typescript_2.9/BUILD.bazel | 2 +- internal/e2e/package_typescript_2.9/WORKSPACE | 8 ++- .../e2e/package_typescript_3.0/BUILD.bazel | 2 +- internal/e2e/package_typescript_3.0/WORKSPACE | 8 ++- .../e2e/package_typescript_3.1/BUILD.bazel | 2 +- internal/e2e/package_typescript_3.1/WORKSPACE | 8 ++- .../package_typescript_3.1_no_npm/BUILD.bazel | 2 +- .../package_typescript_3.1_no_npm/WORKSPACE | 8 ++- .../e2e/package_typescript_karma/WORKSPACE | 12 ++-- .../e2e/reference_types_directive/BUILD.bazel | 4 +- internal/e2e/strict_deps/BUILD | 4 +- internal/e2e/ts_auto_deps/WORKSPACE | 12 ++-- internal/karma/BUILD.bazel | 26 ++++---- internal/karma/ts_web_test.bzl | 42 ++++++------ internal/protobufjs/BUILD.bazel | 23 ++++--- internal/protobufjs/ts_proto_library.bzl | 2 +- internal/ts_repositories.bzl | 2 +- .../tests/ban_expect_truthy_promise/BUILD | 8 +-- .../tests/ban_promise_as_condition/BUILD | 8 +-- .../tsetse/tests/check_return_value/BUILD | 4 +- internal/tsetse/tests/equals_nan/BUILD | 4 +- internal/tsetse/tests/must_use_promises/BUILD | 6 +- package.json | 6 +- .../bazel/src/main/protobuf/BUILD.bazel | 19 +++--- yarn.lock | 18 +++++ 51 files changed, 338 insertions(+), 299 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 997940e4..c11b189c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,8 +19,9 @@ # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") -load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") # ts_library defaults to this label in the top-level package. # Point to where the file actually lives. @@ -54,8 +55,6 @@ js_library( visibility = ["//visibility:public"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") - # A nodejs_binary for @bazel/typescript/tsc_wrapped to use by default in # ts_library that depends on @npm//@bazel/typescript instead of the # output of the //internal/tsc_wrapped ts_library rule. This @@ -77,18 +76,18 @@ nodejs_binary( # It's the companion of the @bazel/typescript, @bazel/karma, etc npm packages. pkg_tar( name = "release", - extension = "tgz", srcs = [ - "BUILD.bazel", - "AUTHORS", - "defs.bzl", - "LICENSE", - "package.bzl", - "WORKSPACE", + "AUTHORS", + "BUILD.bazel", + "LICENSE", + "WORKSPACE", + "defs.bzl", + "package.bzl", ], + extension = "tgz", deps = [ - "//devserver:package", - "//internal:package", - "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:package", + "//devserver:package", + "//internal:package", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:package", ], ) diff --git a/WORKSPACE b/WORKSPACE index 65ca04a9..7a18919f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -21,6 +21,7 @@ load( ) rules_typescript_dependencies() + rules_typescript_dev_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") @@ -57,9 +58,10 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") +load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() + go_register_toolchains() load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") @@ -68,14 +70,14 @@ gazelle_dependencies() load( "@build_bazel_rules_typescript//:defs.bzl", - "ts_setup_workspace", "check_rules_typescript_version", + "ts_setup_workspace", ) ts_setup_workspace() # Test that check_rules_typescript_version works as expected -check_rules_typescript_version("0.15.3") +check_rules_typescript_version(minimum_version_string = "0.15.3") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") @@ -94,12 +96,12 @@ web_test_repositories() platform_http_file( name = "org_chromium_chromium", - licenses = ["notice"], # BSD 3-clause (maybe more?) amd64_sha256 = "6933d0afce6e17304b62029fbbd246cbe9e130eb0d90d7682d3765d3dbc8e1c8", amd64_urls = [ "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/561732/chrome-linux.zip", ], + licenses = ["notice"], # BSD 3-clause (maybe more?) macos_sha256 = "084884e91841a923d7b6e81101f0105bbc3b0026f9f6f7a3477f5b313ee89e32", macos_urls = [ @@ -114,12 +116,12 @@ platform_http_file( platform_http_file( name = "org_chromium_chromedriver", - licenses = ["reciprocal"], # BSD 3-clause, ICU, MPL 1.1, libpng (BSD/MIT-like), Academic Free License v. 2.0, BSD 2-clause, MIT amd64_sha256 = "71eafe087900dbca4bc0b354a1d172df48b31a4a502e21f7c7b156d7e76c95c7", amd64_urls = [ "https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip", ], + licenses = ["reciprocal"], # BSD 3-clause, ICU, MPL 1.1, libpng (BSD/MIT-like), Academic Free License v. 2.0, BSD 2-clause, MIT macos_sha256 = "fd32a27148f44796a55f5ce3397015c89ebd9f600d9dda2bcaca54575e2497ae", macos_urls = [ @@ -134,13 +136,13 @@ platform_http_file( platform_http_file( name = "org_mozilla_firefox", - licenses = ["reciprocal"], # MPL 2.0 amd64_sha256 = "3a729ddcb1e0f5d63933177a35177ac6172f12edbf9fbbbf45305f49333608de", amd64_urls = [ "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", ], + licenses = ["reciprocal"], # MPL 2.0 macos_sha256 = "bf23f659ae34832605dd0576affcca060d1077b7bf7395bc9874f62b84936dc5", macos_urls = [ @@ -151,13 +153,13 @@ platform_http_file( platform_http_file( name = "org_mozilla_geckodriver", - licenses = ["reciprocal"], # MPL 2.0 amd64_sha256 = "c9ae92348cf00aa719be6337a608fae8304691a95668e8e338d92623ba9e0ec6", amd64_urls = [ "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", ], + licenses = ["reciprocal"], # MPL 2.0 macos_sha256 = "ce4a3e9d706db94e8760988de1ad562630412fa8cf898819572522be584f01ce", macos_urls = [ @@ -169,6 +171,6 @@ platform_http_file( # Tell Bazel where the nested local repositories are that are # used for tests local_repository( - name = "disable_tsetse_for_external_test", - path = "internal/e2e/disable_tsetse_for_external", + name = "disable_tsetse_for_external_test", + path = "internal/e2e/disable_tsetse_for_external", ) diff --git a/defs.bzl b/defs.bzl index a426b6fe..3f4b0b31 100644 --- a/defs.bzl +++ b/defs.bzl @@ -17,9 +17,8 @@ Users should not load files under "/internal" """ -load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") -load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") -load("//internal:ts_config.bzl", _ts_config = "ts_config") +load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") +load("//:package.bzl", "VERSION") load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") load( "//internal/karma:ts_web_test.bzl", @@ -27,8 +26,9 @@ load( _ts_web_test_suite = "ts_web_test_suite", ) load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") -load("//:package.bzl", "VERSION") -load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") +load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") +load("//internal:ts_config.bzl", _ts_config = "ts_config") +load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") ts_setup_workspace = _ts_setup_workspace ts_library = _ts_library diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel index 7b83af1b..f70274b9 100644 --- a/devserver/BUILD.bazel +++ b/devserver/BUILD.bazel @@ -1,7 +1,7 @@ -package(default_visibility = ["//visibility:public"]) - -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +package(default_visibility = ["//visibility:public"]) go_library( name = "go_default_library", @@ -25,7 +25,7 @@ config_setting( constraint_values = [ "@bazel_tools//platforms:osx", "@bazel_tools//platforms:x86_64", - ] + ], ) config_setting( @@ -33,7 +33,7 @@ config_setting( constraint_values = [ "@bazel_tools//platforms:linux", "@bazel_tools//platforms:x86_64", - ] + ], ) config_setting( @@ -41,7 +41,7 @@ config_setting( constraint_values = [ "@bazel_tools//platforms:windows", "@bazel_tools//platforms:x86_64", - ] + ], ) filegroup( @@ -57,41 +57,41 @@ filegroup( go_binary( name = "devserver-windows", + out = "devserver-windows_amd64.exe", + embed = [":go_default_library"], goarch = "amd64", goos = "windows", pure = "on", - out = "devserver-windows_amd64.exe", - embed = [":go_default_library"], visibility = ["//visibility:public"], ) go_binary( name = "devserver-darwin", + out = "devserver-darwin_amd64", + embed = [":go_default_library"], goarch = "amd64", goos = "darwin", pure = "on", - out = "devserver-darwin_amd64", - embed = [":go_default_library"], visibility = ["//visibility:public"], ) go_binary( name = "devserver-linux", + out = "devserver-linux_amd64", + embed = [":go_default_library"], goarch = "amd64", goos = "linux", pure = "on", - out = "devserver-linux_amd64", - embed = [":go_default_library"], visibility = ["//visibility:public"], ) pkg_tar( name = "package", srcs = [ - ":devserver-windows", + "BUILD.bazel", ":devserver-darwin", ":devserver-linux", - "BUILD.bazel", + ":devserver-windows", ], package_dir = "devserver", ) diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel index ef8ef1de..7864c079 100644 --- a/examples/BUILD.bazel +++ b/examples/BUILD.bazel @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("//:defs.bzl", "ts_config") load("//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + ts_library( name = "types", srcs = ["types.d.ts"], diff --git a/examples/app/BUILD.bazel b/examples/app/BUILD.bazel index 8c217c80..89842d1d 100644 --- a/examples/app/BUILD.bazel +++ b/examples/app/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "http_server") +load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") load("//:defs.bzl", "ts_devserver") load("//internal:defaults.bzl", "ts_library") @@ -18,9 +18,6 @@ ts_devserver( deps = [":app"], ) -# Test for production mode -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle", "nodejs_binary") - rollup_bundle( name = "bundle", entry_point = "examples/app/app", diff --git a/examples/es6_output/BUILD.bazel b/examples/es6_output/BUILD.bazel index 207a48a7..b5ff91c9 100644 --- a/examples/es6_output/BUILD.bazel +++ b/examples/es6_output/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load(":es6_consumer.bzl", "es6_consumer") +package(default_visibility = ["//visibility:public"]) + es6_consumer( name = "es6_output", deps = ["//examples:bar_ts_library"], diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel index 89beb257..5ed37cb6 100644 --- a/examples/googmodule/BUILD.bazel +++ b/examples/googmodule/BUILD.bazel @@ -1,3 +1,5 @@ +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") +load("//examples/es5_output:es5_consumer.bzl", "es5_consumer") load("//internal:defaults.bzl", "ts_library") ts_library( @@ -6,15 +8,12 @@ ts_library( tsconfig = "tsconfig.json", ) -load("//examples/es5_output:es5_consumer.bzl", "es5_consumer") es5_consumer( name = "es5_output", deps = [":googmodule"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") - jasmine_node_test( name = "googmodule_output_test", srcs = ["googmodule_output_test.js"], diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel index 5b822434..1cb2172b 100644 --- a/examples/protocol_buffers/BUILD.bazel +++ b/examples/protocol_buffers/BUILD.bazel @@ -1,7 +1,8 @@ +load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") load( "//:defs.bzl", - "ts_proto_library", "ts_devserver", + "ts_proto_library", ) load("//internal:defaults.bzl", "ts_library", "ts_web_test_suite") @@ -63,8 +64,6 @@ ts_devserver( ) # Test for production mode -load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle", "nodejs_binary") - rollup_bundle( name = "bundle", entry_point = "examples/protocol_buffers/app", diff --git a/examples/some_library/BUILD.bazel b/examples/some_library/BUILD.bazel index cf42c761..2668d2c9 100644 --- a/examples/some_library/BUILD.bazel +++ b/examples/some_library/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + ts_library( name = "lib", srcs = ["library.ts"], diff --git a/examples/some_module/BUILD.bazel b/examples/some_module/BUILD.bazel index 7ed381ac..a6ff1bf3 100644 --- a/examples/some_module/BUILD.bazel +++ b/examples/some_module/BUILD.bazel @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + # We compile this library with the module name "sm" to make it possible to # use `import {} from 'sm';` both at type-check time (we include the mapping in # the paths map in tsconfig) as well as runtime (we patch the nodejs module diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel index ca8dd3fc..ee484a94 100644 --- a/examples/testing/BUILD.bazel +++ b/examples/testing/BUILD.bazel @@ -25,7 +25,7 @@ ts_library( deps = [ "@npm//@types/jasmine", "@npm//@types/node", - ], + ], ) ts_web_test_suite( diff --git a/examples/tsconfig_extends/BUILD.bazel b/examples/tsconfig_extends/BUILD.bazel index 609f1b59..51258971 100644 --- a/examples/tsconfig_extends/BUILD.bazel +++ b/examples/tsconfig_extends/BUILD.bazel @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("//:defs.bzl", "ts_config") load("//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + # Because our tsconfig.json has an extends property, we must also tell the # ts_library to include the extended tsconfig file in compilations. # The ts_library rule will generate its own tsconfig which extends from the diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 3d7b93f0..5a4932cc 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -14,6 +14,10 @@ # gazelle:exclude worker_protocol.proto +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary", "npm_package") +load("//internal:defaults.bzl", "ts_library") + package(default_visibility = ["//visibility:public"]) exports_files([ @@ -24,10 +28,6 @@ exports_files([ "tsetse/tsconfig.json", ]) -load("//internal:defaults.bzl", "ts_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "jasmine_node_test", "npm_package") -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") - # Vanilla typescript compiler: run the tsc.js binary distributed by TypeScript nodejs_binary( name = "tsc", @@ -153,11 +153,11 @@ npm_package( ) pkg_tar( - name = "tsc_wrapped_pkg", - srcs = glob([ - "tsc_wrapped/**", - ]), - package_dir = "tsc_wrapped", + name = "tsc_wrapped_pkg", + srcs = glob([ + "tsc_wrapped/**", + ]), + package_dir = "tsc_wrapped", ) pkg_tar( @@ -172,20 +172,20 @@ pkg_tar( ) pkg_tar( - name = "package", - srcs = [ - "build_defs.bzl", - "ts_config.bzl", - "ts_repositories.bzl", - "BUILD.bazel", - "package.json", - ], - package_dir = "internal", - deps = [ - ":tsc_wrapped_pkg", - ":common_pkg", - "//internal/karma:package", - "//internal/protobufjs:package", - "//internal/devserver:package", - ] + name = "package", + srcs = [ + "BUILD.bazel", + "build_defs.bzl", + "package.json", + "ts_config.bzl", + "ts_repositories.bzl", + ], + package_dir = "internal", + deps = [ + ":common_pkg", + ":tsc_wrapped_pkg", + "//internal/devserver:package", + "//internal/karma:package", + "//internal/protobufjs:package", + ], ) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index f83c3791..d194f7e9 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -14,12 +14,13 @@ "TypeScript compilation" +load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo", "collect_node_modules_aspect") + # pylint: disable=unused-argument # pylint: disable=missing-docstring load(":common/compilation.bzl", "COMMON_ATTRIBUTES", "DEPS_ASPECTS", "compile_ts", "ts_providers_dict_to_struct") load(":common/tsconfig.bzl", "create_tsconfig") load(":ts_config.bzl", "TsConfigInfo") -load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo", "collect_node_modules_aspect") _DEFAULT_COMPILER = "@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped" @@ -259,26 +260,6 @@ ts_library = rule( allow_files = [".ts", ".tsx"], mandatory = True, ), - "deps": attr.label_list(aspects = local_deps_aspects), - - # TODO(alexeagle): reconcile with google3: ts_library rules should - # be portable across internal/external, so we need this attribute - # internally as well. - "tsconfig": attr.label( - doc = """A tsconfig.json file containing settings for TypeScript compilation. - Note that some properties in the tsconfig are governed by Bazel and will be - overridden, such as `target` and `module`. - - The default value is set to `//:tsconfig.json` by a macro. This means you must - either: - - - Have your `tsconfig.json` file in the workspace root directory - - Use an alias in the root BUILD.bazel file to point to the location of tsconfig: - `alias(name="tsconfig.json", actual="//path/to:tsconfig-something.json")` - - Give an explicit `tsconfig` attribute to all `ts_library` targets - """, - allow_single_file = True, - ), "compiler": attr.label( doc = """Sets a different TypeScript compiler binary to use for this library. For example, we use the vanilla TypeScript tsc.js for bootstrapping, @@ -296,14 +277,6 @@ ts_library = rule( executable = True, cfg = "host", ), - "supports_workers": attr.bool( - doc = """Intended for internal use only. - Allows you to disable the Bazel Worker strategy for this library. - Typically used together with the "compiler" setting when using a - non-worker aware compiler binary.""", - default = True, - ), - "tsickle_typed": attr.bool(default = True), "internal_testing_type_check_dependencies": attr.bool(default = False, doc = "Testing only, whether to type check inputs that aren't srcs."), "node_modules": attr.label( doc = """The npm packages which should be available during the compile. @@ -368,6 +341,34 @@ ts_library = rule( """, default = Label("@npm//typescript:typescript__typings"), ), + "supports_workers": attr.bool( + doc = """Intended for internal use only. + Allows you to disable the Bazel Worker strategy for this library. + Typically used together with the "compiler" setting when using a + non-worker aware compiler binary.""", + default = True, + ), + + # TODO(alexeagle): reconcile with google3: ts_library rules should + # be portable across internal/external, so we need this attribute + # internally as well. + "tsconfig": attr.label( + doc = """A tsconfig.json file containing settings for TypeScript compilation. + Note that some properties in the tsconfig are governed by Bazel and will be + overridden, such as `target` and `module`. + + The default value is set to `//:tsconfig.json` by a macro. This means you must + either: + + - Have your `tsconfig.json` file in the workspace root directory + - Use an alias in the root BUILD.bazel file to point to the location of tsconfig: + `alias(name="tsconfig.json", actual="//path/to:tsconfig-something.json")` + - Give an explicit `tsconfig` attribute to all `ts_library` targets + """, + allow_single_file = True, + ), + "tsickle_typed": attr.bool(default = True), + "deps": attr.label_list(aspects = local_deps_aspects), }), outputs = { "tsconfig": "%{name}_tsconfig.json", diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 5c2e569f..fa1878e4 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -15,8 +15,8 @@ """Used for compilation by the different implementations of build_defs.bzl. """ -load(":common/module_mappings.bzl", "module_mappings_aspect") load(":common/json_marshal.bzl", "json_marshal") +load(":common/module_mappings.bzl", "module_mappings_aspect") BASE_ATTRIBUTES = dict() @@ -28,31 +28,31 @@ DEPS_ASPECTS = [ # Attributes shared by any typescript-compatible rule (ts_library, ng_module) COMMON_ATTRIBUTES = dict(BASE_ATTRIBUTES, **{ - "deps": attr.label_list(aspects = DEPS_ASPECTS), "data": attr.label_list( default = [], allow_files = True, ), - # TODO(evanm): make this the default and remove the option. - "runtime": attr.string(default = "browser"), + # A list of diagnostics expected when compiling this library, in the form of + # "diagnostic:regexp", e.g. "TS1234:failed to quizzle the .* wobble". + # Useful to test for expected compilation errors. + "expected_diagnostics": attr.string_list(), + # Whether to generate externs.js from any "declare" statement. + "generate_externs": attr.bool(default = True), # Used to determine module mappings "module_name": attr.string(), "module_root": attr.string(), + # TODO(evanm): make this the default and remove the option. + "runtime": attr.string(default = "browser"), # TODO(radokirov): remove this attr when clutz is stable enough to consume # any closure JS code. "runtime_deps": attr.label_list( default = [], providers = ["js"], ), + "deps": attr.label_list(aspects = DEPS_ASPECTS), "_additional_d_ts": attr.label_list( allow_files = True, ), - # Whether to generate externs.js from any "declare" statement. - "generate_externs": attr.bool(default = True), - # A list of diagnostics expected when compiling this library, in the form of - # "diagnostic:regexp", e.g. "TS1234:failed to quizzle the .* wobble". - # Useful to test for expected compilation errors. - "expected_diagnostics": attr.string_list(), }) COMMON_OUTPUTS = { @@ -438,9 +438,18 @@ def compile_ts( return { "files": depset(transitive = files_depsets), + "instrumented_files": { + "dependency_attributes": ["deps", "runtime_deps"], + "extensions": ["ts"], + "source_attributes": ["srcs"], + }, + # Expose the module_name so that packaging rules can access it. + # e.g. rollup_bundle under Bazel needs to convert this into a UMD global + # name in the Rollup configuration. + "module_name": ctx.attr.module_name, "output_groups": { - "es6_sources": es6_sources, "es5_sources": es5_sources, + "es6_sources": es6_sources, }, "runfiles": ctx.runfiles( # Note: don't include files=... here, or they will *always* be built @@ -449,29 +458,20 @@ def compile_ts( collect_default = True, collect_data = True, ), + # Expose the tags so that a Skylark aspect can access them. + "tags": ctx.attr.tags, # TODO(martinprobst): Prune transitive deps, only re-export what's needed. "typescript": { "declarations": depset(transitive = declarations_depsets), - "transitive_declarations": transitive_decls, - "es6_sources": es6_sources, - "transitive_es6_sources": transitive_es6_sources, + "devmode_manifest": devmode_manifest, "es5_sources": es5_sources, + "es6_sources": es6_sources, + "replay_params": replay_params, + "transitive_declarations": transitive_decls, "transitive_es5_sources": transitive_es5_sources, - "devmode_manifest": devmode_manifest, - "type_blacklisted_declarations": type_blacklisted_declarations, + "transitive_es6_sources": transitive_es6_sources, "tsickle_externs": tsickle_externs, - "replay_params": replay_params, - }, - # Expose the tags so that a Skylark aspect can access them. - "tags": ctx.attr.tags, - # Expose the module_name so that packaging rules can access it. - # e.g. rollup_bundle under Bazel needs to convert this into a UMD global - # name in the Rollup configuration. - "module_name": ctx.attr.module_name, - "instrumented_files": { - "extensions": ["ts"], - "source_attributes": ["srcs"], - "dependency_attributes": ["deps", "runtime_deps"], + "type_blacklisted_declarations": type_blacklisted_declarations, }, } diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD index 0f72ac37..0f8171f1 100644 --- a/internal/devserver/BUILD +++ b/internal/devserver/BUILD @@ -53,6 +53,6 @@ pkg_tar( "BUILD", ], package_dir = "devserver", - deps = ["strip_workaround"], visibility = ["//internal:__pkg__"], + deps = ["strip_workaround"], ) diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index fe4d2548..90704f80 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -14,10 +14,6 @@ "Simple development server" -load( - "@build_bazel_rules_nodejs//internal:node.bzl", - "sources_aspect", -) load( "@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim", @@ -26,6 +22,10 @@ load( "@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "html_asset_inject", ) +load( + "@build_bazel_rules_nodejs//internal:node.bzl", + "sources_aspect", +) def _ts_devserver(ctx): files = depset() @@ -136,55 +136,54 @@ RUNFILES="$PWD/.." ts_devserver = rule( implementation = _ts_devserver, attrs = { - "deps": attr.label_list( - doc = "Targets that produce JavaScript, such as `ts_library`", - allow_files = True, - aspects = [sources_aspect], + "additional_root_paths": attr.string_list( + doc = """Additional root paths to serve static_files from. + Paths should include the workspace name such as [\"__main__/resources\"] + """, ), - "serving_path": attr.string( - default = "/_ts_scripts.js", - doc = """The path you can request from the client HTML which serves the JavaScript bundle. - If you don't specify one, the JavaScript can be loaded at /_ts_scripts.js""", + "bootstrap": attr.label_list( + doc = "Scripts to include in the JS bundle before the module loader (require.js)", + allow_files = [".js"], ), "data": attr.label_list( doc = "Dependencies that can be require'd while the server is running", allow_files = True, ), + "entry_module": attr.string( + doc = """The entry_module should be the AMD module name of the entry module such as `"__main__/src/index"` + ts_devserver concats the following snippet after the bundle to load the application: + `require(["entry_module"]);` + """, + ), "index_html": attr.label( allow_single_file = True, doc = """An index.html file, we'll inject the script tag for the bundle, as well as script tags for .js static_files and link tags for .css static_files""", ), - "static_files": attr.label_list( - doc = """Arbitrary files which to be served, such as index.html. - They are served relative to the package where this rule is declared.""", - allow_files = True, + "port": attr.int( + doc = """The port that the devserver will listen on.""", + default = 5432, ), "scripts": attr.label_list( doc = "User scripts to include in the JS bundle before the application sources", allow_files = [".js"], ), - "entry_module": attr.string( - doc = """The entry_module should be the AMD module name of the entry module such as `"__main__/src/index"` - ts_devserver concats the following snippet after the bundle to load the application: - `require(["entry_module"]);` - """, - ), - "bootstrap": attr.label_list( - doc = "Scripts to include in the JS bundle before the module loader (require.js)", - allow_files = [".js"], + "serving_path": attr.string( + default = "/_ts_scripts.js", + doc = """The path you can request from the client HTML which serves the JavaScript bundle. + If you don't specify one, the JavaScript can be loaded at /_ts_scripts.js""", ), - "additional_root_paths": attr.string_list( - doc = """Additional root paths to serve static_files from. - Paths should include the workspace name such as [\"__main__/resources\"] - """, + "static_files": attr.label_list( + doc = """Arbitrary files which to be served, such as index.html. + They are served relative to the package where this rule is declared.""", + allow_files = True, ), - "port": attr.int( - doc = """The port that the devserver will listen on.""", - default = 5432, + "deps": attr.label_list( + doc = "Targets that produce JavaScript, such as `ts_library`", + allow_files = True, + aspects = [sources_aspect], ), - "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//node_modules/requirejs:require.js")), "_devserver": attr.label( # For local development in rules_typescript, we build the devserver from sources. # This requires that we have the go toolchain available. @@ -200,6 +199,7 @@ ts_devserver = rule( executable = True, cfg = "host", ), + "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//node_modules/requirejs:require.js")), }, outputs = { "manifest": "%{name}.MF", diff --git a/internal/e2e/absolute_imports/BUILD.bazel b/internal/e2e/absolute_imports/BUILD.bazel index b19d1ec3..a9f216c8 100644 --- a/internal/e2e/absolute_imports/BUILD.bazel +++ b/internal/e2e/absolute_imports/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + ts_library( name = "absolute_imports", srcs = glob(["*.ts"]), diff --git a/internal/e2e/disable_tsetse_for_external/BUILD.bazel b/internal/e2e/disable_tsetse_for_external/BUILD.bazel index aafff28c..b626aaa7 100644 --- a/internal/e2e/disable_tsetse_for_external/BUILD.bazel +++ b/internal/e2e/disable_tsetse_for_external/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + ts_library( name = "main", srcs = glob(["*.ts"]), diff --git a/internal/e2e/errorchecks/BUILD.bazel b/internal/e2e/errorchecks/BUILD.bazel index dfb8ae94..874aeb7a 100644 --- a/internal/e2e/errorchecks/BUILD.bazel +++ b/internal/e2e/errorchecks/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -package(default_visibility = ["//visibility:public"]) - load("//internal:defaults.bzl", "ts_library") +package(default_visibility = ["//visibility:public"]) + ts_library( name = "erroneous", srcs = glob(["*.ts"]), diff --git a/internal/e2e/package_karma/WORKSPACE b/internal/e2e/package_karma/WORKSPACE index beeeec5d..f8b1ad9c 100644 --- a/internal/e2e/package_karma/WORKSPACE +++ b/internal/e2e/package_karma/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,19 +32,21 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") +load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() + go_register_toolchains() load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") web_test_repositories() + browser_repositories( chromium = True, firefox = True, diff --git a/internal/e2e/package_typescript_2.7/BUILD.bazel b/internal/e2e/package_typescript_2.7/BUILD.bazel index 3c9602c3..db3403d9 100644 --- a/internal/e2e/package_typescript_2.7/BUILD.bazel +++ b/internal/e2e/package_typescript_2.7/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", + "@npm//@bazel/typescript", "@npm//@types/jasmine", "@npm//@types/node", - "@npm//@bazel/typescript", ], ) diff --git a/internal/e2e/package_typescript_2.7/WORKSPACE b/internal/e2e/package_typescript_2.7/WORKSPACE index 7cc306d1..ec663136 100644 --- a/internal/e2e/package_typescript_2.7/WORKSPACE +++ b/internal/e2e/package_typescript_2.7/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,9 +32,9 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/package_typescript_2.8/BUILD.bazel b/internal/e2e/package_typescript_2.8/BUILD.bazel index 3c9602c3..db3403d9 100644 --- a/internal/e2e/package_typescript_2.8/BUILD.bazel +++ b/internal/e2e/package_typescript_2.8/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", + "@npm//@bazel/typescript", "@npm//@types/jasmine", "@npm//@types/node", - "@npm//@bazel/typescript", ], ) diff --git a/internal/e2e/package_typescript_2.8/WORKSPACE b/internal/e2e/package_typescript_2.8/WORKSPACE index e383ed45..558b6905 100644 --- a/internal/e2e/package_typescript_2.8/WORKSPACE +++ b/internal/e2e/package_typescript_2.8/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,9 +32,9 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/package_typescript_2.9/BUILD.bazel b/internal/e2e/package_typescript_2.9/BUILD.bazel index 3c9602c3..db3403d9 100644 --- a/internal/e2e/package_typescript_2.9/BUILD.bazel +++ b/internal/e2e/package_typescript_2.9/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", + "@npm//@bazel/typescript", "@npm//@types/jasmine", "@npm//@types/node", - "@npm//@bazel/typescript", ], ) diff --git a/internal/e2e/package_typescript_2.9/WORKSPACE b/internal/e2e/package_typescript_2.9/WORKSPACE index 64fb5996..bfc88db6 100644 --- a/internal/e2e/package_typescript_2.9/WORKSPACE +++ b/internal/e2e/package_typescript_2.9/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,9 +32,9 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/package_typescript_3.0/BUILD.bazel b/internal/e2e/package_typescript_3.0/BUILD.bazel index 3c9602c3..db3403d9 100644 --- a/internal/e2e/package_typescript_3.0/BUILD.bazel +++ b/internal/e2e/package_typescript_3.0/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", + "@npm//@bazel/typescript", "@npm//@types/jasmine", "@npm//@types/node", - "@npm//@bazel/typescript", ], ) diff --git a/internal/e2e/package_typescript_3.0/WORKSPACE b/internal/e2e/package_typescript_3.0/WORKSPACE index dcda2485..6ac19531 100644 --- a/internal/e2e/package_typescript_3.0/WORKSPACE +++ b/internal/e2e/package_typescript_3.0/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,9 +32,9 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/package_typescript_3.1/BUILD.bazel b/internal/e2e/package_typescript_3.1/BUILD.bazel index 3c9602c3..db3403d9 100644 --- a/internal/e2e/package_typescript_3.1/BUILD.bazel +++ b/internal/e2e/package_typescript_3.1/BUILD.bazel @@ -26,9 +26,9 @@ ts_library( srcs = glob(["*.spec.ts"]), deps = [ ":main", + "@npm//@bazel/typescript", "@npm//@types/jasmine", "@npm//@types/node", - "@npm//@bazel/typescript", ], ) diff --git a/internal/e2e/package_typescript_3.1/WORKSPACE b/internal/e2e/package_typescript_3.1/WORKSPACE index dcda2485..6ac19531 100644 --- a/internal/e2e/package_typescript_3.1/WORKSPACE +++ b/internal/e2e/package_typescript_3.1/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,9 +32,9 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel b/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel index c5047f74..042f5467 100644 --- a/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel +++ b/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel @@ -25,13 +25,13 @@ ts_library( name = "test_lib", testonly = True, srcs = glob(["*.spec.ts"]), + compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", deps = [ ":main", "@npm//@types/jasmine", "@npm//@types/node", "@npm//typescript", ], - compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", ) jasmine_node_test( diff --git a/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE b/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE index dcda2485..6ac19531 100644 --- a/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE +++ b/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,9 +32,9 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/package_typescript_karma/WORKSPACE b/internal/e2e/package_typescript_karma/WORKSPACE index 0412d910..d30e254c 100644 --- a/internal/e2e/package_typescript_karma/WORKSPACE +++ b/internal/e2e/package_typescript_karma/WORKSPACE @@ -20,9 +20,11 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + rules_typescript_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -30,19 +32,21 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") +load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() + go_register_toolchains() load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") web_test_repositories() + browser_repositories( chromium = True, firefox = True, diff --git a/internal/e2e/reference_types_directive/BUILD.bazel b/internal/e2e/reference_types_directive/BUILD.bazel index 024fa65d..44a396e2 100644 --- a/internal/e2e/reference_types_directive/BUILD.bazel +++ b/internal/e2e/reference_types_directive/BUILD.bazel @@ -1,9 +1,9 @@ -load("//internal:defaults.bzl", "ts_library") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") +load("//internal:defaults.bzl", "ts_library") ts_library( name = "tsconfig_types", - srcs = glob(["tsconfig_types.ts"]), + srcs = ["tsconfig_types.ts"], expected_diagnostics = [ "TS2304: Cannot find name 'Hammer'", ], diff --git a/internal/e2e/strict_deps/BUILD b/internal/e2e/strict_deps/BUILD index 775c480c..e2387a16 100644 --- a/internal/e2e/strict_deps/BUILD +++ b/internal/e2e/strict_deps/BUILD @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("//internal:defaults.bzl", "ts_library") + licenses(["notice"]) # Apache 2.0 package(default_visibility = ["//visibility:public"]) -load("//internal:defaults.bzl", "ts_library") - ts_library( name = "grandparent", srcs = ["grandparent.ts"], diff --git a/internal/e2e/ts_auto_deps/WORKSPACE b/internal/e2e/ts_auto_deps/WORKSPACE index 71364b05..2fbfb888 100644 --- a/internal/e2e/ts_auto_deps/WORKSPACE +++ b/internal/e2e/ts_auto_deps/WORKSPACE @@ -20,10 +20,13 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies", "rules_typescript_dev_dependencies") + rules_typescript_dependencies() + rules_typescript_dev_dependencies() load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") @@ -31,14 +34,15 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories(preserve_symlinks = True) yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") +load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() + go_register_toolchains() load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 50f80bdc..7852325e 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -1,5 +1,8 @@ -package(default_visibility = ["//visibility:public"]) load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") +load("//internal:defaults.bzl", "ts_library") + +package(default_visibility = ["//visibility:public"]) exports_files([ "test-main.js", @@ -9,8 +12,6 @@ exports_files([ "ts_web_test_suite.bzl", ]) -load("//internal:defaults.bzl", "ts_library") - ts_library( name = "karma_concat_js", srcs = glob(["*.ts"]), @@ -22,8 +23,6 @@ ts_library( ], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") - nodejs_binary( name = "karma_bin", data = [ @@ -61,8 +60,8 @@ npm_package( name = "npm_package", srcs = [ "README.md", - "package.json", "karma.js", + "package.json", ], deps = [ ":check_version_copy", @@ -72,12 +71,11 @@ npm_package( ) pkg_tar( - name = "package", - srcs = [ - "ts_web_test.bzl", - "BUILD.bazel", - "package.json", - ], - package_dir = "karma" + name = "package", + srcs = [ + "BUILD.bazel", + "package.json", + "ts_web_test.bzl", + ], + package_dir = "karma", ) - diff --git a/internal/karma/ts_web_test.bzl b/internal/karma/ts_web_test.bzl index d76703a4..bcdee114 100644 --- a/internal/karma/ts_web_test.bzl +++ b/internal/karma/ts_web_test.bzl @@ -13,14 +13,14 @@ # limitations under the License. "Unit testing with Karma" +load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim") load( "@build_bazel_rules_nodejs//internal:node.bzl", "expand_path_into_runfiles", "sources_aspect", ) -load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim") -load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") _CONF_TMPL = "//internal/karma:karma.conf.js" _DEFAULT_KARMA_BIN = "@npm//@bazel/karma/bin:karma" @@ -108,11 +108,11 @@ def _ts_web_test_impl(ctx): output = conf, template = ctx.file._conf_tmpl, substitutions = { - "TMPL_runfiles_path": "/".join([".."] * config_segments), "TMPL_bootstrap_files": "\n".join([" '%s'," % e for e in bootstrap_entries]), - "TMPL_user_files": "\n".join([" '%s'," % e for e in user_entries]), - "TMPL_static_files": "\n".join([" '%s'," % e for e in static_files]), + "TMPL_runfiles_path": "/".join([".."] * config_segments), "TMPL_runtime_files": "\n".join([" '%s'," % e for e in runtime_files]), + "TMPL_static_files": "\n".join([" '%s'," % e for e in static_files]), + "TMPL_user_files": "\n".join([" '%s'," % e for e in user_entries]), "TMPL_workspace_name": ctx.workspace_name, }, ) @@ -184,27 +184,21 @@ ts_web_test = rule( doc = "JavaScript source files", allow_files = [".js"], ), - "deps": attr.label_list( - doc = "Other targets which produce JavaScript such as `ts_library`", - allow_files = True, - aspects = [sources_aspect], - ), "bootstrap": attr.label_list( doc = """JavaScript files to include *before* the module loader (require.js). For example, you can include Reflect,js for TypeScript decorator metadata reflection, or UMD bundles for third-party libraries.""", allow_files = [".js"], ), - "runtime_deps": attr.label_list( - doc = """Dependencies which should be loaded after the module loader but before the srcs and deps. - These should be a list of targets which produce JavaScript such as `ts_library`. - The files will be loaded in the same order they are declared by that rule.""", - allow_files = True, - aspects = [sources_aspect], - ), "data": attr.label_list( doc = "Runtime dependencies", ), + "karma": attr.label( + default = Label(_DEFAULT_KARMA_BIN), + executable = True, + cfg = "target", + allow_files = True, + ), "static_files": attr.label_list( doc = """Arbitrary files which are available to be served on request. Files are served at: @@ -212,11 +206,17 @@ ts_web_test = rule( `/base/build_bazel_rules_typescript/examples/testing/static_script.js`""", allow_files = True, ), - "karma": attr.label( - default = Label(_DEFAULT_KARMA_BIN), - executable = True, - cfg = "target", + "runtime_deps": attr.label_list( + doc = """Dependencies which should be loaded after the module loader but before the srcs and deps. + These should be a list of targets which produce JavaScript such as `ts_library`. + The files will be loaded in the same order they are declared by that rule.""", + allow_files = True, + aspects = [sources_aspect], + ), + "deps": attr.label_list( + doc = "Other targets which produce JavaScript such as `ts_library`", allow_files = True, + aspects = [sources_aspect], ), "_conf_tmpl": attr.label( default = Label(_CONF_TMPL), diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel index 60085a74..9f8522ef 100644 --- a/internal/protobufjs/BUILD.bazel +++ b/internal/protobufjs/BUILD.bazel @@ -1,7 +1,7 @@ -package(default_visibility = ["//visibility:public"]) - -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") + +package(default_visibility = ["//visibility:public"]) exports_files([ "node_modules/protobufjs/dist/minimal/protobuf.min.js", @@ -56,13 +56,12 @@ nodejs_binary( ) pkg_tar( - name = "package", - srcs = [ - "ts_proto_library.bzl", - "BUILD.bazel", - "yarn.lock", - "package.json", - ], - package_dir = "protobufjs" + name = "package", + srcs = [ + "BUILD.bazel", + "package.json", + "ts_proto_library.bzl", + "yarn.lock", + ], + package_dir = "protobufjs", ) - diff --git a/internal/protobufjs/ts_proto_library.bzl b/internal/protobufjs/ts_proto_library.bzl index 8abb241b..07ae0d30 100644 --- a/internal/protobufjs/ts_proto_library.bzl +++ b/internal/protobufjs/ts_proto_library.bzl @@ -118,11 +118,11 @@ def _ts_proto_library(ctx): ts_proto_library = rule( implementation = _ts_proto_library, attrs = { - "deps": attr.label_list(doc = "proto_library targets"), "output_name": attr.string( doc = """Name of the resulting module, which you will import from. If not specified, the name will match the target's name.""", ), + "deps": attr.label_list(doc = "proto_library targets"), "_pbjs": attr.label( default = Label("//internal/protobufjs:pbjs"), executable = True, diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index afefa442..87327f95 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -14,8 +14,8 @@ "Install toolchain dependencies" -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version", "yarn_install") load("@bazel_gazelle//:deps.bzl", "go_repository") +load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version", "yarn_install") def ts_setup_workspace(): """This repository rule should be called from your WORKSPACE file. diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index dc328a10..46b5590f 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -licenses(["notice"]) # Apache 2.0 - load("//internal:defaults.bzl", "ts_library") +licenses(["notice"]) # Apache 2.0 + error_message = "error TS21224: Value passed.*" ts_library( @@ -29,7 +29,6 @@ ts_library( ts_library( name = "positives", testonly = 1, - tsconfig = "//internal:tsetse/tsconfig.json", srcs = [ "positives.ts", ], @@ -42,6 +41,7 @@ ts_library( "\(34,5\).*" + error_message, "\(35,5\).*" + error_message, ], + tsconfig = "//internal:tsetse/tsconfig.json", deps = [ ":jasmine", ], @@ -50,10 +50,10 @@ ts_library( ts_library( name = "negatives", testonly = 1, - tsconfig = "//internal:tsetse/tsconfig.json", srcs = [ "negatives.ts", ], + tsconfig = "//internal:tsetse/tsconfig.json", deps = [ ":jasmine", ], diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 5907da5a..83817bd7 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -12,16 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -licenses(["notice"]) # Apache 2.0 - load("//internal:defaults.bzl", "ts_library") +licenses(["notice"]) # Apache 2.0 + error_message = "error TS21226: Found a thenable.*" ts_library( name = "positives", testonly = 1, - tsconfig = "//internal:tsetse/tsconfig.json", srcs = [ "positives.ts", ], @@ -37,6 +36,7 @@ ts_library( "\(44,34\).*" + error_message, "\(45,34\).*" + error_message, ], + tsconfig = "//internal:tsetse/tsconfig.json", deps = [ ], ) @@ -44,8 +44,8 @@ ts_library( ts_library( name = "negatives", testonly = 1, - tsconfig = "//internal:tsetse/tsconfig.json", srcs = ["negatives.ts"], + tsconfig = "//internal:tsetse/tsconfig.json", deps = [ ], ) diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index be2414a3..1e7188d5 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -licenses(["notice"]) # Apache 2.0 - load("//internal:defaults.bzl", "ts_library") +licenses(["notice"]) # Apache 2.0 + error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index dd086120..db8a287d 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -licenses(["notice"]) # Apache 2.0 - load("//internal:defaults.bzl", "ts_library") +licenses(["notice"]) # Apache 2.0 + ts_library( name = "positives", diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index 16dddf47..cc73c8a9 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -licenses(["notice"]) # Apache 2.0 - load("//internal:defaults.bzl", "ts_library") +licenses(["notice"]) # Apache 2.0 + error_message = "TS21225: All Promises in async functions must either be awaited or used in an expression." @@ -25,7 +25,6 @@ ts_library( srcs = [ "positives.ts", ], - tsconfig = "//internal:tsetse/tsconfig.json", expected_diagnostics = [ "\(29,3\)" + error_message, "\(30,3\)" + error_message, @@ -33,6 +32,7 @@ ts_library( "\(32,3\)" + error_message, "\(34,3\)" + error_message, ], + tsconfig = "//internal:tsetse/tsconfig.json", deps = [ ], ) diff --git a/package.json b/package.json index 2dd30611..77ac9cda 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "devDependencies": { "@bazel/ibazel": "^0.2.0", + "@bazel/buildifier": "^0.20.0", "@bazel/typescript": "0.19.1", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", @@ -56,6 +57,9 @@ "//": "disable deprecated-api skylint check because we must make legacy-style providers for TS interop in google3", "skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint --disable-checks=deprecated-api", "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", - "version": "node ./on-version.js && git stage package.bzl" + "version": "node ./on-version.js && git stage package.bzl", + "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", + "bazel:lint": "yarn bazel:format --lint=warn", + "bazel:lint-fix": "yarn bazel:format --lint=fix" } } diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel index 3b835fdb..ce4c4152 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel @@ -1,8 +1,8 @@ -package(default_visibility = ["//:__pkg__"]) - +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") + +package(default_visibility = ["//:__pkg__"]) licenses(["notice"]) # Apache 2.0 @@ -30,11 +30,10 @@ go_library( ) pkg_tar( - name = "package", - srcs = [ - "BUILD.bazel", - "worker_protocol.proto", - ], - package_dir = "third_party/github.com/bazelbuild/bazel/src/main/protobuf", + name = "package", + srcs = [ + "BUILD.bazel", + "worker_protocol.proto", + ], + package_dir = "third_party/github.com/bazelbuild/bazel/src/main/protobuf", ) - diff --git a/yarn.lock b/yarn.lock index 8d09cb4c..b7f47a04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,24 @@ # yarn lockfile v1 +"@bazel/buildifier-darwin_x64@0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.20.0.tgz#1aeceb5a1a57a62eef6415377dbe95091781a7d4" + integrity sha512-yV7niwbdpDDPUw1vgyk1wIjPl3+YOM4o5FPgFmnFgzf48JUqrF3PK6Blg95Z8SqGOVoJAOChRC1GvopzEUzwZA== + +"@bazel/buildifier-linux_x64@0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.20.0.tgz#8cb6c8f999dbd8a9ee183906f202b698571d771b" + integrity sha512-djbBtcacgERWZoxjEm8lGmMyEaOYB3moiz0kioHTQc2F96wNLfm6Cikd4Ojrcj5VNQCMW9oy3YFTu+c5mIrCcA== + +"@bazel/buildifier@^0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.20.0.tgz#24a10e485fe65dbd75ef812cf37635df1fb91d0d" + integrity sha512-dahQRtE1KEp+efUV23q/JtOCSbQEk5C/+H3J33g8wP5roxMUa8mfDto85eloJ+gRPW7yOybxknuRYc4KSpgT7w== + optionalDependencies: + "@bazel/buildifier-darwin_x64" "0.20.0" + "@bazel/buildifier-linux_x64" "0.20.0" + "@bazel/ibazel@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" From b4bc468bfb03c05b68dde0b4f846bcd1a8fb7b01 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Wed, 19 Dec 2018 15:14:22 -0800 Subject: [PATCH 031/316] Enforce buildifier on CircleCI Remove legacy Skylint configuration PiperOrigin-RevId: 226241224 --- .circleci/config.yml | 17 +++++++++++++---- examples/googmodule/BUILD.bazel | 1 - internal/common/module_mappings.bzl | 1 - internal/common/tsconfig.bzl | 3 +++ internal/tsetse/tests/check_return_value/BUILD | 1 - internal/tsetse/tests/equals_nan/BUILD | 1 - internal/tsetse/tests/must_use_promises/BUILD | 1 - package.json | 3 --- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 33b33181..150c499e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -111,10 +111,19 @@ jobs: steps: - checkout: <<: *post_checkout - - run: .circleci/setup_cache.sh - - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - *setup-bazel-remote-cache - - run: yarn skylint + + - run: yarn install + + # Run the skylark linter to check our Bazel rules + # Note, this is not yet enforced, because + # - buildifier doesn't exit non-zero in the presence of lint warnings: https://github.com/bazelbuild/buildtools/issues/470 + # - false positive for rule docstrings: https://github.com/bazelbuild/buildtools/issues/471 + - run: 'yarn bazel:lint || + (echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)' + + # Enforce that BUILD files are formatted. + - run: 'yarn bazel:format -mode=check || + (echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)' workflows: version: 2 diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel index 5ed37cb6..6bc149c6 100644 --- a/examples/googmodule/BUILD.bazel +++ b/examples/googmodule/BUILD.bazel @@ -8,7 +8,6 @@ ts_library( tsconfig = "tsconfig.json", ) - es5_consumer( name = "es5_output", deps = [":googmodule"], diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index 06bca052..d085d726 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -22,7 +22,6 @@ """Module mappings. """ - def _get_deps(attrs, names): return [ d diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 971bd83b..0b1fcda6 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -134,6 +134,7 @@ def create_tsconfig( # See javascript/typescript/compiler/tsc_wrapped.ts:BazelOptions. # Unlike compiler_options, the paths here are relative to the rootDir, # not the location of the tsconfig.json file. + # @unsorted-dict-items preserve historical order for golden tests bazel_options = { "workspaceName": ctx.workspace_name, "target": str(ctx.label), @@ -175,6 +176,7 @@ def create_tsconfig( target_language_level = "es5" if devmode_manifest or has_node_runtime else "es2015" # Keep these options in sync with those in playground/playground.ts. + # @unsorted-dict-items preserve historical order for golden tests compiler_options = { # De-sugar to this language level "target": target_language_level, @@ -266,6 +268,7 @@ def create_tsconfig( compiler_options["traceResolution"] = True compiler_options["diagnostics"] = True + # @unsorted-dict-items preserve historical order for golden tests return { "compilerOptions": compiler_options, "bazelOptions": bazel_options, diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index 1e7188d5..502aa274 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -16,7 +16,6 @@ load("//internal:defaults.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 - error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" ts_library( diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index db8a287d..6fad1470 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -16,7 +16,6 @@ load("//internal:defaults.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 - ts_library( name = "positives", testonly = 1, diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index cc73c8a9..9f88bd51 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -16,7 +16,6 @@ load("//internal:defaults.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 - error_message = "TS21225: All Promises in async functions must either be awaited or used in an expression." ts_library( diff --git a/package.json b/package.json index 77ac9cda..607e203b 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,6 @@ "e2e-package_typescript_3.1_no_npm": "cd internal/e2e/package_typescript_3.1_no_npm; bazel test ...", "e2e-package_typescript_karma": "cd internal/e2e/package_typescript_karma; bazel test ...", "e2e-ts_auto_deps": "cd internal/e2e/ts_auto_deps; bazel run @build_bazel_rules_typescript//ts_auto_deps -- -recursive && bazel build simple", - "preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint", - "//": "disable deprecated-api skylint check because we must make legacy-style providers for TS interop in google3", - "skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint --disable-checks=deprecated-api", "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", "version": "node ./on-version.js && git stage package.bzl", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", From 2bfd7ce1b429520e8508194299d833520d589141 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 20 Dec 2018 15:15:13 -0800 Subject: [PATCH 032/316] Fix relative paths in index.html injection Closes #364 PiperOrigin-RevId: 226401464 --- internal/devserver/ts_devserver.bzl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index 90704f80..eee9b69e 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -82,11 +82,19 @@ def _ts_devserver(ctx): if ctx.file.index_html: injected_index = ctx.actions.declare_file("index.html") + bundle_script = ctx.attr.serving_path + if bundle_script.startswith("/"): + bundle_script = bundle_script[1:] html_asset_inject( ctx.file.index_html, ctx.actions, ctx.executable._injector, - [f.path for f in ctx.files.static_files] + [ctx.attr.serving_path], + ctx.attr.additional_root_paths + [ + ctx.label.package, + "/".join([ctx.bin_dir.path, ctx.label.package]), + "/".join([ctx.genfiles_dir.path, ctx.label.package]), + ], + [f.path for f in ctx.files.static_files] + [bundle_script], injected_index, ) devserver_runfiles += [injected_index] @@ -170,9 +178,11 @@ ts_devserver = rule( allow_files = [".js"], ), "serving_path": attr.string( - default = "/_ts_scripts.js", + # This default repeats the one in the go program. We make it explicit here so we can read it + # when injecting scripts into the index file. + default = "/_/ts_scripts.js", doc = """The path you can request from the client HTML which serves the JavaScript bundle. - If you don't specify one, the JavaScript can be loaded at /_ts_scripts.js""", + If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js""", ), "static_files": attr.label_list( doc = """Arbitrary files which to be served, such as index.html. From 2963b55370b21d545d0ac0f30fca9dc74a0f5538 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 20 Dec 2018 15:34:57 -0800 Subject: [PATCH 033/316] Export IsMpegTS and IsTazeDisabledForDir. PiperOrigin-RevId: 226404533 --- ts_auto_deps/updater/updater.go | 39 +++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index cb80b50d..c0f69eed 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -250,7 +250,7 @@ func globSources(ctx context.Context, path string, extensions []string) (srcSet, if err != nil { return nil, fmt.Errorf("cannot stat platform.Glob result %q: %v", p, err) } - isMpeg, err := isMpegTS(ctx, p) + isMpeg, err := IsMpegTS(ctx, p) if err != nil { return nil, err } @@ -266,9 +266,9 @@ func globSources(ctx context.Context, path string, extensions []string) (srcSet, return srcs, nil } -// isMpegTS checks if a ".ts" file is an MPEG transport stream. Taze shouldn't +// IsMpegTS checks if a ".ts" file is an MPEG transport stream. Taze shouldn't // treat them as TypeScript files. -func isMpegTS(ctx context.Context, path string) (bool, error) { +func IsMpegTS(ctx context.Context, path string) (bool, error) { var content [200]byte n, err := platform.ReadBytesFromFile(ctx, path, content[:]) if err != nil && err != io.EOF { @@ -505,16 +505,16 @@ func getBUILDPathAndBUILDFile(ctx context.Context, path string) (string, string, return g3root, buildFilePath, bld, nil } -// isTazeDisabled checks the BUILD file, or if the directory doesn't exist, the nearest -// ancestor BUILD file for a disable_ts_auto_deps() rule. -func isTazeDisabled(ctx context.Context, g3root string, buildFilePath string, bld *build.File) bool { +// isTazeDisabledInPackage checks the BUILD file, or if the BUILD doesn't exist, +// the nearest ancestor BUILD file for a disable_ts_auto_deps() rule. +func isTazeDisabledInPackage(ctx context.Context, g3root string, buildFilePath string, bld *build.File) bool { if _, err := platform.Stat(ctx, buildFilePath); err != nil && os.IsNotExist(err) { // Make sure ts_auto_deps hasn't been disabled in the next closest ancestor package. ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(bld.Path)) if err != nil { platform.Infof("Could not find any ancestor BUILD for %q, continuing with a new BUILD file", buildFilePath) - } else if !hasTazeEnabled(ancestor) { + } else if buildHasDisableTaze(ancestor) { fmt.Printf("ts_auto_deps disabled below %q\n", ancestor.Path) return true } else { @@ -523,7 +523,7 @@ func isTazeDisabled(ctx context.Context, g3root string, buildFilePath string, bl } } - if !hasTazeEnabled(bld) { + if buildHasDisableTaze(bld) { fmt.Printf("ts_auto_deps disabled on %q\n", buildFilePath) return true } @@ -680,6 +680,17 @@ func (upd *Updater) RegisterTsconfigAndTsDevelopmentSources(ctx context.Context, return updated, nil } +// IsTazeDisabledForDir checks if ts_auto_deps is disabled in the BUILD file in the dir, +// or if no BUILD file exists, in the closest ancestor BUILD +func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { + g3root, buildFilePath, bld, err := getBUILDPathAndBUILDFile(ctx, dir) + if err != nil { + return false, err + } + + return isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld), nil +} + // CantProgressAfterWriteError reports that ts_auto_deps was run in an environment // where it can't make writes to the file system (such as when ts_auto_deps is running // as a service for cider) and the writes it made need to be visible to bazel analyze, @@ -720,7 +731,7 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update return false, err } - if isTazeDisabled(ctx, g3root, buildFilePath, bld) { + if isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld) { return false, nil } @@ -772,17 +783,17 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update return changed, nil } -// hasTazeEnabled checks if the BUILD file should be managed using ts_auto_deps. +// buildHasDisableTaze checks if the BUILD file should be managed using ts_auto_deps. // Users can disable ts_auto_deps by adding a "disable_ts_auto_deps()" (or "dont_ts_auto_deps_me()") statement. -func hasTazeEnabled(bld *build.File) bool { +func buildHasDisableTaze(bld *build.File) bool { for _, stmt := range bld.Stmt { if call, ok := stmt.(*build.CallExpr); ok { if fnName, ok := call.X.(*build.Ident); ok && (fnName.Name == "disable_ts_auto_deps" || fnName.Name == "dont_ts_auto_deps_me") { - return false + return true } } } - return true + return false } // QueryBasedBazelAnalyze uses bazel query to analyze targets. It is available under a flag or @@ -860,7 +871,7 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, if err != nil { return err } - if hasTazeEnabled(bld) { + if !buildHasDisableTaze(bld) { return reg.registerTestRule(ctx, parent, ruleKind, rt, g3root, target) } platform.Infof("ts_auto_deps disabled on %q", buildFile) From 61a80f92da82b9fab25353cfddafaf649a6e42c4 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 27 Dec 2018 10:38:59 -0800 Subject: [PATCH 034/316] Respect disable_taze when registering tests with ts_development_sources. PiperOrigin-RevId: 227041623 --- ts_auto_deps/updater/updater.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index c0f69eed..1a970849 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -857,6 +857,9 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, if targetRegisteredInRule(bld, ruleKind, rt, target) { return nil } + if buildHasDisableTaze(bld) { + return nil + } r := getRule(bld, ruleKind, rt) if r != nil { addDep(bld, r, target) @@ -871,11 +874,7 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, if err != nil { return err } - if !buildHasDisableTaze(bld) { - return reg.registerTestRule(ctx, parent, ruleKind, rt, g3root, target) - } - platform.Infof("ts_auto_deps disabled on %q", buildFile) - // Continue below. + return reg.registerTestRule(ctx, parent, ruleKind, rt, g3root, target) } parentDir = filepath.Dir(parentDir) } From 26c14d888ea1fe3e20b0857b1ec538e7349d2ebf Mon Sep 17 00:00:00 2001 From: martinprobst Date: Thu, 3 Jan 2019 11:31:15 -0800 Subject: [PATCH 035/316] Adjust rules_typescript to TypeScript 3.1.3 API changes. PiperOrigin-RevId: 227720990 --- internal/tsc_wrapped/compiler_host.ts | 23 +++++++++++++---------- package.json | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index c6140615..96eb3d27 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -382,8 +382,9 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { * typescript secondary search behavior needs to be overridden to support * looking under `bazelOpts.nodeModulesPrefix` */ - resolveTypeReferenceDirectives(names: string[], containingFile: string): (ts.ResolvedTypeReferenceDirective)[] { - let result: (ts.ResolvedTypeReferenceDirective)[] = [] + resolveTypeReferenceDirectives(names: string[], containingFile: string): ts.ResolvedTypeReferenceDirective[] { + if (!this.allowActionInputReads) return []; + const result: ts.ResolvedTypeReferenceDirective[] = []; names.forEach(name => { let resolved: ts.ResolvedTypeReferenceDirective | undefined; @@ -402,10 +403,12 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { // Types not resolved should be silently ignored. Leave it to Typescript // to either error out with "TS2688: Cannot find type definition file for // 'foo'" or for the build to fail due to a missing type that is used. - if (DEBUG && !resolved) { - debug(`Failed to resolve type reference directive '${name}'`); + if (!resolved) { + if (DEBUG) { + debug(`Failed to resolve type reference directive '${name}'`); + } + return; } - // In typescript 2.x the return type for this function // is `(ts.ResolvedTypeReferenceDirective | undefined)[]` thus we actually // do allow returning `undefined` in the array but the function is typed @@ -448,18 +451,18 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { writeFile( fileName: string, content: string, writeByteOrderMark: boolean, - onError: ((message: string) => void) | undefined, - sourceFiles: ReadonlyArray | undefined): void { + onError: ((message: string) => void)|undefined, + sourceFiles: ReadonlyArray|undefined): void { perfTrace.wrap( `writeFile ${fileName}`, () => this.writeFileImpl( - fileName, content, writeByteOrderMark, onError, sourceFiles || [])); + fileName, content, writeByteOrderMark, onError, sourceFiles)); } writeFileImpl( fileName: string, content: string, writeByteOrderMark: boolean, - onError: ((message: string) => void) | undefined, - sourceFiles: ReadonlyArray): void { + onError: ((message: string) => void)|undefined, + sourceFiles: ReadonlyArray|undefined): void { // Workaround https://github.com/Microsoft/TypeScript/issues/18648 // This bug is fixed in TS 2.9 const version = ts.versionMajorMinor; diff --git a/package.json b/package.json index 607e203b..6757ec08 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "protractor": "^5.2.0", "shelljs": "^0.8.2", "tsickle": "0.33.1", - "typescript": "~2.9.1", + "typescript": "~3.1.6", "which": "~1.0.5" }, "scripts": { From d3e5f8be8c85e862fb75d713f07dabde3168411a Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 4 Jan 2019 14:39:13 -0800 Subject: [PATCH 036/316] Remove the ErrorOnUnresolvedImports flag. Taze previously gave an option to error or warn on unresolved imports. Warnings aren't visible to many users of taze (IDE users, cider users, in the presubmit). To level the playing field the warning is now always an error. PiperOrigin-RevId: 227916155 --- ts_auto_deps/updater/updater.go | 23 +++++----------------- ts_auto_deps/updater/updater_test.go | 29 ++++++---------------------- 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 1a970849..3f6980bc 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -371,7 +371,7 @@ func (a *AnalysisFailedError) Error() string { // updateDeps adds missing dependencies and removes unnecessary dependencies // for the targets in the given DependencyReports to the build rules in bld. -func updateDeps(bld *build.File, errorOnUnresolvedImports bool, reports []*arpb.DependencyReport) error { +func updateDeps(bld *build.File, reports []*arpb.DependencyReport) error { // First, check *all* reports on whether they were successful, so that users // get the complete set of errors at once. var errors []AnalysisFailureCause @@ -433,20 +433,11 @@ func updateDeps(bld *build.File, errorOnUnresolvedImports bool, reports []*arpb. } hadUnresolved := len(report.UnresolvedImport) > 0 if hadUnresolved { - errMsg := fmt.Sprintf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ + return fmt.Errorf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ "'// from ...'' comment, or the target BUILD files are incorrect?\n%s\n", fullTarget, report.UnresolvedImport, strings.Join(report.GetFeedback(), "\n")) - if errorOnUnresolvedImports { - return fmt.Errorf(errMsg) - } - fmt.Fprintf(os.Stderr, errMsg) - fmt.Fprintf(os.Stderr, "Continuing.\n") } for _, d := range report.UnnecessaryDependency { - if hadUnresolved { - fmt.Fprintf(os.Stderr, "Keeping unnecessary dependency %s due to unresolved imports\n", d) - continue - } platform.Infof("Removing dependency on %s from %s\n", d, fullTarget) edit.ListAttributeDelete(r, "deps", d, pkg) } @@ -624,10 +615,10 @@ func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFil // updateBUILDAfterBazelAnalyze applies the BUILD file updates that depend on bazel // analyze's DependencyReports, most notably updating any rules' deps. -func (upd *Updater) updateBUILDAfterBazelAnalyze(ctx context.Context, isRoot bool, errorOnUnresolvedImports bool, +func (upd *Updater) updateBUILDAfterBazelAnalyze(ctx context.Context, isRoot bool, g3root string, buildFilePath string, bld *build.File, reports []*arpb.DependencyReport) (bool, error) { platform.Infof("Updating deps") - if err := updateDeps(bld, errorOnUnresolvedImports, reports); err != nil { + if err := updateDeps(bld, reports); err != nil { return false, err } @@ -715,10 +706,6 @@ type UpdateBUILDOptions struct { // IsRoot indicates that the directory is a project's root directory, so a tsconfig // rule should be created. IsRoot bool - // ErrorOnUnresolvedImports indicates to ts_auto_deps that it should fail when it's unable - // to resolve the package for an import instead of printing a warning and continuing - // assuming the the user manually added an import to their BUILD for it. - ErrorOnUnresolvedImports bool } // UpdateBUILD drives the main process of creating/updating the BUILD file @@ -771,7 +758,7 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update return false, err } - changedAfterBazelAnalyze, err := upd.updateBUILDAfterBazelAnalyze(ctx, options.IsRoot, options.ErrorOnUnresolvedImports, g3root, buildFilePath, bld, reports) + changedAfterBazelAnalyze, err := upd.updateBUILDAfterBazelAnalyze(ctx, options.IsRoot, g3root, buildFilePath, bld, reports) if err != nil { return false, err } diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index f587baf9..65dd3bb7 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -214,7 +214,7 @@ func TestUpdateDeps(t *testing.T) { if err != nil { t.Errorf("parse %s after failed: %s", tst.name, err) } - if err := updateDeps(bld, false, []*arpb.DependencyReport{report}); err != nil { + if err := updateDeps(bld, []*arpb.DependencyReport{report}); err != nil { t.Errorf("update %s failed: %s", tst.name, err) } updated := string(build.Format(bld)) @@ -238,29 +238,12 @@ func TestUnresolvedImportError(t *testing.T) { t.Fatal(err) } - tests := []struct { - name string - errorOnUnresolvedImports bool - err error - }{ - { - name: "Error", - errorOnUnresolvedImports: true, - err: fmt.Errorf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ - "'// from ...'' comment, or the target BUILD files are incorrect?\n\n", "//foo:bar", []string{"unresolved/import"}), - }, - { - name: "Warn", - errorOnUnresolvedImports: false, - err: nil, - }, - } + expectedErr := fmt.Errorf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ + "'// from ...'' comment, or the target BUILD files are incorrect?\n\n", "//foo:bar", []string{"unresolved/import"}) - for _, tst := range tests { - err = updateDeps(bld, tst.errorOnUnresolvedImports, []*arpb.DependencyReport{report}) - if !reflect.DeepEqual(err, tst.err) { - t.Errorf("update %s returned error %s: expected %s", tst.name, err, tst.err) - } + err = updateDeps(bld, []*arpb.DependencyReport{report}) + if !reflect.DeepEqual(err, expectedErr) { + t.Errorf("returned error %s: expected %s", err, expectedErr) } } From 312c023ba572319368f59c72f2488b76463f375f Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 7 Jan 2019 15:09:58 -0800 Subject: [PATCH 037/316] Fix build breakage of rules_typescript Because google3 only runs the BuildKite (BazelCI) tests, we miss coverage of the tests which are only on CircleCI. tsc_wrapped now requires TS>2.9 to compile, so one of our integration tests needs to update to more recent typescript since it compiles tsc_wrapped from sources. PiperOrigin-RevId: 228244244 --- internal/e2e/default_tsconfig_test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index 2dfbda3b..2df18270 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -48,7 +48,7 @@ const PACKAGE_JSON = `{ "source-map-support": "0.5.9", "tsickle": "0.33.1", "tsutils": "2.27.2", - "typescript": "~2.9.1" + "typescript": "~3.1.3" } } `; @@ -307,10 +307,10 @@ tsutils@2.27.2: dependencies: tslib "^1.8.1" -typescript@~2.9.1: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== +typescript@~3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== window-size@^0.1.4: version "0.1.4" From 65d4708db6fc28030faeeafe40cec168cac3fa56 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 7 Jan 2019 18:12:11 -0800 Subject: [PATCH 038/316] Also add --action_env=PATH for building test PiperOrigin-RevId: 228268875 --- .bazelci/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 86b7f3b0..298966d2 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -46,6 +46,7 @@ platforms: - "..." - "@disable_tsetse_for_external_test//..." test_flags: + - "--action_env=PATH" - "--test_env=PATH" test_targets: - "..." From 8dc1c31e7e768ec2db8798661284761371b41565 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Wed, 9 Jan 2019 14:27:51 -0800 Subject: [PATCH 039/316] Update docs for release --- docs/api/devserver/ts_devserver.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/api/devserver/ts_devserver.html b/docs/api/devserver/ts_devserver.html index 4d5b179e..9c4febb2 100644 --- a/docs/api/devserver/ts_devserver.html +++ b/docs/api/devserver/ts_devserver.html @@ -147,7 +147,7 @@

Attributes

ts_devserver

-
ts_devserver(name, deps, data, additional_root_paths, bootstrap, entry_module, port, scripts, serving_path, static_files)
+
ts_devserver(name, deps, data, additional_root_paths, bootstrap, entry_module, index_html, port, scripts, serving_path, static_files)

ts_devserver is a simple development server intended for a quick "getting started" experience.

Additional documentation at https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel

@@ -204,6 +204,15 @@

Attributes

The entrymodule should be the AMD module name of the entry module such as `"_main/src/index"ts_devserver concats the following snippet after the bundle to load the application:require(["entry_module"]);`

+ + index_html + +

Label; Optional

+

An index.html file, we'll inject the script tag for the bundle, + as well as script tags for .js static_files and link tags for .css + static_files

+ + port @@ -221,7 +230,7 @@

Attributes

serving_path -

String; Optional; Default is ''

+

String; Optional; Default is '/_/ts_scripts.js'

The path you can request from the client HTML which serves the JavaScript bundle. If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js

From a1970bac0b866d431b179d299d747ef05bfb42e3 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Wed, 9 Jan 2019 14:28:05 -0800 Subject: [PATCH 040/316] rel: 0.22.1 --- package.bzl | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.bzl b/package.bzl index 86bf207a..1f54ddec 100644 --- a/package.bzl +++ b/package.bzl @@ -24,7 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # It will be automatically synced via the npm "version" script # that is run when running `npm version` during the release # process. See `Releasing` section in README.md. -VERSION = "0.22.0" +VERSION = "0.22.1" def rules_typescript_dependencies(): """ diff --git a/package.json b/package.json index 6757ec08..4140a450 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", "private": true, - "version": "0.22.0", + "version": "0.22.1", "dependencies": { "jasmine-core": "2.8.0", "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", From c339f0ca365d8e7494b0a65ccc9ddcb15b6b929a Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 9 Jan 2019 16:04:09 -0800 Subject: [PATCH 041/316] -- Change 1 of 2 by Keen Yee Liau : rel: 0.22.1 -- Change 2 of 2 by Greg Magolan : Use xlarge resource_class for CircleCI test job Closes #379 PiperOrigin-RevId: 228606178 --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 150c499e..e2cb0bb6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,6 +88,7 @@ jobs: # Runs end-to-end browser tests. test: <<: *job_defaults + resource_class: xlarge steps: - checkout: <<: *post_checkout From 4a087c084cab78e610f91764db52e705aefa1814 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 9 Jan 2019 17:25:05 -0800 Subject: [PATCH 042/316] -- Change 1 of 1 by Greg Magolan : Update yarn lock file after change to typescript 3.1 Closes #376 PiperOrigin-RevId: 228619566 --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7f47a04..20b3f83b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4089,10 +4089,10 @@ type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" -typescript@~2.9.1: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== +typescript@~3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== ultron@1.0.x: version "1.0.2" From 3f58b7eed83864c62965fde726f553877ad2fccd Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 11 Jan 2019 07:47:04 -0800 Subject: [PATCH 043/316] ci: lower memory ceiling Both https://github.com/bazelbuild/rules_typescript/pull/327 and https://github.com/bazelbuild/rules_typescript/pull/378 have circleci `test` jobs being killed: ``` Server terminated abruptly (error code: 14, error message: '', log file: '/home/circleci/.cache/bazel/_bazel_circleci/cced162ff126e466524550c57f0d7df5/server/jvm.out') ``` According to the note in https://github.com/bazelbuild/rules_typescript/blob/4a087c084cab78e610f91764db52e705aefa1814/.circleci/bazel.rc#L32-L38 this means the memory limit should be reduced. Closes #380 PiperOrigin-RevId: 228881108 --- .circleci/bazel.rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc index 75e6ee74..595b37d6 100644 --- a/.circleci/bazel.rc +++ b/.circleci/bazel.rc @@ -25,8 +25,8 @@ build --experimental_repository_cache=/home/circleci/bazel_repository_cache # Workaround https://github.com/bazelbuild/bazel/issues/3645 # Bazel doesn't calculate the memory ceiling correctly when running under Docker. -# Limit Bazel to consuming 2560K of RAM -build --local_resources=2560,1.0,1.0 +# Limit Bazel to consuming 2360K of RAM +build --local_resources=2360,1.0,1.0 # Also limit Bazel's own JVM heap to stay within our 4G container limit startup --host_jvm_args=-Xmx3g # Since the default CircleCI container has only 4G, limiting the memory From 3ce148a33b6c8a21fceb3329f96a2f5d59ec6b23 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Fri, 11 Jan 2019 16:18:10 -0800 Subject: [PATCH 044/316] Add karma_web_test and karma_web_test_suite Closes #363 PiperOrigin-RevId: 228963937 --- defs.bzl | 9 +- examples/testing/BUILD.bazel | 36 ++- examples/testing/karma.conf.js | 12 + internal/defaults.bzl | 18 +- internal/karma/karma.conf.js | 426 +++++++++++++++++----------- internal/karma/karma_web_test.bzl | 449 ++++++++++++++++++++++++++++++ internal/karma/package.json | 2 +- internal/karma/ts_web_test.bzl | 322 +++++---------------- internal/karma/web_test.bzl | 40 +++ package.json | 3 +- yarn.lock | 245 +++------------- 11 files changed, 934 insertions(+), 628 deletions(-) create mode 100644 examples/testing/karma.conf.js create mode 100644 internal/karma/karma_web_test.bzl create mode 100644 internal/karma/web_test.bzl diff --git a/defs.bzl b/defs.bzl index 3f4b0b31..4f68fa23 100644 --- a/defs.bzl +++ b/defs.bzl @@ -20,9 +20,14 @@ Users should not load files under "/internal" load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") load("//:package.bzl", "VERSION") load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") +load( + "//internal/karma:karma_web_test.bzl", + _karma_web_test = "karma_web_test", + _karma_web_test_suite = "karma_web_test_suite", +) load( "//internal/karma:ts_web_test.bzl", - _ts_web_test = "ts_web_test_macro", + _ts_web_test = "ts_web_test", _ts_web_test_suite = "ts_web_test_suite", ) load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") @@ -38,6 +43,8 @@ ts_devserver = _ts_devserver # TODO(alexeagle): make ts_web_test && ts_web_test_suite work in google3 ts_web_test = _ts_web_test ts_web_test_suite = _ts_web_test_suite +karma_web_test = _karma_web_test +karma_web_test_suite = _karma_web_test_suite ts_proto_library = _ts_proto_library # DO NOT ADD MORE rules here unless they appear in the generated docsite. # Run yarn skydoc to re-generate the docsite. diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel index ee484a94..d2d7e287 100644 --- a/examples/testing/BUILD.bazel +++ b/examples/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//internal:defaults.bzl", "ts_library", "ts_web_test_suite") +load("//internal:defaults.bzl", "karma_web_test_suite", "ts_library", "ts_web_test_suite") ts_library( name = "lib", @@ -28,6 +28,40 @@ ts_library( ], ) +karma_web_test_suite( + name = "testing_karma", + browsers = [ + "@io_bazel_rules_webtesting//browsers:chromium-local", + "@io_bazel_rules_webtesting//browsers:firefox-local", + ], + config_file = ":karma.conf.js", + static_files = [ + "static_script.js", + ], + runtime_deps = [ + ":tests_setup", + ], + deps = [ + ":tests", + "@npm//karma-json-result-reporter", + ], +) + +karma_web_test_suite( + name = "testing_karma_sauce", + browsers = [ + "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10", + ], + tags = [ + "sauce", + # TODO(alexeagle): enable on CI once we have set the SAUCE env variables + "manual", + ], + deps = [ + ":tests", + ], +) + ts_web_test_suite( name = "testing", browsers = [ diff --git a/examples/testing/karma.conf.js b/examples/testing/karma.conf.js new file mode 100644 index 00000000..f96e698b --- /dev/null +++ b/examples/testing/karma.conf.js @@ -0,0 +1,12 @@ +module.exports = function(config) { + config.set({ + plugins: ['karma-json-result-reporter'], + reporters: ['dots', 'progress', 'json-result'], + logLevel: config.LOG_DEBUG, + colors: false, + jsonResultReporter: { + outputFile: `${process.env['TEST_UNDECLARED_OUTPUTS_DIR']}/karma-result.json`, + isSynchronous: true, + }, + }); +} diff --git a/internal/defaults.bzl b/internal/defaults.bzl index ba515024..ca2f4235 100644 --- a/internal/defaults.bzl +++ b/internal/defaults.bzl @@ -14,7 +14,14 @@ "Defaults for rules_typescript repository not meant to be used downstream" -load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library", _ts_web_test_suite = "ts_web_test_suite") +load( + "@build_bazel_rules_typescript//:defs.bzl", + _karma_web_test = "karma_web_test", + _karma_web_test_suite = "karma_web_test_suite", + _ts_library = "ts_library", + _ts_web_test = "ts_web_test", + _ts_web_test_suite = "ts_web_test_suite", +) # We can't use the defaults for ts_library compiler and ts_web_test_suite karma # internally because the defaults are .js dependencies on the npm packages that are @@ -22,8 +29,17 @@ load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library", _ts INTERNAL_TS_LIBRARY_COMPILER = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin" INTERNAL_KARMA_BIN = "@build_bazel_rules_typescript//internal/karma:karma_bin" +def karma_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): + _karma_web_test(karma = karma, **kwargs) + +def karma_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): + _karma_web_test_suite(karma = karma, **kwargs) + def ts_library(compiler = INTERNAL_TS_LIBRARY_COMPILER, **kwargs): _ts_library(compiler = compiler, **kwargs) +def ts_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): + _ts_web_test(karma = karma, **kwargs) + def ts_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): _ts_web_test_suite(karma = karma, **kwargs) diff --git a/internal/karma/karma.conf.js b/internal/karma/karma.conf.js index 70dc9bf8..1ef2a492 100644 --- a/internal/karma/karma.conf.js +++ b/internal/karma/karma.conf.js @@ -7,8 +7,21 @@ try const tmp = require('tmp'); const child_process = require('child_process'); - // Helper function to find a particular namedFile - // within the webTestMetadata webTestFiles + const DEBUG = false; + + TMPL_env_vars + + const configPath = 'TMPL_config_file'; + + if (DEBUG) + console.info(`Karma test starting with: + cwd: ${process.cwd()} + configPath: ${configPath}`); + + /** + * Helper function to find a particular namedFile + * within the webTestMetadata webTestFiles + */ function findNamedFile(webTestMetadata, key) { let result; webTestMetadata['webTestFiles'].forEach(entry => { @@ -20,8 +33,10 @@ try return result; } - // Helper function to extract a browser archive - // and return the path to extract executable + /** + * Helper function to extract a browser archive + * and return the path to extract executable + */ function extractWebArchive(extractExe, archiveFile, executablePath) { try { // Paths are relative to the root runfiles folder @@ -34,6 +49,7 @@ try child_process.execFileSync( extractExe, [archiveFile, '.'], {stdio: [process.stdin, process.stdout, process.stderr]}); + if (DEBUG) console.info(`Extracting web archive ${archiveFile} with ${extractExe} to ${extractedExecutablePath}`); return extractedExecutablePath; } catch (e) { console.error(`Failed to extract ${archiveFile}`); @@ -41,17 +57,19 @@ try } } - // Chrome on Linux uses sandboxing, which needs user namespaces to be enabled. - // This is not available on all kernels and it might be turned off even if it is available. - // Notable examples where user namespaces are not available include: - // - In Debian it is compiled-in but disabled by default. - // - The Docker daemon for Windows or OSX does not support user namespaces. - // We can detect if user namespaces are supported via /proc/sys/kernel/unprivileged_userns_clone. - // For more information see: - // https://github.com/Googlechrome/puppeteer/issues/290 - // https://superuser.com/questions/1094597/enable-user-namespaces-in-debian-kernel#1122977 - // https://github.com/karma-runner/karma-chrome-launcher/issues/158 - // https://github.com/angular/angular/pull/24906 + /** + * Chrome on Linux uses sandboxing, which needs user namespaces to be enabled. + * This is not available on all kernels and it might be turned off even if it is available. + * Notable examples where user namespaces are not available include: + * - In Debian it is compiled-in but disabled by default. + * - The Docker daemon for Windows or OSX does not support user namespaces. + * We can detect if user namespaces are supported via /proc/sys/kernel/unprivileged_userns_clone. + * For more information see: + * https://github.com/Googlechrome/puppeteer/issues/290 + * https://superuser.com/questions/1094597/enable-user-namespaces-in-debian-kernel#1122977 + * https://github.com/karma-runner/karma-chrome-launcher/issues/158 + * https://github.com/angular/angular/pull/24906 + */ function supportsSandboxing() { if (process.platform !== 'linux') { return true; @@ -65,14 +83,177 @@ try return false; } - const browsers = []; - let customLaunchers = null; + /** + * Helper function to override base karma config values. + */ + function overrideConfigValue(conf, name, value) { + if (conf.hasOwnProperty(name)) { + console.warn( + `Your karma configuration specifies '${name}' which will be overwritten by Bazel`); + } + conf[name] = value; + } + + /** + * Helper function to merge base karma config values that are arrays. + */ + function mergeConfigArray(conf, name, values) { + if (!conf[name]) { + conf[name] = []; + } + values.forEach(v => { + if (!conf[name].includes(v)) { + conf[name].push(v); + } + }) + } + + /** + * Configuration settings for karma under Bazel common to karma_web_test + * and karma_web_test_suite. + */ + function configureBazelConfig(config, conf) { + // list of karma plugins + mergeConfigArray(conf, 'plugins', [ + 'karma-*', + '@bazel/karma', + 'karma-sourcemap-loader', + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-sauce-launcher', + ]); + + // list of karma preprocessors + if (!conf.preprocessors) { + conf.preprocessors = {} + } + conf.preprocessors['**/*.js'] = ['sourcemap']; + + // list of test frameworks to use + overrideConfigValue(conf, 'frameworks', ['jasmine', 'concat_js']); + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + mergeConfigArray(conf, 'reporters', ['progress']); + + // enable / disable colors in the output (reporters and logs) + if (!conf.colors) { + conf.colors = true; + } + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || + // config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + if (!conf.logLevel) { + conf.logLevel = config.LOG_INFO; + } + + // enable / disable watching file and executing tests whenever + // any file changes + overrideConfigValue(conf, 'autoWatch', true); + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + // note: run_karma.sh may override this as a command-line option. + overrideConfigValue(conf, 'singleRun', false); + + // Concurrency level + // how many browser should be started simultaneous + overrideConfigValue(conf, 'concurrency', Infinity); + + // base path that will be used to resolve all patterns + // (eg. files, exclude) + overrideConfigValue(conf, 'basePath', 'TMPL_runfiles_path'); + + if (process.env['IBAZEL_NOTIFY_CHANGES'] === 'y') { + // Tell karma to only listen for ibazel messages on stdin rather than + // watch all the input files This is from fork alexeagle/karma in the + // ibazel branch: + // https://github.com/alexeagle/karma/blob/576d262af50b10e63485b86aee99c5358958c4dd/lib/server.js#L172 + overrideConfigValue(conf, 'watchMode', 'ibazel'); + } + } + + /** + * Configure the 'files' and 'proxies' configuration attributes. + * These are concatenated into a single file by karma-concat-js. + */ + function configureFiles(conf) { + overrideConfigValue(conf, 'files', [ + TMPL_bootstrap_files + TMPL_user_files + ].map(f => { + if (f.startsWith('NODE_MODULES/')) { + try { + // attempt to resolve in @bazel/karma nested node_modules first + return require.resolve(f.replace(/^NODE_MODULES\//, '@bazel/karma/node_modules/')); + } catch (e) { + // if that failed then attempt to resolve in root node_modules + return require.resolve(f.replace(/^NODE_MODULES\//, '')); + } + } else { + return require.resolve(f); + } + })); + overrideConfigValue(conf, 'exclude', []); + overrideConfigValue(conf, 'proxies', {}); + + // static files are added to the files array but + // configured to not be included so karma-concat-js does + // not included them in the bundle + [TMPL_static_files].forEach((f) => { + // In Windows, the runfile will probably not be symlinked. Se we need to + // serve the real file through karma, and proxy calls to the expected file + // location in the runfiles to the real file. + const resolvedFile = require.resolve(f); + conf.files.push({pattern: resolvedFile, included: false}); + // Prefixing the proxy path with '/absolute' allows karma to load local + // files. This doesn't see to be an official API. + // https://github.com/karma-runner/karma/issues/2703 + conf.proxies['/base/' + f] = '/absolute' + resolvedFile; + }); + + var requireConfigContent = ` +// A simplified version of Karma's requirejs.config.tpl.js for use with Karma under Bazel. +// This does an explicit \`require\` on each test script in the files, otherwise nothing will be loaded. +(function(){ + var runtimeFiles = [TMPL_runtime_files].map(function(file) { return file.replace(/\\.js$/, ''); }); + var allFiles = [TMPL_user_files]; + var allTestFiles = []; + allFiles.forEach(function (file) { + if (/[^a-zA-Z0-9](spec|test)\\.js$/i.test(file) && !/\\/node_modules\\//.test(file)) { + allTestFiles.push(file.replace(/\\.js$/, '')) + } + }); + require(runtimeFiles, function() { return require(allTestFiles, window.__karma__.start); }); +})(); +`; + + const requireConfigFile = tmp.fileSync( + {keep: false, postfix: '.js', dir: process.env['TEST_TMPDIR']}); + fs.writeFileSync(requireConfigFile.name, requireConfigContent); + conf.files.push(requireConfigFile.name); + } + + /** + * Configure karma under karma_web_test_suite. + * `browsers` and `customLaunchers` are setup by Bazel. + */ + function configureTsWebTestSuiteConfig(conf) { + // WEB_TEST_METADATA is configured in rules_webtesting based on value + // of the browsers attribute passed to karms_web_test_suite + // We setup the karma configuration based on the values in this object + if (!process.env['WEB_TEST_METADATA']) { + // This is a karma_web_test rule since there is no WEB_TEST_METADATA + return; + } + + overrideConfigValue(conf, 'browsers', []); + overrideConfigValue(conf, 'customLaunchers', null); - // WEB_TEST_METADATA is configured in rules_webtesting based on value - // of the browsers attribute passed to ts_web_test_suite - // We setup the karma configuration based on the values in this object - if (process.env['WEB_TEST_METADATA']) { const webTestMetadata = require(process.env['WEB_TEST_METADATA']); + if (DEBUG) console.info(`WEB_TEST_METADATA: ${JSON.stringify(webTestMetadata, null, 2)}`); if (webTestMetadata['environment'] === 'sauce') { // If a sauce labs browser is chosen for the test such as // "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10" @@ -85,7 +266,7 @@ try } // 'capabilities' will specify the sauce labs configuration to use const capabilities = webTestMetadata['capabilities']; - customLaunchers = { + conf.customLaunchers = { 'sauce': { base: 'SauceLabs', browserName: capabilities['browserName'], @@ -93,7 +274,7 @@ try version: capabilities['version'], } }; - browsers.push('sauce'); + conf.browsers.push('sauce'); } else if (webTestMetadata['environment'] === 'local') { // When a local chrome or firefox browser is chosen such as // "@io_bazel_rules_webtesting//browsers:chromium-local" or @@ -115,15 +296,15 @@ try const browser = process.env['DISPLAY'] ? 'Chrome' : 'ChromeHeadless'; if (!supportsSandboxing()) { const launcher = 'CustomChromeWithoutSandbox'; - customLaunchers = { + conf.customLaunchers = { [launcher]: { base: browser, flags: ['--no-sandbox'] } }; - browsers.push(launcher); + conf.browsers.push(launcher); } else { - browsers.push(browser); + conf.browsers.push(browser); } } if (webTestNamedFiles['FIREFOX']) { @@ -134,165 +315,76 @@ try } else { process.env.FIREFOX_BIN = require.resolve(webTestNamedFiles['FIREFOX']); } - browsers.push(process.env['DISPLAY'] ? 'Firefox' : 'FirefoxHeadless'); + conf.browsers.push(process.env['DISPLAY'] ? 'Firefox' : 'FirefoxHeadless'); } }); } else { - console.warn(`Unknown WEB_TEST_METADATA environment '${webTestMetadata['environment']}'`); - } - } - - // Fallback to using the system local chrome if no valid browsers have been - // configured above - if (!browsers.length) { - console.warn('No browsers configured. Configuring Karma to use system Chrome.'); - browsers.push(process.env['DISPLAY'] ? 'Chrome': 'ChromeHeadless'); - } - - const proxies = {}; - const files = [ - TMPL_bootstrap_files - TMPL_user_files - ].map(f => { - if (f.startsWith('NODE_MODULES/')) { - try { - // attempt to resolve in @bazel/karma nested node_modules first - return require.resolve(f.replace(/^NODE_MODULES\//, '@bazel/karma/node_modules/')); - } catch (e) { - // if that failed then attempt to resolve in root node_modules - return require.resolve(f.replace(/^NODE_MODULES\//, '')); - } - } else { - return require.resolve(f); - } - }); - - // static files are added to the files array but - // configured to not be included so karma-concat-js does - // not included them in the bundle - [TMPL_static_files].forEach((f) => { - // In Windows, the runfile will probably not be symlinked. Se we need to - // serve the real file through karma, and proxy calls to the expected file - // location in the runfiles to the real file. - const resolvedFile = require.resolve(f); - files.push({pattern: resolvedFile, included: false}); - // Prefixing the proxy path with '/absolute' allows karma to load local - // files. This doesn't see to be an official API. - // https://github.com/karma-runner/karma/issues/2703 - proxies['/base/' + f] = '/absolute' + resolvedFile; - }); - - var requireConfigContent = ` -// A simplified version of Karma's requirejs.config.tpl.js for use with Karma under Bazel. -// This does an explicit \`require\` on each test script in the files, otherwise nothing will be loaded. -(function(){ - var runtimeFiles = [TMPL_runtime_files].map(function(file) { return file.replace(/\\.js$/, ''); }); - var allFiles = [TMPL_user_files]; - var allTestFiles = []; - allFiles.forEach(function (file) { - if (/[^a-zA-Z0-9](spec|test)\\.js$/i.test(file) && !/\\/node_modules\\//.test(file)) { - allTestFiles.push(file.replace(/\\.js$/, '')) - } - }); - require(runtimeFiles, function() { return require(allTestFiles, window.__karma__.start); }); -})(); -`; - - const requireConfigFile = tmp.fileSync( - {keep: false, postfix: '.js', dir: process.env['TEST_TMPDIR']}); - fs.writeFileSync(requireConfigFile.name, requireConfigContent); - files.push(requireConfigFile.name); - - module.exports = function(config) { - const configuration = { - // list of karma plugins - plugins: [ - 'karma-*', - '@bazel/karma', - 'karma-sourcemap-loader', - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-sauce-launcher', - ], - - // list of karma preprocessors - preprocessors: {'**/*.js': ['sourcemap']}, - - // list of test frameworks to use - frameworks: ['jasmine', 'concat_js'], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || - // config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file - // changes - autoWatch: true, - - // start these browsers - // available browser launchers: - // https://npmjs.org/browse/keyword/karma-launcher - browsers: browsers, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - // note: run_karma.sh may override this as a command-line option. - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity, - - // base path that will be used to resolve all patterns (eg. files, - // exclude) - basePath: 'TMPL_runfiles_path', - - // list of files passed to karma; these are concatenated into a single - // file by karma-concat-js - files, - proxies, + throw new Error(`Unknown WEB_TEST_METADATA environment '${webTestMetadata['environment']}'`); } - if (process.env['IBAZEL_NOTIFY_CHANGES'] === 'y') { - // Tell karma to only listen for ibazel messages on stdin rather than - // watch all the input files This is from fork alexeagle/karma in the - // ibazel branch: - // https://github.com/alexeagle/karma/blob/576d262af50b10e63485b86aee99c5358958c4dd/lib/server.js#L172 - configuration.watchMode = 'ibazel'; + if (!conf.browsers.length) { + throw new Error('No browsers configured in web test suite'); } // Extra configuration is needed for saucelabs // See: https://github.com/karma-runner/karma-sauce-launcher - if (customLaunchers) { + if (conf.customLaunchers) { // set the test name for sauce labs to use // TEST_BINARY is set by Bazel and contains the name of the test - // target posfixed with the the browser name such as + // target postfixed with the browser name such as // 'examples/testing/testing_sauce_chrome-win10' for the // test target examples/testing:testing - configuration.sauceLabs = { - testName: process.env['TEST_BINARY'] || 'ts_web_test_suite' - }; + if (!conf.sauceLabs) { + conf.sauceLabs = {} + } + conf.sauceLabs.testName = process.env['TEST_BINARY'] || 'karma'; - // setup the custom launchers for saucelabs - configuration.customLaunchers = customLaunchers; + // Try "websocket" for a faster transmission first. Fallback to "polling" if necessary. + overrideConfigValue(conf, 'transports', ['websocket', 'polling']); // add the saucelabs reporter - configuration.reporters.push('saucelabs'); + mergeConfigArray(conf, 'reporters', ['saucelabs']); } + } + + function configureTsWebTestConfig(conf) { + if (process.env['WEB_TEST_METADATA']) { + // This is a karma_web_test_suite rule since there is a WEB_TEST_METADATA + return; + } + + // Fallback to using the system local chrome if no valid browsers have been + // configured above + if (!conf.browsers || !conf.browsers.length) { + console.warn('No browsers configured. Configuring Karma to use system Chrome.'); + conf.browsers = [process.env['DISPLAY'] ? 'Chrome': 'ChromeHeadless']; + } + } + + module.exports = function(config) { + let conf = {}; + + // Import the user's base karma configuration if specified + if (configPath) { + const baseConf = require(configPath); + if (typeof baseConf !== 'function') { + throw new Error('Invalid base karma configuration. Expected config function to be exported.'); + } + const originalSetConfig = config.set; + config.set = function(c) { conf = c; } + baseConf(config); + config.set = originalSetConfig; + if (DEBUG) console.info(`Base karma configuration: ${JSON.stringify(conf, null, 2)}`); + } + + configureBazelConfig(config, conf); + configureFiles(conf); + configureTsWebTestSuiteConfig(conf); + configureTsWebTestConfig(conf); + + if (DEBUG) console.info(`Karma configuration: ${JSON.stringify(conf, null, 2)}`); - config.set(configuration); + config.set(conf); } } catch (e) { console.error('Error in karma configuration', e.toString()); diff --git a/internal/karma/karma_web_test.bzl b/internal/karma/karma_web_test.bzl new file mode 100644 index 00000000..f6be58fc --- /dev/null +++ b/internal/karma/karma_web_test.bzl @@ -0,0 +1,449 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"Unit testing with Karma" + +load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim") +load( + "@build_bazel_rules_nodejs//internal:node.bzl", + "expand_path_into_runfiles", + "sources_aspect", +) +load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") +load(":web_test.bzl", "COMMON_WEB_TEST_ATTRS") + +_CONF_TMPL = "//internal/karma:karma.conf.js" +_DEFAULT_KARMA_BIN = "@npm//@bazel/karma/bin:karma" + +# Attributes for karma_web_test that are shared with ts_web_test which +# uses Karma under the hood +KARMA_GENERIC_WEB_TEST_ATTRS = dict(COMMON_WEB_TEST_ATTRS, **{ + "bootstrap": attr.label_list( + doc = """JavaScript files to include *before* the module loader (require.js). + For example, you can include Reflect,js for TypeScript decorator metadata reflection, + or UMD bundles for third-party libraries.""", + allow_files = [".js"], + ), + "karma": attr.label( + doc = "karma binary label", + default = Label(_DEFAULT_KARMA_BIN), + executable = True, + cfg = "target", + allow_files = True, + ), + "static_files": attr.label_list( + doc = """Arbitrary files which are available to be served on request. + Files are served at: + `/base//`, e.g. + `/base/build_bazel_rules_typescript/examples/testing/static_script.js`""", + allow_files = True, + ), + "runtime_deps": attr.label_list( + doc = """Dependencies which should be loaded after the module loader but before the srcs and deps. + These should be a list of targets which produce JavaScript such as `ts_library`. + The files will be loaded in the same order they are declared by that rule.""", + allow_files = True, + aspects = [sources_aspect], + ), + "_conf_tmpl": attr.label( + default = Label(_CONF_TMPL), + allow_single_file = True, + ), +}) + +# Attributes for karma_web_test that are specific to karma_web_test +KARMA_WEB_TEST_ATTRS = dict(KARMA_GENERIC_WEB_TEST_ATTRS, **{ + "config_file": attr.label( + doc = """User supplied Karma configuration file. Bazel will override + certain attributes of this configuration file. Attributes that are + overridden will be outputted to the test log.""", + allow_single_file = True, + aspects = [sources_aspect], + ), +}) + +# Helper function to convert a short path to a path that is +# found in the MANIFEST file. +def _short_path_to_manifest_path(ctx, short_path): + if short_path.startswith("../"): + return short_path[3:] + else: + return ctx.workspace_name + "/" + short_path + +# Write the AMD names shim bootstrap file +def _write_amd_names_shim(ctx): + amd_names_shim = ctx.actions.declare_file( + "_%s.amd_names_shim.js" % ctx.label.name, + sibling = ctx.outputs.executable, + ) + write_amd_names_shim(ctx.actions, amd_names_shim, ctx.attr.bootstrap) + return amd_names_shim + +# Generates the karma configuration file for the rule +def _write_karma_config(ctx, files, amd_names_shim): + configuration = ctx.actions.declare_file( + "%s.conf.js" % ctx.label.name, + sibling = ctx.outputs.executable, + ) + + config_file = "" + if hasattr(ctx.file, "config_file"): + config_file = ctx.file.config_file + if hasattr(ctx.attr.config_file, "typescript"): + config_file = ctx.attr.config_file.typescript.es5_sources.to_list()[0] + + # The files in the bootstrap attribute come before the require.js support. + # Note that due to frameworks = ['jasmine'], a few scripts will come before + # the bootstrap entries: + # jasmine-core/lib/jasmine-core/jasmine.js + # karma-jasmine/lib/boot.js + # karma-jasmine/lib/adapter.js + # This is desired so that the bootstrap entries can patch jasmine, as zone.js does. + bootstrap_entries = [ + expand_path_into_runfiles(ctx, f.short_path) + for f in ctx.files.bootstrap + ] + + # Explicitly list the requirejs library files here, rather than use + # `frameworks: ['requirejs']` + # so that we control the script order, and the bootstrap files come before + # require.js. + # That allows bootstrap files to have anonymous AMD modules, or to do some + # polyfilling before test libraries load. + # See https://github.com/karma-runner/karma/issues/699 + # `NODE_MODULES/` is a prefix recogized by karma.conf.js to allow + # for a priority require of nested `@bazel/karma/node_modules` before + # looking in root node_modules. + bootstrap_entries += [ + "NODE_MODULES/requirejs/require.js", + "NODE_MODULES/karma-requirejs/lib/adapter.js", + "/".join([ctx.workspace_name, amd_names_shim.short_path]), + ] + + # Next we load the "runtime_deps" which we expect to contain named AMD modules + # Thus they should come after the require.js script, but before any srcs or deps + runtime_files = [] + for d in ctx.attr.runtime_deps: + if not hasattr(d, "typescript"): + # Workaround https://github.com/bazelbuild/rules_nodejs/issues/57 + # We should allow any JS source as long as it yields something that + # can be loaded by require.js + fail("labels in runtime_deps must be created by ts_library") + for src in d.typescript.es5_sources.to_list(): + runtime_files.append(expand_path_into_runfiles(ctx, src.short_path)) + + # Finally we load the user's srcs and deps + user_entries = [ + expand_path_into_runfiles(ctx, f.short_path) + for f in files.to_list() + ] + + # Expand static_files paths to runfiles for config + static_files = [ + expand_path_into_runfiles(ctx, f.short_path) + for f in ctx.files.static_files + ] + + # root-relative (runfiles) path to the directory containing karma.conf + config_segments = len(configuration.short_path.split("/")) + + # configuration_env_vars are set using process.env() + env_vars = "" + for k in ctx.attr.configuration_env_vars: + if k in ctx.var.keys(): + env_vars += "process.env[\"%s\"]=\"%s\";\n" % (k, ctx.var[k]) + + ctx.actions.expand_template( + output = configuration, + template = ctx.file._conf_tmpl, + substitutions = { + "TMPL_bootstrap_files": "\n".join([" '%s'," % e for e in bootstrap_entries]), + "TMPL_config_file": expand_path_into_runfiles(ctx, config_file.short_path) if config_file else "", + "TMPL_env_vars": env_vars, + "TMPL_runfiles_path": "/".join([".."] * config_segments), + "TMPL_runtime_files": "\n".join([" '%s'," % e for e in runtime_files]), + "TMPL_static_files": "\n".join([" '%s'," % e for e in static_files]), + "TMPL_user_files": "\n".join([" '%s'," % e for e in user_entries]), + }, + ) + + return configuration + +def run_karma_web_test(ctx): + """Creates an action that can run karma. + + This is also used by ts_web_test_rule. + + Args: + ctx: Bazel rule execution context + + Returns: + The runfiles for the generated action. + """ + files = depset(ctx.files.srcs) + for d in ctx.attr.deps + ctx.attr.runtime_deps: + if hasattr(d, "node_sources"): + files = depset(transitive = [files, d.node_sources]) + elif hasattr(d, "files"): + files = depset(transitive = [files, d.files]) + + amd_names_shim = _write_amd_names_shim(ctx) + + configuration = _write_karma_config(ctx, files, amd_names_shim) + + ctx.actions.write( + output = ctx.outputs.executable, + is_executable = True, + content = """#!/usr/bin/env bash +# Immediately exit if any command fails. +set -e + +if [ -e "$RUNFILES_MANIFEST_FILE" ]; then + while read line; do + declare -a PARTS=($line) + if [ "${{PARTS[0]}}" == "{TMPL_karma}" ]; then + readonly KARMA=${{PARTS[1]}} + elif [ "${{PARTS[0]}}" == "{TMPL_conf}" ]; then + readonly CONF=${{PARTS[1]}} + fi + done < $RUNFILES_MANIFEST_FILE +else + readonly KARMA=../{TMPL_karma} + readonly CONF=../{TMPL_conf} +fi + +export HOME=$(mktemp -d) + +# Print the karma version in the test log +echo $($KARMA --version) + +ARGV=( "start" $CONF ) + +# Detect that we are running as a test, by using well-known environment +# variables. See go/test-encyclopedia +# Note: in Bazel 0.14 and later, TEST_TMPDIR is set for both bazel test and bazel run +# so we also check for the BUILD_WORKSPACE_DIRECTORY which is set only for bazel run +if [[ ! -z "${{TEST_TMPDIR}}" && ! -n "${{BUILD_WORKSPACE_DIRECTORY}}" ]]; then + ARGV+=( "--single-run" ) +fi + +$KARMA ${{ARGV[@]}} +""".format( + TMPL_workspace = ctx.workspace_name, + TMPL_karma = _short_path_to_manifest_path(ctx, ctx.executable.karma.short_path), + TMPL_conf = _short_path_to_manifest_path(ctx, configuration.short_path), + ), + ) + + config_sources = [] + if hasattr(ctx.file, "config_file"): + if ctx.file.config_file: + config_sources = [ctx.file.config_file] + if hasattr(ctx.attr.config_file, "node_sources"): + config_sources = ctx.attr.config_file.node_sources.to_list() + + runfiles = [ + configuration, + amd_names_shim, + ] + runfiles += config_sources + runfiles += ctx.files.srcs + runfiles += ctx.files.deps + runfiles += ctx.files.runtime_deps + runfiles += ctx.files.bootstrap + runfiles += ctx.files.static_files + + return ctx.runfiles( + files = runfiles, + transitive_files = files, + ).merge(ctx.attr.karma[DefaultInfo].data_runfiles) + +def _karma_web_test_impl(ctx): + runfiles = run_karma_web_test(ctx) + + return [DefaultInfo( + files = depset([ctx.outputs.executable]), + runfiles = runfiles, + executable = ctx.outputs.executable, + )] + +_karma_web_test = rule( + implementation = _karma_web_test_impl, + test = True, + executable = True, + attrs = KARMA_WEB_TEST_ATTRS, +) + +def karma_web_test( + srcs = [], + deps = [], + data = [], + configuration_env_vars = [], + bootstrap = [], + runtime_deps = [], + static_files = [], + config_file = None, + tags = [], + **kwargs): + """Runs unit tests in a browser with Karma. + + When executed under `bazel test`, this uses a headless browser for speed. + This is also because `bazel test` allows multiple targets to be tested together, + and we don't want to open a Chrome window on your machine for each one. Also, + under `bazel test` the test will execute and immediately terminate. + + Running under `ibazel test` gives you a "watch mode" for your tests. The rule is + optimized for this case - the test runner server will stay running and just + re-serve the up-to-date JavaScript source bundle. + + To debug a single test target, run it with `bazel run` instead. This will open a + browser window on your computer. Also you can use any other browser by opening + the URL printed when the test starts up. The test will remain running until you + cancel the `bazel run` command. + + This rule will use your system Chrome by default. In the default case, your + environment must specify CHROME_BIN so that the rule will know which Chrome binary to run. + Other `browsers` and `customLaunchers` may be set using the a base Karma configuration + specified in the `config_file` attribute. + + Args: + srcs: A list of JavaScript test files + deps: Other targets which produce JavaScript such as `ts_library` + data: Runtime dependencies + configuration_env_vars: Pass these configuration environment variables to the resulting binary. + Chooses a subset of the configuration environment variables (taken from ctx.var), which also + includes anything specified via the --define flag. + Note, this can lead to different outputs produced by this rule. + bootstrap: JavaScript files to include *before* the module loader (require.js). + For example, you can include Reflect,js for TypeScript decorator metadata reflection, + or UMD bundles for third-party libraries. + runtime_deps: Dependencies which should be loaded after the module loader but before the srcs and deps. + These should be a list of targets which produce JavaScript such as `ts_library`. + The files will be loaded in the same order they are declared by that rule. + static_files: Arbitrary files which are available to be served on request. + Files are served at: + `/base//`, e.g. + `/base/build_bazel_rules_typescript/examples/testing/static_script.js` + config_file: User supplied Karma configuration file. Bazel will override + certain attributes of this configuration file. Attributes that are + overridden will be outputted to the test log. + tags: Standard Bazel tags, this macro adds tags for ibazel support + **kwargs: Passed through to `karma_web_test` + """ + + _karma_web_test( + srcs = srcs, + deps = deps, + data = data, + configuration_env_vars = configuration_env_vars, + bootstrap = bootstrap, + runtime_deps = runtime_deps, + static_files = static_files, + config_file = config_file, + tags = tags + [ + # Users don't need to know that this tag is required to run under ibazel + "ibazel_notify_changes", + ], + **kwargs + ) + +def karma_web_test_suite( + name, + browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"], + args = None, + browser_overrides = None, + config = None, + flaky = None, + local = None, + shard_count = None, + size = None, + tags = [], + test_suite_tags = None, + timeout = None, + visibility = None, + web_test_data = [], + wrapped_test_tags = None, + **remaining_keyword_args): + """Defines a test_suite of web_test targets that wrap a karma_web_test target. + + This macro also accepts all parameters in karma_web_test. See karma_web_test docs + for details. + + Args: + name: The base name of the test + browsers: A sequence of labels specifying the browsers to use. + args: Args for web_test targets generated by this extension. + browser_overrides: Dictionary; optional; default is an empty dictionary. A + dictionary mapping from browser names to browser-specific web_test + attributes, such as shard_count, flakiness, timeout, etc. For example: + {'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} + '//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}. + config: Label; optional; Configuration of web test features. + flaky: A boolean specifying that the test is flaky. If set, the test will + be retried up to 3 times (default: 0) + local: boolean; optional. + shard_count: The number of test shards to use per browser. (default: 1) + size: A string specifying the test size. (default: 'large') + tags: A list of test tag strings to apply to each generated web_test target. + This macro adds a couple for ibazel. + test_suite_tags: A list of tag strings for the generated test_suite. + timeout: A string specifying the test timeout (default: computed from size) + visibility: List of labels; optional. + web_test_data: Data dependencies for the web_test. + wrapped_test_tags: A list of test tag strings to use for the wrapped test + **remaining_keyword_args: Arguments for the wrapped test target. + """ + + # Check explicitly for None so that users can set this to the empty list + if wrapped_test_tags == None: + wrapped_test_tags = DEFAULT_WRAPPED_TEST_TAGS + + size = size or "large" + + wrapped_test_name = name + "_wrapped_test" + + _karma_web_test( + name = wrapped_test_name, + args = args, + flaky = flaky, + local = local, + shard_count = shard_count, + size = size, + tags = wrapped_test_tags, + timeout = timeout, + visibility = ["//visibility:private"], + **remaining_keyword_args + ) + + web_test_suite( + name = name, + launcher = ":" + wrapped_test_name, + args = args, + browsers = browsers, + browser_overrides = browser_overrides, + config = config, + data = web_test_data, + flaky = flaky, + local = local, + shard_count = shard_count, + size = size, + tags = tags + [ + # Users don't need to know that this tag is required to run under ibazel + "ibazel_notify_changes", + ], + test = wrapped_test_name, + test_suite_tags = test_suite_tags, + timeout = timeout, + visibility = visibility, + ) diff --git a/internal/karma/package.json b/internal/karma/package.json index c5bf6d9a..9ffa9c02 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -19,7 +19,7 @@ "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.1.0", "karma-jasmine": "1.1.1", - "karma-sauce-launcher": "1.2.0", + "karma-sauce-launcher": "2.0.2", "karma-sourcemap-loader": "0.3.7", "karma-requirejs": "1.1.0", "requirejs": "2.3.5", diff --git a/internal/karma/ts_web_test.bzl b/internal/karma/ts_web_test.bzl index bcdee114..9189076a 100644 --- a/internal/karma/ts_web_test.bzl +++ b/internal/karma/ts_web_test.bzl @@ -11,279 +11,108 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"Unit testing with Karma" +"Unit testing in a browser" -load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim") -load( - "@build_bazel_rules_nodejs//internal:node.bzl", - "expand_path_into_runfiles", - "sources_aspect", -) load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") +load(":karma_web_test.bzl", "KARMA_GENERIC_WEB_TEST_ATTRS", "run_karma_web_test") -_CONF_TMPL = "//internal/karma:karma.conf.js" -_DEFAULT_KARMA_BIN = "@npm//@bazel/karma/bin:karma" - -def _short_path_to_manifest_path(ctx, short_path): - if short_path.startswith("../"): - return short_path[3:] - else: - return ctx.workspace_name + "/" + short_path +# Using generic karma_web_test attributes under the hood +TS_WEB_TEST_ATTRS = dict(KARMA_GENERIC_WEB_TEST_ATTRS, **{}) def _ts_web_test_impl(ctx): - conf = ctx.actions.declare_file( - "%s.conf.js" % ctx.label.name, - sibling = ctx.outputs.executable, - ) - - files = depset(ctx.files.srcs) - for d in ctx.attr.deps + ctx.attr.runtime_deps: - if hasattr(d, "node_sources"): - files = depset(transitive = [files, d.node_sources]) - elif hasattr(d, "files"): - files = depset(transitive = [files, d.files]) - - # Write the AMD names shim bootstrap file - amd_names_shim = ctx.actions.declare_file( - "_%s.amd_names_shim.js" % ctx.label.name, - sibling = ctx.outputs.executable, - ) - write_amd_names_shim(ctx.actions, amd_names_shim, ctx.attr.bootstrap) - - # The files in the bootstrap attribute come before the require.js support. - # Note that due to frameworks = ['jasmine'], a few scripts will come before - # the bootstrap entries: - # jasmine-core/lib/jasmine-core/jasmine.js - # karma-jasmine/lib/boot.js - # karma-jasmine/lib/adapter.js - # This is desired so that the bootstrap entries can patch jasmine, as zone.js does. - bootstrap_entries = [ - expand_path_into_runfiles(ctx, f.short_path) - for f in ctx.files.bootstrap - ] - - # Explicitly list the requirejs library files here, rather than use - # `frameworks: ['requirejs']` - # so that we control the script order, and the bootstrap files come before - # require.js. - # That allows bootstrap files to have anonymous AMD modules, or to do some - # polyfilling before test libraries load. - # See https://github.com/karma-runner/karma/issues/699 - # `NODE_MODULES/` is a prefix recogized by karma.conf.js to allow - # for a priority require of nested `@bazel/karma/node_modules` before - # looking in root node_modules. - bootstrap_entries += [ - "NODE_MODULES/requirejs/require.js", - "NODE_MODULES/karma-requirejs/lib/adapter.js", - "/".join([ctx.workspace_name, amd_names_shim.short_path]), - ] - - # Next we load the "runtime_deps" which we expect to contain named AMD modules - # Thus they should come after the require.js script, but before any srcs or deps - runtime_files = [] - for d in ctx.attr.runtime_deps: - if not hasattr(d, "typescript"): - # Workaround https://github.com/bazelbuild/rules_nodejs/issues/57 - # We should allow any JS source as long as it yields something that - # can be loaded by require.js - fail("labels in runtime_deps must be created by ts_library") - for src in d.typescript.es5_sources.to_list(): - runtime_files.append(expand_path_into_runfiles(ctx, src.short_path)) - - # Finally we load the user's srcs and deps - user_entries = [ - expand_path_into_runfiles(ctx, f.short_path) - for f in files.to_list() - ] - static_files = [ - expand_path_into_runfiles(ctx, f.short_path) - for f in ctx.files.static_files - ] - - # root-relative (runfiles) path to the directory containing karma.conf - config_segments = len(conf.short_path.split("/")) - - ctx.actions.expand_template( - output = conf, - template = ctx.file._conf_tmpl, - substitutions = { - "TMPL_bootstrap_files": "\n".join([" '%s'," % e for e in bootstrap_entries]), - "TMPL_runfiles_path": "/".join([".."] * config_segments), - "TMPL_runtime_files": "\n".join([" '%s'," % e for e in runtime_files]), - "TMPL_static_files": "\n".join([" '%s'," % e for e in static_files]), - "TMPL_user_files": "\n".join([" '%s'," % e for e in user_entries]), - "TMPL_workspace_name": ctx.workspace_name, - }, - ) - - karma_runfiles = [ - conf, - amd_names_shim, - ] - karma_runfiles += ctx.files.srcs - karma_runfiles += ctx.files.deps - karma_runfiles += ctx.files.runtime_deps - karma_runfiles += ctx.files.bootstrap - karma_runfiles += ctx.files.static_files - - ctx.actions.write( - output = ctx.outputs.executable, - is_executable = True, - content = """#!/usr/bin/env bash -if [ -e "$RUNFILES_MANIFEST_FILE" ]; then - while read line; do - declare -a PARTS=($line) - if [ "${{PARTS[0]}}" == "{TMPL_karma}" ]; then - readonly KARMA=${{PARTS[1]}} - elif [ "${{PARTS[0]}}" == "{TMPL_conf}" ]; then - readonly CONF=${{PARTS[1]}} - fi - done < $RUNFILES_MANIFEST_FILE -else - readonly KARMA=../{TMPL_karma} - readonly CONF=../{TMPL_conf} -fi - -export HOME=$(mktemp -d) -ARGV=( "start" $CONF ) + # Using karma_web_test under the hood + runfiles = run_karma_web_test(ctx) -# Detect that we are running as a test, by using well-known environment -# variables. See go/test-encyclopedia -# Note: in Bazel 0.14 and later, TEST_TMPDIR is set for both bazel test and bazel run -# so we also check for the BUILD_WORKSPACE_DIRECTORY which is set only for bazel run -if [[ ! -z "${{TEST_TMPDIR}}" && ! -n "${{BUILD_WORKSPACE_DIRECTORY}}" ]]; then - ARGV+=( "--single-run" ) -fi - -$KARMA ${{ARGV[@]}} -""".format( - TMPL_workspace = ctx.workspace_name, - TMPL_karma = _short_path_to_manifest_path(ctx, ctx.executable.karma.short_path), - TMPL_conf = _short_path_to_manifest_path(ctx, conf.short_path), - ), - ) return [DefaultInfo( files = depset([ctx.outputs.executable]), - runfiles = ctx.runfiles( - files = karma_runfiles, - transitive_files = files, - # Propagate karma_bin and its runfiles - collect_data = True, - collect_default = True, - ), + runfiles = runfiles, executable = ctx.outputs.executable, )] -ts_web_test = rule( +_ts_web_test = rule( implementation = _ts_web_test_impl, test = True, executable = True, - attrs = { - "srcs": attr.label_list( - doc = "JavaScript source files", - allow_files = [".js"], - ), - "bootstrap": attr.label_list( - doc = """JavaScript files to include *before* the module loader (require.js). - For example, you can include Reflect,js for TypeScript decorator metadata reflection, - or UMD bundles for third-party libraries.""", - allow_files = [".js"], - ), - "data": attr.label_list( - doc = "Runtime dependencies", - ), - "karma": attr.label( - default = Label(_DEFAULT_KARMA_BIN), - executable = True, - cfg = "target", - allow_files = True, - ), - "static_files": attr.label_list( - doc = """Arbitrary files which are available to be served on request. - Files are served at: - `/base//`, e.g. - `/base/build_bazel_rules_typescript/examples/testing/static_script.js`""", - allow_files = True, - ), - "runtime_deps": attr.label_list( - doc = """Dependencies which should be loaded after the module loader but before the srcs and deps. - These should be a list of targets which produce JavaScript such as `ts_library`. - The files will be loaded in the same order they are declared by that rule.""", - allow_files = True, - aspects = [sources_aspect], - ), - "deps": attr.label_list( - doc = "Other targets which produce JavaScript such as `ts_library`", - allow_files = True, - aspects = [sources_aspect], - ), - "_conf_tmpl": attr.label( - default = Label(_CONF_TMPL), - allow_single_file = True, - ), - }, + attrs = TS_WEB_TEST_ATTRS, ) -"""Runs unit tests in a browser. -When executed under `bazel test`, this uses a headless browser for speed. -This is also because `bazel test` allows multiple targets to be tested together, -and we don't want to open a Chrome window on your machine for each one. Also, -under `bazel test` the test will execute and immediately terminate. - -Running under `ibazel test` gives you a "watch mode" for your tests. The rule is -optimized for this case - the test runner server will stay running and just -re-serve the up-to-date JavaScript source bundle. +def ts_web_test( + srcs = [], + deps = [], + data = [], + configuration_env_vars = [], + bootstrap = [], + runtime_deps = [], + static_files = [], + tags = [], + **kwargs): + """Runs unit tests in a browser. -To debug a single test target, run it with `bazel run` instead. This will open a -browser window on your computer. Also you can use any other browser by opening -the URL printed when the test starts up. The test will remain running until you -cancel the `bazel run` command. + When executed under `bazel test`, this uses a headless browser for speed. + This is also because `bazel test` allows multiple targets to be tested together, + and we don't want to open a Chrome window on your machine for each one. Also, + under `bazel test` the test will execute and immediately terminate. -Currently this rule uses Karma as the test runner, but this is an implementation -detail. We might switch to another runner like Jest in the future. -""" + Running under `ibazel test` gives you a "watch mode" for your tests. The rule is + optimized for this case - the test runner server will stay running and just + re-serve the up-to-date JavaScript source bundle. -# This macro exists only to modify the users rule definition a bit. -# DO NOT add composition of additional rules here. -def ts_web_test_macro( - karma = Label(_DEFAULT_KARMA_BIN), - tags = [], - data = [], - **kwargs): - """ibazel wrapper for `ts_web_test` + To debug a single test target, run it with `bazel run` instead. This will open a + browser window on your computer. Also you can use any other browser by opening + the URL printed when the test starts up. The test will remain running until you + cancel the `bazel run` command. - This macro re-exposes the `ts_web_test` rule with some extra tags so that - it behaves correctly under ibazel. + This rule will use your system Chrome. Your environment must specify CHROME_BIN + so that the rule will know which Chrome binary to run. - This is re-exported in `//:defs.bzl` as `ts_web_test` so if you load the rule - from there, you actually get this macro. + Currently this rule uses Karma as the test runner under the hood, but this is + an implementation detail. We might switch to another runner like Jest in the future. Args: - karma: karma binary label - tags: standard Bazel tags, this macro adds a couple for ibazel - data: runtime dependencies - **kwargs: passed through to `ts_web_test` + srcs: A list of JavaScript test files + deps: Other targets which produce JavaScript such as `ts_library` + data: Runtime dependencies + configuration_env_vars: Pass these configuration environment variables to the resulting binary. + Chooses a subset of the configuration environment variables (taken from ctx.var), which also + includes anything specified via the --define flag. + Note, this can lead to different outputs produced by this rule. + bootstrap: JavaScript files to include *before* the module loader (require.js). + For example, you can include Reflect,js for TypeScript decorator metadata reflection, + or UMD bundles for third-party libraries. + runtime_deps: Dependencies which should be loaded after the module loader but before the srcs and deps. + These should be a list of targets which produce JavaScript such as `ts_library`. + The files will be loaded in the same order they are declared by that rule. + static_files: Arbitrary files which are available to be served on request. + Files are served at: + `/base//`, e.g. + `/base/build_bazel_rules_typescript/examples/testing/static_script.js` + tags: Standard Bazel tags, this macro adds tags for ibazel support as well as + `browser:chromium-system` to allow for filtering on systems with no + system Chrome. + **kwargs: Passed through to `ts_web_test` """ - ts_web_test( - karma = karma, + _ts_web_test( + srcs = srcs, + deps = deps, + data = data, + configuration_env_vars = configuration_env_vars, + bootstrap = bootstrap, + runtime_deps = runtime_deps, + static_files = static_files, tags = tags + [ # Users don't need to know that this tag is required to run under ibazel "ibazel_notify_changes", # Always attach this label to allow filtering, eg. envs w/ no browser "browser:chromium-system", ], - # Our binary dependency must be in data[] for collect_data to pick it up - # FIXME: maybe we can just ask the attr.karma for its runfiles attr - data = data + [karma], **kwargs ) def ts_web_test_suite( name, browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"], - karma = Label(_DEFAULT_KARMA_BIN), args = None, browser_overrides = None, config = None, @@ -300,10 +129,12 @@ def ts_web_test_suite( **remaining_keyword_args): """Defines a test_suite of web_test targets that wrap a ts_web_test target. + This macro also accepts all parameters in ts_web_test. See ts_web_test docs for + details. + Args: name: The base name of the test. browsers: A sequence of labels specifying the browsers to use. - karma: karma binary label args: Args for web_test targets generated by this extension. browser_overrides: Dictionary; optional; default is an empty dictionary. A dictionary mapping from browser names to browser-specific web_test @@ -316,12 +147,12 @@ def ts_web_test_suite( local: boolean; optional. shard_count: The number of test shards to use per browser. (default: 1) size: A string specifying the test size. (default: 'large') - tags: A list of test tag strings to apply to each generated web_test target. + tags: A list of test tag strings to apply to each generated web_test_suite target. This macro adds a couple for ibazel. test_suite_tags: A list of tag strings for the generated test_suite. timeout: A string specifying the test timeout (default: computed from size) visibility: List of labels; optional. - web_test_data: Data dependencies for the web_test. + web_test_data: Data dependencies for the web_test_suite. wrapped_test_tags: A list of test tag strings to use for the wrapped test **remaining_keyword_args: Arguments for the wrapped test target. """ @@ -334,16 +165,8 @@ def ts_web_test_suite( wrapped_test_name = name + "_wrapped_test" - # Users don't need to know that this tag is required to run under ibazel - tags = tags + ["ibazel_notify_changes"] - - # Our binary dependency must be in data[] for collect_data to pick it up - # FIXME: maybe we can just ask the attr.karma for its runfiles attr - web_test_data = web_test_data + [karma] - - ts_web_test( + _ts_web_test( name = wrapped_test_name, - karma = karma, args = args, flaky = flaky, local = local, @@ -367,7 +190,10 @@ def ts_web_test_suite( local = local, shard_count = shard_count, size = size, - tags = tags, + tags = tags + [ + # Users don't need to know that this tag is required to run under ibazel + "ibazel_notify_changes", + ], test = wrapped_test_name, test_suite_tags = test_suite_tags, timeout = timeout, diff --git a/internal/karma/web_test.bzl b/internal/karma/web_test.bzl new file mode 100644 index 00000000..b40d4e08 --- /dev/null +++ b/internal/karma/web_test.bzl @@ -0,0 +1,40 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"Common web_test attributes" + +load("@build_bazel_rules_nodejs//internal:node.bzl", "sources_aspect") + +# Attributes shared by any web_test rule (ts_web_test, karma_web_test, protractor_web_test) +COMMON_WEB_TEST_ATTRS = { + "srcs": attr.label_list( + doc = "A list of JavaScript test files", + allow_files = [".js"], + ), + "configuration_env_vars": attr.string_list( + doc = """Pass these configuration environment variables to the resulting binary. + Chooses a subset of the configuration environment variables (taken from ctx.var), which also + includes anything specified via the --define flag. + Note, this can lead to different outputs produced by this rule.""", + default = [], + ), + "data": attr.label_list( + doc = "Runtime dependencies", + allow_files = True, + ), + "deps": attr.label_list( + doc = "Other targets which produce JavaScript such as `ts_library`", + allow_files = True, + aspects = [sources_aspect], + ), +} diff --git a/package.json b/package.json index 4140a450..724a1f27 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,9 @@ "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.1.0", "karma-jasmine": "1.1.1", + "karma-json-result-reporter": "1.0.0", "karma-requirejs": "1.1.0", - "karma-sauce-launcher": "1.2.0", + "karma-sauce-launcher": "2.0.2", "karma-sourcemap-loader": "0.3.7", "protobufjs": "5.0.3", "requirejs": "2.3.5", diff --git a/yarn.lock b/yarn.lock index 20b3f83b..c6df00c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -197,32 +197,6 @@ aproba@^1.0.3: resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -archiver-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174" - integrity sha1-5QtMCccL89aA4y/xt5lOn52JUXQ= - dependencies: - glob "^7.0.0" - graceful-fs "^4.1.0" - lazystream "^1.0.0" - lodash "^4.8.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - -archiver@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-2.1.1.tgz#ff662b4a78201494a3ee544d3a33fe7496509ebc" - integrity sha1-/2YrSnggFJSj7lRNOjP+dJZQnrw= - dependencies: - archiver-utils "^1.3.0" - async "^2.0.0" - buffer-crc32 "^0.2.1" - glob "^7.0.0" - lodash "^4.8.0" - readable-stream "^2.0.0" - tar-stream "^1.5.0" - zip-stream "^1.2.0" - are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" @@ -333,19 +307,12 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.0.1.tgz#b709cc0280a9c36f09f4536be823c838a9049e25" - integrity sha1-twnMAoCpw28J9FNr6CPIOKkEniU= - dependencies: - lodash "^4.8.0" - async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@^2.0.0, async@^2.1.2, async@~2.6.0: +async@^2.1.2, async@~2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== @@ -404,11 +371,6 @@ base64-arraybuffer@0.1.5: resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= -base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== - base64id@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" @@ -453,14 +415,6 @@ bitsyntax@~0.0.4: dependencies: buffer-more-ints "0.0.2" -bl@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - integrity sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA== - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - bl@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" @@ -567,7 +521,7 @@ buffer-alloc-unsafe@^1.1.0: resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== -buffer-alloc@^1.1.0, buffer-alloc@^1.2.0: +buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== @@ -575,11 +529,6 @@ buffer-alloc@^1.1.0, buffer-alloc@^1.2.0: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" -buffer-crc32@^0.2.1: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" @@ -595,14 +544,6 @@ buffer-more-ints@0.0.2: resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c" integrity sha1-JrOIXRD6E9t/wBquOquHAZngEkw= -buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - buildmail@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" @@ -825,16 +766,6 @@ component-inherit@0.0.3: resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= -compress-commons@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f" - integrity sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8= - dependencies: - buffer-crc32 "^0.2.1" - crc32-stream "^2.0.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -904,21 +835,6 @@ corser@~2.0.0: resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87" integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c= -crc32-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4" - integrity sha1-483TtN8xaN10494/u8t7KX/pCPQ= - dependencies: - crc "^3.4.4" - readable-stream "^2.0.0" - -crc@^3.4.4: - version "3.8.0" - resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" - integrity sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ== - dependencies: - buffer "^5.1.0" - cryptiles@2.x.x: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" @@ -1105,13 +1021,6 @@ encodeurl@~1.0.1: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -end-of-stream@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== - dependencies: - once "^1.4.0" - engine.io-client@~3.1.0: version "3.1.6" resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.6.tgz#5bdeb130f8b94a50ac5cbeb72583e7a4a063ddfd" @@ -1449,11 +1358,6 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -1482,6 +1386,11 @@ ftp@~0.3.10: readable-stream "1.1.x" xregexp "2.0.0" +fun-map@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fun-map/-/fun-map-3.3.1.tgz#6415fde3b93ad58f9ee9566236cff3e3c64b94cb" + integrity sha1-ZBX947k61Y+e6VZiNs/z48ZLlMs= + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -1596,7 +1505,7 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= @@ -1850,11 +1759,6 @@ iconv-lite@^0.4.4: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4: - version "1.1.12" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" - integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA== - ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" @@ -2244,20 +2148,26 @@ karma-jasmine@1.1.1: resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= +karma-json-result-reporter@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/karma-json-result-reporter/-/karma-json-result-reporter-1.0.0.tgz#9bfaa17d610470d08556e48ccbaf64d7950c7255" + integrity sha1-m/qhfWEEcNCFVuSMy69k15UMclU= + dependencies: + fun-map "^3.3.1" + karma-requirejs@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= -karma-sauce-launcher@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz#6f2558ddef3cf56879fa27540c8ae9f8bfd16bca" - integrity sha512-lEhtGRGS+3Yw6JSx/vJY9iQyHNtTjcojrSwNzqNUOaDceKDu9dPZqA/kr69bUO9G2T6GKbu8AZgXqy94qo31Jg== +karma-sauce-launcher@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" + integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== dependencies: - q "^1.5.0" - sauce-connect-launcher "^1.2.2" - saucelabs "^1.4.0" - wd "^1.4.0" + sauce-connect-launcher "^1.2.4" + saucelabs "^1.5.0" + selenium-webdriver "^4.0.0-alpha.1" karma-sourcemap-loader@0.3.7: version "0.3.7" @@ -2322,13 +2232,6 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= - dependencies: - readable-stream "^2.0.5" - lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" @@ -2370,12 +2273,7 @@ lie@~3.1.0: dependencies: immediate "~3.0.5" -lodash@4.17.10: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg== - -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.5.0, lodash@^4.8.0: +lodash@^4.0.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.5.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -2815,7 +2713,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -3111,11 +3009,6 @@ q@1.4.1, q@^1.4.1: resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4= -q@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - qjobs@^1.1.4: version "1.2.0" resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" @@ -3185,7 +3078,7 @@ readable-stream@1.1.x, "readable-stream@1.x >=1.1.9": isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.3.0, readable-stream@^2.3.5: +readable-stream@2, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: version "2.3.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -3307,34 +3200,6 @@ request@2.75.x: tough-cookie "~2.3.0" tunnel-agent "~0.4.1" -request@2.85.0: - version "2.85.0" - resolved "http://registry.npmjs.org/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - integrity sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - request@^2.0.0, request@^2.74.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" @@ -3460,7 +3325,7 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sauce-connect-launcher@^1.2.2: +sauce-connect-launcher@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== @@ -3471,7 +3336,7 @@ sauce-connect-launcher@^1.2.2: lodash "^4.16.6" rimraf "^2.5.4" -saucelabs@^1.4.0: +saucelabs@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== @@ -3516,6 +3381,16 @@ selenium-webdriver@^2.53.2: ws "^1.0.1" xml2js "0.4.4" +selenium-webdriver@^4.0.0-alpha.1: + version "4.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" + integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -3904,19 +3779,6 @@ supports-color@^3.2.3: dependencies: has-flag "^1.0.0" -tar-stream@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" - integrity sha512-IFLM5wp3QrJODQFPm6/to3LJZrONdBY/otxcvDIQzu217zKye6yVR3hhi9lAjrC2Z+m/j5oDxMPb1qcd8cIvpA== - dependencies: - bl "^1.0.0" - buffer-alloc "^1.1.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.0" - xtend "^4.0.0" - tar@^4: version "4.4.6" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" @@ -3964,11 +3826,6 @@ to-array@0.1.4: resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= -to-buffer@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -4187,11 +4044,6 @@ uws@~9.14.0: resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95" integrity sha512-HNMztPP5A1sKuVFmdZ6BPVpBQd5bUjNC8EFMFiICK+oho/OQsAJy5hnIx4btMHiOk8j04f/DbIlqnEZ9d72dqg== -vargs@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/vargs/-/vargs-0.1.0.tgz#6b6184da6520cc3204ce1b407cac26d92609ebff" - integrity sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8= - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -4206,19 +4058,6 @@ void-elements@^2.0.0: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= -wd@^1.4.0: - version "1.10.3" - resolved "https://registry.yarnpkg.com/wd/-/wd-1.10.3.tgz#395ac7eb58a98e556369f8f8e5f845d91fb152a3" - integrity sha512-ffqqZDtFFLeg5u/4pw2vYKECW+z+vW6vc+7rcqF15uu1/rmw3BydV84BONNc9DIcQ5Z7gQFS/hAuMvj53eVtSg== - dependencies: - archiver "2.1.1" - async "2.0.1" - lodash "4.17.10" - mkdirp "^0.5.1" - q "1.4.1" - request "2.85.0" - vargs "0.1.0" - webdriver-js-extender@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz#81c533a9e33d5bfb597b4e63e2cdb25b54777515" @@ -4386,13 +4225,3 @@ yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= - -zip-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04" - integrity sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ= - dependencies: - archiver-utils "^1.3.0" - compress-commons "^1.2.0" - lodash "^4.8.0" - readable-stream "^2.0.0" From 0ea07050e9807e08e893cdb1edbb0cf0facb51ba Mon Sep 17 00:00:00 2001 From: radokirov Date: Tue, 15 Jan 2019 21:17:01 -0800 Subject: [PATCH 045/316] Clean-up of an useless attribute list. PiperOrigin-RevId: 229494519 --- internal/common/compilation.bzl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index fa1878e4..36720443 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -18,7 +18,6 @@ load(":common/json_marshal.bzl", "json_marshal") load(":common/module_mappings.bzl", "module_mappings_aspect") -BASE_ATTRIBUTES = dict() _DEBUG = False @@ -27,7 +26,7 @@ DEPS_ASPECTS = [ ] # Attributes shared by any typescript-compatible rule (ts_library, ng_module) -COMMON_ATTRIBUTES = dict(BASE_ATTRIBUTES, **{ +COMMON_ATTRIBUTES = { "data": attr.label_list( default = [], allow_files = True, @@ -53,7 +52,7 @@ COMMON_ATTRIBUTES = dict(BASE_ATTRIBUTES, **{ "_additional_d_ts": attr.label_list( allow_files = True, ), -}) +} COMMON_OUTPUTS = { # Allow the tsconfig.json to be generated without running compile actions. From 4155687a91d84eb550fa52d25f792c002e645edc Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 17 Jan 2019 19:49:54 -0800 Subject: [PATCH 046/316] -- Change 1 of 19 by Filipe Silva : Use native.sh_binary for cross-platform ts_devserver -- Change 2 of 19 by Filipe Silva : Use runfiles resolution in ts_devserver -- Change 3 of 19 by Paul Gschwendtner : Resolve all devserver files using runfiles manifest -- Change 4 of 19 by Paul Gschwendtner : Support index.html files in subdirectories on windows -- Change 5 of 19 by Paul Gschwendtner : Properly handle directories for symlinked runfiles in devserver -- Change 6 of 19 by Paul Gschwendtner : Update gazelle and properly resolve Go runfile library -- Change 7 of 19 by Paul Gschwendtner : Add workaround for specifying serving_path on windows. -- Change 8 of 19 by Paul Gschwendtner : Do not resolve entry_module as runfile * As with https://github.com/bazelbuild/rules_typescript/pull/327/commits/b739d771fb6c71f0d2b4c25e04a1aabb6808c27d, the `entry_module` is resolved through `rlocation`. This is wrong because the entry_module is not a real runfile. -- Change 9 of 19 by Paul Gschwendtner : Support serving runfiles through absolute manifest path -- Change 10 of 19 by Paul Gschwendtner : fixup! Resolve all devserver files using runfiles manifest Address feedback -- Change 11 of 19 by Paul Gschwendtner : fixup! Resolve all devserver files using runfiles manifest Update rules_go version to avoid incompatible protobuf version -- Change 12 of 19 by Minko Gechev : Fixes for golint and refactoring for g3 -- Change 13 of 19 by Minko Gechev : Refactor Runfile invocation and fix golint errors -- Change 14 of 19 by Minko Gechev : Refactor Runfile invocation and fix golint errors -- Change 15 of 19 by Paul Gschwendtner : fixup! Refactor Runfile invocation and fix golint errors Fix accidentally revert -- Change 16 of 19 by Paul Gschwendtner : fixup! Refactor Runfile invocation and fix golint errors Fix wrong package name -- Change 17 of 19 by Minko Gechev : Update method name -- Change 18 of 19 by Minko Gechev : Do not depend on external rules_go package -- Change 19 of 19 by Paul Gschwendtner : Add logic to resolve runfiles within G3 without using external runfile helpers Closes #327 PiperOrigin-RevId: 229863281 --- .bazelci/presubmit.yml | 2 + WORKSPACE | 5 + devserver/BUILD.bazel | 6 +- devserver/concatjs/BUILD.bazel | 14 --- devserver/concatjs/concatjs.go | 68 +++++++--- devserver/concatjs/concatjs_test.go | 70 +++++++++-- devserver/devserver/BUILD.bazel | 10 ++ devserver/devserver/devserver.go | 94 ++++++++------ devserver/devserver/devserver_test.go | 118 ++++++++++++------ devserver/devserver/test/index.html | 1 + devserver/devserver/test/relative.html | 1 + .../devserver/test/test-workspace/BUILD.bazel | 6 + .../devserver/test/test-workspace/WORKSPACE | 0 .../test/test-workspace/pkg1/foo.html | 1 + .../test/test-workspace/pkg1/index.html | 1 + .../test/test-workspace/pkg2/bar.html | 1 + .../test/test-workspace/pkg2/foo.html | 1 + .../test-workspace/pkg2/rpc/items/index.html | 1 + .../test/test-workspace/pkg3/baz.html | 1 + devserver/runfile-filesystem.go | 35 ++++++ devserver/runfiles/runfiles.go | 10 ++ examples/BUILD.bazel | 2 + examples/devserver/BUILD.bazel | 43 +++++++ examples/devserver/app.ts | 7 ++ examples/devserver/index.html | 16 +++ examples/protocol_buffers/BUILD.bazel | 27 +++- examples/protocol_buffers/index.html | 14 +-- package.bzl | 7 +- 28 files changed, 431 insertions(+), 131 deletions(-) delete mode 100644 devserver/concatjs/BUILD.bazel create mode 100644 devserver/devserver/test/index.html create mode 100644 devserver/devserver/test/relative.html create mode 100644 devserver/devserver/test/test-workspace/BUILD.bazel create mode 100644 devserver/devserver/test/test-workspace/WORKSPACE create mode 100644 devserver/devserver/test/test-workspace/pkg1/foo.html create mode 100644 devserver/devserver/test/test-workspace/pkg1/index.html create mode 100644 devserver/devserver/test/test-workspace/pkg2/bar.html create mode 100644 devserver/devserver/test/test-workspace/pkg2/foo.html create mode 100644 devserver/devserver/test/test-workspace/pkg2/rpc/items/index.html create mode 100644 devserver/devserver/test/test-workspace/pkg3/baz.html create mode 100644 devserver/runfile-filesystem.go create mode 100644 devserver/runfiles/runfiles.go create mode 100644 examples/devserver/BUILD.bazel create mode 100644 examples/devserver/app.ts create mode 100644 examples/devserver/index.html diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 298966d2..fef67604 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -49,4 +49,6 @@ platforms: - "--action_env=PATH" - "--test_env=PATH" test_targets: + - "--" - "..." + - "-//devserver/devserver:go_default_test" diff --git a/WORKSPACE b/WORKSPACE index 7a18919f..a62f07bc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -174,3 +174,8 @@ local_repository( name = "disable_tsetse_for_external_test", path = "internal/e2e/disable_tsetse_for_external", ) + +local_repository( + name = "devserver_test_workspace", + path = "devserver/devserver/test/test-workspace", +) diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel index f70274b9..a79f5459 100644 --- a/devserver/BUILD.bazel +++ b/devserver/BUILD.bazel @@ -5,12 +5,16 @@ package(default_visibility = ["//visibility:public"]) go_library( name = "go_default_library", - srcs = ["main.go"], + srcs = [ + "main.go", + "runfile-filesystem.go", + ], importpath = "github.com/bazelbuild/rules_typescript/devserver", visibility = ["//visibility:private"], deps = [ "//devserver/concatjs:go_default_library", "//devserver/devserver:go_default_library", + "//devserver/runfiles:go_default_library", ], ) diff --git a/devserver/concatjs/BUILD.bazel b/devserver/concatjs/BUILD.bazel deleted file mode 100644 index 6cc1a741..00000000 --- a/devserver/concatjs/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["concatjs.go"], - importpath = "github.com/bazelbuild/rules_typescript/devserver/concatjs", - visibility = ["//visibility:public"], -) - -go_test( - name = "go_default_test", - srcs = ["concatjs_test.go"], - embed = [":go_default_library"], -) diff --git a/devserver/concatjs/concatjs.go b/devserver/concatjs/concatjs.go index b6eea8a1..bde02440 100644 --- a/devserver/concatjs/concatjs.go +++ b/devserver/concatjs/concatjs.go @@ -96,14 +96,16 @@ func acceptGzip(h http.Header) bool { // FileSystem is the interface to reading files from disk. // It's abstracted into an interface to allow tests to replace it. type FileSystem interface { - statMtime(filename string) (time.Time, error) - readFile(filename string) ([]byte, error) + StatMtime(filename string) (time.Time, error) + ReadFile(filename string) ([]byte, error) + ResolvePath(root string, file string) (string, error) } -// realFileSystem implements FileSystem by actual disk access. -type realFileSystem struct{} +// RealFileSystem implements FileSystem by actual disk access. +type RealFileSystem struct{} -func (fs *realFileSystem) statMtime(filename string) (time.Time, error) { +// StatMtime gets the last modification time of the specified file. +func (fs *RealFileSystem) StatMtime(filename string) (time.Time, error) { s, err := os.Stat(filename) if err != nil { return time.Time{}, err @@ -111,10 +113,19 @@ func (fs *realFileSystem) statMtime(filename string) (time.Time, error) { return s.ModTime(), nil } -func (fs *realFileSystem) readFile(filename string) ([]byte, error) { +// ReadFile reads the specified file using the real filesystem. +func (fs *RealFileSystem) ReadFile(filename string) ([]byte, error) { return ioutil.ReadFile(filename) } +// ResolvePath resolves the specified path within a given root by joining root and the filepath. +// This is only works if the specified file is located within the given root in the +// real filesystem. This does not work in Bazel where requested files aren't always +// located within the specified root. Files would need to be resolved as runfiles. +func (fs *RealFileSystem) ResolvePath(root string, file string) (string, error) { + return filepath.Join(root, file), nil +} + // FileCache caches a set of files in memory and provides a single // method, WriteFiles(), that streams them out in the concatjs format. type FileCache struct { @@ -129,7 +140,7 @@ type FileCache struct { // will use the real file system if nil. func NewFileCache(root string, fs FileSystem) *FileCache { if fs == nil { - fs = &realFileSystem{} + fs = &RealFileSystem{} } return &FileCache{ root: root, @@ -140,10 +151,11 @@ func NewFileCache(root string, fs FileSystem) *FileCache { type cacheEntry struct { // err holds an error encountered while updating the entry; if - // it's non-nil, then mtime and contents are invalid. - err error - mtime time.Time - contents []byte + // it's non-nil, then mtime, contents and the resolved path are invalid. + err error + mtime time.Time + contents []byte + resolvedPath string } // manifestFiles parses a manifest, returning a list of the files in the manifest. @@ -213,8 +225,8 @@ func (cache *FileCache) WriteFiles(w io.Writer, files []string) error { // refresh ensures a single cacheEntry is up to date. It stat()s and // potentially reads the contents of the file it is caching. -func (e *cacheEntry) refresh(root, path string, fs FileSystem) error { - mt, err := fs.statMtime(filepath.Join(root, path)) +func (e *cacheEntry) refresh(fs FileSystem) error { + mt, err := fs.StatMtime(e.resolvedPath) if err != nil { return err } @@ -222,7 +234,7 @@ func (e *cacheEntry) refresh(root, path string, fs FileSystem) error { return nil // up to date } - contents, err := fileContents(root, path, fs) + contents, err := fileContents(e.resolvedPath, fs) if err != nil { return err } @@ -231,6 +243,10 @@ func (e *cacheEntry) refresh(root, path string, fs FileSystem) error { return nil } +// Convert Windows paths separators. We can use this to create canonical paths that +// can be also used as browser source urls. +var pathReplacer = strings.NewReplacer("\\", "/") + // refreshFiles stats the given files and updates the cache for them. func (cache *FileCache) refreshFiles(files []string) { // Stating many files asynchronously is faster on network file systems. @@ -248,7 +264,7 @@ func (cache *FileCache) refreshFiles(files []string) { // TODO(evanm): benchmark limiting this to fewer goroutines. go func() { w := <-work - w.entry.err = w.entry.refresh(cache.root, w.path, cache.fs) + w.entry.err = w.entry.refresh(cache.fs) wg.Done() }() } @@ -256,7 +272,21 @@ func (cache *FileCache) refreshFiles(files []string) { for _, path := range files { entry := cache.entries[path] if entry == nil { - entry = &cacheEntry{} + // Resolve path only once for a cache entry. The resolved path will be part of the + // cache item. + resolvedPath, err := cache.fs.ResolvePath(cache.root, path) + + if err != nil { + fmt.Fprintf(os.Stderr, "could not resolve path %s. %v\n", path, err) + os.Exit(1) + } + + // Create a new cache entry with the corresponding resolved path. Also normalize the path + // before storing it persistently in the cache. The normalizing is good to do here because + // the path might be used in browser source URLs and should be kept in posix format. + entry = &cacheEntry{ + resolvedPath: pathReplacer.Replace(resolvedPath), + } cache.entries[path] = entry } work <- workItem{path, entry} @@ -275,10 +305,8 @@ const googModuleSearchLimit = 50 * 1000 var googModuleRegExp = regexp.MustCompile(`(?m)^\s*goog\.module\s*\(\s*['"]`) // fileContents returns escaped JS file contents for the given path. -// The path is resolved relative to root, but the path without root is used as the path -// in the source map. -func fileContents(root, path string, fs FileSystem) ([]byte, error) { - contents, err := fs.readFile(filepath.Join(root, path)) +func fileContents(path string, fs FileSystem) ([]byte, error) { + contents, err := fs.ReadFile(path) if err != nil { return nil, err } diff --git a/devserver/concatjs/concatjs_test.go b/devserver/concatjs/concatjs_test.go index 2ee47f12..00793bec 100644 --- a/devserver/concatjs/concatjs_test.go +++ b/devserver/concatjs/concatjs_test.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "net/http/httptest" + "path/filepath" "reflect" "strings" "testing" @@ -41,21 +42,26 @@ func TestWriteJSEscaped(t *testing.T) { } type fakeFileSystem struct { - fakeReadFile func(filename string) ([]byte, error) - fakeStatMtime func(filename string) (time.Time, error) + fakeReadFile func(filename string) ([]byte, error) + fakeStatMtime func(filename string) (time.Time, error) + fakeResolvePath func(root string, filename string) (string, error) } -func (fs *fakeFileSystem) readFile(filename string) ([]byte, error) { +func (fs *fakeFileSystem) ReadFile(filename string) ([]byte, error) { return fs.fakeReadFile(filename) } -func (fs *fakeFileSystem) statMtime(filename string) (time.Time, error) { +func (fs *fakeFileSystem) StatMtime(filename string) (time.Time, error) { return fs.fakeStatMtime(filename) } +func (fs *fakeFileSystem) ResolvePath(root string, filename string) (string, error) { + return fs.fakeResolvePath(root, filename) +} + func TestWriteFiles(t *testing.T) { - // Convert Windows paths separators for easier matching. - var pathReplacer = strings.NewReplacer("\\", "/") + var inputFiles = []string{"a", "missing", "module"} + fs := fakeFileSystem{ fakeReadFile: func(filename string) ([]byte, error) { var normalizedFilename = pathReplacer.Replace(filename) @@ -77,20 +83,23 @@ func TestWriteFiles(t *testing.T) { return time.Time{}, fmt.Errorf("unexpected file stat: %s", normalizedFilename) } }, + fakeResolvePath: func(root string, filename string) (string, error) { + return filepath.Join(root, filename), nil + }, } cache := NewFileCache("root", &fs) var b bytes.Buffer - cache.WriteFiles(&b, []string{"a", "missing", "module"}) + cache.WriteFiles(&b, inputFiles) got := string(b.Bytes()) want := `// a -eval('a content\n\n//# sourceURL=http://concatjs/a\n'); +eval('a content\n\n//# sourceURL=http://concatjs/root/a\n'); // missing throw new Error('loading missing failed: unexpected file stat: root/missing'); // module -goog.loadModule('// A module\ngoog.module(\'hello\');\n\n//# sourceURL=http://concatjs/module\n'); +goog.loadModule('// A module\ngoog.module(\'hello\');\n\n//# sourceURL=http://concatjs/root/module\n'); ` if got != want { @@ -109,6 +118,9 @@ func TestFileCaching(t *testing.T) { fakeStatMtime: func(string) (time.Time, error) { return time.Time{}, nil }, + fakeResolvePath: func(root string, filename string) (string, error) { + return filepath.Join(root, filename), nil + }, } var b bytes.Buffer @@ -141,6 +153,46 @@ func TestAcceptHeader(t *testing.T) { } } +func TestCustomFileResolving(t *testing.T) { + fs := fakeFileSystem{ + fakeReadFile: func(filename string) ([]byte, error) { + var normalizedFilename = pathReplacer.Replace(filename) + switch normalizedFilename { + case "/system_root/bazel-bin/a.txt": + return []byte("a content"), nil + case "/system_root/bazel-bin/nested/b.js": + return []byte("b content"), nil + default: + return []byte{}, fmt.Errorf("unexpected file read: %s", normalizedFilename) + } + }, + fakeStatMtime: func(filename string) (time.Time, error) { + return time.Now(), nil + }, + fakeResolvePath: func(root string, filename string) (string, error) { + // For this test, we use an absolute root. This is similar to how + // Bazel resolves runfiles through the manifest. + return filepath.Join("/system_root/bazel-bin/", filename), nil + }, + } + + cache := NewFileCache("", &fs) + + var b bytes.Buffer + cache.WriteFiles(&b, []string{"a.txt", "nested/b.js"}) + + actual := string(b.Bytes()) + expected := `// a.txt +eval('a content\n\n//# sourceURL=http://concatjs//system_root/bazel-bin/a.txt\n'); +// nested/b.js +eval('b content\n\n//# sourceURL=http://concatjs//system_root/bazel-bin/nested/b.js\n'); +` + + if actual != expected { + t.Errorf("Response differs, actual: %s, expected: %s", actual, expected) + } +} + func runOneRequest(b *testing.B, handler http.Handler, gzip bool) { req, err := http.NewRequest("GET", "", nil) if err != nil { diff --git a/devserver/devserver/BUILD.bazel b/devserver/devserver/BUILD.bazel index 484068dc..a7c27359 100644 --- a/devserver/devserver/BUILD.bazel +++ b/devserver/devserver/BUILD.bazel @@ -5,10 +5,20 @@ go_library( srcs = ["devserver.go"], importpath = "github.com/bazelbuild/rules_typescript/devserver/devserver", visibility = ["//visibility:public"], + deps = [ + "//devserver/runfiles:go_default_library", + ], ) go_test( name = "go_default_test", srcs = ["devserver_test.go"], + # Required runfiles for the devserver tests. + data = [ + "test/index.html", + "test/relative.html", + "@devserver_test_workspace//:sources", + ], embed = [":go_default_library"], ) + diff --git a/devserver/devserver/devserver.go b/devserver/devserver/devserver.go index 95c12d79..47489080 100644 --- a/devserver/devserver/devserver.go +++ b/devserver/devserver/devserver.go @@ -11,6 +11,8 @@ import ( "path/filepath" "strings" "time" + + "github.com/bazelbuild/rules_typescript/devserver/runfiles" ) // Convert Windows paths separators. @@ -93,16 +95,15 @@ func (w *headerSuppressorResponseWriter) WriteHeader(code int) {} // CreateFileHandler returns an http handler to locate files on disk func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) http.HandlerFunc { - pkgPaths := chainedDir{} + // We want to add the root runfile path because by default developers should be able to request + // runfiles through their absolute manifest path (e.g. "my_workspace_name/src/file.css") + // We use the empty string package because of the different algorithm for + // file resolution used internally and externally. + pkgPaths := dirHTTPFileSystem{[]string{"./"}, base} for _, pkg := range pkgs { - path := pathReplacer.Replace(filepath.Join(base, pkg)) - if _, err := os.Stat(path); err != nil { - fmt.Fprintf(os.Stderr, "Cannot read server root package at %s: %v\n", path, err) - os.Exit(1) - } - pkgPaths = append(pkgPaths, http.Dir(path)) + pkgPaths.files = append(pkgPaths.files, pathReplacer.Replace(pkg)) } - pkgPaths = append(pkgPaths, http.Dir(base)) + pkgPaths.files = append(pkgPaths.files, base) fileHandler := http.FileServer(pkgPaths).ServeHTTP @@ -122,12 +123,18 @@ func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) indexHandler := func(w http.ResponseWriter, r *http.Request) { // search through pkgs for the first index.html file found if any exists for _, pkg := range pkgs { - // defaultIndex is not cached, so that a user's edits will be reflected. - defaultIndex := pathReplacer.Replace(filepath.Join(base, pkg, "index.html")) - if _, err := os.Stat(defaultIndex); err == nil { - http.ServeFile(w, r, defaultIndex) - return + // File path is not cached, so that a user's edits will be reflected. + userIndexFile, err := runfiles.Runfile(base, pathReplacer.Replace(filepath.Join(pkg, "index.html"))) + + // In case the potential user index file couldn't be found in the runfiles, + // just continue searching. + if _, statErr := os.Stat(userIndexFile); err != nil || statErr != nil { + continue } + + // We can assume that the file is readable if it's listed in the runfiles manifest. + http.ServeFile(w, r, userIndexFile) + return } content := bytes.NewReader(defaultPage) http.ServeContent(w, r, "index.html", time.Now(), content) @@ -166,40 +173,49 @@ func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) return indexOnNotFoundHandler } -// chainedDir implements http.FileSystem by looking in the list of dirs one after each other. -type chainedDir []http.Dir +// dirHTTPFileSystem implements http.FileSystem by looking in the list of dirs one after each other. +type dirHTTPFileSystem struct { + files []string + base string +} -func (chain chainedDir) Open(name string) (http.File, error) { - for _, dir := range chain { - f, err := dir.Open(name) - if os.IsNotExist(err) { - continue - } - if err != nil { - return nil, err +func (fs dirHTTPFileSystem) Open(name string) (http.File, error) { + for _, packageName := range fs.files { + filePackageName := filepath.Join(packageName, name) + realFilePath, err := runfiles.Runfile(fs.base, filePackageName) + stat, statErr := os.Stat(realFilePath) + + if err != nil || statErr != nil { + // In case the runfile could not be found, we also need to check that the requested + // path does not refer to a directory containing an "index.html" file. This can + // happen if Bazel runs without runfile symlinks, where only files can be resolved + // from the manifest. In that case we dirty check if there is a "index.html" file. + realFilePath, err = runfiles.Runfile(fs.base, filepath.Join(filePackageName, "index.html")) + + // Continue searching if the runfile couldn't be found for the request filed. + if _, statErr := os.Stat(realFilePath); err != nil || statErr != nil { + continue + } } - // Do not return a directory, since FileServer will either: - // 1) serve the index.html file -or- - // 2) fall back to directory listings - // In place of (2), we prefer to fall back to our index.html. We accomplish - // this by lying to the FileServer that the directory doesn't exist. - stat, err := f.Stat() - if err != nil { - return nil, err - } + // In case the resolved file resolves to a directory. This can only happen if + // Bazel runs with symlinked runfiles (e.g. on MacOS, linux). In that case, we + // just look for a index.html in the directory. if stat.IsDir() { - // Make sure to close the previous file handle before moving to a different file. - f.Close() - indexName := pathReplacer.Replace(filepath.Join(name, "index.html")) - f, err := dir.Open(indexName) - if os.IsNotExist(err) { + realFilePath, err = runfiles.Runfile(fs.base, filepath.Join(filePackageName, "index.html")) + + // In case the index.html file of the requested directory couldn't be found, + // we just continue searching. + if err != nil { continue } - return f, err } - return f, nil + + // We can assume that the file is present, if it's listed in the runfile manifest. Though, we + // return the error, in case something prevented the read-access. + return os.Open(realFilePath) } + return nil, os.ErrNotExist } diff --git a/devserver/devserver/devserver_test.go b/devserver/devserver/devserver_test.go index 2fc77c1c..0c0ba56a 100644 --- a/devserver/devserver/devserver_test.go +++ b/devserver/devserver/devserver_test.go @@ -44,63 +44,48 @@ func req(handler http.HandlerFunc, url string) (int, string) { } func TestDevserverFileHandling(t *testing.T) { - _, del := tmpfile(t, "TestIndexServing/manifest.MF", "file1.js\nfile2.js") - defer del() - _, delIdx := tmpfile(t, "TestIndexServing/pkg1/index.html", "contents of index.html") - defer delIdx() - _, del = tmpfile(t, "TestIndexServing/pkg1/foo.html", "contents of foo.html") - defer del() - _, del = tmpfile(t, "TestIndexServing/pkg2/bar.html", "contents of bar.html") - defer del() - _, del = tmpfile(t, "TestIndexServing/pkg2/foo.html", "contents of foo.html in pkg2") - defer del() - _, del = tmpfile(t, "TestIndexServing/pkg2/rpc/items/index.html", "contents of rpc/items/index.html") - defer del() - _, del = tmpfile(t, "TestIndexServing/pkg3/baz.html", "contents of baz.html in pkg3") - defer del() + handler := CreateFileHandler("/app.js", "manifest.MF", []string{ + // This verifies that we can resolve relatively to the current package. Usually the + // devserver Bazel rule adds the current package here. + "build_bazel_rules_typescript/devserver/devserver", + // Verifies that we can specify subfolders of workspaces + "build_bazel_rules_typescript/devserver/devserver/test", + // Verifies that we can specify external workspaces as root dirs. + "devserver_test_workspace", + // Verifies that we can specify subfolders from external workspaces. + "devserver_test_workspace/pkg2", + }, "") - handler := CreateFileHandler("/app.js", "manifest.MF", []string{"pkg1", "pkg2"}, - filepath.Join(os.Getenv("TEST_TMPDIR"), "TestIndexServing")) defaultPageContent := ` + + + + + + + + + \ No newline at end of file diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel index 1cb2172b..89a2cbb4 100644 --- a/examples/protocol_buffers/BUILD.bazel +++ b/examples/protocol_buffers/BUILD.bazel @@ -1,4 +1,6 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") +load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") load( "//:defs.bzl", "ts_devserver", @@ -60,7 +62,7 @@ ts_devserver( bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"], entry_module = "build_bazel_rules_typescript/examples/protocol_buffers/app", port = 8080, - deps = [":app"], + deps = [":bundle"], ) # Test for production mode @@ -111,3 +113,26 @@ ts_library( "@npm//protractor", ], ) + +proto_library( + name = "rules_typescript_proto", + srcs = [ + "car.proto", + "tire.proto", + ], + visibility = ["//visibility:public"], +) + +go_proto_library( + name = "rules_typescript_go_proto", + importpath = "github.com/bazelbuild/rules_typescript/examples/protocol_buffers", + proto = ":rules_typescript_proto", + visibility = ["//visibility:public"], +) + +go_library( + name = "go_default_library", + embed = [":rules_typescript_go_proto"], + importpath = "github.com/bazelbuild/rules_typescript/examples/protocol_buffers", + visibility = ["//visibility:public"], +) diff --git a/examples/protocol_buffers/index.html b/examples/protocol_buffers/index.html index 617b833a..6f8690ee 100644 --- a/examples/protocol_buffers/index.html +++ b/examples/protocol_buffers/index.html @@ -1,10 +1,10 @@ - + protocol_buffers example - - - - - - + + + + + + \ No newline at end of file diff --git a/package.bzl b/package.bzl index 1f54ddec..5e1e5b0f 100644 --- a/package.bzl +++ b/package.bzl @@ -56,8 +56,11 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "io_bazel_rules_go", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.16.3/rules_go-0.16.3.tar.gz", - # sha256 = "ee5fe78fe417c685ecb77a0a725dc9f6040ae5beb44a0ba4ddb55453aad23a8a", + # We need https://github.com/bazelbuild/rules_go/commit/109c520465fcb418f2c4be967f3744d959ad66d3 which + # is not part of any 0.16.x release yet. This commit provides runfile resolve support for Windows. + urls = ["https://github.com/bazelbuild/rules_go/archive/12a52e9845a5b06a28ffda06d7f2b07ff2320b97.zip"], + strip_prefix = "rules_go-12a52e9845a5b06a28ffda06d7f2b07ff2320b97", + sha256 = "5c0a059afe51c744c90ae2b33ac70b9b4f4c514715737e2ec0b5fd297400c10d", ) # go_repository is defined in bazel_gazelle From 68fed6a243cbb452413d627eb08460a38b74e0fb Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 18 Jan 2019 07:27:19 -0800 Subject: [PATCH 047/316] Introduce TscPlugin methods to implement ngtsc as a tsc_wrapped plugin. PiperOrigin-RevId: 229925525 --- internal/tsc_wrapped/index.ts | 1 + internal/tsc_wrapped/plugin_api.ts | 52 +++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/internal/tsc_wrapped/index.ts b/internal/tsc_wrapped/index.ts index f2959d6f..725c2a9d 100644 --- a/internal/tsc_wrapped/index.ts +++ b/internal/tsc_wrapped/index.ts @@ -4,3 +4,4 @@ export * from './compiler_host'; export * from './diagnostics'; export * from './worker'; export * from './manifest'; +export * from './plugin_api'; diff --git a/internal/tsc_wrapped/plugin_api.ts b/internal/tsc_wrapped/plugin_api.ts index b28f64f3..f778c0f8 100644 --- a/internal/tsc_wrapped/plugin_api.ts +++ b/internal/tsc_wrapped/plugin_api.ts @@ -23,15 +23,59 @@ import * as ts from 'typescript'; +export interface PluginCompilerHost extends ts.CompilerHost { + /** + * Absolute file paths which should be included in the initial ts.Program. + * In vanilla tsc, these are the ts.ParsedCommandLine#fileNames + */ + inputFiles: ReadonlyArray; + + /** + * A helper the transformer can use when generating new import statements + * @param fileName the absolute path to the file as referenced in the ts.Program + * @return a string suitable for use in an import statement + */ + fileNameToModuleId: (fileName: string) => string; +} + /** * This API is simpler than LanguageService plugins. * It's used for plugins that only target the command-line and never run in an * editor context. - * IMPORTANT: plugins must propagate the diagnostics from the original program. - * Execution of plugins is not additive; only the result from the top-most - * wrapped Program is used. + * + * One instance of the TscPlugin will be created for each execution of the compiler, so it is + * safe for these plugins to hold state that's local to one execution. + * + * The methods on the plugin will be called in the order shown below: + * - wrapHost to intercept CompilerHost methods and contribute inputFiles to the program + * - wrap to intercept diagnostics requests on the program + * - createTransformers once it's time to emit */ -export interface TscPlugin { wrap(p: ts.Program, config?: {}): ts.Program; } +export interface TscPlugin { + /** + * Allow plugins to add additional files to the program. + * For example, Angular creates ngsummary and ngfactory files. + * These files must be in the program since there may be incoming references to the symbols. + * @param inputFiles the files that were part of the original program + * @param compilerHost: the original host (likely a ts.CompilerHost) that we can delegate to + */ + wrapHost?(inputFiles: string[], compilerHost: PluginCompilerHost): PluginCompilerHost; + + /** + * Same API as ts.LanguageService: allow the plugin to contribute additional + * diagnostics + * IMPORTANT: plugins must propagate the diagnostics from the original program. + * Execution of plugins is not additive; only the result from the top-most + * wrapped Program is used. + */ + wrap(p: ts.Program, config?: {}, host?: ts.CompilerHost): ts.Program; + + /** + * Allow plugins to contribute additional TypeScript CustomTransformers. + * These can modify the TS AST, JS AST, or .d.ts output AST. + */ + createTransformers?(host: PluginCompilerHost): ts.CustomTransformers; +} // TODO(alexeagle): this should be unioned with tsserverlibrary.PluginModule export type Plugin = TscPlugin; From 67b25f37af2a9b6c0c8fc895719677301af20858 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 18 Jan 2019 19:19:36 +0100 Subject: [PATCH 048/316] build: fix missing build files --- devserver/concatjs/BUILD.bazel | 14 ++++++++++++++ devserver/runfiles/BUILD.bazel | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 devserver/concatjs/BUILD.bazel create mode 100644 devserver/runfiles/BUILD.bazel diff --git a/devserver/concatjs/BUILD.bazel b/devserver/concatjs/BUILD.bazel new file mode 100644 index 00000000..4606773b --- /dev/null +++ b/devserver/concatjs/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "go_default_library", + srcs = ["concatjs.go"], + importpath = "github.com/bazelbuild/rules_typescript/devserver/concatjs", + visibility = ["//visibility:public"], +) + +go_test( + name = "go_default_test", + srcs = ["concatjs_test.go"], + embed = [":go_default_library"], +) \ No newline at end of file diff --git a/devserver/runfiles/BUILD.bazel b/devserver/runfiles/BUILD.bazel new file mode 100644 index 00000000..2e0b9b7a --- /dev/null +++ b/devserver/runfiles/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +# Gazelle by default tries to map the import for the Bazel runfile go library to a repository with +# an auto-generated name. This does not work for us because the rules_go repository name is different. +# This gazelle directive ensures that Gazelle resolves the import to the proper Bazel label. +# Read more here: https://github.com/bazelbuild/bazel-gazelle#directives +# gazelle:resolve go github.com/bazelbuild/rules_go/go/tools/bazel @io_bazel_rules_go//go/tools/bazel:go_default_library + +go_library( + name = "go_default_library", + srcs = ["runfiles.go"], + deps = [ + "@io_bazel_rules_go//go/tools/bazel:go_default_library", + ], + importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", + visibility = ["//visibility:public"], +) From 0f7c6f624c7ac56880d466ea81d83a57c72bf963 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Thu, 24 Jan 2019 14:31:15 -0800 Subject: [PATCH 049/316] karma: Use upstream v4 Upgraded Karma version to latest, and implemented custom injector for iblaze in @bazel/karma module. Closes #387 PiperOrigin-RevId: 230791110 --- internal/e2e/package_karma/README.md | 4 ++-- internal/karma/BUILD.bazel | 6 +++--- internal/karma/index.ts | 30 ++++++++++++++++++++++++++-- internal/karma/karma.conf.js | 10 +--------- internal/karma/package.json | 8 ++++---- 5 files changed, 38 insertions(+), 20 deletions(-) diff --git a/internal/e2e/package_karma/README.md b/internal/e2e/package_karma/README.md index 2dfa4e23..a9c02549 100644 --- a/internal/e2e/package_karma/README.md +++ b/internal/e2e/package_karma/README.md @@ -1,5 +1,5 @@ # Testing karma dependency A karma 3.0.0 dependency is here to verify that a user's karma dependency doesn't interfere with -the ts_web_test_suite rule which depends on a transitive dependency in @bazel/karma on a fork -of karma. +the ts_web_test_suite rule which depends on a transitive dependency in @bazel/karma on a different +version of karma. diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 7852325e..b2a22bce 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -13,7 +13,7 @@ exports_files([ ]) ts_library( - name = "karma_concat_js", + name = "bazel_karma", srcs = glob(["*.ts"]), module_name = "@bazel/karma", tsconfig = "//internal/karma:tsconfig.json", @@ -26,7 +26,7 @@ ts_library( nodejs_binary( name = "karma_bin", data = [ - ":karma_concat_js", + ":bazel_karma", "@npm//jasmine-core", "@npm//karma", "@npm//karma-chrome-launcher", @@ -65,7 +65,7 @@ npm_package( ], deps = [ ":check_version_copy", - ":karma_concat_js", + ":bazel_karma", ":license_copy", ], ) diff --git a/internal/karma/index.ts b/internal/karma/index.ts index 74c47500..ad02ec93 100644 --- a/internal/karma/index.ts +++ b/internal/karma/index.ts @@ -6,6 +6,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as process from 'process'; import * as tmp from 'tmp'; +import {createInterface} from 'readline'; /// /** @@ -32,7 +33,8 @@ function initConcatJs(logger, emitter, basePath) { path: '/concatjs_bundle.js', contentPath: tmpFile.name, isUrl: false, - content: '' + content: '', + encodings: {}, } as any; const included = []; @@ -70,6 +72,30 @@ function initConcatJs(logger, emitter, basePath) { (initConcatJs as any).$inject = ['logger', 'emitter', 'config.basePath']; +function watcher(fileList: {refresh: () => void}) { + // ibazel will write this string after a successful build + // We don't want to re-trigger tests if the compilation fails, so + // we should only listen for this event. + const IBAZEL_NOTIFY_BUILD_SUCCESS = 'IBAZEL_BUILD_COMPLETED SUCCESS'; + // ibazel communicates with us via stdin + const rl = createInterface({input: process.stdin, terminal: false}); + rl.on('line', (chunk: string) => { + if (chunk === IBAZEL_NOTIFY_BUILD_SUCCESS) { + fileList.refresh(); + } + }); + rl.on('close', () => { + // Give ibazel 5s to kill our process, otherwise do it ourselves + setTimeout(() => { + console.error('ibazel failed to stop karma after 5s; probably a bug'); + process.exit(1); + }, 5000); + }); +} + +(watcher as any).$inject = ['fileList']; + module.exports = { - 'framework:concat_js': ['factory', initConcatJs] + 'framework:concat_js': ['factory', initConcatJs], + 'watcher': ['value', watcher], }; diff --git a/internal/karma/karma.conf.js b/internal/karma/karma.conf.js index 1ef2a492..ff066d9f 100644 --- a/internal/karma/karma.conf.js +++ b/internal/karma/karma.conf.js @@ -151,7 +151,7 @@ try // enable / disable watching file and executing tests whenever // any file changes - overrideConfigValue(conf, 'autoWatch', true); + overrideConfigValue(conf, 'autoWatch', process.env['IBAZEL_NOTIFY_CHANGES'] === 'y'); // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits @@ -165,14 +165,6 @@ try // base path that will be used to resolve all patterns // (eg. files, exclude) overrideConfigValue(conf, 'basePath', 'TMPL_runfiles_path'); - - if (process.env['IBAZEL_NOTIFY_CHANGES'] === 'y') { - // Tell karma to only listen for ibazel messages on stdin rather than - // watch all the input files This is from fork alexeagle/karma in the - // ibazel branch: - // https://github.com/alexeagle/karma/blob/576d262af50b10e63485b86aee99c5358958c4dd/lib/server.js#L172 - overrideConfigValue(conf, 'watchMode', 'ibazel'); - } } /** diff --git a/internal/karma/package.json b/internal/karma/package.json index 9ffa9c02..be1c6eb4 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -5,8 +5,8 @@ "license": "Apache-2.0", "version": "0.0.0-PLACEHOLDER", "keywords": [ - "karma", - "bazel" + "karma", + "bazel" ], "main": "./index.js", "typings": "./index.d.ts", @@ -15,13 +15,13 @@ }, "dependencies": { "jasmine-core": "2.8.0", - "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", + "karma": "^4.0.0", "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.1.0", "karma-jasmine": "1.1.1", + "karma-requirejs": "1.1.0", "karma-sauce-launcher": "2.0.2", "karma-sourcemap-loader": "0.3.7", - "karma-requirejs": "1.1.0", "requirejs": "2.3.5", "semver": "5.6.0", "tmp": "0.0.33" From 9ba1c5a2797c0095ea95ddf0fc7d685c360258e1 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 25 Jan 2019 11:23:21 -0800 Subject: [PATCH 050/316] Support generated sources in query-based taze. 1. Don't report generated sources as missing sources to be removed. 2. Correctly report that ts_libraries with generated sources provide the generated sources as exports. PiperOrigin-RevId: 230936754 --- ts_auto_deps/analyze/analyze.go | 156 ++++++++++++++----- ts_auto_deps/analyze/analyze_test.go | 224 ++++++++++++++++++++++++++- ts_auto_deps/analyze/loader.go | 65 ++++++-- 3 files changed, 392 insertions(+), 53 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 04a8f57f..851509a1 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -44,19 +44,29 @@ func debugf(format string, v ...interface{}) { // TargetLoader provides methods for loading targets from BUILD files. type TargetLoader interface { - // LoadLabels loads targets from BUILD files associated with labels. - // It returns a mapping from labels to targets or an error, if any + // LoadTargets loads targets from BUILD files associated with labels. A target + // is a rule, source file, generated file, package group or environment group. + // It returns a mapping from labels to targets or an error, if any occurred. + // + // A label must be the absolute label associated with a target. For example, + // '//foo/bar:baz' is acceptable whereas 'bar:baz' or '//foo/bar' will result + // in undefined behavior. TODO(lucassloan): make this an error + // + // Only returns targets visible to currentPkg. If currentPkg is an empty + // string returns all targets regardless of visibility. + LoadTargets(currentPkg string, labels []string) (map[string]*appb.Target, error) + // LoadRules loads rules from BUILD files associated with labels. + // It returns a mapping from labels to rules or an error, if any // occurred. // - // A label must be the absolute label associated with a target. For + // A label must be the absolute label associated with a rule. For // example, '//foo/bar:baz' is acceptable whereas 'bar:baz' or '//foo/bar' - // will result in undefined behavior. If no target is found associated - // with a provided label, the label should be excluded from the returned - // mapping but an error should not be returned. + // will result in undefined behavior. + // TODO(lucassloan): make this an error. // // Only returns rules visible to currentPkg. If currentPkg is an empty string - // returns all targets regardless of visibility. - LoadLabels(currentPkg string, labels []string) (map[string]*appb.Rule, error) + // returns all rules regardless of visibility. + LoadRules(currentPkg string, labels []string) (map[string]*appb.Rule, error) // LoadImportPaths loads targets from BUILD files associated with import // paths relative to a root directory. It returns a mapping from import // paths to targets or an error, if any occurred. @@ -102,11 +112,11 @@ func (a *Analyzer) Analyze(ctx context.Context, dir string, labels []string) ([] if err != nil { return nil, err } - targets, err := a.loader.LoadLabels(currentPkg, labels) + rules, err := a.loader.LoadRules(currentPkg, labels) if err != nil { return nil, err } - resolved, err := a.resolveImportsForTargets(ctx, currentPkg, root, targets) + resolved, err := a.resolveImportsForTargets(ctx, currentPkg, root, rules) if err != nil { return nil, err } @@ -126,30 +136,91 @@ type resolvedTarget struct { // missingSources are source files which could not be opened on disk. // These are added to the dependency reports and MissingSources. missingSources []string + // A map from the labels in the target's srcs to the Targets those + // labels refer. + sources map[string]*appb.Target +} + +// setSources sets the sources on t. It returns an error if one of the srcs of +// t's rule isn't in loadedSrcs. +func (t *resolvedTarget) setSources(loadedSrcs map[string]*appb.Target) error { + for _, label := range listAttribute(t.rule, "srcs") { + src := loadedSrcs[label] + if src == nil { + return fmt.Errorf("no source found for label %s", label) + } + t.sources[label] = src + } + return nil } +// srcs returns the labels of the sources of t. func (t *resolvedTarget) srcs() ([]string, error) { - srcs, err := sources(t.rule) - if err != nil { - // Targets without sources are considered errors. - return nil, err + srcs := listAttribute(t.rule, "srcs") + if srcs == nil { + return nil, fmt.Errorf("target %q missing \"srcs\" attribute", t.label) } + return srcs, nil } +// literalSrcPaths returns the file paths of the non-generated sources of t. +func (t *resolvedTarget) literalSrcPaths() ([]string, error) { + srcs := listAttribute(t.rule, "srcs") + if srcs == nil { + return nil, fmt.Errorf("target %q missing \"srcs\" attribute", t.label) + } + var literalFilePaths []string + for _, label := range listAttribute(t.rule, "srcs") { + src := t.sources[label] + if src == nil { + return nil, fmt.Errorf("src %q has no associated target", label) + } + // There's no syntactic way to determine if a label is a source file + // so check against the type of the relevant target + if src.GetType() == appb.Target_SOURCE_FILE { + literalFilePaths = append(literalFilePaths, labelToPath(label)) + } + } + return literalFilePaths, nil +} + +// getAllLiteralSrcPaths returns the file paths of all the non-generated sources +// of the targets. +func getAllLiteralSrcPaths(targets map[string]*resolvedTarget) ([]string, error) { + var allLiteralSrcPaths []string + for _, t := range targets { + literalSrcPaths, err := t.literalSrcPaths() + if err != nil { + return nil, err + } + allLiteralSrcPaths = append(allLiteralSrcPaths, literalSrcPaths...) + } + + return allLiteralSrcPaths, nil +} + func (t *resolvedTarget) deps() []string { return listAttribute(t.rule, "deps") } // provides returns whether the resolved target can provide the path provided. func (t *resolvedTarget) provides(path string) bool { - srcs, err := t.srcs() - if err != nil { - return false - } - for _, src := range srcs { - if src == path { - return true + for _, label := range listAttribute(t.rule, "srcs") { + src := t.sources[label] + if src.GetType() == appb.Target_SOURCE_FILE { + // For literal sources, check the path of the source + if labelToPath(label) == path { + return true + } + } else if src.GetType() == appb.Target_RULE { + // For generated souces, check against the paths of rule's + // outputs + for _, genSrc := range src.GetRule().GetRuleOutput() { + if labelToPath(genSrc) == path { + return true + } + } } } return false @@ -162,6 +233,7 @@ func newResolvedTarget(r *appb.Rule) *resolvedTarget { dependencies: make(map[string]*appb.Rule), imports: make(map[string][]*ts_auto_depsImport), rule: r, + sources: make(map[string]*appb.Target), } } @@ -180,7 +252,7 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo allDeps = append(allDeps, target.deps()...) allSrcs = append(allSrcs, srcs...) } - deps, err := a.loader.LoadLabels(currentPkg, allDeps) + deps, err := a.loader.LoadRules(currentPkg, allDeps) if err != nil { return nil, err } @@ -191,7 +263,25 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo t.dependencies[dep] = deps[dep] } } - imports, errs := extractAllImports(root, allSrcs) + // load all the sources in the targets, so that literal and generated + // targets can be distinguished + srcs, err := a.loader.LoadTargets(currentPkg, allSrcs) + if err != nil { + return nil, err + } + for _, t := range targets { + err := t.setSources(srcs) + if err != nil { + return nil, err + } + } + // only extract the imports out of the literal sources, since ts_auto_deps can't + // see the contents of generated files + allLiteralSrcPaths, err := getAllLiteralSrcPaths(targets) + if err != nil { + return nil, err + } + imports, errs := extractAllImports(root, allLiteralSrcPaths) for _, err := range errs { // NotExist errors are caught and added to the generated dependency // reports as missing source files. Only errors which are not NotExist @@ -201,7 +291,7 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo } } for _, t := range targets { - srcs, err := t.srcs() + srcs, err := t.literalSrcPaths() if err != nil { return nil, err } @@ -328,19 +418,9 @@ func redirectedLabel(target *appb.Rule) string { return target.GetName() } -// sources creates an array of all sources listed in the 'srcs' attribute -// on each target in targets. -func sources(target *appb.Rule) ([]string, error) { - srcs := listAttribute(target, "srcs") - if srcs == nil { - return nil, fmt.Errorf("target %q missing \"srcs\" attribute", target.GetName()) - } - for i, src := range srcs { - _, pkg, file := edit.ParseLabel(src) - // TODO(jdhamlik): Handle generated files. - srcs[i] = platform.Normalize(filepath.Clean(filepath.Join(pkg, file))) - } - return srcs, nil +func labelToPath(label string) string { + _, pkg, file := edit.ParseLabel(label) + return platform.Normalize(filepath.Clean(filepath.Join(pkg, file))) } // generateReports generates reports for each label in labels. @@ -419,7 +499,7 @@ func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyRepor unusedDeps = append(unusedDeps, dep) } } - labelToRule, err := a.loader.LoadLabels("", unusedDeps) + labelToRule, err := a.loader.LoadRules("", unusedDeps) if err != nil { return nil, err } diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index 26aac4db..700ea845 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -6,6 +6,8 @@ import ( "io/ioutil" "os" "path/filepath" + "reflect" + "strconv" "strings" "testing" @@ -44,8 +46,20 @@ func newFakeTargetLoader() *fakeTargetLoader { } } -func (bl *fakeTargetLoader) LoadLabels(_ string, labels []string) (map[string]*appb.Rule, error) { - return bl.loadTargets(bl.targetsByLabels, labels) +func (bl *fakeTargetLoader) LoadRules(_ string, labels []string) (map[string]*appb.Rule, error) { + return bl.loadRules(bl.targetsByLabels, labels) +} + +func (bl *fakeTargetLoader) LoadTargets(_ string, labels []string) (map[string]*appb.Target, error) { + targets := make(map[string]*appb.Target) + for _, l := range labels { + if strings.Contains(l, ".") { + targets[l] = &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()} + } else { + targets[l] = &appb.Target{Type: appb.Target_RULE.Enum()} + } + } + return targets, nil } func (bl *fakeTargetLoader) byLabel(label, value string) { @@ -53,14 +67,14 @@ func (bl *fakeTargetLoader) byLabel(label, value string) { } func (bl *fakeTargetLoader) LoadImportPaths(_ context.Context, _, _ string, paths []string) (map[string]*appb.Rule, error) { - return bl.loadTargets(bl.targetsByImportPaths, paths) + return bl.loadRules(bl.targetsByImportPaths, paths) } func (bl *fakeTargetLoader) byImportPath(importPath, value string) { bl.targetsByImportPaths[importPath] = value } -func (bl *fakeTargetLoader) loadTargets(source map[string]string, keys []string) (map[string]*appb.Rule, error) { +func (bl *fakeTargetLoader) loadRules(source map[string]string, keys []string) (map[string]*appb.Rule, error) { targets := make(map[string]*appb.Rule) for _, key := range keys { value, ok := source[key] @@ -479,6 +493,208 @@ func TestStringAttribute(t *testing.T) { } } +func createResolvedTarget(srcs []string) *resolvedTarget { + return &resolvedTarget{ + rule: &appb.Rule{ + Attribute: []*appb.Attribute{ + &appb.Attribute{ + Name: proto.String("srcs"), + Type: appb.Attribute_STRING_LIST.Enum(), + StringListValue: srcs, + }, + }, + }, + sources: map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, + "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, + }, + } +} + +func TestLiteralSrcPaths(t *testing.T) { + tests := []struct { + name string + srcs []string + err error + expected []string + }{ + { + "OneLiteralSource", + []string{"//a:file.ts"}, + nil, + []string{"a/file.ts"}, + }, + { + "MultipleLiteralSources", + []string{"//a:file.ts", "//b:file.ts"}, + nil, + []string{"a/file.ts", "b/file.ts"}, + }, + { + "MultipleGeneratedSources", + []string{"//b:generator", "//b:wiz"}, + nil, + nil, + }, + { + "MixedSources", + []string{"//a:file.ts", "//b:file.ts", "//b:generator", "//b:wiz"}, + nil, + []string{"a/file.ts", "b/file.ts"}, + }, + { + "MissingSource", + []string{"//not/in/the/set/of/resolved:sources"}, + fmt.Errorf("src %q has no associated target", "//not/in/the/set/of/resolved:sources"), + nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + rt := createResolvedTarget(test.srcs) + literalSrcPaths, err := rt.literalSrcPaths() + if !reflect.DeepEqual(err, test.err) { + t.Errorf("got err %q, expected %q", err, test.err) + } + + if diff := pretty.Compare(literalSrcPaths, test.expected); diff != "" { + t.Errorf("failed to get correct literal source paths: (-got, +want)\n%s", diff) + } + }) + } +} + +func TestGetAllLiteralSrcPaths(t *testing.T) { + tests := []struct { + name string + srcsLists [][]string + err error + expected []string + }{ + { + "OneTarget", + [][]string{ + []string{"//a:file.ts", "//b:file.ts"}, + }, + nil, + []string{"a/file.ts", "b/file.ts"}, + }, + { + "MultipleTargets", + [][]string{ + []string{"//a:file.ts"}, + []string{"//b:file.ts"}, + }, + nil, + []string{"a/file.ts", "b/file.ts"}, + }, + { + "MissingSource", + [][]string{ + []string{"//not/in/the/set/of/resolved:sources"}, + }, + fmt.Errorf("src %q has no associated target", "//not/in/the/set/of/resolved:sources"), + nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + rts := make(map[string]*resolvedTarget) + for i, srcs := range test.srcsLists { + rts[strconv.Itoa(i)] = createResolvedTarget(srcs) + } + literalSrcPaths, err := getAllLiteralSrcPaths(rts) + if !reflect.DeepEqual(err, test.err) { + t.Errorf("got err %q, expected %q", err, test.err) + } + + if diff := pretty.Compare(literalSrcPaths, test.expected); diff != "" { + t.Errorf("failed to get correct literal source paths: (-got, +want)\n%s", diff) + } + }) + } +} + +func TestSetSources(t *testing.T) { + tests := []struct { + name string + srcs []string + loadedSrcs map[string]*appb.Target + err error + expected map[string]*appb.Target + }{ + { + "NoSources", + nil, + nil, + nil, + nil, + }, + { + "OneSource", + []string{"//a:file.ts"}, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + }, + nil, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + }, + }, + { + "ExtraSources", + []string{"//a:file.ts"}, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, + "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, + }, + nil, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + }, + }, + { + "MissingSources", + []string{"//a:file.ts"}, + nil, + fmt.Errorf("no source found for label %s", "//a:file.ts"), + nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + rt := &resolvedTarget{ + rule: &appb.Rule{ + Attribute: []*appb.Attribute{ + &appb.Attribute{ + Name: proto.String("srcs"), + Type: appb.Attribute_STRING_LIST.Enum(), + StringListValue: test.srcs, + }, + }, + }, + sources: make(map[string]*appb.Target), + } + + err := rt.setSources(test.loadedSrcs) + if !reflect.DeepEqual(err, test.err) { + t.Errorf("got err %q, expected %q", err, test.err) + } + + if diff := pretty.Compare(rt.sources, test.expected); diff != "" { + t.Errorf("failed to set correct sources: (-got, +want)\n%s", diff) + } + }) + } +} + func missingDeps(report *arpb.DependencyReport) []string { var deps []string for _, group := range report.GetMissingDependencyGroup() { diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 0308267e..51cfd448 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -42,8 +42,8 @@ type QueryBasedTargetLoader struct { // analyzed in the "-recursive" case, these caches will be garbage // collected between directories. pkgCache map[string]*pkgCacheEntry - // labelCache is a mapping from a label to its loaded rule. - labelCache map[string]*appb.Rule + // labelCache is a mapping from a label to its loaded target. + labelCache map[string]*appb.Target // queryCount is the total number of queries executed by the target loader. queryCount int @@ -57,13 +57,33 @@ func NewQueryBasedTargetLoader(workdir, bazelBinary string) *QueryBasedTargetLoa bazelBinary: bazelBinary, pkgCache: make(map[string]*pkgCacheEntry), - labelCache: make(map[string]*appb.Rule), + labelCache: make(map[string]*appb.Target), } } -// LoadLabels uses Bazel query to load targets associated with labels from BUILD +// LoadRules uses Bazel query to load rules associated with labels from BUILD // files. -func (q *QueryBasedTargetLoader) LoadLabels(pkg string, labels []string) (map[string]*appb.Rule, error) { +func (q *QueryBasedTargetLoader) LoadRules(pkg string, labels []string) (map[string]*appb.Rule, error) { + labelToTarget, err := q.LoadTargets(pkg, labels) + if err != nil { + return nil, err + } + + labelToRule := make(map[string]*appb.Rule) + for _, label := range labels { + target := labelToTarget[label] + if target.GetType() == appb.Target_RULE { + labelToRule[label] = target.GetRule() + } else { + return nil, fmt.Errorf("target contains object of type %q instead of type %q", target.GetType(), appb.Target_RULE) + } + } + return labelToRule, nil +} + +// LoadTargets uses Bazel query to load targets associated with labels from BUILD +// files. +func (q *QueryBasedTargetLoader) LoadTargets(pkg string, labels []string) (map[string]*appb.Target, error) { var labelCacheMisses []string for _, label := range labels { if _, ok := q.labelCache[labelCacheKey(pkg, label)]; !ok { @@ -84,11 +104,11 @@ func (q *QueryBasedTargetLoader) LoadLabels(pkg string, labels []string) (map[st return nil, err } for _, target := range r.GetTarget() { - label, err := q.ruleLabel(target) + label, err := q.targetLabel(target) if err != nil { return nil, err } - q.labelCache[labelCacheKey(pkg, label)] = target.GetRule() + q.labelCache[labelCacheKey(pkg, label)] = target } for _, label := range labelCacheMisses { key := labelCacheKey(pkg, label) @@ -101,11 +121,11 @@ func (q *QueryBasedTargetLoader) LoadLabels(pkg string, labels []string) (map[st } } } - labelToRule := make(map[string]*appb.Rule) + labelToTarget := make(map[string]*appb.Target) for _, label := range labels { - labelToRule[label] = q.labelCache[labelCacheKey(pkg, label)] + labelToTarget[label] = q.labelCache[labelCacheKey(pkg, label)] } - return labelToRule, nil + return labelToTarget, nil } func labelCacheKey(currentPkg, label string) string { @@ -168,7 +188,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg labelToRule := make(map[string]*appb.Rule) for len(generators) > 0 { - generatorToRule, err := q.LoadLabels(currentPkg, generators) + generatorToRule, err := q.LoadRules(currentPkg, generators) if err != nil { return nil, err } @@ -218,6 +238,8 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg return results, nil } +// ruleLabel returns the label for a target which is a rule. Returns an error if +// target is not a rule. func (q *QueryBasedTargetLoader) ruleLabel(target *appb.Target) (string, error) { if t := target.GetType(); t != appb.Target_RULE { return "", fmt.Errorf("target contains object of type %q instead of type %q", t, appb.Target_RULE) @@ -225,6 +247,8 @@ func (q *QueryBasedTargetLoader) ruleLabel(target *appb.Target) (string, error) return target.GetRule().GetName(), nil } +// fileLabel returns the label for a target which is a file. Returns an error if +// target is not a source file or a generated file. func (q *QueryBasedTargetLoader) fileLabel(target *appb.Target) (string, error) { switch t := target.GetType(); t { case appb.Target_GENERATED_FILE: @@ -236,6 +260,25 @@ func (q *QueryBasedTargetLoader) fileLabel(target *appb.Target) (string, error) } } +// targetLabel returns the label for a target. Returns an error if target is an +// unknown type. +func (q *QueryBasedTargetLoader) targetLabel(target *appb.Target) (string, error) { + switch t := target.GetType(); t { + case appb.Target_GENERATED_FILE: + return target.GetGeneratedFile().GetName(), nil + case appb.Target_SOURCE_FILE: + return target.GetSourceFile().GetName(), nil + case appb.Target_RULE: + return target.GetRule().GetName(), nil + case appb.Target_PACKAGE_GROUP: + return target.GetPackageGroup().GetName(), nil + case appb.Target_ENVIRONMENT_GROUP: + return target.GetEnvironmentGroup().GetName(), nil + default: + return "", fmt.Errorf("target contains object of unknown type %q", t) + } +} + // loadRuleIncludingSourceFiles loads all rules which include labels in // sourceFileLabels, Returns a map from source file label to the rule which // includes it. From 9fcff2bfcc4872f28833ec772ef082e1dd2a9beb Mon Sep 17 00:00:00 2001 From: radokirov Date: Fri, 25 Jan 2019 17:20:30 -0800 Subject: [PATCH 051/316] Fix error messages text when validating compilerOptions. PiperOrigin-RevId: 230998217 --- internal/tsc_wrapped/compiler_host.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 96eb3d27..04c35fd0 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -29,10 +29,10 @@ export function narrowTsOptions(options: ts.CompilerOptions): BazelTsOptions { throw new Error(`compilerOptions.rootDirs should be set by tsconfig.bzl`); } if (!options.rootDir) { - throw new Error(`compilerOptions.rootDirs should be set by tsconfig.bzl`); + throw new Error(`compilerOptions.rootDir should be set by tsconfig.bzl`); } if (!options.outDir) { - throw new Error(`compilerOptions.rootDirs should be set by tsconfig.bzl`); + throw new Error(`compilerOptions.outDir should be set by tsconfig.bzl`); } return options as BazelTsOptions; } From 42a2f89be5943b16b1c83cb35f8d3a094298b5f6 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Mon, 28 Jan 2019 14:38:32 -0800 Subject: [PATCH 052/316] Support an alternative collection point for test libraries. PiperOrigin-RevId: 231291427 --- ts_auto_deps/main.go | 7 +- ts_auto_deps/updater/test_register.go | 202 ++++++++++++++++++++++++++ ts_auto_deps/updater/updater.go | 163 ++++----------------- 3 files changed, 238 insertions(+), 134 deletions(-) create mode 100644 ts_auto_deps/updater/test_register.go diff --git a/ts_auto_deps/main.go b/ts_auto_deps/main.go index 81542dc2..2d1da26f 100644 --- a/ts_auto_deps/main.go +++ b/ts_auto_deps/main.go @@ -12,8 +12,9 @@ import ( var ( isRoot = flag.Bool("root", false, "the given path is the root of a TypeScript project "+ "(generates ts_config and ts_development_sources targets).") - recursive = flag.Bool("recursive", false, "recursively update all packages under the given root.") - files = flag.Bool("files", false, "treats arguments as file names. Filters .ts files, then runs on their dirnames.") + recursive = flag.Bool("recursive", false, "recursively update all packages under the given root.") + files = flag.Bool("files", false, "treats arguments as file names. Filters .ts files, then runs on their dirnames.") + allowAllTestLibraries = flag.Bool("allow_all_test_libraries", false, "treats testonly ts_libraries named 'all_tests' as an alternative to ts_config/ts_dev_srcs for registering tests") ) func usage() { @@ -58,7 +59,7 @@ func main() { } host := updater.New(false, false, updater.QueryBasedBazelAnalyze, updater.LocalUpdateFile) - if err := updater.Execute(host, paths, *isRoot, *recursive); err != nil { + if err := updater.Execute(host, paths, *isRoot, *recursive, *allowAllTestLibraries); err != nil { platform.Error(err) } } diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go new file mode 100644 index 00000000..794dcecb --- /dev/null +++ b/ts_auto_deps/updater/test_register.go @@ -0,0 +1,202 @@ +package updater + +import ( + "context" + "fmt" + "path/filepath" + + "github.com/bazelbuild/buildtools/build" + "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" +) + +// isAllTestLibrary identifies testonly ts_libraries named "all_tests". Taze +// will register tests with these rules instead of +// ts_config/ts_development_sources rules to allow users to set up their builds +// differently. +func isAllTestLibrary(bld *build.File, r *build.Rule) bool { + if !ruleMatches(bld, r, "ts_library", ruleTypeTest) { + return false + } + + if r.Name() != "all_tests" { + return false + } + + return true +} + +func getAllTestLibraries(bld *build.File) []*build.Rule { + var allTestRules []*build.Rule + for _, r := range buildRules(bld, "ts_library") { + if isAllTestLibrary(bld, r) { + allTestRules = append(allTestRules, r) + } + } + return allTestRules +} + +// RegisterTestRules registers ts_library test targets with the project's +// ts_config and ts_development_sources rules. It may also register the tests +// with a testonly ts_library named "all_tests", which allows users to set up +// their own BUILD layout. It's separated from UpdateBUILD since it's non-local, +// multiple packages may all need to make writes to the same ts_config. +func (upd *Updater) RegisterTestRules(ctx context.Context, allowAllTestLibrary bool, paths ...string) (bool, error) { + reg := &buildRegistry{make(map[string]*build.File), make(map[*build.File]bool)} + var g3root string + for _, path := range paths { + // declare variables manually so that g3root doesn't get overwritten by a := + // declaration + var err error + var buildPath string + g3root, buildPath, err = getBUILDPath(ctx, path) + if err != nil { + return false, err + } + bld, err := reg.readBUILD(ctx, g3root, buildPath) + if err != nil { + return false, err + } + if tr := getRule(bld, "ts_library", ruleTypeTest); tr != nil { + // don't register all_test libraries themselves + if isAllTestLibrary(bld, tr) { + continue + } + platform.Infof("Registering test rule in closest ts_config & ts_development_sources") + target := AbsoluteBazelTarget(bld, tr.Name()) + if err := reg.registerTestRule(ctx, bld, tsConfig, g3root, target); err != nil { + return false, err + } + // NodeJS rules should not be added to ts_development_sources automatically, because + // they typically do not run in the browser. + if tr.AttrString("runtime") != "nodejs" { + if err := reg.registerTestRule(ctx, bld, tsDevSrcs, g3root, target); err != nil { + return false, err + } + } + } + } + + updated := false + for b := range reg.filesToUpdate { + fmt.Printf("Registered test(s) in %s\n", b.Path) + fileChanged, err := upd.maybeWriteBUILD(ctx, filepath.Join(g3root, b.Path), b) + if err != nil { + return false, err + } + updated = updated || fileChanged + } + + return updated, nil +} + +// buildRegistry buffers reads and writes done while registering ts_libraries +// with ts_config and ts_development_sources rules, so that registers from +// multiple packages all get applied at once. +type buildRegistry struct { + bldFiles map[string]*build.File + filesToUpdate map[*build.File]bool +} + +func (reg *buildRegistry) readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build.File, error) { + normalizedG3Path, err := getAbsoluteBUILDPath(workspaceRoot, buildFilePath) + if err != nil { + return nil, err + } + + if bld, ok := reg.bldFiles[normalizedG3Path]; ok { + return bld, nil + } + + bld, err := readBUILD(ctx, workspaceRoot, buildFilePath) + if err != nil { + return nil, err + } + + reg.bldFiles[normalizedG3Path] = bld + + return bld, nil +} + +func (reg *buildRegistry) registerForPossibleUpdate(bld *build.File) { + reg.filesToUpdate[bld] = true +} + +type registerTarget int + +const ( + tsConfig registerTarget = iota + tsDevSrcs +) + +func (rt registerTarget) kind() string { + if rt == tsConfig { + return "ts_config" + } + + return "ts_development_sources" +} + +func (rt registerTarget) ruleType() ruleType { + if rt == tsConfig { + return ruleTypeAny + } + + return ruleTypeTest +} + +// registerTestRule searches ancestor packages for a rule matching the register +// target and adds the given target to it. If an all_tests library is found, the +// rule is registered with it, instead of specified register target. Prints a +// warning if no rule is found, but only returns an error if adding the +// dependency fails. +func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, rt registerTarget, g3root, target string) error { + if buildHasDisableTaze(bld) { + return nil + } + + var ruleToRegister *build.Rule + for _, r := range bld.Rules("") { + if isAllTestLibrary(bld, r) { + if hasDependency(bld, r, target) { + return nil + } + + // an all_tests library takes presidence over a registerTarget, and there + // can only be one, since there can only be one rule with a given name, so + // can just break after finding + ruleToRegister = r + break + } + if ruleMatches(bld, r, rt.kind(), rt.ruleType()) { + if hasDependency(bld, r, target) { + return nil + } + + // keep overwriting ruleToRegister so the last match in the BUILD gets + // used + ruleToRegister = r + } + } + + if ruleToRegister != nil { + addDep(bld, ruleToRegister, target) + reg.registerForPossibleUpdate(bld) + return nil + } + + parentDir := filepath.Dir(filepath.Dir(bld.Path)) + for parentDir != "." && parentDir != "/" { + buildFile := filepath.Join(g3root, parentDir, "BUILD") + if _, err := platform.Stat(ctx, buildFile); err == nil { + parent, err := reg.readBUILD(ctx, g3root, buildFile) + if err != nil { + return err + } + return reg.registerTestRule(ctx, parent, rt, g3root, target) + } + parentDir = filepath.Dir(parentDir) + } + fmt.Printf("WARNING: no %s rule in parent packages of %s to register with.\n", + rt.kind(), target) + return nil +} diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 3f6980bc..a45d04c8 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -477,16 +477,26 @@ func (upd *Updater) maybeWriteBUILD(ctx context.Context, path string, bld *build return true, nil } -func getBUILDPathAndBUILDFile(ctx context.Context, path string) (string, string, *build.File, error) { +func getBUILDPath(ctx context.Context, path string) (string, string, error) { path = strings.TrimSuffix(path, "/BUILD") // Support both package paths and BUILD files if _, err := platform.Stat(ctx, path); os.IsNotExist(err) { - return "", "", nil, err + return "", "", err } buildFilePath := filepath.Join(path, "BUILD") g3root, err := workspace.Root(buildFilePath) + if err != nil { + return "", "", err + } + + return g3root, buildFilePath, nil +} + +func getBUILDPathAndBUILDFile(ctx context.Context, path string) (string, string, *build.File, error) { + g3root, buildFilePath, err := getBUILDPath(ctx, path) if err != nil { return "", "", nil, err } + bld, err := readBUILD(ctx, g3root, buildFilePath) if err != nil { platform.Infof("Error reading building file!") @@ -629,48 +639,6 @@ func (upd *Updater) updateBUILDAfterBazelAnalyze(ctx context.Context, isRoot boo return upd.maybeWriteBUILD(ctx, buildFilePath, bld) } -// RegisterTsconfigAndTsDevelopmentSources registers ts_library targets with the project's -// ts_config and ts_development_sources rules. It's separated from UpdateBUILD since it's -// non-local, multiple packages may all need to make writes to the same ts_config. -func (upd *Updater) RegisterTsconfigAndTsDevelopmentSources(ctx context.Context, paths ...string) (bool, error) { - reg := &buildRegistry{make(map[string]*build.File), make(map[*build.File]bool)} - var g3root string - for _, path := range paths { - var bld *build.File - var err error - g3root, _, bld, err = getBUILDPathAndBUILDFile(ctx, path) - if err != nil { - return false, err - } - if tr := getRule(bld, "ts_library", ruleTypeTest); tr != nil { - platform.Infof("Registering test rule in closest ts_config & ts_development_sources") - target := AbsoluteBazelTarget(bld, tr.Name()) - if err := reg.registerTestRule(ctx, bld, "ts_config", ruleTypeAny, g3root, target); err != nil { - return false, err - } - // NodeJS rules should not be added to ts_development_sources automatically, because - // they typically do not run in the browser. - if tr.AttrString("runtime") != "nodejs" { - if err := reg.registerTestRule(ctx, bld, "ts_development_sources", ruleTypeTest, g3root, target); err != nil { - return false, err - } - } - } - } - - updated := false - for b := range reg.filesToUpdate { - fmt.Printf("Registered test(s) in %s\n", b.Path) - fileChanged, err := upd.maybeWriteBUILD(ctx, filepath.Join(g3root, b.Path), b) - if err != nil { - return false, err - } - updated = updated || fileChanged - } - - return updated, nil -} - // IsTazeDisabledForDir checks if ts_auto_deps is disabled in the BUILD file in the dir, // or if no BUILD file exists, in the closest ancestor BUILD func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { @@ -803,82 +771,6 @@ func QueryBasedBazelAnalyze(buildFilePath string, args []string) ([]byte, []byte return s, nil, err } -// buildRegistry buffers reads and writes done while registering ts_libraries -// with ts_config and ts_development_sources rules, so that registers from -// multiple packages all get applied at once. -type buildRegistry struct { - bldFiles map[string]*build.File - filesToUpdate map[*build.File]bool -} - -func (reg *buildRegistry) readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build.File, error) { - normalizedG3Path, err := getAbsoluteBUILDPath(workspaceRoot, buildFilePath) - if err != nil { - return nil, err - } - - if bld, ok := reg.bldFiles[normalizedG3Path]; ok { - return bld, nil - } - - bld, err := readBUILD(ctx, workspaceRoot, buildFilePath) - if err != nil { - return nil, err - } - - reg.bldFiles[normalizedG3Path] = bld - - return bld, nil -} - -func (reg *buildRegistry) registerForPossibleUpdate(bld *build.File) { - reg.filesToUpdate[bld] = true -} - -// registerTestRule searches ancestor packages for a rule with the given ruleKind and ruleType -// and adds the given target to it. Prints a warning if no rule is found, but only returns an error -// if adding the dependency fails. -func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, ruleKind string, rt ruleType, g3root, target string) error { - // If the target has already been registered in any of the rule with the given ruleKind and ruleType, - // we shouldn't register it again. - if targetRegisteredInRule(bld, ruleKind, rt, target) { - return nil - } - if buildHasDisableTaze(bld) { - return nil - } - r := getRule(bld, ruleKind, rt) - if r != nil { - addDep(bld, r, target) - reg.registerForPossibleUpdate(bld) - return nil - } - parentDir := filepath.Dir(filepath.Dir(bld.Path)) - for parentDir != "." && parentDir != "/" { - buildFile := filepath.Join(g3root, parentDir, "BUILD") - if _, err := platform.Stat(ctx, buildFile); err == nil { - parent, err := reg.readBUILD(ctx, g3root, buildFile) - if err != nil { - return err - } - return reg.registerTestRule(ctx, parent, ruleKind, rt, g3root, target) - } - parentDir = filepath.Dir(parentDir) - } - ruleTypeStr := "" - switch rt { - case ruleTypeRegular: - ruleTypeStr = "testonly=0" - case ruleTypeTest, ruleTypeTestSupport: - ruleTypeStr = "testonly=1" - default: - break - } - fmt.Printf("WARNING: no %s(%s) rule in parent packages of %s to register with.\n", - ruleKind, ruleTypeStr, target) - return nil -} - type ruleType int const ( @@ -888,6 +780,14 @@ const ( ruleTypeTestSupport ) +// isKind returns true if the rule has given kind. It also accepts "ng_modules" +// as "ts_library" kind. +func isKind(r *build.Rule, kind string) bool { + acceptNgModule := kind == "ts_library" + + return r.Kind() == kind || (acceptNgModule && r.Kind() == "ng_module") +} + func buildRules(bld *build.File, kind string) []*build.Rule { // Find all rules, then filter by kind. // This is nearly the same as just calling bld.Rules(kind), but allows to @@ -896,9 +796,8 @@ func buildRules(bld *build.File, kind string) []*build.Rule { // last build rule in the file in case multiple match, regardless of kind. allRules := bld.Rules("") var res []*build.Rule - acceptNgModule := kind == "ts_library" for _, r := range allRules { - if r.Kind() == kind || (acceptNgModule && r.Kind() == "ng_module") { + if isKind(r, kind) { res = append(res, r) } } @@ -1152,8 +1051,11 @@ func getOrCreateRule(bld *build.File, ruleName, ruleKind string, rt ruleType) *b return r } -// ruleMatches return whether a rule matches the specified rt value. -func ruleMatches(bld *build.File, r *build.Rule, rt ruleType) bool { +// ruleMatches return whether a rule matches the specified kind and rt value. +func ruleMatches(bld *build.File, r *build.Rule, kind string, rt ruleType) bool { + if !isKind(r, kind) { + return false + } inTestingDir := determineRuleType(bld.Path, "somefile.ts") == ruleTypeTestSupport hasTestsName := strings.HasSuffix(r.Name(), "_tests") // Accept the rule if it matches the testonly attribute. @@ -1174,9 +1076,8 @@ func ruleMatches(bld *build.File, r *build.Rule, rt ruleType) bool { // targetRegisteredInRule returns whether a target has been registered in a rule that // matches a specified ruleKind and ruleType in current build file func targetRegisteredInRule(bld *build.File, ruleKind string, rt ruleType, target string) bool { - rs := buildRules(bld, ruleKind) - for _, r := range rs { - if ruleMatches(bld, r, rt) && hasDependency(bld, r, target) { + for _, r := range bld.Rules("") { + if ruleMatches(bld, r, ruleKind, rt) && hasDependency(bld, r, target) { return true } } @@ -1186,10 +1087,10 @@ func targetRegisteredInRule(bld *build.File, ruleKind string, rt ruleType, targe // getRule returns the last rule in bld that has the given ruleKind and matches // the specified rt value. func getRule(bld *build.File, ruleKind string, rt ruleType) *build.Rule { - rs := buildRules(bld, ruleKind) + rs := bld.Rules("") for i := len(rs) - 1; i >= 0; i-- { r := rs[i] - if ruleMatches(bld, r, rt) { + if ruleMatches(bld, r, ruleKind, rt) { return r } } @@ -1320,7 +1221,7 @@ func Paths(isRoot bool, files bool, recursive bool) ([]string, error) { } // Execute runs ts_auto_deps on paths using host. -func Execute(host *Updater, paths []string, isRoot bool, recursive bool) error { +func Execute(host *Updater, paths []string, isRoot, recursive, allowAllTestLibraries bool) error { ctx := context.Background() for i, p := range paths { isLastAndRoot := isRoot && i == len(paths)-1 @@ -1339,7 +1240,7 @@ func Execute(host *Updater, paths []string, isRoot bool, recursive bool) error { } } } - host.RegisterTsconfigAndTsDevelopmentSources(ctx, paths...) + host.RegisterTestRules(ctx, allowAllTestLibraries, paths...) return nil } From 29a448b40241074a628617fa1da67c1ce1bb5405 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 29 Jan 2019 13:50:46 -0800 Subject: [PATCH 053/316] Report unused ts_declaration deps as unused instead of ambiguous. PiperOrigin-RevId: 231466548 --- ts_auto_deps/analyze/analyze.go | 4 ---- ts_auto_deps/analyze/analyze_test.go | 4 ++++ ts_auto_deps/analyze/loader.go | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 851509a1..644110a2 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -506,10 +506,6 @@ func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyRepor for label, rule := range labelToRule { if isTazeManagedRuleClass(rule.GetRuleClass()) || isGenerated(rule) { report.UnnecessaryDependency = append(report.UnnecessaryDependency, label) - } else if c := rule.GetRuleClass(); c == "ts_declaration" { - // ts_declarations may be used even if there is no explicit import - // since ambient types can't be detected. - report.AmbiguousDependency = append(report.AmbiguousDependency, label) } } return report, nil diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index 700ea845..3e669ad3 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "reflect" + "sort" "strconv" "strings" "testing" @@ -612,6 +613,9 @@ func TestGetAllLiteralSrcPaths(t *testing.T) { t.Errorf("got err %q, expected %q", err, test.err) } + // getAllLiteralSrcPaths takes a map, so its output ordering isn't + // deterministic + sort.Strings(literalSrcPaths) if diff := pretty.Compare(literalSrcPaths, test.expected); diff != "" { t.Errorf("failed to get correct literal source paths: (-got, +want)\n%s", diff) } diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 51cfd448..cdfee618 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -380,8 +380,7 @@ func dedupeLabels(labels []string) []string { func isTazeManagedRuleClass(class string) bool { for _, c := range []string{ "ts_library", - // TODO(alexeagle): Add ts_declaration once it can be determined - // if they are unused. + "ts_declaration", "ng_module", "js_library", } { From 50837cfe886c6330628f72b33d321fa90b704c1e Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 29 Jan 2019 15:11:24 -0800 Subject: [PATCH 054/316] Add data to karma runfiles Closes #391 PiperOrigin-RevId: 231482078 --- internal/karma/karma_web_test.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/karma/karma_web_test.bzl b/internal/karma/karma_web_test.bzl index f6be58fc..99ea1505 100644 --- a/internal/karma/karma_web_test.bzl +++ b/internal/karma/karma_web_test.bzl @@ -263,6 +263,7 @@ $KARMA ${{ARGV[@]}} runfiles += ctx.files.runtime_deps runfiles += ctx.files.bootstrap runfiles += ctx.files.static_files + runfiles += ctx.files.data return ctx.runfiles( files = runfiles, From 4702c541b8266d9773969134daa0de1b57dcded6 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Tue, 29 Jan 2019 15:52:24 -0800 Subject: [PATCH 055/316] ci: run gazelle and bazel:format --- devserver/concatjs/BUILD.bazel | 2 +- devserver/devserver/BUILD.bazel | 1 - devserver/devserver/test/test-workspace/BUILD.bazel | 1 - devserver/runfiles/BUILD.bazel | 4 ++-- internal/common/compilation.bzl | 1 - internal/common/module_mappings.bzl | 1 - internal/karma/BUILD.bazel | 2 +- ts_auto_deps/updater/BUILD.bazel | 5 ++++- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/devserver/concatjs/BUILD.bazel b/devserver/concatjs/BUILD.bazel index 4606773b..6cc1a741 100644 --- a/devserver/concatjs/BUILD.bazel +++ b/devserver/concatjs/BUILD.bazel @@ -11,4 +11,4 @@ go_test( name = "go_default_test", srcs = ["concatjs_test.go"], embed = [":go_default_library"], -) \ No newline at end of file +) diff --git a/devserver/devserver/BUILD.bazel b/devserver/devserver/BUILD.bazel index a7c27359..4602de94 100644 --- a/devserver/devserver/BUILD.bazel +++ b/devserver/devserver/BUILD.bazel @@ -21,4 +21,3 @@ go_test( ], embed = [":go_default_library"], ) - diff --git a/devserver/devserver/test/test-workspace/BUILD.bazel b/devserver/devserver/test/test-workspace/BUILD.bazel index d2c2e9d6..85d47776 100644 --- a/devserver/devserver/test/test-workspace/BUILD.bazel +++ b/devserver/devserver/test/test-workspace/BUILD.bazel @@ -3,4 +3,3 @@ filegroup( srcs = glob(["**/*"]), visibility = ["//visibility:public"], ) - diff --git a/devserver/runfiles/BUILD.bazel b/devserver/runfiles/BUILD.bazel index 2e0b9b7a..2285f5ba 100644 --- a/devserver/runfiles/BUILD.bazel +++ b/devserver/runfiles/BUILD.bazel @@ -9,9 +9,9 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["runfiles.go"], + importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", + visibility = ["//visibility:public"], deps = [ "@io_bazel_rules_go//go/tools/bazel:go_default_library", ], - importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", - visibility = ["//visibility:public"], ) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 36720443..23e5a59b 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -18,7 +18,6 @@ load(":common/json_marshal.bzl", "json_marshal") load(":common/module_mappings.bzl", "module_mappings_aspect") - _DEBUG = False DEPS_ASPECTS = [ diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index d085d726..a28b3279 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -33,7 +33,6 @@ def _get_deps(attrs, names): # Traverse 'srcs' in addition so that we can go across a genrule _MODULE_MAPPINGS_DEPS_NAMES = ["deps", "srcs", "_helpers"] - _DEBUG = False def debug(msg, values = ()): diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index b2a22bce..dc8a50dd 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -64,8 +64,8 @@ npm_package( "package.json", ], deps = [ - ":check_version_copy", ":bazel_karma", + ":check_version_copy", ":license_copy", ], ) diff --git a/ts_auto_deps/updater/BUILD.bazel b/ts_auto_deps/updater/BUILD.bazel index 53e319c7..ea67ff6e 100644 --- a/ts_auto_deps/updater/BUILD.bazel +++ b/ts_auto_deps/updater/BUILD.bazel @@ -2,7 +2,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", - srcs = ["updater.go"], + srcs = [ + "test_register.go", + "updater.go", + ], importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/updater", visibility = ["//visibility:public"], deps = [ From 1acfe5d8e4d5056a37071dd0343485693020c0e4 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 29 Jan 2019 16:57:18 -0800 Subject: [PATCH 056/316] Formatting cleanup PiperOrigin-RevId: 231501183 --- devserver/concatjs/BUILD.bazel | 2 +- devserver/devserver/BUILD.bazel | 1 + devserver/devserver/test/test-workspace/BUILD.bazel | 1 + devserver/runfiles/BUILD.bazel | 4 ++-- internal/common/compilation.bzl | 1 + internal/common/module_mappings.bzl | 1 + internal/karma/BUILD.bazel | 2 +- 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/devserver/concatjs/BUILD.bazel b/devserver/concatjs/BUILD.bazel index 6cc1a741..4606773b 100644 --- a/devserver/concatjs/BUILD.bazel +++ b/devserver/concatjs/BUILD.bazel @@ -11,4 +11,4 @@ go_test( name = "go_default_test", srcs = ["concatjs_test.go"], embed = [":go_default_library"], -) +) \ No newline at end of file diff --git a/devserver/devserver/BUILD.bazel b/devserver/devserver/BUILD.bazel index 4602de94..a7c27359 100644 --- a/devserver/devserver/BUILD.bazel +++ b/devserver/devserver/BUILD.bazel @@ -21,3 +21,4 @@ go_test( ], embed = [":go_default_library"], ) + diff --git a/devserver/devserver/test/test-workspace/BUILD.bazel b/devserver/devserver/test/test-workspace/BUILD.bazel index 85d47776..d2c2e9d6 100644 --- a/devserver/devserver/test/test-workspace/BUILD.bazel +++ b/devserver/devserver/test/test-workspace/BUILD.bazel @@ -3,3 +3,4 @@ filegroup( srcs = glob(["**/*"]), visibility = ["//visibility:public"], ) + diff --git a/devserver/runfiles/BUILD.bazel b/devserver/runfiles/BUILD.bazel index 2285f5ba..2e0b9b7a 100644 --- a/devserver/runfiles/BUILD.bazel +++ b/devserver/runfiles/BUILD.bazel @@ -9,9 +9,9 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["runfiles.go"], - importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", - visibility = ["//visibility:public"], deps = [ "@io_bazel_rules_go//go/tools/bazel:go_default_library", ], + importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", + visibility = ["//visibility:public"], ) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 23e5a59b..36720443 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -18,6 +18,7 @@ load(":common/json_marshal.bzl", "json_marshal") load(":common/module_mappings.bzl", "module_mappings_aspect") + _DEBUG = False DEPS_ASPECTS = [ diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index a28b3279..d085d726 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -33,6 +33,7 @@ def _get_deps(attrs, names): # Traverse 'srcs' in addition so that we can go across a genrule _MODULE_MAPPINGS_DEPS_NAMES = ["deps", "srcs", "_helpers"] + _DEBUG = False def debug(msg, values = ()): diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index dc8a50dd..b2a22bce 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -64,8 +64,8 @@ npm_package( "package.json", ], deps = [ - ":bazel_karma", ":check_version_copy", + ":bazel_karma", ":license_copy", ], ) From 03372d8be06e857076f244c1a7c0a22e4cb9b484 Mon Sep 17 00:00:00 2001 From: radokirov Date: Tue, 29 Jan 2019 17:20:46 -0800 Subject: [PATCH 057/316] Remove local override of protobuf JS option - convertFieldsToCamelCase. PiperOrigin-RevId: 231505010 --- internal/tsc_wrapped/worker.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 287486d0..4a102cc0 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -4,8 +4,6 @@ const protobufjs = require('protobufjs'); // tslint:disable-next-line:variable-name: ByteBuffer is instantiatable. const ByteBuffer = require('bytebuffer'); -protobufjs.convertFieldsToCamelCase = true; - export const DEBUG = false; export function debug(...args: Array<{}>) { From 169a2788af264536e1efe45e58a206a1058a689d Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 30 Jan 2019 12:33:11 -0800 Subject: [PATCH 058/316] Update to rules_nodejs 0.16.6, rules_webtesting 0.3.0 and Bazel 0.22.0 Closes #394 PiperOrigin-RevId: 231647001 --- .circleci/config.yml | 50 +++++++------------ devserver/concatjs/BUILD.bazel | 2 +- devserver/devserver/BUILD.bazel | 1 - .../devserver/test/test-workspace/BUILD.bazel | 1 - devserver/runfiles/BUILD.bazel | 4 +- internal/e2e/default_tsconfig_test.js | 2 - internal/karma/BUILD.bazel | 2 +- package.bzl | 19 ++++--- package.json | 3 +- yarn.lock | 24 +++++++++ 10 files changed, 58 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2cb0bb6..eb5c2558 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,22 +9,13 @@ ## IMPORTANT # If you change the `docker_image` version, also change the `cache_key` suffix -var_1: &docker_image angular/ngcontainer:0.7.0 -var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-0.7.0 +var_1: &docker_image circleci/node:10.12-browsers +var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-internal/karma:{{ checksum "internal/karma/yarn.lock" }}-node:10.12-browsers var_3: &setup-bazel-remote-cache run: name: Start up bazel remote cache proxy command: ~/bazel-remote-proxy -backend circleci:// background: true -# Move node binaries out of the way to enforce that Bazel uses -# only the hermetic ones it downloads -var_4: &hide_node_and_yarn_local_binaries - run: - name: Move node, npm, and yarn binaries - command: | - sudo mv /usr/local/bin/node /usr/local/bin/node_ - sudo mv /usr/local/bin/npm /usr/local/bin/npm_ - sudo mv /usr/local/bin/yarn /usr/local/bin/yarn_ # Settings common to each job anchor_1: &job_defaults @@ -49,14 +40,14 @@ jobs: - run: .circleci/setup_cache.sh - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - *setup-bazel-remote-cache - - *hide_node_and_yarn_local_binaries - - restore_cache: key: *cache_key - - run: bazel info release - - run: bazel build ... - - run: bazel test ... - - run: bazel build @disable_tsetse_for_external_test//... + + - run: yarn install + - run: yarn bazel info release + - run: yarn bazel build ... + - run: yarn bazel test ... + - run: yarn bazel build @disable_tsetse_for_external_test//... # This job tests the same stuff, but without the .bazelrc file. # It disables worker mode, for example. @@ -68,17 +59,17 @@ jobs: - run: .circleci/setup_cache.sh - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - *setup-bazel-remote-cache - - *hide_node_and_yarn_local_binaries - - restore_cache: key: *cache_key - - run: bazel --bazelrc=/dev/null info release + + - run: yarn install + - run: yarn bazel --bazelrc=/dev/null info release # We cherry pick the memory utilization options from .circleci/bazel.rc here. # Since the default CircleCI container has only 4G, limiting the memory # is required to keep Bazel from exhausting the memory. - - run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0 - - run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0 - - run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build @disable_tsetse_for_external_test//... --local_resources=2560,1.0,1.0 + - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0 + - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0 + - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build @disable_tsetse_for_external_test//... --local_resources=2560,1.0,1.0 - save_cache: key: *cache_key @@ -95,17 +86,14 @@ jobs: - run: .circleci/setup_cache.sh - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - *setup-bazel-remote-cache - - *hide_node_and_yarn_local_binaries - restore_cache: key: *cache_key + + - run: yarn install # Build the npm packages which are used in the e2e tests - - run: bazel build //internal:npm_package - - run: bazel build //internal/karma:npm_package - # Run yarn as e2e tests depend on self managed node_modules - - run: bazel run @nodejs//:bin/yarn - # Don't occupy the bazel server, as this test wants to run Bazel itself - - run: bazel run @nodejs//:bin/yarn e2e --script_path=yarn_e2e.sh - - run: xvfb-run -a ./yarn_e2e.sh + - run: yarn bazel build //internal:npm_package + - run: yarn bazel build //internal/karma:npm_package + - run: xvfb-run -a yarn e2e lint: <<: *job_defaults diff --git a/devserver/concatjs/BUILD.bazel b/devserver/concatjs/BUILD.bazel index 4606773b..6cc1a741 100644 --- a/devserver/concatjs/BUILD.bazel +++ b/devserver/concatjs/BUILD.bazel @@ -11,4 +11,4 @@ go_test( name = "go_default_test", srcs = ["concatjs_test.go"], embed = [":go_default_library"], -) \ No newline at end of file +) diff --git a/devserver/devserver/BUILD.bazel b/devserver/devserver/BUILD.bazel index a7c27359..4602de94 100644 --- a/devserver/devserver/BUILD.bazel +++ b/devserver/devserver/BUILD.bazel @@ -21,4 +21,3 @@ go_test( ], embed = [":go_default_library"], ) - diff --git a/devserver/devserver/test/test-workspace/BUILD.bazel b/devserver/devserver/test/test-workspace/BUILD.bazel index d2c2e9d6..85d47776 100644 --- a/devserver/devserver/test/test-workspace/BUILD.bazel +++ b/devserver/devserver/test/test-workspace/BUILD.bazel @@ -3,4 +3,3 @@ filegroup( srcs = glob(["**/*"]), visibility = ["//visibility:public"], ) - diff --git a/devserver/runfiles/BUILD.bazel b/devserver/runfiles/BUILD.bazel index 2e0b9b7a..2285f5ba 100644 --- a/devserver/runfiles/BUILD.bazel +++ b/devserver/runfiles/BUILD.bazel @@ -9,9 +9,9 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = ["runfiles.go"], + importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", + visibility = ["//visibility:public"], deps = [ "@io_bazel_rules_go//go/tools/bazel:go_default_library", ], - importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles", - visibility = ["//visibility:public"], ) diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index 2df18270..b0792718 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -28,8 +28,6 @@ local_repository( ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") -rules_nodejs_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories() yarn_install( diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index b2a22bce..dc8a50dd 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -64,8 +64,8 @@ npm_package( "package.json", ], deps = [ - ":check_version_copy", ":bazel_karma", + ":check_version_copy", ":license_copy", ], ) diff --git a/package.bzl b/package.bzl index 5e1e5b0f..f0d3b321 100644 --- a/package.bzl +++ b/package.bzl @@ -38,17 +38,16 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.4.zip"], - strip_prefix = "rules_nodejs-0.16.4", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.6.zip"], + strip_prefix = "rules_nodejs-0.16.6", ) # ts_web_test depends on the web testing rules to provision browsers. _maybe( http_archive, name = "io_bazel_rules_webtesting", - urls = ["https://github.com/bazelbuild/rules_webtesting/archive/111d792b9a5b17f87b6e177e274dbbee46094791.zip"], - strip_prefix = "rules_webtesting-111d792b9a5b17f87b6e177e274dbbee46094791", - sha256 = "a13af63e928c34eff428d47d31bafeec4e38ee9b6940e70bf2c9cd47184c5c16", + urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.0/rules_webtesting.tar.gz"], + sha256 = "1c0900547bdbe33d22aa258637dc560ce6042230e41e9ea9dad5d7d2fca8bc42", ) # ts_devserver depends on the Go rules. @@ -81,11 +80,11 @@ def rules_typescript_dependencies(): sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79", ) - ############################################### - # Repeat the dependencies of rules_nodejs here! - # We can't load() from rules_nodejs yet, because we've only just fetched it. - # But we also don't want to make users load and call the rules_nodejs_dependencies - # function because we can do that for them, mostly hiding the transitive dependency. + # io_bazel_rules_webtesting depends on bazel_skylib. It is installed by + # web_test_repositories() but we depend on it here in case users don't call + # web_test_repositories(). This will get cleaned up by https://github.com/bazelbuild/rules_typescript/pull/374 + # which introduces build_bazel_rules_karma with its own defs.bzl file + # that will allow this dep to be removed from rules_typescript_dependencies() _maybe( http_archive, name = "bazel_skylib", diff --git a/package.json b/package.json index 724a1f27..c117f154 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,9 @@ "tsutils": "2.27.2" }, "devDependencies": { - "@bazel/ibazel": "^0.2.0", + "@bazel/bazel": "~0.22.0", "@bazel/buildifier": "^0.20.0", + "@bazel/ibazel": "^0.2.0", "@bazel/typescript": "0.19.1", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index c6df00c1..db0c286b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,30 @@ # yarn lockfile v1 +"@bazel/bazel-darwin_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.22.0.tgz#a2bea5922dba9a32554a218ba4849a200115b248" + integrity sha512-LFxkyQgPATeB64z/1IvOWZhK+lc3JVHejbmdo96qB4lsoD8zselvOlgHvVXxlAjRxVZ9mlmXDvDRDyaXyyRdwA== + +"@bazel/bazel-linux_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.22.0.tgz#12e5884f2a7b7f3b62afbef9f8da4de0976f3bc8" + integrity sha512-xDs8cb2bbGZ9uvzYZOzCVrMBywzRhLj0J/t+py+FYZj+VO5B3wVg9eUf6nWWR0oJ2mzvToI9h31t2tNdqwy2kQ== + +"@bazel/bazel-win32_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.22.0.tgz#a8a65986639583a8cc7b018e001aedfdafe41b50" + integrity sha512-FbJaXVDoCLnpIFLnPHFkQdfriYPXfnfQNuf9EXMliERdRuoeBVbwEZfwcuArxZWNFus7bD8QiTj0XzKVWO+Wbw== + +"@bazel/bazel@~0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.22.0.tgz#feb0f2d82f9d169cb47951d95d55e512eda72bc9" + integrity sha512-uaXZsfCXOASBXzmge56akRIhJnKYdShn1X3AdEBzq2NNCf2llkc1H25gKGm4BfuWDBXRbXDMmcXup+fw39h+WQ== + optionalDependencies: + "@bazel/bazel-darwin_x64" "0.22.0" + "@bazel/bazel-linux_x64" "0.22.0" + "@bazel/bazel-win32_x64" "0.22.0" + "@bazel/buildifier-darwin_x64@0.20.0": version "0.20.0" resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.20.0.tgz#1aeceb5a1a57a62eef6415377dbe95091781a7d4" From 9824e493fe5b6924fc80754455bd1e89695ec330 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 30 Jan 2019 16:43:12 -0800 Subject: [PATCH 059/316] Improve handling of generated source files. Previously, the query-based analyzer looked for the dep providing a generated source file by walking up the graph of generating rules, which relied on generated files only happening in macros and the ts_library in the macro sharing a label with the macro. Instead, generated sources should be handled like any other source - the analyzer should look for the generated file (or the generating rule) in the srcs attribute of some other rule. PiperOrigin-RevId: 231693464 --- ts_auto_deps/analyze/loader.go | 59 +++++++++++++++------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index cdfee618..ab82fcea 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -167,7 +167,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg if err != nil { return nil, err } - var sourceFileLabels, generators []string + var fileLabels, generators []string generatorsToFiles := make(map[string][]*appb.GeneratedFile) for _, target := range r.GetTarget() { label, err := q.fileLabel(target) @@ -179,40 +179,21 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg file := target.GetGeneratedFile() generator := file.GetGeneratingRule() + // a generated file can be included as a source by referencing the label + // of the generated file, or the label of the generating rule, so check + // for both + fileLabels = append(fileLabels, file.GetName()) generators = append(generators, generator) generatorsToFiles[generator] = append(generatorsToFiles[generator], file) case appb.Target_SOURCE_FILE: - sourceFileLabels = append(sourceFileLabels, label) + fileLabels = append(fileLabels, label) } } labelToRule := make(map[string]*appb.Rule) - for len(generators) > 0 { - generatorToRule, err := q.LoadRules(currentPkg, generators) - if err != nil { - return nil, err - } - var newGenerators []string - for label, rule := range generatorToRule { - _, _, target := edit.ParseLabel(label) - - if generator := stringAttribute(rule, "generator_name"); generator != "" && generator != target { - // Located rule is also a generated rule. Look for the rule - // that generates it. - _, pkg, _ := edit.ParseLabel(label) - newLabel := "//" + pkg + ":" + generator - newGenerators = append(newGenerators, newLabel) - generatorsToFiles[newLabel] = generatorsToFiles[label] - } else { - for _, generated := range generatorsToFiles[label] { - labelToRule[generated.GetName()] = rule - } - } - } - generators = newGenerators - } - sourceLabelToRule, err := q.loadRulesIncludingSourceFiles(workspaceRoot, sourceFileLabels) + // load all the rules with file srcs (either literal or generated) + sourceLabelToRule, err := q.loadRulesWithSources(workspaceRoot, fileLabels) if err != nil { return nil, err } @@ -220,6 +201,17 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg labelToRule[label] = rule } + // load all the rules with generator rule srcs + generatorLabelToRule, err := q.loadRulesWithSources(workspaceRoot, generators) + if err != nil { + return nil, err + } + for label, rule := range generatorLabelToRule { + for _, generated := range generatorsToFiles[label] { + labelToRule[generated.GetName()] = rule + } + } + for label, rule := range labelToRule { _, pkg, file := edit.ParseLabel(label) // Trim "/index" suffixes that were added to path in the queries above. @@ -279,13 +271,14 @@ func (q *QueryBasedTargetLoader) targetLabel(target *appb.Target) (string, error } } -// loadRuleIncludingSourceFiles loads all rules which include labels in -// sourceFileLabels, Returns a map from source file label to the rule which -// includes it. -func (q *QueryBasedTargetLoader) loadRulesIncludingSourceFiles(workspaceRoot string, sourceFileLabels []string) (map[string]*appb.Rule, error) { +// loadRulesWithSources loads all rules which include the labels in sources as +// srcs attributes. Returns a map from source label to the rule which includes +// it. A source label can be the label of a source file or a generated file or +// a generating rule. +func (q *QueryBasedTargetLoader) loadRulesWithSources(workspaceRoot string, sources []string) (map[string]*appb.Rule, error) { pkgToLabels := make(map[string][]string) - queries := make([]string, 0, len(sourceFileLabels)) - for _, label := range sourceFileLabels { + queries := make([]string, 0, len(sources)) + for _, label := range sources { _, pkg, file := edit.ParseLabel(label) pkgToLabels[pkg] = append(pkgToLabels[pkg], label) // Query for all targets in the package which use file. From 6afbb35611c0cb59a05c9f127c382b34ee5927d6 Mon Sep 17 00:00:00 2001 From: vikerman Date: Wed, 30 Jan 2019 22:55:29 -0800 Subject: [PATCH 060/316] fix: fix formatting of Karma stack traces Make the paths(with and without sourcemaps) relative to the project root so that the file locations are linkified in editors like VS Code. Tested in angular/angular using VS Code. Closes #369 PiperOrigin-RevId: 231730383 --- .bazelignore | 1 + .../e2e/package_karma_stack_trace/.bazelrc | 6 + .../e2e/package_karma_stack_trace/BUILD.bazel | 52 + .../e2e/package_karma_stack_trace/WORKSPACE | 57 + .../package_karma_stack_trace/failing.spec.ts | 9 + .../package_karma_stack_trace/package.json | 8 + .../test_folder/BUILD.bazel | 35 + .../test_folder/hello.ts | 7 + .../test_folder/test.spec.ts | 11 + .../test_sourcemap.sh | 25 + .../package_karma_stack_trace/tsconfig.json | 0 .../e2e/package_karma_stack_trace/yarn.lock | 2305 +++++++++++++++++ internal/karma/index.ts | 8 +- internal/karma/karma.conf.js | 26 + package.json | 3 +- 15 files changed, 2548 insertions(+), 5 deletions(-) create mode 100644 internal/e2e/package_karma_stack_trace/.bazelrc create mode 100644 internal/e2e/package_karma_stack_trace/BUILD.bazel create mode 100644 internal/e2e/package_karma_stack_trace/WORKSPACE create mode 100644 internal/e2e/package_karma_stack_trace/failing.spec.ts create mode 100644 internal/e2e/package_karma_stack_trace/package.json create mode 100644 internal/e2e/package_karma_stack_trace/test_folder/BUILD.bazel create mode 100644 internal/e2e/package_karma_stack_trace/test_folder/hello.ts create mode 100644 internal/e2e/package_karma_stack_trace/test_folder/test.spec.ts create mode 100755 internal/e2e/package_karma_stack_trace/test_sourcemap.sh create mode 100644 internal/e2e/package_karma_stack_trace/tsconfig.json create mode 100644 internal/e2e/package_karma_stack_trace/yarn.lock diff --git a/.bazelignore b/.bazelignore index d4962ded..adba1fb2 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,6 +1,7 @@ node_modules internal/e2e/ts_auto_deps internal/e2e/package_karma +internal/e2e/package_karma_stack_trace internal/e2e/package_typescript_2.7 internal/e2e/package_typescript_2.8 internal/e2e/package_typescript_2.9 diff --git a/internal/e2e/package_karma_stack_trace/.bazelrc b/internal/e2e/package_karma_stack_trace/.bazelrc new file mode 100644 index 00000000..178af0a3 --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/.bazelrc @@ -0,0 +1,6 @@ +# Don't create symlinks like bazel-out in the project. +# These cause VSCode to traverse a massive tree, opening file handles and +# eventually a surprising failure with auto-discovery of the C++ toolchain in +# MacOS High Sierra. +# See https://github.com/bazelbuild/bazel/issues/4603 +build --symlink_prefix=/ diff --git a/internal/e2e/package_karma_stack_trace/BUILD.bazel b/internal/e2e/package_karma_stack_trace/BUILD.bazel new file mode 100644 index 00000000..fbd169e9 --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/BUILD.bazel @@ -0,0 +1,52 @@ +# Copyright 2019 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test_suite") + +package(default_visibility = ["//visibility:public"]) + +exports_files(["tsconfig.json"]) + +ts_library( + name = "test_lib", + testonly = True, + srcs = glob(["*.spec.ts"]), + deps = [ + "@npm//@types/jasmine", + ], +) + +# This is a test with failing test. This test is not directly run by CI. +# The sh_test below invokes this test and checks the source mapped lines in the +# stack trace. +ts_web_test_suite( + name = "karma_test", + browsers = [ + "@io_bazel_rules_webtesting//browsers:chromium-local", + ], + tags = ["manual"], # not run by CI + deps = [ + ":test_lib", + "//test_folder:test_lib", + ], +) + +sh_test( + name = "test_sourcemap", + srcs = ["test_sourcemap.sh"], + data = [ + ":karma_test", + "@bazel_tools//tools/bash/runfiles", + ], +) diff --git a/internal/e2e/package_karma_stack_trace/WORKSPACE b/internal/e2e/package_karma_stack_trace/WORKSPACE new file mode 100644 index 00000000..aa0c58bf --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/WORKSPACE @@ -0,0 +1,57 @@ +# Copyright 2019 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "package_karma_stack_trace") + +local_repository( + name = "build_bazel_rules_typescript", + path = "../../..", +) + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + +rules_nodejs_dependencies() + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories(preserve_symlinks = True) + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") + +go_rules_dependencies() + +go_register_toolchains() + +load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") + +web_test_repositories() + +browser_repositories( + chromium = True, + firefox = True, +) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/package_karma_stack_trace/failing.spec.ts b/internal/e2e/package_karma_stack_trace/failing.spec.ts new file mode 100644 index 00000000..5b77ed5b --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/failing.spec.ts @@ -0,0 +1,9 @@ +// This dummy export ensures that this file is compiled as a module instead +// of a script. +export {}; + +describe('stack trace', () => { + it('failing test', () => { + expect(true).toBe(false); + }); +}); diff --git a/internal/e2e/package_karma_stack_trace/package.json b/internal/e2e/package_karma_stack_trace/package.json new file mode 100644 index 00000000..87f725b9 --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@bazel/karma": "file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package", + "@types/jasmine": "2.8.2", + "typescript": "3.1.x" + } +} diff --git a/internal/e2e/package_karma_stack_trace/test_folder/BUILD.bazel b/internal/e2e/package_karma_stack_trace/test_folder/BUILD.bazel new file mode 100644 index 00000000..6ffe7a79 --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/test_folder/BUILD.bazel @@ -0,0 +1,35 @@ +# Copyright 2019 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") + +package(default_visibility = ["//visibility:public"]) + +ts_library( + name = "hello", + srcs = glob( + ["*.ts"], + exclude = ["*.spec.ts"], + ), +) + +ts_library( + name = "test_lib", + testonly = True, + srcs = glob(["*.spec.ts"]), + deps = [ + ":hello", + "@npm//@types/jasmine", + ], +) diff --git a/internal/e2e/package_karma_stack_trace/test_folder/hello.ts b/internal/e2e/package_karma_stack_trace/test_folder/hello.ts new file mode 100644 index 00000000..72c2d1f9 --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/test_folder/hello.ts @@ -0,0 +1,7 @@ +export function sayHello() { + return 'Hello'; +} + +export function error() { + throw new Error('Error here'); +} \ No newline at end of file diff --git a/internal/e2e/package_karma_stack_trace/test_folder/test.spec.ts b/internal/e2e/package_karma_stack_trace/test_folder/test.spec.ts new file mode 100644 index 00000000..5ff40341 --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/test_folder/test.spec.ts @@ -0,0 +1,11 @@ +import { sayHello, error } from "./hello"; + +describe('multiple stack frames', () => { + it('failing test', () => { + expect(sayHello()).toBe('World'); + }); + + it('another failing test', () => { + expect(error()).toBe(null); + }); +}); diff --git a/internal/e2e/package_karma_stack_trace/test_sourcemap.sh b/internal/e2e/package_karma_stack_trace/test_sourcemap.sh new file mode 100755 index 00000000..0d85f8ec --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/test_sourcemap.sh @@ -0,0 +1,25 @@ +# Execute first test. +OUTPUT=$(${RUNFILES_DIR}/package_karma_stack_trace/karma_test_chromium-local) + +# Test whether the package relative TS path is printed in stack trace. +echo ${OUTPUT} | grep -q "(failing.spec.ts:7:17" +if [[ "$?" != "0" ]]; then + echo "Did not find 'failing.spec.ts:7:17' in Karma stack trace" + exit 1 +fi + +# Test whether the package relative path inside a subdirectory is printed. +echo ${OUTPUT} | grep -q "(test_folder/test.spec.ts:5:23" +if [[ "$?" != "0" ]]; then + echo "Did not find 'test_folder/test.spec.ts:5:23' in Karma stack trace" + exit 1 +fi + +# Test whether stack trace with multiple stack frames mapped get printed. +echo ${OUTPUT} | grep -q "(test_folder/hello.ts:6:8" +if [[ "$?" != "0" ]]; then + echo "Did not find 'test_folder/hello.ts:6:8' in Karma stack trace" + exit 1 +fi + +exit 0 diff --git a/internal/e2e/package_karma_stack_trace/tsconfig.json b/internal/e2e/package_karma_stack_trace/tsconfig.json new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_karma_stack_trace/yarn.lock b/internal/e2e/package_karma_stack_trace/yarn.lock new file mode 100644 index 00000000..24ba869e --- /dev/null +++ b/internal/e2e/package_karma_stack_trace/yarn.lock @@ -0,0 +1,2305 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@bazel/karma@file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package": + version "0.22.1-10-g1bac7de" + dependencies: + jasmine-core "2.8.0" + karma "^4.0.0" + karma-chrome-launcher "2.2.0" + karma-firefox-launcher "1.1.0" + karma-jasmine "1.1.1" + karma-requirejs "1.1.0" + karma-sauce-launcher "2.0.2" + karma-sourcemap-loader "0.3.7" + requirejs "2.3.5" + semver "5.6.0" + tmp "0.0.33" + +"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": + version "0.22.1-10-g63696af" + dependencies: + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +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== + +accepts@~1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" + integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= + dependencies: + mime-types "~2.1.18" + negotiator "0.6.1" + +adm-zip@~0.4.3: + version "0.4.13" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" + integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== + +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" + integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= + +agent-base@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== + dependencies: + es6-promisify "^5.0.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-slice@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" + integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" + integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + integrity sha1-GdOGodntxufByF04iu28xW0zYC0= + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +async@^2.1.2: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== + dependencies: + lodash "^4.17.10" + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +backo2@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-arraybuffer@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" + integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= + +base64id@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" + integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +better-assert@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" + integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= + dependencies: + callsite "1.0.0" + +binary-extensions@^1.0.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" + integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== + +blob@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" + integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== + +bluebird@^3.3.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" + integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== + +body-parser@^1.16.1: + version "1.18.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" + integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "~1.6.3" + iconv-lite "0.4.23" + on-finished "~2.3.0" + qs "6.5.2" + raw-body "2.3.3" + type-is "~1.6.16" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^0.1.2: + version "0.1.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" + integrity sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY= + dependencies: + expand-range "^0.1.0" + +braces@^2.3.0, braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsite@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +chokidar@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.5" + optionalDependencies: + fsevents "^1.2.2" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +circular-json@^0.5.5: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +colors@^1.1.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" + integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +combine-lists@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" + integrity sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y= + dependencies: + lodash "^4.5.0" + +component-bind@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" + integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= + +component-emitter@1.2.1, component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +component-inherit@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" + integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +connect@^3.6.0: + version "3.6.6" + resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" + integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= + dependencies: + debug "2.6.9" + finalhandler "1.1.0" + parseurl "~1.3.2" + utils-merge "1.0.1" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.2.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" + integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== + +core-js@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" + integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +custom-event@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" + integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= + +date-format@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" + integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= + +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@=3.1.0, debug@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +di@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" + integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + +dom-serialize@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" + integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= + dependencies: + custom-event "~1.0.0" + ent "~2.2.0" + extend "^3.0.0" + void-elements "^2.0.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +encodeurl@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +engine.io-client@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" + integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== + dependencies: + component-emitter "1.2.1" + component-inherit "0.0.3" + debug "~3.1.0" + engine.io-parser "~2.1.1" + has-cors "1.1.0" + indexof "0.0.1" + parseqs "0.0.5" + parseuri "0.0.5" + ws "~3.3.1" + xmlhttprequest-ssl "~1.5.4" + yeast "0.1.2" + +engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" + integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== + dependencies: + after "0.8.2" + arraybuffer.slice "~0.0.7" + base64-arraybuffer "0.1.5" + blob "0.0.5" + has-binary2 "~1.0.2" + +engine.io@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" + integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== + dependencies: + accepts "~1.3.4" + base64id "1.0.0" + cookie "0.3.1" + debug "~3.1.0" + engine.io-parser "~2.1.0" + ws "~3.3.1" + +ent@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" + integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= + +es6-promise@^4.0.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== + +es6-promise@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" + integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +eventemitter3@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" + integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== + +expand-braces@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" + integrity sha1-SIsdHSRRyz06axks/AMPRMWFX+o= + dependencies: + array-slice "^0.2.3" + array-unique "^0.2.1" + braces "^0.1.2" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" + integrity sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ= + dependencies: + is-number "^0.1.1" + repeat-string "^0.2.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +finalhandler@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" + integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= + dependencies: + debug "2.6.9" + encodeurl "~1.0.1" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.2" + statuses "~1.3.1" + unpipe "~1.0.0" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +follow-redirects@^1.0.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" + integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== + dependencies: + debug "=3.1.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-access@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" + integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= + dependencies: + null-check "^1.0.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.2: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@^7.0.5, glob@^7.1.1, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +has-binary2@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" + integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== + dependencies: + isarray "2.0.1" + +has-cors@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" + integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= + +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= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +http-errors@1.6.3, http-errors@~1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-proxy@^1.13.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" + integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== + dependencies: + eventemitter3 "^3.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +iconv-lite@0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.4.4: + 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-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= + dependencies: + is-extglob "^2.1.1" + +is-number@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" + integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= + +isbinaryfile@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" + integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== + dependencies: + buffer-alloc "^1.2.0" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +jasmine-core@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jszip@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" + integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== + dependencies: + core-js "~2.3.0" + es6-promise "~3.0.2" + lie "~3.1.0" + pako "~1.0.2" + readable-stream "~2.0.6" + +karma-chrome-launcher@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" + integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== + dependencies: + fs-access "^1.0.0" + which "^1.2.1" + +karma-firefox-launcher@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" + integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== + +karma-jasmine@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" + integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= + +karma-requirejs@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" + integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= + +karma-sauce-launcher@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" + integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== + dependencies: + sauce-connect-launcher "^1.2.4" + saucelabs "^1.5.0" + selenium-webdriver "^4.0.0-alpha.1" + +karma-sourcemap-loader@0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" + integrity sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg= + dependencies: + graceful-fs "^4.1.2" + +karma@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" + integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== + dependencies: + bluebird "^3.3.0" + body-parser "^1.16.1" + chokidar "^2.0.3" + colors "^1.1.0" + combine-lists "^1.0.0" + connect "^3.6.0" + core-js "^2.2.0" + di "^0.0.1" + dom-serialize "^2.2.0" + expand-braces "^0.1.1" + flatted "^2.0.0" + glob "^7.1.1" + graceful-fs "^4.1.2" + http-proxy "^1.13.0" + isbinaryfile "^3.0.0" + lodash "^4.17.5" + log4js "^3.0.0" + mime "^2.3.1" + minimatch "^3.0.2" + optimist "^0.6.1" + qjobs "^1.1.4" + range-parser "^1.2.0" + rimraf "^2.6.0" + safe-buffer "^5.0.1" + socket.io "2.1.1" + source-map "^0.6.1" + tmp "0.0.33" + useragent "2.3.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +lie@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= + dependencies: + immediate "~3.0.5" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + +lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log4js@^3.0.0: + version "3.0.6" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" + integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== + dependencies: + circular-json "^0.5.5" + date-format "^1.2.0" + debug "^3.1.0" + rfdc "^1.1.2" + streamroller "0.7.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +lru-cache@4.1.x: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== + +mime-types@~2.1.18: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== + dependencies: + mime-db "~1.37.0" + +mime@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +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== + +nan@^2.9.2: + version "2.12.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" + integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +needle@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== + +npm-packlist@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" + integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +null-check@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" + integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +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= + +object-component@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" + integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +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-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, 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= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +pako@~1.0.2: + version "1.0.8" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" + integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== + +parseqs@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" + integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= + dependencies: + better-assert "~1.0.0" + +parseuri@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" + integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= + dependencies: + better-assert "~1.0.0" + +parseurl@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +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= + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= + +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== + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +qjobs@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" + integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== + +qs@6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +range-parser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= + +raw-body@2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" + integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== + dependencies: + bytes "3.0.0" + http-errors "1.6.3" + iconv-lite "0.4.23" + unpipe "1.0.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" + integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +requirejs@2.3.5: + version "2.3.5" + resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" + integrity sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rfdc@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" + integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== + +rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: + 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" + +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== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sauce-connect-launcher@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" + integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== + dependencies: + adm-zip "~0.4.3" + async "^2.1.2" + https-proxy-agent "^2.2.1" + lodash "^4.16.6" + rimraf "^2.5.4" + +saucelabs@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" + integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== + dependencies: + https-proxy-agent "^2.2.1" + +sax@>=0.6.0, sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +selenium-webdriver@^4.0.0-alpha.1: + version "4.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" + integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + +semver@5.6.0, semver@^5.3.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +socket.io-adapter@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" + integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= + +socket.io-client@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" + integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== + dependencies: + backo2 "1.0.2" + base64-arraybuffer "0.1.5" + component-bind "1.0.0" + component-emitter "1.2.1" + debug "~3.1.0" + engine.io-client "~3.2.0" + has-binary2 "~1.0.2" + has-cors "1.1.0" + indexof "0.0.1" + object-component "0.0.3" + parseqs "0.0.5" + parseuri "0.0.5" + socket.io-parser "~3.2.0" + to-array "0.1.4" + +socket.io-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" + integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== + dependencies: + component-emitter "1.2.1" + debug "~3.1.0" + isarray "2.0.1" + +socket.io@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" + integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== + dependencies: + debug "~3.1.0" + engine.io "~3.2.0" + has-binary2 "~1.0.2" + socket.io-adapter "~1.1.0" + socket.io-client "2.1.1" + socket.io-parser "~3.2.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +statuses@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= + +streamroller@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" + integrity sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ== + dependencies: + date-format "^1.2.0" + debug "^3.1.0" + mkdirp "^0.5.1" + readable-stream "^2.3.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-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= + +tar@^4: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +tmp@0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + dependencies: + os-tmpdir "~1.0.1" + +tmp@0.0.33, tmp@0.0.x: + 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" + +to-array@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" + integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +type-is@~1.6.16: + version "1.6.16" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" + integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.18" + +typescript@3.1.x: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== + +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +useragent@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" + integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== + dependencies: + lru-cache "4.1.x" + tmp "0.0.x" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +void-elements@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" + integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= + +which@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +ws@~3.3.1: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +xml2js@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= + +xmlhttprequest-ssl@~1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" + integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" + +yeast@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" + integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= diff --git a/internal/karma/index.ts b/internal/karma/index.ts index ad02ec93..511a6fbb 100644 --- a/internal/karma/index.ts +++ b/internal/karma/index.ts @@ -21,7 +21,7 @@ function sha1(data) { /** * Entry-point for the Karma plugin. */ -function initConcatJs(logger, emitter, basePath) { +function initConcatJs(logger, emitter, basePath, hostname, port) { const log = logger.create('framework.concat_js'); // Create a tmp file for the concat bundle that is automatically cleaned up on @@ -50,8 +50,8 @@ function initConcatJs(logger, emitter, basePath) { let content = file.content.replace(/('use strict'|"use strict");?/, ''); content = JSON.stringify( - content + '\n//# sourceURL=http://concatjs/base/' + - relativePath + '\n'); + `${content}\n//# sourceURL=http://${hostname}:${port}/base/` + + `${relativePath}\n`); content = `//${relativePath}\neval(${content});\n`; bundleFile.content += content; } @@ -70,7 +70,7 @@ function initConcatJs(logger, emitter, basePath) { }); } -(initConcatJs as any).$inject = ['logger', 'emitter', 'config.basePath']; +(initConcatJs as any).$inject = ['logger', 'emitter', 'config.basePath', 'config.hostname', 'config.port']; function watcher(fileList: {refresh: () => void}) { // ibazel will write this string after a successful build diff --git a/internal/karma/karma.conf.js b/internal/karma/karma.conf.js index ff066d9f..76c2343e 100644 --- a/internal/karma/karma.conf.js +++ b/internal/karma/karma.conf.js @@ -353,6 +353,31 @@ try } } + function configureFormatError(conf) { + conf.formatError = (msg) => { + // This is a bazel specific formatError that removes the workspace + // name from stack traces. + // Look for filenames of the format "(::" + const FILENAME_REGEX = /\(([^:]+)(:\d+:\d+)/gm; + msg = msg.replace(FILENAME_REGEX, (_, p1, p2) => { + if (p1. startsWith('../')) { + // Remove all leading "../" + while (p1.startsWith('../')) { + p1 = p1.substr(3); + } + } else { + // Remove workspace name(angular, ngdeps etc.) from the beginning. + const index = p1.indexOf('/'); + if (index >= 0) { + p1 = p1.substr(index + 1); + } + } + return '(' + p1 + p2; + }); + return msg + '\n\n'; + }; + } + module.exports = function(config) { let conf = {}; @@ -373,6 +398,7 @@ try configureFiles(conf); configureTsWebTestSuiteConfig(conf); configureTsWebTestConfig(conf); + configureFormatError(conf); if (DEBUG) console.info(`Karma configuration: ${JSON.stringify(conf, null, 2)}`); diff --git a/package.json b/package.json index c117f154..1394247d 100644 --- a/package.json +++ b/package.json @@ -39,13 +39,14 @@ }, "scripts": { "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build examples/app:e2e && bazel build examples/protocol_buffers:e2e", - "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-package_karma && yarn e2e-package_typescript && yarn e2e-package_typescript_karma && yarn e2e-ts_auto_deps", + "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-package_karma && yarn e2e-package_karma_stack_trace && yarn e2e-package_typescript && yarn e2e-package_typescript_karma && yarn e2e-ts_auto_deps", "e2e-bazel-external": "jasmine internal/e2e/default_tsconfig_test.js", "e2e-examples-app-devserver": "concurrently \"bazel run examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-app-prodserver": "concurrently \"bazel run examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-protobuf-devserver": "concurrently \"bazel run examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-examples-protobuf-prodserver": "concurrently \"bazel run examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-package_karma": "cd internal/e2e/package_karma; bazel test ...", + "e2e-package_karma_stack_trace": "cd internal/e2e/package_karma_stack_trace; bazel test ...", "e2e-package_typescript": "yarn e2e-package_typescript_2.7 && yarn e2e-package_typescript_2.8 && yarn e2e-package_typescript_2.9 && yarn e2e-package_typescript_3.0 && yarn e2e-package_typescript_3.1 && yarn e2e-package_typescript_3.1_no_npm", "e2e-package_typescript_2.7": "cd internal/e2e/package_typescript_2.7; bazel test ...", "e2e-package_typescript_2.8": "cd internal/e2e/package_typescript_2.8; bazel test ...", From 8fb611899760e923102c030f00b693934754e1cd Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 31 Jan 2019 08:24:36 -0800 Subject: [PATCH 061/316] Create CODEOWNERS. Closes https://github.com/bazelbuild/rules_typescript/pull/393. PiperOrigin-RevId: 231790200 --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..b1485d04 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @mgechev @kyliau @alexeagle \ No newline at end of file From 2bdb55d6ea634e32b5c70f393313a8f92c72840c Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Thu, 31 Jan 2019 14:01:15 -0800 Subject: [PATCH 062/316] Cleanup of e2e tests Closes #395 PiperOrigin-RevId: 231848839 --- .bazelignore | 14 +- .circleci/config.yml | 5 +- .gitignore | 9 +- DEVELOPING.md | 4 +- WORKSPACE | 4 - internal/e2e/npm_packages/README.md | 19 + .../karma}/.bazelrc | 0 .../karma}/BUILD.bazel | 0 .../karma}/README.md | 0 .../karma}/WORKSPACE | 8 +- .../karma}/decrement.js | 2 +- .../karma}/decrement.spec.js | 6 +- .../npm_packages/karma/package-template.json | 9 + .../karma}/yarn.lock | 1588 ++-------------- .../karma_stack_trace}/.bazelrc | 0 .../karma_stack_trace}/BUILD.bazel | 0 .../karma_stack_trace}/WORKSPACE | 8 +- .../karma_stack_trace}/failing.spec.ts | 0 .../karma_stack_trace/package-template.json | 11 + .../test_folder/BUILD.bazel | 0 .../karma_stack_trace}/test_folder/hello.ts | 0 .../test_folder/test.spec.ts | 0 .../karma_stack_trace}/test_sourcemap.sh | 2 +- .../karma_stack_trace}/tsconfig.json | 0 .../karma_stack_trace}/yarn.lock | 0 .../karma_typescript}/.bazelrc | 0 .../karma_typescript}/BUILD.bazel | 0 .../karma_typescript}/WORKSPACE | 8 +- .../karma_typescript}/decrement.spec.ts | 0 .../karma_typescript}/decrement.ts | 0 .../karma_typescript/package-template.json | 11 + .../karma_typescript}/tsconfig.json | 0 .../karma_typescript}/yarn.lock | 1641 +++-------------- internal/e2e/npm_packages/test.sh | 65 + .../typescript_2.7}/.bazelrc | 0 .../typescript_2.7}/BUILD.bazel | 0 .../typescript_2.7}/WORKSPACE | 8 +- .../typescript_2.7}/main.spec.ts | 0 .../typescript_2.7}/main.ts | 0 .../typescript_2.7/package-template.json} | 5 +- .../typescript_2.7}/tsconfig.json | 0 .../typescript_2.7}/yarn.lock | 10 +- .../typescript_2.8}/.bazelrc | 0 .../typescript_2.8}/BUILD.bazel | 0 .../typescript_2.8}/WORKSPACE | 8 +- .../typescript_2.8}/main.spec.ts | 0 .../typescript_2.8}/main.ts | 0 .../typescript_2.8/package-template.json} | 5 +- .../typescript_2.8}/tsconfig.json | 0 .../typescript_2.8}/yarn.lock | 10 +- .../typescript_2.9}/.bazelrc | 0 .../typescript_2.9}/BUILD.bazel | 0 .../typescript_2.9}/WORKSPACE | 8 +- .../typescript_2.9}/main.spec.ts | 0 .../typescript_2.9}/main.ts | 0 .../typescript_2.9/package-template.json} | 5 +- .../typescript_2.9}/tsconfig.json | 0 .../typescript_2.9}/yarn.lock | 10 +- .../typescript_3.0}/.bazelrc | 0 .../typescript_3.0}/BUILD.bazel | 0 .../e2e/npm_packages/typescript_3.0/WORKSPACE | 38 + .../typescript_3.0}/main.spec.ts | 0 .../typescript_3.0}/main.ts | 0 .../typescript_3.0/package-template.json} | 5 +- .../typescript_3.0}/tsconfig.json | 0 .../typescript_3.0}/yarn.lock | 10 +- .../typescript_3.1}/.bazelrc | 0 .../typescript_3.1}/BUILD.bazel | 0 .../e2e/npm_packages/typescript_3.1/WORKSPACE | 38 + .../typescript_3.1}/main.spec.ts | 0 .../typescript_3.1}/main.ts | 0 .../typescript_3.1/package-template.json} | 5 +- .../typescript_3.1}/tsconfig.json | 0 .../typescript_3.1}/yarn.lock | 10 +- internal/e2e/package_karma/package.json | 6 - .../package_karma_stack_trace/package.json | 8 - .../tsconfig.json.oss} | 0 .../package_typescript_2.7/tsconfig.json.oss | 0 .../package_typescript_2.8/tsconfig.json.oss | 0 .../package_typescript_2.9/tsconfig.json.oss | 0 .../package_typescript_3.0/tsconfig.json.oss | 0 internal/e2e/package_typescript_3.1/WORKSPACE | 42 - .../package_typescript_3.1/tsconfig.json.oss | 0 .../package_typescript_3.1_no_npm/WORKSPACE | 42 - .../tsconfig.json.oss | 0 .../e2e/package_typescript_karma/package.json | 8 - .../tsconfig.json.oss | 0 internal/e2e/ts_auto_deps/WORKSPACE | 4 - internal/e2e/ts_auto_deps/package.json | 3 + .../.bazelrc | 0 .../BUILD.bazel | 0 .../WORKSPACE | 6 +- .../main.spec.ts | 0 .../main.ts | 0 .../package.json | 3 + internal/e2e/typescript_3.1/tsconfig.json | 0 .../yarn.lock | 0 package.bzl | 4 +- package.json | 26 +- 99 files changed, 675 insertions(+), 3066 deletions(-) create mode 100644 internal/e2e/npm_packages/README.md rename internal/e2e/{package_karma => npm_packages/karma}/.bazelrc (100%) rename internal/e2e/{package_karma => npm_packages/karma}/BUILD.bazel (100%) rename internal/e2e/{package_karma => npm_packages/karma}/README.md (100%) rename internal/e2e/{package_karma => npm_packages/karma}/WORKSPACE (89%) rename internal/e2e/{package_karma => npm_packages/karma}/decrement.js (84%) rename internal/e2e/{package_karma => npm_packages/karma}/decrement.spec.js (72%) create mode 100644 internal/e2e/npm_packages/karma/package-template.json rename internal/e2e/{package_karma => npm_packages/karma}/yarn.lock (55%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/.bazelrc (100%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/BUILD.bazel (100%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/WORKSPACE (89%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/failing.spec.ts (100%) create mode 100644 internal/e2e/npm_packages/karma_stack_trace/package-template.json rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/test_folder/BUILD.bazel (100%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/test_folder/hello.ts (100%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/test_folder/test.spec.ts (100%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/test_sourcemap.sh (89%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/tsconfig.json (100%) rename internal/e2e/{package_karma_stack_trace => npm_packages/karma_stack_trace}/yarn.lock (100%) rename internal/e2e/{package_typescript_2.7 => npm_packages/karma_typescript}/.bazelrc (100%) rename internal/e2e/{package_typescript_karma => npm_packages/karma_typescript}/BUILD.bazel (100%) rename internal/e2e/{package_typescript_karma => npm_packages/karma_typescript}/WORKSPACE (89%) rename internal/e2e/{package_typescript_karma => npm_packages/karma_typescript}/decrement.spec.ts (100%) rename internal/e2e/{package_typescript_karma => npm_packages/karma_typescript}/decrement.ts (100%) create mode 100644 internal/e2e/npm_packages/karma_typescript/package-template.json rename internal/e2e/{package_typescript_2.7 => npm_packages/karma_typescript}/tsconfig.json (100%) rename internal/e2e/{package_typescript_karma => npm_packages/karma_typescript}/yarn.lock (56%) create mode 100755 internal/e2e/npm_packages/test.sh rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.7}/.bazelrc (100%) rename internal/e2e/{package_typescript_2.7 => npm_packages/typescript_2.7}/BUILD.bazel (100%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.7}/WORKSPACE (86%) rename internal/e2e/{package_typescript_2.7 => npm_packages/typescript_2.7}/main.spec.ts (100%) rename internal/e2e/{package_typescript_2.7 => npm_packages/typescript_2.7}/main.ts (100%) rename internal/e2e/{package_typescript_2.7/package.json => npm_packages/typescript_2.7/package-template.json} (54%) rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.7}/tsconfig.json (100%) rename internal/e2e/{package_typescript_2.7 => npm_packages/typescript_2.7}/yarn.lock (94%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.8}/.bazelrc (100%) rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.8}/BUILD.bazel (100%) rename internal/e2e/{package_typescript_2.7 => npm_packages/typescript_2.8}/WORKSPACE (86%) rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.8}/main.spec.ts (100%) rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.8}/main.ts (100%) rename internal/e2e/{package_typescript_2.8/package.json => npm_packages/typescript_2.8/package-template.json} (54%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.8}/tsconfig.json (100%) rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.8}/yarn.lock (94%) rename internal/e2e/{package_typescript_3.0 => npm_packages/typescript_2.9}/.bazelrc (100%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.9}/BUILD.bazel (100%) rename internal/e2e/{package_typescript_2.8 => npm_packages/typescript_2.9}/WORKSPACE (86%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.9}/main.spec.ts (100%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.9}/main.ts (100%) rename internal/e2e/{package_typescript_2.9/package.json => npm_packages/typescript_2.9/package-template.json} (54%) rename internal/e2e/{package_typescript_3.0 => npm_packages/typescript_2.9}/tsconfig.json (100%) rename internal/e2e/{package_typescript_2.9 => npm_packages/typescript_2.9}/yarn.lock (94%) rename internal/e2e/{package_typescript_3.1 => npm_packages/typescript_3.0}/.bazelrc (100%) rename internal/e2e/{package_typescript_3.0 => npm_packages/typescript_3.0}/BUILD.bazel (100%) create mode 100644 internal/e2e/npm_packages/typescript_3.0/WORKSPACE rename internal/e2e/{package_typescript_3.0 => npm_packages/typescript_3.0}/main.spec.ts (100%) rename internal/e2e/{package_typescript_3.0 => npm_packages/typescript_3.0}/main.ts (100%) rename internal/e2e/{package_typescript_3.0/package.json => npm_packages/typescript_3.0/package-template.json} (54%) rename internal/e2e/{package_typescript_3.1 => npm_packages/typescript_3.0}/tsconfig.json (100%) rename internal/e2e/{package_typescript_3.0 => npm_packages/typescript_3.0}/yarn.lock (94%) rename internal/e2e/{package_typescript_3.1_no_npm => npm_packages/typescript_3.1}/.bazelrc (100%) rename internal/e2e/{package_typescript_3.1 => npm_packages/typescript_3.1}/BUILD.bazel (100%) create mode 100644 internal/e2e/npm_packages/typescript_3.1/WORKSPACE rename internal/e2e/{package_typescript_3.1 => npm_packages/typescript_3.1}/main.spec.ts (100%) rename internal/e2e/{package_typescript_3.1 => npm_packages/typescript_3.1}/main.ts (100%) rename internal/e2e/{package_typescript_3.1/package.json => npm_packages/typescript_3.1/package-template.json} (54%) rename internal/e2e/{package_typescript_3.1_no_npm => npm_packages/typescript_3.1}/tsconfig.json (100%) rename internal/e2e/{package_typescript_3.1 => npm_packages/typescript_3.1}/yarn.lock (94%) delete mode 100644 internal/e2e/package_karma/package.json delete mode 100644 internal/e2e/package_karma_stack_trace/package.json rename internal/e2e/{package_typescript_karma/tsconfig.json => package_karma_stack_trace/tsconfig.json.oss} (100%) create mode 100644 internal/e2e/package_typescript_2.7/tsconfig.json.oss create mode 100644 internal/e2e/package_typescript_2.8/tsconfig.json.oss create mode 100644 internal/e2e/package_typescript_2.9/tsconfig.json.oss create mode 100644 internal/e2e/package_typescript_3.0/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_3.1/WORKSPACE create mode 100644 internal/e2e/package_typescript_3.1/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_3.1_no_npm/WORKSPACE create mode 100644 internal/e2e/package_typescript_3.1_no_npm/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_karma/package.json create mode 100644 internal/e2e/package_typescript_karma/tsconfig.json.oss rename internal/e2e/{package_typescript_karma => typescript_3.1}/.bazelrc (100%) rename internal/e2e/{package_typescript_3.1_no_npm => typescript_3.1}/BUILD.bazel (100%) rename internal/e2e/{package_typescript_3.0 => typescript_3.1}/WORKSPACE (88%) rename internal/e2e/{package_typescript_3.1_no_npm => typescript_3.1}/main.spec.ts (100%) rename internal/e2e/{package_typescript_3.1_no_npm => typescript_3.1}/main.ts (100%) rename internal/e2e/{package_typescript_3.1_no_npm => typescript_3.1}/package.json (83%) create mode 100644 internal/e2e/typescript_3.1/tsconfig.json rename internal/e2e/{package_typescript_3.1_no_npm => typescript_3.1}/yarn.lock (100%) diff --git a/.bazelignore b/.bazelignore index adba1fb2..f4b9e2b2 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,12 +1,6 @@ node_modules -internal/e2e/ts_auto_deps -internal/e2e/package_karma -internal/e2e/package_karma_stack_trace -internal/e2e/package_typescript_2.7 -internal/e2e/package_typescript_2.8 -internal/e2e/package_typescript_2.9 -internal/e2e/package_typescript_3.0 -internal/e2e/package_typescript_3.1 -internal/e2e/package_typescript_3.1_no_npm -internal/e2e/package_typescript_karma +devserver/devserver/test/test-workspace internal/e2e/disable_tsetse_for_external +internal/e2e/npm_packages +internal/e2e/ts_auto_deps +internal/e2e/typescript_3.1 diff --git a/.circleci/config.yml b/.circleci/config.yml index eb5c2558..9c19ed02 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ ## IMPORTANT # If you change the `docker_image` version, also change the `cache_key` suffix var_1: &docker_image circleci/node:10.12-browsers -var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-internal/karma:{{ checksum "internal/karma/yarn.lock" }}-node:10.12-browsers +var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-node:10.12-browsers var_3: &setup-bazel-remote-cache run: name: Start up bazel remote cache proxy @@ -90,9 +90,6 @@ jobs: key: *cache_key - run: yarn install - # Build the npm packages which are used in the e2e tests - - run: yarn bazel build //internal:npm_package - - run: yarn bazel build //internal/karma:npm_package - run: xvfb-run -a yarn e2e lint: diff --git a/.gitignore b/.gitignore index b19e31d8..be15be3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ .idea node_modules /bazel-* -/internal/e2e/package_karma/bazel-* -/internal/e2e/package_typescript_*/bazel-* +/internal/e2e/npm_packages/*/bazel-* +/internal/e2e/npm_packages/*/package.json /internal/e2e/ts_auto_deps/bazel-* - -internal/e2e/ts_auto_deps/simple/BUILD -internal/e2e/ts_auto_deps/simple/BUILD.bazel +/internal/e2e/ts_auto_deps/simple/BUILD +/internal/e2e/ts_auto_deps/simple/BUILD.bazel diff --git a/DEVELOPING.md b/DEVELOPING.md index 684835fa..426443f1 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -42,12 +42,12 @@ to ``` The correct defaults to use so that you are not depending on the npm package downstream are in `/internal/defaults.bzl`. Note, your downstream -workspace will also need the correct `@npm` dependencies available to build these targets (see `internal/e2e/package_typescript_3.1_no_npm/package.json`). +workspace will also need the correct `@npm` dependencies available to build these targets (see `internal/e2e/typescript_3.1/package.json`). In the case of the `angular` workspace, some `@npm` dependencies in this repository will also need to be changed to `@ngdeps` since `angular` does not have an `@npm` workspace with npm dependencies. Note, with this workflow the downstream version of `@npm//typescript` will be used to compile the `ts_library` targets in `build_bazel_rules_typescript`. -An example of this can be found under `internal/e2e/package_typescript_3.1_no_npm`. +An example of this can be found under `internal/e2e/typescript_3.1`. ## Releasing diff --git a/WORKSPACE b/WORKSPACE index a62f07bc..49d4fde2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -24,10 +24,6 @@ rules_typescript_dependencies() rules_typescript_dev_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") # Use a bazel-managed npm dependency, allowing us to test resolution to these paths diff --git a/internal/e2e/npm_packages/README.md b/internal/e2e/npm_packages/README.md new file mode 100644 index 00000000..183e15cd --- /dev/null +++ b/internal/e2e/npm_packages/README.md @@ -0,0 +1,19 @@ +# End-to-end tests for generated npm packages + +All tests that depend on the generated npm packages such as `@bazel/typescript` and `@bazel/karma` should +go in this folder. + +## Running + +These tests are run using `test.sh` which generates the `package.json` files in each directory before calling `yarn test`. +The `package.json` files are generated from template `package-template.json` files. The absolute locations of +the generated npm packages are substituted in when generating the `package.json` files. + +### Running an individual test + +To run a specific test run this script with `./internal/e2e/npm_packages/test.sh --test ` where `` +is the name of the test folder to run. + +### Updating yarn.lock file + +To update the `yarn.lock` files for these tests run `./internal/e2e/npm_packages/test.sh --update-lock-files`. diff --git a/internal/e2e/package_karma/.bazelrc b/internal/e2e/npm_packages/karma/.bazelrc similarity index 100% rename from internal/e2e/package_karma/.bazelrc rename to internal/e2e/npm_packages/karma/.bazelrc diff --git a/internal/e2e/package_karma/BUILD.bazel b/internal/e2e/npm_packages/karma/BUILD.bazel similarity index 100% rename from internal/e2e/package_karma/BUILD.bazel rename to internal/e2e/npm_packages/karma/BUILD.bazel diff --git a/internal/e2e/package_karma/README.md b/internal/e2e/npm_packages/karma/README.md similarity index 100% rename from internal/e2e/package_karma/README.md rename to internal/e2e/npm_packages/karma/README.md diff --git a/internal/e2e/package_karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE similarity index 89% rename from internal/e2e/package_karma/WORKSPACE rename to internal/e2e/npm_packages/karma/WORKSPACE index f8b1ad9c..c2e453c1 100644 --- a/internal/e2e/package_karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -12,21 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_karma_e2e") +workspace(name = "npm_packages_karma_e2e") local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../../../..", ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_karma/decrement.js b/internal/e2e/npm_packages/karma/decrement.js similarity index 84% rename from internal/e2e/package_karma/decrement.js rename to internal/e2e/npm_packages/karma/decrement.js index 6fd5fbb6..9743a400 100644 --- a/internal/e2e/package_karma/decrement.js +++ b/internal/e2e/npm_packages/karma/decrement.js @@ -3,7 +3,7 @@ if (typeof module === 'object' && typeof module.exports === 'object') { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === 'function' && define.amd) { - define('package_karma_e2e/decrement', ['require', 'exports'], factory); + define('npm_packages_karma_e2e/decrement', ['require', 'exports'], factory); } })(function(require, exports) { 'use strict'; diff --git a/internal/e2e/package_karma/decrement.spec.js b/internal/e2e/npm_packages/karma/decrement.spec.js similarity index 72% rename from internal/e2e/package_karma/decrement.spec.js rename to internal/e2e/npm_packages/karma/decrement.spec.js index b29d16b3..6485d22b 100644 --- a/internal/e2e/package_karma/decrement.spec.js +++ b/internal/e2e/npm_packages/karma/decrement.spec.js @@ -4,13 +4,13 @@ if (typeof module === 'object' && typeof module.exports === 'object') { if (v !== undefined) module.exports = v; } else if (typeof define === 'function' && define.amd) { define( - 'package_karma_e2e/decrement.spec', - ['require', 'exports', 'package_karma_e2e/decrement'], factory); + 'npm_packages_karma_e2e/decrement.spec', + ['require', 'exports', 'npm_packages_karma_e2e/decrement'], factory); } })(function(require, exports) { 'use strict'; Object.defineProperty(exports, '__esModule', {value: true}); -var decrement_1 = require('package_karma_e2e/decrement'); +var decrement_1 = require('npm_packages_karma_e2e/decrement'); describe('decrementing', function() { it('should do that', function() { expect(decrement_1.decrement(1)).toBe(0); diff --git a/internal/e2e/npm_packages/karma/package-template.json b/internal/e2e/npm_packages/karma/package-template.json new file mode 100644 index 00000000..9f22599a --- /dev/null +++ b/internal/e2e/npm_packages/karma/package-template.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@bazel/karma": "file:${BAZEL_KARMA_NPM_PACKAGE}", + "karma": "3.0.0" + }, + "scripts": { + "test": "bazel test ..." + } +} diff --git a/internal/e2e/package_karma/yarn.lock b/internal/e2e/npm_packages/karma/yarn.lock similarity index 55% rename from internal/e2e/package_karma/yarn.lock rename to internal/e2e/npm_packages/karma/yarn.lock index f62050fe..5d4f3b09 100644 --- a/internal/e2e/package_karma/yarn.lock +++ b/internal/e2e/npm_packages/karma/yarn.lock @@ -2,18 +2,19 @@ # yarn lockfile v1 -"@bazel/karma@file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package": - version "0.20.3" +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/karma/npm_package": + version "0.22.1-19-gecef600" dependencies: jasmine-core "2.8.0" - karma alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a + karma "^4.0.0" karma-chrome-launcher "2.2.0" karma-firefox-launcher "1.1.0" karma-jasmine "1.1.1" karma-requirejs "1.1.0" - karma-sauce-launcher "1.2.0" + karma-sauce-launcher "2.0.2" karma-sourcemap-loader "0.3.7" requirejs "2.3.5" + semver "5.6.0" tmp "0.0.33" abbrev@1: @@ -27,10 +28,6 @@ accepts@~1.3.4: mime-types "~2.1.18" negotiator "0.6.1" -addressparser@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" - adm-zip@~0.4.3: version "0.4.11" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a" @@ -39,31 +36,12 @@ after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" -agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0, agent-base@~4.2.0: +agent-base@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" dependencies: es6-promisify "^5.0.0" -ajv@^5.1.0, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -amqplib@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63" - dependencies: - bitsyntax "~0.0.4" - bluebird "^3.4.6" - buffer-more-ints "0.0.2" - readable-stream "1.x >=1.1.9" - safe-buffer "^5.0.1" - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -72,17 +50,6 @@ ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -94,30 +61,6 @@ aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" -archiver-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174" - dependencies: - glob "^7.0.0" - graceful-fs "^4.1.0" - lazystream "^1.0.0" - lodash "^4.8.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - -archiver@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-2.1.1.tgz#ff662b4a78201494a3ee544d3a33fe7496509ebc" - dependencies: - archiver-utils "^1.3.0" - async "^2.0.0" - buffer-crc32 "^0.2.1" - glob "^7.0.0" - lodash "^4.8.0" - readable-stream "^2.0.0" - tar-stream "^1.5.0" - zip-stream "^1.2.0" - are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" @@ -125,17 +68,11 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" -arr-flatten@^1.0.1, arr-flatten@^1.1.0: +arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" @@ -159,28 +96,10 @@ arraybuffer.slice@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" -ast-types@0.x.x: - version "0.11.5" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.5.tgz#9890825d660c03c28339f315e9fa0a360e31ec28" - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -189,44 +108,16 @@ async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" -async@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.0.1.tgz#b709cc0280a9c36f09f4536be823c838a9049e25" - dependencies: - lodash "^4.8.0" - -async@^2.0.0, async@^2.1.2, async@~2.6.0: +async@^2.1.2: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" dependencies: lodash "^4.17.10" -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - -aws4@^1.2.1, aws4@^1.6.0, aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - -axios@^0.15.3: - version "0.15.3" - resolved "http://registry.npmjs.org/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" - dependencies: - follow-redirects "1.0.0" - backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" @@ -239,10 +130,6 @@ base64-arraybuffer@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" -base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - base64id@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" @@ -259,12 +146,6 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - dependencies: - tweetnacl "^0.14.3" - better-assert@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" @@ -275,30 +156,11 @@ binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" -bitsyntax@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82" - dependencies: - buffer-more-ints "0.0.2" - -bl@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" - dependencies: - readable-stream "~2.0.5" - blob@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" -bluebird@^3.3.0, bluebird@^3.4.6: +bluebird@^3.3.0: version "3.5.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" @@ -317,24 +179,6 @@ body-parser@^1.16.1: raw-body "2.3.3" type-is "~1.6.16" -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - dependencies: - hoek "2.x.x" - -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -348,14 +192,6 @@ braces@^0.1.2: dependencies: expand-range "^0.1.0" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" @@ -375,44 +211,17 @@ buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" -buffer-alloc@^1.1.0, buffer-alloc@^1.2.0: +buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" dependencies: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" -buffer-crc32@^0.2.1: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" -buffer-more-ints@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c" - -buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -buildmail@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" - dependencies: - addressparser "1.0.1" - libbase64 "0.1.0" - libmime "3.0.0" - libqp "1.1.0" - nodemailer-fetch "1.6.0" - nodemailer-shared "1.1.0" - punycode "1.4.1" - bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -435,39 +244,6 @@ callsite@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -chalk@^1.1.1: - version "1.1.3" - resolved "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chokidar@^1.4.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - chokidar@^2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" @@ -491,7 +267,7 @@ chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" -circular-json@^0.5.4, circular-json@^0.5.5: +circular-json@^0.5.5: version "0.5.7" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.7.tgz#b8be478d72ea58c7eeda26bf1cf1fba43d188842" @@ -504,10 +280,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - 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" @@ -529,22 +301,6 @@ combine-lists@^1.0.0: dependencies: lodash "^4.5.0" -combined-stream@1.0.6: - version "1.0.6" - resolved "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - dependencies: - delayed-stream "~1.0.0" - -combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - dependencies: - delayed-stream "~1.0.0" - -commander@^2.9.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" - component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -557,15 +313,6 @@ component-inherit@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" -compress-commons@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f" - dependencies: - buffer-crc32 "^0.2.1" - crc32-stream "^2.0.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -599,60 +346,30 @@ core-js@^2.2.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" -core-util-is@1.0.2, core-util-is@~1.0.0: +core-js@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" + integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= + +core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -crc32-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4" - dependencies: - crc "^3.4.4" - readable-stream "^2.0.0" - -crc@^3.4.4: - version "3.8.0" - resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" - dependencies: - buffer "^5.1.0" - -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - dependencies: - boom "2.x.x" - -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - custom-event@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - dependencies: - assert-plus "^1.0.0" - -data-uri-to-buffer@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" - date-format@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" -debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@~2.6.4, debug@~2.6.6: +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" -debug@3.1.0, debug@=3.1.0, debug@~3.1.0: +debug@=3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -672,10 +389,6 @@ deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -695,18 +408,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -degenerator@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" - dependencies: - ast-types "0.x.x" - escodegen "1.x.x" - esprima "3.x.x" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" @@ -732,17 +433,6 @@ dom-serialize@^2.2.0: extend "^3.0.0" void-elements "^2.0.0" -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -751,28 +441,6 @@ encodeurl@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" -end-of-stream@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - dependencies: - once "^1.4.0" - -engine.io-client@~3.1.0: - version "3.1.6" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.6.tgz#5bdeb130f8b94a50ac5cbeb72583e7a4a063ddfd" - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - engine.io-client@~3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" @@ -799,19 +467,6 @@ engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: blob "0.0.4" has-binary2 "~1.0.2" -engine.io@~3.1.0: - version "3.1.5" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845" - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - optionalDependencies: - uws "~9.14.0" - engine.io@~3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.0.tgz#54332506f42f2edc71690d2f2a42349359f3bf7d" @@ -831,6 +486,11 @@ es6-promise@^4.0.3: version "4.2.5" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" +es6-promise@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" + integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= + es6-promisify@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" @@ -841,33 +501,6 @@ escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" -escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escodegen@1.x.x: - version "1.11.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@3.x.x, esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - eventemitter3@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" @@ -880,12 +513,6 @@ expand-braces@^0.1.1: array-unique "^0.2.1" braces "^0.1.2" -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -905,12 +532,6 @@ expand-range@^0.1.0: is-number "^0.1.1" repeat-string "^0.2.2" -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -924,16 +545,10 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1, extend@~3.0.2: +extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -947,44 +562,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - -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" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -file-uri-to-path@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1006,11 +583,10 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" -follow-redirects@1.0.0: - version "1.0.0" - resolved "http://registry.npmjs.org/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" - dependencies: - debug "^2.2.0" +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== follow-redirects@^1.0.0: version "1.5.8" @@ -1018,36 +594,10 @@ follow-redirects@^1.0.0: dependencies: debug "=3.1.0" -for-in@^1.0.1, for-in@^1.0.2: +for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.11" - -form-data@~2.3.0, form-data@~2.3.1, form-data@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - dependencies: - asynckit "^0.4.0" - combined-stream "1.0.6" - mime-types "^2.1.12" - fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -1060,10 +610,6 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -1074,20 +620,13 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0, fsevents@^1.2.2: +fsevents@^1.2.2: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" -ftp@~0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -1101,52 +640,10 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -generate-function@^2.0.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" - dependencies: - is-property "^1.0.2" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -get-uri@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.2.tgz#5c795e71326f6ca1286f2fc82575cd2bab2af578" - dependencies: - data-uri-to-buffer "1" - debug "2" - extend "3" - file-uri-to-path "1" - ftp "~0.3.10" - readable-stream "2" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - dependencies: - assert-plus "^1.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -1154,7 +651,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1: +glob@^7.0.5, glob@^7.1.1: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" dependencies: @@ -1165,43 +662,10 @@ glob@^7.0.0, glob@^7.0.5, glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - -har-validator@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" - dependencies: - ajv "^5.3.0" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - has-binary2@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" @@ -1243,39 +707,6 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - -hipchat-notifier@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e" - dependencies: - lodash "^4.0.0" - request "^2.0.0" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - http-errors@1.6.3, http-errors@~1.6.3: version "1.6.3" resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -1285,13 +716,6 @@ http-errors@1.6.3, http-errors@~1.6.3: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - dependencies: - agent-base "4" - debug "3.1.0" - http-proxy@^1.13.0: version "1.17.0" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" @@ -1300,33 +724,6 @@ http-proxy@^1.13.0: follow-redirects "^1.0.0" requires-port "^1.0.0" -http-signature@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -httpntlm@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2" - dependencies: - httpreq ">=0.4.22" - underscore "~1.7.0" - -httpreq@>=0.4.22: - version "0.4.24" - resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f" - https-proxy-agent@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" @@ -1334,10 +731,6 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" -iconv-lite@0.4.15: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" @@ -1350,28 +743,21 @@ iconv-lite@^0.4.4: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4: - version "1.1.12" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" - ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" dependencies: minimatch "^3.0.4" +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" -inflection@~1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" - -inflection@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1387,10 +773,6 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -ip@^1.1.2, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1441,16 +823,6 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -1461,10 +833,6 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1479,12 +847,6 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" - is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -1497,74 +859,26 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" - -is-my-json-valid@^2.12.4: - version "2.19.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz#8fd6e40363cd06b963fa877d444bfb5eddc62175" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - is-number@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" dependencies: kind-of "^3.0.2" -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-property@^1.0.0, is-property@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1593,42 +907,20 @@ isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - jasmine-core@2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - -json-stringify-safe@5.0.x, 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" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" +jszip@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" + integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" + core-js "~2.3.0" + es6-promise "~3.0.2" + lie "~3.1.0" + pako "~1.0.2" + readable-stream "~2.0.6" karma-chrome-launcher@2.2.0: version "2.2.0" @@ -1649,14 +941,14 @@ karma-requirejs@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" -karma-sauce-launcher@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz#6f2558ddef3cf56879fa27540c8ae9f8bfd16bca" +karma-sauce-launcher@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" + integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== dependencies: - q "^1.5.0" - sauce-connect-launcher "^1.2.2" - saucelabs "^1.4.0" - wd "^1.4.0" + sauce-connect-launcher "^1.2.4" + saucelabs "^1.5.0" + selenium-webdriver "^4.0.0-alpha.1" karma-sourcemap-loader@0.3.7: version "0.3.7" @@ -1696,13 +988,14 @@ karma@3.0.0: tmp "0.0.33" useragent "2.2.1" -karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: - version "1.7.1" - resolved "https://codeload.github.com/alexeagle/karma/tar.gz/fa1a84ac881485b5657cb669e9b4e5da77b79f0a" +karma@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" + integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== dependencies: bluebird "^3.3.0" body-parser "^1.16.1" - chokidar "^1.4.1" + chokidar "^2.0.3" colors "^1.1.0" combine-lists "^1.0.0" connect "^3.6.0" @@ -1710,23 +1003,24 @@ karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: di "^0.0.1" dom-serialize "^2.2.0" expand-braces "^0.1.1" + flatted "^2.0.0" glob "^7.1.1" graceful-fs "^4.1.2" http-proxy "^1.13.0" isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^2.3.9" - mime "^1.3.4" + lodash "^4.17.5" + log4js "^3.0.0" + mime "^2.3.1" minimatch "^3.0.2" optimist "^0.6.1" qjobs "^1.1.4" range-parser "^1.2.0" rimraf "^2.6.0" safe-buffer "^5.0.1" - socket.io "2.0.4" + socket.io "2.1.1" source-map "^0.6.1" tmp "0.0.33" - useragent "^2.1.12" + useragent "2.3.0" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" @@ -1748,66 +1042,21 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - dependencies: - readable-stream "^2.0.5" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -libbase64@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6" - -libmime@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6" +lie@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= dependencies: - iconv-lite "0.4.15" - libbase64 "0.1.0" - libqp "1.1.0" - -libqp@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" + immediate "~3.0.5" lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" -lodash@4.17.10: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.5.0, lodash@^4.8.0: +lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.5.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" -log4js@^2.3.9: - version "2.11.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.11.0.tgz#bf3902eff65c6923d9ce9cfbd2db54160e34005a" - dependencies: - circular-json "^0.5.4" - date-format "^1.2.0" - debug "^3.1.0" - semver "^5.5.0" - streamroller "0.7.0" - optionalDependencies: - amqplib "^0.5.2" - axios "^0.15.3" - hipchat-notifier "^1.1.0" - loggly "^1.1.0" - mailgun-js "^0.18.0" - nodemailer "^2.5.0" - redis "^2.7.1" - slack-node "~0.2.0" - log4js@^3.0.0: version "3.0.5" resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.5.tgz#b80146bfebad68b430d4f3569556d8a6edfef303" @@ -1818,46 +1067,17 @@ log4js@^3.0.0: rfdc "^1.1.2" streamroller "0.7.0" -loggly@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee" - dependencies: - json-stringify-safe "5.0.x" - request "2.75.x" - timespan "2.3.x" - lru-cache@2.2.x: version "2.2.4" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d" -lru-cache@4.1.x, lru-cache@^4.1.2: +lru-cache@4.1.x: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" dependencies: pseudomap "^1.0.2" yallist "^2.1.2" -mailcomposer@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4" - dependencies: - buildmail "4.0.1" - libmime "3.0.0" - -mailgun-js@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.1.tgz#ee39aa18d7bb598a5ce9ede84afb681defc8a6b0" - dependencies: - async "~2.6.0" - debug "~3.1.0" - form-data "~2.3.0" - inflection "~1.12.0" - is-stream "^1.1.0" - path-proxy "~1.0.0" - promisify-call "^2.0.2" - proxy-agent "~3.0.0" - tsscmp "~1.0.0" - map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -1868,32 +1088,10 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -1916,16 +1114,12 @@ mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.19, mime-types@~2.1.7: +mime-types@~2.1.18: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" dependencies: mime-db "~1.36.0" -mime@^1.3.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - mime@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" @@ -2014,10 +1208,6 @@ negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" -netmask@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" - node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" @@ -2033,59 +1223,6 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - -nodemailer-direct-transport@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86" - dependencies: - nodemailer-shared "1.1.0" - smtp-connection "2.12.0" - -nodemailer-fetch@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4" - -nodemailer-shared@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0" - dependencies: - nodemailer-fetch "1.6.0" - -nodemailer-smtp-pool@2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-smtp-transport@2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-wellknown@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5" - -nodemailer@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9" - dependencies: - libmime "3.0.0" - mailcomposer "4.0.1" - nodemailer-direct-transport "3.3.2" - nodemailer-shared "1.1.0" - nodemailer-smtp-pool "2.8.2" - nodemailer-smtp-transport "2.7.2" - socks "1.1.9" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -2093,7 +1230,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: +normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -2127,14 +1264,6 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1, oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2157,13 +1286,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -2176,7 +1298,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2189,22 +1311,11 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - 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" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2215,37 +1326,10 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -pac-proxy-agent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-3.0.0.tgz#11d578b72a164ad74bf9d5bac9ff462a38282432" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - get-uri "^2.0.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - pac-resolver "^3.0.0" - raw-body "^2.2.0" - socks-proxy-agent "^4.0.1" - -pac-resolver@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-3.0.0.tgz#6aea30787db0a891704deb7800a722a7615a6f26" - dependencies: - co "^4.6.0" - degenerator "^1.0.4" - ip "^1.1.5" - netmask "^1.0.6" - thunkify "^2.1.2" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" +pako@~1.0.2: + version "1.0.8" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" + integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== parseqs@0.0.5: version "0.0.5" @@ -2275,38 +1359,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-proxy@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e" - dependencies: - inflection "~1.3.0" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -2315,74 +1371,23 @@ 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" -promisify-call@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba" - dependencies: - with-callback "^1.0.2" - -proxy-agent@~3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.3.tgz#1c1a33db60ef5f2e9e35b876fd63c2bc681c611d" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" - pac-proxy-agent "^3.0.0" - proxy-from-env "^1.0.0" - socks-proxy-agent "^4.0.1" - -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -psl@^1.1.24: - version "1.1.29" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" - -punycode@1.4.1, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -q@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" - -q@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - qjobs@^1.1.4: version "1.2.0" resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" -qs@6.5.2, qs@~6.5.1, qs@~6.5.2: +qs@6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - -randomatic@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - range-parser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" -raw-body@2.3.3, raw-body@^2.2.0: +raw-body@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" dependencies: @@ -2400,16 +1405,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -readable-stream@1.1.x, "readable-stream@1.x >=1.1.9": - version "1.1.14" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.3.0, readable-stream@^2.3.5: +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: version "2.3.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -2421,9 +1417,10 @@ readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stre string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@~2.0.5: +readable-stream@~2.0.6: version "2.0.6" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -2440,28 +1437,6 @@ readdirp@^2.0.0: micromatch "^3.1.10" readable-stream "^2.0.2" -redis-commands@^1.2.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2" - -redis-parser@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" - -redis@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" - dependencies: - double-ended-queue "^2.1.0-0" - redis-commands "^1.2.0" - redis-parser "^2.6.0" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -2481,97 +1456,10 @@ repeat-string@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" -repeat-string@^1.5.2, repeat-string@^1.6.1: +repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" -request@2.75.x: - version "2.75.0" - resolved "http://registry.npmjs.org/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.0.0" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - -request@2.85.0: - version "2.85.0" - resolved "http://registry.npmjs.org/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -request@^2.0.0, request@^2.74.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -requestretry@^1.2.2: - version "1.13.0" - resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94" - dependencies: - extend "^3.0.0" - lodash "^4.15.0" - request "^2.74.0" - when "^3.7.7" - requirejs@2.3.5: version "2.3.5" resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" @@ -2598,7 +1486,7 @@ rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: dependencies: glob "^7.0.5" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +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" @@ -2608,13 +1496,14 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" -sauce-connect-launcher@^1.2.2: +sauce-connect-launcher@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" + integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== dependencies: adm-zip "~0.4.3" async "^2.1.2" @@ -2622,17 +1511,33 @@ sauce-connect-launcher@^1.2.2: lodash "^4.16.6" rimraf "^2.5.4" -saucelabs@^1.4.0: +saucelabs@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" + integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== dependencies: https-proxy-agent "^2.2.1" -sax@^1.2.4: +sax@>=0.6.0, sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -semver@^5.3.0, semver@^5.5.0: +selenium-webdriver@^4.0.0-alpha.1: + version "4.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" + integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +semver@^5.3.0: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" @@ -2666,27 +1571,6 @@ signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" -slack-node@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30" - dependencies: - requestretry "^1.2.2" - -smart-buffer@^1.0.4: - version "1.1.15" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" - -smart-buffer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" - -smtp-connection@2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" - dependencies: - httpntlm "1.6.1" - nodemailer-shared "1.1.0" - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -2714,40 +1598,10 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - dependencies: - hoek "2.x.x" - -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - dependencies: - hoek "4.x.x" - socket.io-adapter@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" -socket.io-client@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e" - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~2.6.4" - engine.io-client "~3.1.0" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.1.1" - to-array "0.1.4" - socket.io-client@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" @@ -2767,15 +1621,6 @@ socket.io-client@2.1.1: socket.io-parser "~3.2.0" to-array "0.1.4" -socket.io-parser@~3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e" - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - has-binary2 "~1.0.2" - isarray "2.0.1" - socket.io-parser@~3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" @@ -2784,16 +1629,6 @@ socket.io-parser@~3.2.0: debug "~3.1.0" isarray "2.0.1" -socket.io@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014" - dependencies: - debug "~2.6.6" - engine.io "~3.1.0" - socket.io-adapter "~1.1.0" - socket.io-client "2.0.4" - socket.io-parser "~3.1.1" - socket.io@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" @@ -2805,27 +1640,6 @@ socket.io@2.1.1: socket.io-client "2.1.1" socket.io-parser "~3.2.0" -socks-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" - dependencies: - agent-base "~4.2.0" - socks "~2.2.0" - -socks@1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" - dependencies: - ip "^1.1.2" - smart-buffer "^1.0.4" - -socks@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" - dependencies: - ip "^1.1.5" - smart-buffer "^4.0.1" - source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -2844,7 +1658,7 @@ source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -2854,21 +1668,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -sshpk@^1.7.0: - version "1.14.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - safer-buffer "^2.0.2" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -2918,10 +1717,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringstream@~0.0.4, stringstream@~0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -2938,22 +1733,6 @@ 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" -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -tar-stream@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" - dependencies: - bl "^1.0.0" - buffer-alloc "^1.1.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.0" - xtend "^4.0.0" - tar@^4: version "4.4.6" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" @@ -2966,13 +1745,12 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -thunkify@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" - -timespan@2.3.x: - version "2.3.0" - resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" +tmp@0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + dependencies: + os-tmpdir "~1.0.1" tmp@0.0.33, tmp@0.0.x: version "0.0.33" @@ -2984,10 +1762,6 @@ to-array@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" -to-buffer@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -3010,43 +1784,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tsscmp@~1.0.0: - version "1.0.6" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - dependencies: - safe-buffer "^5.0.1" - -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" @@ -3058,10 +1795,6 @@ ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" -underscore@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" - union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -3101,9 +1834,10 @@ useragent@2.2.1: lru-cache "2.2.x" tmp "0.0.x" -useragent@^2.1.12: +useragent@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" + integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== dependencies: lru-cache "4.1.x" tmp "0.0.x" @@ -3116,46 +1850,10 @@ utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" -uuid@^3.1.0, uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - -uws@~9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95" - -vargs@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/vargs/-/vargs-0.1.0.tgz#6b6184da6520cc3204ce1b407cac26d92609ebff" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - void-elements@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" -wd@^1.4.0: - version "1.10.3" - resolved "https://registry.yarnpkg.com/wd/-/wd-1.10.3.tgz#395ac7eb58a98e556369f8f8e5f845d91fb152a3" - dependencies: - archiver "2.1.1" - async "2.0.1" - lodash "4.17.10" - mkdirp "^0.5.1" - q "1.4.1" - request "2.85.0" - vargs "0.1.0" - -when@^3.7.7: - version "3.7.8" - resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82" - which@^1.2.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -3168,18 +1866,10 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -with-callback@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/with-callback/-/with-callback-1.0.2.tgz#a09629b9a920028d721404fb435bdcff5c91bc21" - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -3192,18 +1882,23 @@ ws@~3.3.1: safe-buffer "~5.1.0" ultron "~1.1.0" +xml2js@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= + xmlhttprequest-ssl@~1.5.4: version "1.5.5" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -3215,12 +1910,3 @@ yallist@^3.0.0, yallist@^3.0.2: yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - -zip-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04" - dependencies: - archiver-utils "^1.3.0" - compress-commons "^1.2.0" - lodash "^4.8.0" - readable-stream "^2.0.0" diff --git a/internal/e2e/package_karma_stack_trace/.bazelrc b/internal/e2e/npm_packages/karma_stack_trace/.bazelrc similarity index 100% rename from internal/e2e/package_karma_stack_trace/.bazelrc rename to internal/e2e/npm_packages/karma_stack_trace/.bazelrc diff --git a/internal/e2e/package_karma_stack_trace/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel similarity index 100% rename from internal/e2e/package_karma_stack_trace/BUILD.bazel rename to internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel diff --git a/internal/e2e/package_karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE similarity index 89% rename from internal/e2e/package_karma_stack_trace/WORKSPACE rename to internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index aa0c58bf..5cad07ea 100644 --- a/internal/e2e/package_karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -12,21 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_karma_stack_trace") +workspace(name = "npm_packages_karma_stack_trace") local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../../../..", ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_karma_stack_trace/failing.spec.ts b/internal/e2e/npm_packages/karma_stack_trace/failing.spec.ts similarity index 100% rename from internal/e2e/package_karma_stack_trace/failing.spec.ts rename to internal/e2e/npm_packages/karma_stack_trace/failing.spec.ts diff --git a/internal/e2e/npm_packages/karma_stack_trace/package-template.json b/internal/e2e/npm_packages/karma_stack_trace/package-template.json new file mode 100644 index 00000000..4e167d87 --- /dev/null +++ b/internal/e2e/npm_packages/karma_stack_trace/package-template.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "@bazel/karma": "file:${BAZEL_KARMA_NPM_PACKAGE}", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", + "@types/jasmine": "2.8.2", + "typescript": "3.1.x" + }, + "scripts": { + "test": "bazel test ..." + } +} diff --git a/internal/e2e/package_karma_stack_trace/test_folder/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel similarity index 100% rename from internal/e2e/package_karma_stack_trace/test_folder/BUILD.bazel rename to internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel diff --git a/internal/e2e/package_karma_stack_trace/test_folder/hello.ts b/internal/e2e/npm_packages/karma_stack_trace/test_folder/hello.ts similarity index 100% rename from internal/e2e/package_karma_stack_trace/test_folder/hello.ts rename to internal/e2e/npm_packages/karma_stack_trace/test_folder/hello.ts diff --git a/internal/e2e/package_karma_stack_trace/test_folder/test.spec.ts b/internal/e2e/npm_packages/karma_stack_trace/test_folder/test.spec.ts similarity index 100% rename from internal/e2e/package_karma_stack_trace/test_folder/test.spec.ts rename to internal/e2e/npm_packages/karma_stack_trace/test_folder/test.spec.ts diff --git a/internal/e2e/package_karma_stack_trace/test_sourcemap.sh b/internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh similarity index 89% rename from internal/e2e/package_karma_stack_trace/test_sourcemap.sh rename to internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh index 0d85f8ec..1f733f8e 100755 --- a/internal/e2e/package_karma_stack_trace/test_sourcemap.sh +++ b/internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh @@ -1,5 +1,5 @@ # Execute first test. -OUTPUT=$(${RUNFILES_DIR}/package_karma_stack_trace/karma_test_chromium-local) +OUTPUT=$(${RUNFILES_DIR}/npm_packages_karma_stack_trace/karma_test_chromium-local) # Test whether the package relative TS path is printed in stack trace. echo ${OUTPUT} | grep -q "(failing.spec.ts:7:17" diff --git a/internal/e2e/package_karma_stack_trace/tsconfig.json b/internal/e2e/npm_packages/karma_stack_trace/tsconfig.json similarity index 100% rename from internal/e2e/package_karma_stack_trace/tsconfig.json rename to internal/e2e/npm_packages/karma_stack_trace/tsconfig.json diff --git a/internal/e2e/package_karma_stack_trace/yarn.lock b/internal/e2e/npm_packages/karma_stack_trace/yarn.lock similarity index 100% rename from internal/e2e/package_karma_stack_trace/yarn.lock rename to internal/e2e/npm_packages/karma_stack_trace/yarn.lock diff --git a/internal/e2e/package_typescript_2.7/.bazelrc b/internal/e2e/npm_packages/karma_typescript/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_2.7/.bazelrc rename to internal/e2e/npm_packages/karma_typescript/.bazelrc diff --git a/internal/e2e/package_typescript_karma/BUILD.bazel b/internal/e2e/npm_packages/karma_typescript/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_karma/BUILD.bazel rename to internal/e2e/npm_packages/karma_typescript/BUILD.bazel diff --git a/internal/e2e/package_typescript_karma/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE similarity index 89% rename from internal/e2e/package_typescript_karma/WORKSPACE rename to internal/e2e/npm_packages/karma_typescript/WORKSPACE index d30e254c..aab8aa70 100644 --- a/internal/e2e/package_typescript_karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -12,21 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_typescript_karma_e2e") +workspace(name = "npm_package_karma_typescript_e2e") local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../../../..", ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_karma/decrement.spec.ts b/internal/e2e/npm_packages/karma_typescript/decrement.spec.ts similarity index 100% rename from internal/e2e/package_typescript_karma/decrement.spec.ts rename to internal/e2e/npm_packages/karma_typescript/decrement.spec.ts diff --git a/internal/e2e/package_typescript_karma/decrement.ts b/internal/e2e/npm_packages/karma_typescript/decrement.ts similarity index 100% rename from internal/e2e/package_typescript_karma/decrement.ts rename to internal/e2e/npm_packages/karma_typescript/decrement.ts diff --git a/internal/e2e/npm_packages/karma_typescript/package-template.json b/internal/e2e/npm_packages/karma_typescript/package-template.json new file mode 100644 index 00000000..a2d01b35 --- /dev/null +++ b/internal/e2e/npm_packages/karma_typescript/package-template.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "@bazel/karma": "file:${BAZEL_KARMA_NPM_PACKAGE}", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", + "@types/jasmine": "2.8.2", + "typescript": "2.9.2" + }, + "scripts": { + "test": "bazel test ..." + } +} diff --git a/internal/e2e/package_typescript_2.7/tsconfig.json b/internal/e2e/npm_packages/karma_typescript/tsconfig.json similarity index 100% rename from internal/e2e/package_typescript_2.7/tsconfig.json rename to internal/e2e/npm_packages/karma_typescript/tsconfig.json diff --git a/internal/e2e/package_typescript_karma/yarn.lock b/internal/e2e/npm_packages/karma_typescript/yarn.lock similarity index 56% rename from internal/e2e/package_typescript_karma/yarn.lock rename to internal/e2e/npm_packages/karma_typescript/yarn.lock index d35f28b5..44341146 100644 --- a/internal/e2e/package_typescript_karma/yarn.lock +++ b/internal/e2e/npm_packages/karma_typescript/yarn.lock @@ -2,26 +2,27 @@ # yarn lockfile v1 -"@bazel/karma@file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package": - version "0.20.3" +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/karma/npm_package": + version "0.22.1-19-gecef600" dependencies: jasmine-core "2.8.0" - karma alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a + karma "^4.0.0" karma-chrome-launcher "2.2.0" karma-firefox-launcher "1.1.0" karma-jasmine "1.1.1" karma-requirejs "1.1.0" - karma-sauce-launcher "1.2.0" + karma-sauce-launcher "2.0.2" karma-sourcemap-loader "0.3.7" requirejs "2.3.5" + semver "5.6.0" tmp "0.0.33" -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.20.3" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": + version "0.22.1-18-g169a278" dependencies: protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" - tsickle "0.28.0" tsutils "2.27.2" "@types/jasmine@2.8.2": @@ -39,10 +40,6 @@ accepts@~1.3.4: mime-types "~2.1.18" negotiator "0.6.1" -addressparser@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" - adm-zip@~0.4.3: version "0.4.11" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a" @@ -51,31 +48,12 @@ after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" -agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0, agent-base@~4.2.0: +agent-base@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" dependencies: es6-promisify "^5.0.0" -ajv@^5.1.0, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -amqplib@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63" - dependencies: - bitsyntax "~0.0.4" - bluebird "^3.4.6" - buffer-more-ints "0.0.2" - readable-stream "1.x >=1.1.9" - safe-buffer "^5.0.1" - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -84,45 +62,18 @@ ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" + micromatch "^3.1.4" + normalize-path "^2.1.1" aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" -archiver-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174" - dependencies: - glob "^7.0.0" - graceful-fs "^4.1.0" - lazystream "^1.0.0" - lodash "^4.8.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - -archiver@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-2.1.1.tgz#ff662b4a78201494a3ee544d3a33fe7496509ebc" - dependencies: - archiver-utils "^1.3.0" - async "^2.0.0" - buffer-crc32 "^0.2.1" - glob "^7.0.0" - lodash "^4.8.0" - readable-stream "^2.0.0" - tar-stream "^1.5.0" - zip-stream "^1.2.0" - are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" @@ -130,17 +81,11 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" -arr-flatten@^1.0.1, arr-flatten@^1.1.0: +arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" @@ -171,28 +116,10 @@ ascli@~1: colour "~0.7.1" optjs "~3.2.2" -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" -ast-types@0.x.x: - version "0.11.5" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.5.tgz#9890825d660c03c28339f315e9fa0a360e31ec28" - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -201,44 +128,16 @@ async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" -async@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.0.1.tgz#b709cc0280a9c36f09f4536be823c838a9049e25" - dependencies: - lodash "^4.8.0" - -async@^2.0.0, async@^2.1.2, async@~2.6.0: +async@^2.1.2: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" dependencies: lodash "^4.17.10" -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - -aws4@^1.2.1, aws4@^1.6.0, aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - -axios@^0.15.3: - version "0.15.3" - resolved "http://registry.npmjs.org/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" - dependencies: - follow-redirects "1.0.0" - backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" @@ -251,10 +150,6 @@ base64-arraybuffer@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" -base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - base64id@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" @@ -271,12 +166,6 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - dependencies: - tweetnacl "^0.14.3" - better-assert@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" @@ -287,30 +176,11 @@ binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" -bitsyntax@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82" - dependencies: - buffer-more-ints "0.0.2" - -bl@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" - dependencies: - readable-stream "^2.3.5" - safe-buffer "^5.1.1" - -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" - dependencies: - readable-stream "~2.0.5" - blob@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" -bluebird@^3.3.0, bluebird@^3.4.6: +bluebird@^3.3.0: version "3.5.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" @@ -329,24 +199,6 @@ body-parser@^1.16.1: raw-body "2.3.3" type-is "~1.6.16" -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - dependencies: - hoek "2.x.x" - -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -360,15 +212,7 @@ braces@^0.1.2: dependencies: expand-range "^0.1.0" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: +braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" dependencies: @@ -387,17 +231,13 @@ buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" -buffer-alloc@^1.1.0, buffer-alloc@^1.2.0: +buffer-alloc@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" dependencies: buffer-alloc-unsafe "^1.1.0" buffer-fill "^1.0.0" -buffer-crc32@^0.2.1: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" @@ -406,29 +246,6 @@ buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" -buffer-more-ints@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c" - -buffer@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -buildmail@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" - dependencies: - addressparser "1.0.1" - libbase64 "0.1.0" - libmime "3.0.0" - libqp "1.1.0" - nodemailer-fetch "1.6.0" - nodemailer-shared "1.1.0" - punycode "1.4.1" - bytebuffer@~5: version "5.0.1" resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" @@ -461,46 +278,34 @@ camelcase@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -chalk@^1.1.1: - version "1.1.3" - resolved "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chokidar@^1.4.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" +chokidar@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== dependencies: - anymatch "^1.3.0" + anymatch "^2.0.0" async-each "^1.0.0" - glob-parent "^2.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" inherits "^2.0.1" is-binary-path "^1.0.0" - is-glob "^2.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" path-is-absolute "^1.0.0" readdirp "^2.0.0" + upath "^1.0.5" optionalDependencies: - fsevents "^1.0.0" + fsevents "^1.2.2" chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" -circular-json@^0.5.4: - version "0.5.7" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.7.tgz#b8be478d72ea58c7eeda26bf1cf1fba43d188842" +circular-json@^0.5.5: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== class-utils@^0.3.5: version "0.3.6" @@ -519,10 +324,6 @@ cliui@^3.0.3: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - 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" @@ -548,22 +349,6 @@ combine-lists@^1.0.0: dependencies: lodash "^4.5.0" -combined-stream@1.0.6: - version "1.0.6" - resolved "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - dependencies: - delayed-stream "~1.0.0" - -combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - dependencies: - delayed-stream "~1.0.0" - -commander@^2.9.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" - component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -576,15 +361,6 @@ component-inherit@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" -compress-commons@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-1.2.2.tgz#524a9f10903f3a813389b0225d27c48bb751890f" - dependencies: - buffer-crc32 "^0.2.1" - crc32-stream "^2.0.0" - normalize-path "^2.0.0" - readable-stream "^2.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -618,60 +394,30 @@ core-js@^2.2.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" -core-util-is@1.0.2, core-util-is@~1.0.0: +core-js@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" + integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= + +core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -crc32-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-2.0.0.tgz#e3cdd3b4df3168dd74e3de3fbbcb7b297fe908f4" - dependencies: - crc "^3.4.4" - readable-stream "^2.0.0" - -crc@^3.4.4: - version "3.8.0" - resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" - dependencies: - buffer "^5.1.0" - -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - dependencies: - boom "2.x.x" - -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - custom-event@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - dependencies: - assert-plus "^1.0.0" - -data-uri-to-buffer@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" - date-format@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" -debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@~2.6.4, debug@~2.6.6: +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" -debug@3.1.0, debug@=3.1.0, debug@~3.1.0: +debug@=3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -695,10 +441,6 @@ deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -718,18 +460,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -degenerator@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" - dependencies: - ast-types "0.x.x" - escodegen "1.x.x" - esprima "3.x.x" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" @@ -755,17 +485,6 @@ dom-serialize@^2.2.0: extend "^3.0.0" void-elements "^2.0.0" -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -774,15 +493,10 @@ encodeurl@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" -end-of-stream@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - dependencies: - once "^1.4.0" - -engine.io-client@~3.1.0: - version "3.1.6" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.6.tgz#5bdeb130f8b94a50ac5cbeb72583e7a4a063ddfd" +engine.io-client@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" + integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== dependencies: component-emitter "1.2.1" component-inherit "0.0.3" @@ -806,9 +520,10 @@ engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: blob "0.0.4" has-binary2 "~1.0.2" -engine.io@~3.1.0: - version "3.1.5" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845" +engine.io@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" + integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== dependencies: accepts "~1.3.4" base64id "1.0.0" @@ -816,8 +531,6 @@ engine.io@~3.1.0: debug "~3.1.0" engine.io-parser "~2.1.0" ws "~3.3.1" - optionalDependencies: - uws "~9.14.0" ent@~2.2.0: version "2.2.0" @@ -827,6 +540,11 @@ es6-promise@^4.0.3: version "4.2.5" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" +es6-promise@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" + integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= + es6-promisify@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" @@ -837,33 +555,6 @@ escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" -escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escodegen@1.x.x: - version "1.11.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@3.x.x, esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - eventemitter3@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" @@ -876,12 +567,6 @@ expand-braces@^0.1.1: array-unique "^0.2.1" braces "^0.1.2" -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -901,12 +586,6 @@ expand-range@^0.1.0: is-number "^0.1.1" repeat-string "^0.2.2" -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -920,16 +599,10 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1, extend@~3.0.2: +extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -943,44 +616,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - -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" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -file-uri-to-path@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1002,11 +637,10 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" -follow-redirects@1.0.0: - version "1.0.0" - resolved "http://registry.npmjs.org/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" - dependencies: - debug "^2.2.0" +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== follow-redirects@^1.0.0: version "1.5.8" @@ -1014,36 +648,10 @@ follow-redirects@^1.0.0: dependencies: debug "=3.1.0" -for-in@^1.0.1, for-in@^1.0.2: +for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.11" - -form-data@~2.3.0, form-data@~2.3.1, form-data@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - dependencies: - asynckit "^0.4.0" - combined-stream "1.0.6" - mime-types "^2.1.12" - fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -1056,10 +664,6 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -1070,20 +674,14 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" +fsevents@^1.2.2: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" -ftp@~0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -1097,53 +695,19 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -generate-function@^2.0.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" - dependencies: - is-property "^1.0.2" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -get-uri@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.2.tgz#5c795e71326f6ca1286f2fc82575cd2bab2af578" - dependencies: - data-uri-to-buffer "1" - debug "2" - extend "3" - file-uri-to-path "1" - ftp "~0.3.10" - readable-stream "2" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - dependencies: - assert-plus "^1.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: - is-glob "^2.0.0" + is-glob "^3.1.0" + path-dirname "^1.0.0" -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1: +glob@^7.0.5, glob@^7.1.1: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" dependencies: @@ -1154,43 +718,10 @@ glob@^7.0.0, glob@^7.0.5, glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - -har-validator@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" - dependencies: - ajv "^5.3.0" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - has-binary2@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" @@ -1232,39 +763,6 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - -hipchat-notifier@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e" - dependencies: - lodash "^4.0.0" - request "^2.0.0" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - http-errors@1.6.3, http-errors@~1.6.3: version "1.6.3" resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -1274,13 +772,6 @@ http-errors@1.6.3, http-errors@~1.6.3: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - dependencies: - agent-base "4" - debug "3.1.0" - http-proxy@^1.13.0: version "1.17.0" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" @@ -1289,33 +780,6 @@ http-proxy@^1.13.0: follow-redirects "^1.0.0" requires-port "^1.0.0" -http-signature@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -httpntlm@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2" - dependencies: - httpreq ">=0.4.22" - underscore "~1.7.0" - -httpreq@>=0.4.22: - version "0.4.24" - resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f" - https-proxy-agent@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" @@ -1323,10 +787,6 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" -iconv-lite@0.4.15: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" @@ -1339,28 +799,21 @@ iconv-lite@^0.4.4: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.4: - version "1.1.12" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" - ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" dependencies: minimatch "^3.0.4" +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + indexof@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" -inflection@~1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" - -inflection@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1380,10 +833,6 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" -ip@^1.1.2, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1434,16 +883,6 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -1454,9 +893,10 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^1.0.0: version "1.0.0" @@ -1468,80 +908,40 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: - is-extglob "^1.0.0" - -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" + is-extglob "^2.1.0" -is-my-json-valid@^2.12.4: - version "2.19.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz#8fd6e40363cd06b963fa877d444bfb5eddc62175" +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" + is-extglob "^2.1.1" is-number@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" dependencies: kind-of "^3.0.2" -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" dependencies: isobject "^3.0.1" -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-property@^1.0.0, is-property@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1570,42 +970,20 @@ isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - jasmine-core@2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - -json-stringify-safe@5.0.x, 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" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" +jszip@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" + integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" + core-js "~2.3.0" + es6-promise "~3.0.2" + lie "~3.1.0" + pako "~1.0.2" + readable-stream "~2.0.6" karma-chrome-launcher@2.2.0: version "2.2.0" @@ -1626,14 +1004,14 @@ karma-requirejs@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" -karma-sauce-launcher@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz#6f2558ddef3cf56879fa27540c8ae9f8bfd16bca" +karma-sauce-launcher@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" + integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== dependencies: - q "^1.5.0" - sauce-connect-launcher "^1.2.2" - saucelabs "^1.4.0" - wd "^1.4.0" + sauce-connect-launcher "^1.2.4" + saucelabs "^1.5.0" + selenium-webdriver "^4.0.0-alpha.1" karma-sourcemap-loader@0.3.7: version "0.3.7" @@ -1641,13 +1019,14 @@ karma-sourcemap-loader@0.3.7: dependencies: graceful-fs "^4.1.2" -karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: - version "1.7.1" - resolved "https://codeload.github.com/alexeagle/karma/tar.gz/fa1a84ac881485b5657cb669e9b4e5da77b79f0a" +karma@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" + integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== dependencies: bluebird "^3.3.0" body-parser "^1.16.1" - chokidar "^1.4.1" + chokidar "^2.0.3" colors "^1.1.0" combine-lists "^1.0.0" connect "^3.6.0" @@ -1655,23 +1034,24 @@ karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: di "^0.0.1" dom-serialize "^2.2.0" expand-braces "^0.1.1" + flatted "^2.0.0" glob "^7.1.1" graceful-fs "^4.1.2" http-proxy "^1.13.0" isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^2.3.9" - mime "^1.3.4" + lodash "^4.17.5" + log4js "^3.0.0" + mime "^2.3.1" minimatch "^3.0.2" optimist "^0.6.1" qjobs "^1.1.4" range-parser "^1.2.0" rimraf "^2.6.0" safe-buffer "^5.0.1" - socket.io "2.0.4" + socket.io "2.1.1" source-map "^0.6.1" tmp "0.0.33" - useragent "^2.1.12" + useragent "2.3.0" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" @@ -1693,108 +1073,50 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - dependencies: - readable-stream "^2.0.5" - lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" dependencies: invert-kv "^1.0.0" -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -libbase64@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6" - -libmime@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6" +lie@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= dependencies: - iconv-lite "0.4.15" - libbase64 "0.1.0" - libqp "1.1.0" - -libqp@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" + immediate "~3.0.5" -lodash@4.17.10: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.5.0, lodash@^4.8.0: +lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" -log4js@^2.3.9: - version "2.11.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.11.0.tgz#bf3902eff65c6923d9ce9cfbd2db54160e34005a" +log4js@^3.0.0: + version "3.0.6" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" + integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== dependencies: - circular-json "^0.5.4" + circular-json "^0.5.5" date-format "^1.2.0" debug "^3.1.0" - semver "^5.5.0" + rfdc "^1.1.2" streamroller "0.7.0" - optionalDependencies: - amqplib "^0.5.2" - axios "^0.15.3" - hipchat-notifier "^1.1.0" - loggly "^1.1.0" - mailgun-js "^0.18.0" - nodemailer "^2.5.0" - redis "^2.7.1" - slack-node "~0.2.0" - -loggly@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee" - dependencies: - json-stringify-safe "5.0.x" - request "2.75.x" - timespan "2.3.x" long@~3: version "3.2.0" resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" -lru-cache@4.1.x, lru-cache@^4.1.2: +lru-cache@4.1.x: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" dependencies: pseudomap "^1.0.2" yallist "^2.1.2" -mailcomposer@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4" - dependencies: - buildmail "4.0.1" - libmime "3.0.0" - -mailgun-js@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.1.tgz#ee39aa18d7bb598a5ce9ede84afb681defc8a6b0" - dependencies: - async "~2.6.0" - debug "~3.1.0" - form-data "~2.3.0" - inflection "~1.12.0" - is-stream "^1.1.0" - path-proxy "~1.0.0" - promisify-call "^2.0.2" - proxy-agent "~3.0.0" - tsscmp "~1.0.0" - map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -1805,33 +1127,11 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10: +micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" dependencies: @@ -1853,15 +1153,16 @@ mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.19, mime-types@~2.1.7: +mime-types@~2.1.18: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" dependencies: mime-db "~1.36.0" -mime@^1.3.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +mime@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" @@ -1947,10 +1248,6 @@ negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" -netmask@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" - node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" @@ -1966,59 +1263,6 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - -nodemailer-direct-transport@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86" - dependencies: - nodemailer-shared "1.1.0" - smtp-connection "2.12.0" - -nodemailer-fetch@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4" - -nodemailer-shared@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0" - dependencies: - nodemailer-fetch "1.6.0" - -nodemailer-smtp-pool@2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-smtp-transport@2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-wellknown@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5" - -nodemailer@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9" - dependencies: - libmime "3.0.0" - mailcomposer "4.0.1" - nodemailer-direct-transport "3.3.2" - nodemailer-shared "1.1.0" - nodemailer-smtp-pool "2.8.2" - nodemailer-smtp-transport "2.7.2" - socks "1.1.9" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -2026,9 +1270,10 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" @@ -2060,14 +1305,6 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1, oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2090,13 +1327,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -2109,7 +1339,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2122,17 +1352,6 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - 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" - optjs@~3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" @@ -2147,7 +1366,7 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2158,37 +1377,10 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -pac-proxy-agent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-3.0.0.tgz#11d578b72a164ad74bf9d5bac9ff462a38282432" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - get-uri "^2.0.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - pac-resolver "^3.0.0" - raw-body "^2.2.0" - socks-proxy-agent "^4.0.1" - -pac-resolver@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-3.0.0.tgz#6aea30787db0a891704deb7800a722a7615a6f26" - dependencies: - co "^4.6.0" - degenerator "^1.0.4" - ip "^1.1.5" - netmask "^1.0.6" - thunkify "^2.1.2" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" +pako@~1.0.2: + version "1.0.8" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" + integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== parseqs@0.0.5: version "0.0.5" @@ -2210,42 +1402,19 @@ pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-proxy@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e" - dependencies: - inflection "~1.3.0" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -2254,12 +1423,6 @@ 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" -promisify-call@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba" - dependencies: - with-callback "^1.0.2" - protobufjs@5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" @@ -2269,68 +1432,23 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" -proxy-agent@~3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.3.tgz#1c1a33db60ef5f2e9e35b876fd63c2bc681c611d" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" - pac-proxy-agent "^3.0.0" - proxy-from-env "^1.0.0" - socks-proxy-agent "^4.0.1" - -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -psl@^1.1.24: - version "1.1.29" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" - -punycode@1.4.1, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -q@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" - -q@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - qjobs@^1.1.4: version "1.2.0" resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" -qs@6.5.2, qs@~6.5.1, qs@~6.5.2: +qs@6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - -randomatic@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - range-parser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" -raw-body@2.3.3, raw-body@^2.2.0: +raw-body@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" dependencies: @@ -2348,16 +1466,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -readable-stream@1.1.x, "readable-stream@1.x >=1.1.9": - version "1.1.14" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.3.0, readable-stream@^2.3.5: +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: version "2.3.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -2369,9 +1478,10 @@ readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stre string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@~2.0.5: +readable-stream@~2.0.6: version "2.0.6" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" @@ -2388,28 +1498,6 @@ readdirp@^2.0.0: micromatch "^3.1.10" readable-stream "^2.0.2" -redis-commands@^1.2.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2" - -redis-parser@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" - -redis@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" - dependencies: - double-ended-queue "^2.1.0-0" - redis-commands "^1.2.0" - redis-parser "^2.6.0" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -2429,97 +1517,10 @@ repeat-string@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" -repeat-string@^1.5.2, repeat-string@^1.6.1: +repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" -request@2.75.x: - version "2.75.0" - resolved "http://registry.npmjs.org/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.0.0" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - -request@2.85.0: - version "2.85.0" - resolved "http://registry.npmjs.org/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -request@^2.0.0, request@^2.74.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -requestretry@^1.2.2: - version "1.13.0" - resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94" - dependencies: - extend "^3.0.0" - lodash "^4.15.0" - request "^2.74.0" - when "^3.7.7" - requirejs@2.3.5: version "2.3.5" resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" @@ -2536,13 +1537,18 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" +rfdc@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" + integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== + rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: glob "^7.0.5" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +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" @@ -2552,13 +1558,14 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" -sauce-connect-launcher@^1.2.2: +sauce-connect-launcher@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" + integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== dependencies: adm-zip "~0.4.3" async "^2.1.2" @@ -2566,17 +1573,33 @@ sauce-connect-launcher@^1.2.2: lodash "^4.16.6" rimraf "^2.5.4" -saucelabs@^1.4.0: +saucelabs@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" + integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== dependencies: https-proxy-agent "^2.2.1" -sax@^1.2.4: +sax@>=0.6.0, sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -semver@^5.3.0, semver@^5.5.0: +selenium-webdriver@^4.0.0-alpha.1: + version "4.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" + integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +semver@^5.3.0: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" @@ -2610,27 +1633,6 @@ signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" -slack-node@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30" - dependencies: - requestretry "^1.2.2" - -smart-buffer@^1.0.4: - version "1.1.15" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" - -smart-buffer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" - -smtp-connection@2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" - dependencies: - httpntlm "1.6.1" - nodemailer-shared "1.1.0" - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -2658,79 +1660,50 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - dependencies: - hoek "2.x.x" - -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - dependencies: - hoek "4.x.x" - socket.io-adapter@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" -socket.io-client@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e" +socket.io-client@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" + integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== dependencies: backo2 "1.0.2" base64-arraybuffer "0.1.5" component-bind "1.0.0" component-emitter "1.2.1" - debug "~2.6.4" - engine.io-client "~3.1.0" + debug "~3.1.0" + engine.io-client "~3.2.0" + has-binary2 "~1.0.2" has-cors "1.1.0" indexof "0.0.1" object-component "0.0.3" parseqs "0.0.5" parseuri "0.0.5" - socket.io-parser "~3.1.1" + socket.io-parser "~3.2.0" to-array "0.1.4" -socket.io-parser@~3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e" +socket.io-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" + integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== dependencies: component-emitter "1.2.1" debug "~3.1.0" - has-binary2 "~1.0.2" isarray "2.0.1" -socket.io@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014" +socket.io@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" + integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== dependencies: - debug "~2.6.6" - engine.io "~3.1.0" + debug "~3.1.0" + engine.io "~3.2.0" + has-binary2 "~1.0.2" socket.io-adapter "~1.1.0" - socket.io-client "2.0.4" - socket.io-parser "~3.1.1" - -socks-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" - dependencies: - agent-base "~4.2.0" - socks "~2.2.0" - -socks@1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" - dependencies: - ip "^1.1.2" - smart-buffer "^1.0.4" - -socks@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" - dependencies: - ip "^1.1.5" - smart-buffer "^4.0.1" + socket.io-client "2.1.1" + socket.io-parser "~3.2.0" source-map-resolve@^0.5.0: version "0.5.2" @@ -2742,7 +1715,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@0.5.9, source-map-support@^0.5.0: +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" dependencies: @@ -2757,7 +1730,7 @@ source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -2767,21 +1740,6 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -sshpk@^1.7.0: - version "1.14.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - safer-buffer "^2.0.2" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -2831,10 +1789,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringstream@~0.0.4, stringstream@~0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -2851,22 +1805,6 @@ 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" -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -tar-stream@^1.5.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" - dependencies: - bl "^1.0.0" - buffer-alloc "^1.1.0" - end-of-stream "^1.0.0" - fs-constants "^1.0.0" - readable-stream "^2.3.0" - to-buffer "^1.1.0" - xtend "^4.0.0" - tar@^4: version "4.4.6" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" @@ -2879,13 +1817,12 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -thunkify@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" - -timespan@2.3.x: - version "2.3.0" - resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" +tmp@0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + dependencies: + os-tmpdir "~1.0.1" tmp@0.0.33, tmp@0.0.x: version "0.0.33" @@ -2897,10 +1834,6 @@ to-array@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" -to-buffer@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -2923,62 +1856,16 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" -tsscmp@~1.0.0: - version "1.0.6" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" - tsutils@2.27.2: version "2.27.2" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" 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" - dependencies: - safe-buffer "^5.0.1" - -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" @@ -2994,10 +1881,6 @@ ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" -underscore@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" - union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -3018,6 +1901,11 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -3026,9 +1914,10 @@ use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" -useragent@^2.1.12: +useragent@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" + integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== dependencies: lru-cache "4.1.x" tmp "0.0.x" @@ -3041,46 +1930,10 @@ utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" -uuid@^3.1.0, uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - -uws@~9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95" - -vargs@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/vargs/-/vargs-0.1.0.tgz#6b6184da6520cc3204ce1b407cac26d92609ebff" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - void-elements@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" -wd@^1.4.0: - version "1.10.3" - resolved "https://registry.yarnpkg.com/wd/-/wd-1.10.3.tgz#395ac7eb58a98e556369f8f8e5f845d91fb152a3" - dependencies: - archiver "2.1.1" - async "2.0.1" - lodash "4.17.10" - mkdirp "^0.5.1" - q "1.4.1" - request "2.85.0" - vargs "0.1.0" - -when@^3.7.7: - version "3.7.8" - resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82" - which@^1.2.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -3097,18 +1950,10 @@ window-size@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" -with-callback@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/with-callback/-/with-callback-1.0.2.tgz#a09629b9a920028d721404fb435bdcff5c91bc21" - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wrap-ansi@^2.0.0: version "2.1.0" resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -3128,18 +1973,23 @@ ws@~3.3.1: safe-buffer "~5.1.0" ultron "~1.1.0" +xml2js@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= + xmlhttprequest-ssl@~1.5.4: version "1.5.5" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - y18n@^3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -3167,12 +2017,3 @@ yargs@^3.10.0: yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - -zip-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04" - dependencies: - archiver-utils "^1.3.0" - compress-commons "^1.2.0" - lodash "^4.8.0" - readable-stream "^2.0.0" diff --git a/internal/e2e/npm_packages/test.sh b/internal/e2e/npm_packages/test.sh new file mode 100755 index 00000000..cb769dad --- /dev/null +++ b/internal/e2e/npm_packages/test.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +set -u -e -o pipefail + +cd $(dirname "$0") +TESTS_ROOT_DIR=$(pwd) + +echo "" +echo "#################################################################################" +echo "Running all npm package e2e tests under $TESTS_ROOT_DIR" +echo "" +echo "To run a specific test run this script with `--test ` where " +echo "is the name of the test folder to run" +echo "" +echo "Run this script with `--update-lock-files` to update yarn.lock files" +echo "instead of running tests" +echo "" + +# Determine the absolute paths to the generated @bazel/typescript and @bazel/karma npm packages +cd $TESTS_ROOT_DIR/../../.. +BAZEL=$(pwd)/node_modules/.bin/bazel +if [[ ! -f $BAZEL ]] ; then + echo "Bazel not found under $BAZEL" + exit 1 +fi +BAZEL_BIN=$($BAZEL info bazel-bin) +BAZEL_TYPESCRIPT_NPM_PACKAGE=$BAZEL_BIN/internal/npm_package +BAZEL_KARMA_NPM_PACKAGE=$BAZEL_BIN/internal/karma/npm_package +echo "@bazel/typescript: $BAZEL_TYPESCRIPT_NPM_PACKAGE" +echo "@bazel/karma: $BAZEL_KARMA_NPM_PACKAGE" + +# Now run all e2e tests +cd $TESTS_ROOT_DIR +for testDir in $(ls) ; do + [[ -d "$testDir" ]] || continue + ( + cd $testDir + echo "" + echo "#################################################################################" + echo "Running npm package e2e test $(pwd)" + echo "" + if [[ ! -f "package-template.json" ]] ; then + echo "No package-template.json file found in $testDir" + exit 1 + fi + # Generate package.json subsituting variables + # BAZEL_TYPESCRIPT_NPM_PACKAGE and BAZEL_KARMA_NPM_PACKAGE + ESCAPED_TYPESCRIPT=$(echo $BAZEL_TYPESCRIPT_NPM_PACKAGE | sed 's/\//\\\//g') + ESCAPED_KARMA=$(echo $BAZEL_KARMA_NPM_PACKAGE | sed 's/\//\\\//g') + sed -e "s/\${BAZEL_TYPESCRIPT_NPM_PACKAGE}/$ESCAPED_TYPESCRIPT/" -e "s/\${BAZEL_KARMA_NPM_PACKAGE}/$ESCAPED_KARMA/" package-template.json > package.json + if [[ $# -ge 1 && $1 = "--update-lock-files" ]] ; then + # Update yarn.lock files + echo "Running yarn install to update lock file" + yarn install + else + if [[ $# -ge 2 && $1 = "--test" && $2 != $testDir ]] ; then + # Skip this test + echo "Skipping test that was not specified in --test argument" + else + # Run tests + yarn test + fi + fi + ) +done diff --git a/internal/e2e/package_typescript_2.8/.bazelrc b/internal/e2e/npm_packages/typescript_2.7/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_2.8/.bazelrc rename to internal/e2e/npm_packages/typescript_2.7/.bazelrc diff --git a/internal/e2e/package_typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_2.7/BUILD.bazel rename to internal/e2e/npm_packages/typescript_2.7/BUILD.bazel diff --git a/internal/e2e/package_typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE similarity index 86% rename from internal/e2e/package_typescript_2.9/WORKSPACE rename to internal/e2e/npm_packages/typescript_2.7/WORKSPACE index bfc88db6..f585fb66 100644 --- a/internal/e2e/package_typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -12,21 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_typescript_29_e2e") +workspace(name = "npm_packages_typescript_27_e2e") local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../../../..", ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.7/main.spec.ts b/internal/e2e/npm_packages/typescript_2.7/main.spec.ts similarity index 100% rename from internal/e2e/package_typescript_2.7/main.spec.ts rename to internal/e2e/npm_packages/typescript_2.7/main.spec.ts diff --git a/internal/e2e/package_typescript_2.7/main.ts b/internal/e2e/npm_packages/typescript_2.7/main.ts similarity index 100% rename from internal/e2e/package_typescript_2.7/main.ts rename to internal/e2e/npm_packages/typescript_2.7/main.ts diff --git a/internal/e2e/package_typescript_2.7/package.json b/internal/e2e/npm_packages/typescript_2.7/package-template.json similarity index 54% rename from internal/e2e/package_typescript_2.7/package.json rename to internal/e2e/npm_packages/typescript_2.7/package-template.json index 26c1fd8c..dd80dfa7 100644 --- a/internal/e2e/package_typescript_2.7/package.json +++ b/internal/e2e/npm_packages/typescript_2.7/package-template.json @@ -1,9 +1,12 @@ { "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", "@types/jasmine": "2.8.2", "@types/node": "7.0.18", "jasmine": "2.8.0", "typescript": "2.7.x" + }, + "scripts": { + "test": "bazel test ..." } } diff --git a/internal/e2e/package_typescript_2.8/tsconfig.json b/internal/e2e/npm_packages/typescript_2.7/tsconfig.json similarity index 100% rename from internal/e2e/package_typescript_2.8/tsconfig.json rename to internal/e2e/npm_packages/typescript_2.7/tsconfig.json diff --git a/internal/e2e/package_typescript_2.7/yarn.lock b/internal/e2e/npm_packages/typescript_2.7/yarn.lock similarity index 94% rename from internal/e2e/package_typescript_2.7/yarn.lock rename to internal/e2e/npm_packages/typescript_2.7/yarn.lock index 474a2b8f..3f71f88b 100644 --- a/internal/e2e/package_typescript_2.7/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.7/yarn.lock @@ -2,10 +2,11 @@ # yarn lockfile v1 -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.22.0-1-g1e6d07d" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": + version "0.22.1-18-g169a278" dependencies: protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" tsutils "2.27.2" @@ -178,6 +179,11 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" diff --git a/internal/e2e/package_typescript_2.9/.bazelrc b/internal/e2e/npm_packages/typescript_2.8/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_2.9/.bazelrc rename to internal/e2e/npm_packages/typescript_2.8/.bazelrc diff --git a/internal/e2e/package_typescript_2.8/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_2.8/BUILD.bazel rename to internal/e2e/npm_packages/typescript_2.8/BUILD.bazel diff --git a/internal/e2e/package_typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE similarity index 86% rename from internal/e2e/package_typescript_2.7/WORKSPACE rename to internal/e2e/npm_packages/typescript_2.8/WORKSPACE index ec663136..8866bbd6 100644 --- a/internal/e2e/package_typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -12,21 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_typescript_27_e2e") +workspace(name = "npm_packages_typescript_28_e2e") local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../../../..", ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.8/main.spec.ts b/internal/e2e/npm_packages/typescript_2.8/main.spec.ts similarity index 100% rename from internal/e2e/package_typescript_2.8/main.spec.ts rename to internal/e2e/npm_packages/typescript_2.8/main.spec.ts diff --git a/internal/e2e/package_typescript_2.8/main.ts b/internal/e2e/npm_packages/typescript_2.8/main.ts similarity index 100% rename from internal/e2e/package_typescript_2.8/main.ts rename to internal/e2e/npm_packages/typescript_2.8/main.ts diff --git a/internal/e2e/package_typescript_2.8/package.json b/internal/e2e/npm_packages/typescript_2.8/package-template.json similarity index 54% rename from internal/e2e/package_typescript_2.8/package.json rename to internal/e2e/npm_packages/typescript_2.8/package-template.json index d67c935f..b0fb4851 100644 --- a/internal/e2e/package_typescript_2.8/package.json +++ b/internal/e2e/npm_packages/typescript_2.8/package-template.json @@ -1,9 +1,12 @@ { "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", "@types/jasmine": "2.8.2", "@types/node": "7.0.18", "jasmine": "2.8.0", "typescript": "2.8.x" + }, + "scripts": { + "test": "bazel test ..." } } diff --git a/internal/e2e/package_typescript_2.9/tsconfig.json b/internal/e2e/npm_packages/typescript_2.8/tsconfig.json similarity index 100% rename from internal/e2e/package_typescript_2.9/tsconfig.json rename to internal/e2e/npm_packages/typescript_2.8/tsconfig.json diff --git a/internal/e2e/package_typescript_2.8/yarn.lock b/internal/e2e/npm_packages/typescript_2.8/yarn.lock similarity index 94% rename from internal/e2e/package_typescript_2.8/yarn.lock rename to internal/e2e/npm_packages/typescript_2.8/yarn.lock index cc4f619d..6edcd7e8 100644 --- a/internal/e2e/package_typescript_2.8/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.8/yarn.lock @@ -2,10 +2,11 @@ # yarn lockfile v1 -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.22.0-1-g1e6d07d" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": + version "0.22.1-18-g169a278" dependencies: protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" tsutils "2.27.2" @@ -178,6 +179,11 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" diff --git a/internal/e2e/package_typescript_3.0/.bazelrc b/internal/e2e/npm_packages/typescript_2.9/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_3.0/.bazelrc rename to internal/e2e/npm_packages/typescript_2.9/.bazelrc diff --git a/internal/e2e/package_typescript_2.9/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_2.9/BUILD.bazel rename to internal/e2e/npm_packages/typescript_2.9/BUILD.bazel diff --git a/internal/e2e/package_typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE similarity index 86% rename from internal/e2e/package_typescript_2.8/WORKSPACE rename to internal/e2e/npm_packages/typescript_2.9/WORKSPACE index 558b6905..1758dec3 100644 --- a/internal/e2e/package_typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -12,21 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_typescript_28_e2e") +workspace(name = "npm_packages_typescript_29_e2e") local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../../../..", ) load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_2.9/main.spec.ts b/internal/e2e/npm_packages/typescript_2.9/main.spec.ts similarity index 100% rename from internal/e2e/package_typescript_2.9/main.spec.ts rename to internal/e2e/npm_packages/typescript_2.9/main.spec.ts diff --git a/internal/e2e/package_typescript_2.9/main.ts b/internal/e2e/npm_packages/typescript_2.9/main.ts similarity index 100% rename from internal/e2e/package_typescript_2.9/main.ts rename to internal/e2e/npm_packages/typescript_2.9/main.ts diff --git a/internal/e2e/package_typescript_2.9/package.json b/internal/e2e/npm_packages/typescript_2.9/package-template.json similarity index 54% rename from internal/e2e/package_typescript_2.9/package.json rename to internal/e2e/npm_packages/typescript_2.9/package-template.json index 5907089c..31480f03 100644 --- a/internal/e2e/package_typescript_2.9/package.json +++ b/internal/e2e/npm_packages/typescript_2.9/package-template.json @@ -1,9 +1,12 @@ { "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", "@types/jasmine": "2.8.2", "@types/node": "7.0.18", "jasmine": "2.8.0", "typescript": "2.9.x" + }, + "scripts": { + "test": "bazel test ..." } } diff --git a/internal/e2e/package_typescript_3.0/tsconfig.json b/internal/e2e/npm_packages/typescript_2.9/tsconfig.json similarity index 100% rename from internal/e2e/package_typescript_3.0/tsconfig.json rename to internal/e2e/npm_packages/typescript_2.9/tsconfig.json diff --git a/internal/e2e/package_typescript_2.9/yarn.lock b/internal/e2e/npm_packages/typescript_2.9/yarn.lock similarity index 94% rename from internal/e2e/package_typescript_2.9/yarn.lock rename to internal/e2e/npm_packages/typescript_2.9/yarn.lock index abb04b31..a0a84fcc 100644 --- a/internal/e2e/package_typescript_2.9/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.9/yarn.lock @@ -2,10 +2,11 @@ # yarn lockfile v1 -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.22.0-1-g1e6d07d" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": + version "0.22.1-18-g169a278" dependencies: protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" tsutils "2.27.2" @@ -178,6 +179,11 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" diff --git a/internal/e2e/package_typescript_3.1/.bazelrc b/internal/e2e/npm_packages/typescript_3.0/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_3.1/.bazelrc rename to internal/e2e/npm_packages/typescript_3.0/.bazelrc diff --git a/internal/e2e/package_typescript_3.0/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_3.0/BUILD.bazel rename to internal/e2e/npm_packages/typescript_3.0/BUILD.bazel diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE new file mode 100644 index 00000000..92816e4f --- /dev/null +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -0,0 +1,38 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "npm_packages_typescript_30_e2e") + +local_repository( + name = "build_bazel_rules_typescript", + path = "../../../..", +) + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories(preserve_symlinks = True) + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/package_typescript_3.0/main.spec.ts b/internal/e2e/npm_packages/typescript_3.0/main.spec.ts similarity index 100% rename from internal/e2e/package_typescript_3.0/main.spec.ts rename to internal/e2e/npm_packages/typescript_3.0/main.spec.ts diff --git a/internal/e2e/package_typescript_3.0/main.ts b/internal/e2e/npm_packages/typescript_3.0/main.ts similarity index 100% rename from internal/e2e/package_typescript_3.0/main.ts rename to internal/e2e/npm_packages/typescript_3.0/main.ts diff --git a/internal/e2e/package_typescript_3.0/package.json b/internal/e2e/npm_packages/typescript_3.0/package-template.json similarity index 54% rename from internal/e2e/package_typescript_3.0/package.json rename to internal/e2e/npm_packages/typescript_3.0/package-template.json index 1d3eb0fc..23f78b62 100644 --- a/internal/e2e/package_typescript_3.0/package.json +++ b/internal/e2e/npm_packages/typescript_3.0/package-template.json @@ -1,9 +1,12 @@ { "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", "@types/jasmine": "2.8.2", "@types/node": "7.0.18", "jasmine": "2.8.0", "typescript": "3.0.x" + }, + "scripts": { + "test": "bazel test ..." } } diff --git a/internal/e2e/package_typescript_3.1/tsconfig.json b/internal/e2e/npm_packages/typescript_3.0/tsconfig.json similarity index 100% rename from internal/e2e/package_typescript_3.1/tsconfig.json rename to internal/e2e/npm_packages/typescript_3.0/tsconfig.json diff --git a/internal/e2e/package_typescript_3.0/yarn.lock b/internal/e2e/npm_packages/typescript_3.0/yarn.lock similarity index 94% rename from internal/e2e/package_typescript_3.0/yarn.lock rename to internal/e2e/npm_packages/typescript_3.0/yarn.lock index f2b74f8d..6177ba67 100644 --- a/internal/e2e/package_typescript_3.0/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.0/yarn.lock @@ -2,10 +2,11 @@ # yarn lockfile v1 -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.22.0-1-g1e6d07d" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": + version "0.22.1-18-g169a278" dependencies: protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" tsutils "2.27.2" @@ -178,6 +179,11 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" diff --git a/internal/e2e/package_typescript_3.1_no_npm/.bazelrc b/internal/e2e/npm_packages/typescript_3.1/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_3.1_no_npm/.bazelrc rename to internal/e2e/npm_packages/typescript_3.1/.bazelrc diff --git a/internal/e2e/package_typescript_3.1/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_3.1/BUILD.bazel rename to internal/e2e/npm_packages/typescript_3.1/BUILD.bazel diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE new file mode 100644 index 00000000..92816e4f --- /dev/null +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -0,0 +1,38 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "npm_packages_typescript_30_e2e") + +local_repository( + name = "build_bazel_rules_typescript", + path = "../../../..", +) + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories(preserve_symlinks = True) + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/package_typescript_3.1/main.spec.ts b/internal/e2e/npm_packages/typescript_3.1/main.spec.ts similarity index 100% rename from internal/e2e/package_typescript_3.1/main.spec.ts rename to internal/e2e/npm_packages/typescript_3.1/main.spec.ts diff --git a/internal/e2e/package_typescript_3.1/main.ts b/internal/e2e/npm_packages/typescript_3.1/main.ts similarity index 100% rename from internal/e2e/package_typescript_3.1/main.ts rename to internal/e2e/npm_packages/typescript_3.1/main.ts diff --git a/internal/e2e/package_typescript_3.1/package.json b/internal/e2e/npm_packages/typescript_3.1/package-template.json similarity index 54% rename from internal/e2e/package_typescript_3.1/package.json rename to internal/e2e/npm_packages/typescript_3.1/package-template.json index fb560b50..b53c57a7 100644 --- a/internal/e2e/package_typescript_3.1/package.json +++ b/internal/e2e/npm_packages/typescript_3.1/package-template.json @@ -1,9 +1,12 @@ { "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", "@types/jasmine": "2.8.2", "@types/node": "7.0.18", "jasmine": "2.8.0", "typescript": "3.1.x" + }, + "scripts": { + "test": "bazel test ..." } } diff --git a/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json b/internal/e2e/npm_packages/typescript_3.1/tsconfig.json similarity index 100% rename from internal/e2e/package_typescript_3.1_no_npm/tsconfig.json rename to internal/e2e/npm_packages/typescript_3.1/tsconfig.json diff --git a/internal/e2e/package_typescript_3.1/yarn.lock b/internal/e2e/npm_packages/typescript_3.1/yarn.lock similarity index 94% rename from internal/e2e/package_typescript_3.1/yarn.lock rename to internal/e2e/npm_packages/typescript_3.1/yarn.lock index 9033fe3e..2fdc680e 100644 --- a/internal/e2e/package_typescript_3.1/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.1/yarn.lock @@ -2,10 +2,11 @@ # yarn lockfile v1 -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.22.0-1-g1e6d07d" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": + version "0.22.1-18-g169a278" dependencies: protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" tsutils "2.27.2" @@ -178,6 +179,11 @@ protobufjs@5.0.3: glob "^7.0.5" yargs "^3.10.0" +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" diff --git a/internal/e2e/package_karma/package.json b/internal/e2e/package_karma/package.json deleted file mode 100644 index f91e5bbd..00000000 --- a/internal/e2e/package_karma/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "@bazel/karma": "file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package", - "karma": "3.0.0" - } -} diff --git a/internal/e2e/package_karma_stack_trace/package.json b/internal/e2e/package_karma_stack_trace/package.json deleted file mode 100644 index 87f725b9..00000000 --- a/internal/e2e/package_karma_stack_trace/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", - "@bazel/karma": "file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package", - "@types/jasmine": "2.8.2", - "typescript": "3.1.x" - } -} diff --git a/internal/e2e/package_typescript_karma/tsconfig.json b/internal/e2e/package_karma_stack_trace/tsconfig.json.oss similarity index 100% rename from internal/e2e/package_typescript_karma/tsconfig.json rename to internal/e2e/package_karma_stack_trace/tsconfig.json.oss diff --git a/internal/e2e/package_typescript_2.7/tsconfig.json.oss b/internal/e2e/package_typescript_2.7/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_2.8/tsconfig.json.oss b/internal/e2e/package_typescript_2.8/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_2.9/tsconfig.json.oss b/internal/e2e/package_typescript_2.9/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_3.0/tsconfig.json.oss b/internal/e2e/package_typescript_3.0/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_3.1/WORKSPACE b/internal/e2e/package_typescript_3.1/WORKSPACE deleted file mode 100644 index 6ac19531..00000000 --- a/internal/e2e/package_typescript_3.1/WORKSPACE +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "package_typescript_30_e2e") - -local_repository( - name = "build_bazel_rules_typescript", - path = "../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories(preserve_symlinks = True) - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/package_typescript_3.1/tsconfig.json.oss b/internal/e2e/package_typescript_3.1/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE b/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE deleted file mode 100644 index 6ac19531..00000000 --- a/internal/e2e/package_typescript_3.1_no_npm/WORKSPACE +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "package_typescript_30_e2e") - -local_repository( - name = "build_bazel_rules_typescript", - path = "../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories(preserve_symlinks = True) - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json.oss b/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_karma/package.json b/internal/e2e/package_typescript_karma/package.json deleted file mode 100644 index 98fa1871..00000000 --- a/internal/e2e/package_typescript_karma/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dependencies": { - "@bazel/karma": "file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package", - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", - "@types/jasmine": "2.8.2", - "typescript": "2.9.2" - } -} diff --git a/internal/e2e/package_typescript_karma/tsconfig.json.oss b/internal/e2e/package_typescript_karma/tsconfig.json.oss new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/ts_auto_deps/WORKSPACE b/internal/e2e/ts_auto_deps/WORKSPACE index 2fbfb888..49f673db 100644 --- a/internal/e2e/ts_auto_deps/WORKSPACE +++ b/internal/e2e/ts_auto_deps/WORKSPACE @@ -25,10 +25,6 @@ rules_typescript_dependencies() rules_typescript_dev_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/ts_auto_deps/package.json b/internal/e2e/ts_auto_deps/package.json index 74af3ee5..b51c2ea1 100644 --- a/internal/e2e/ts_auto_deps/package.json +++ b/internal/e2e/ts_auto_deps/package.json @@ -2,5 +2,8 @@ "dependencies": { "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", "typescript": "2.9.2" + }, + "scripts": { + "test": "bazel run @build_bazel_rules_typescript//ts_auto_deps -- -recursive && bazel build simple" } } diff --git a/internal/e2e/package_typescript_karma/.bazelrc b/internal/e2e/typescript_3.1/.bazelrc similarity index 100% rename from internal/e2e/package_typescript_karma/.bazelrc rename to internal/e2e/typescript_3.1/.bazelrc diff --git a/internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel b/internal/e2e/typescript_3.1/BUILD.bazel similarity index 100% rename from internal/e2e/package_typescript_3.1_no_npm/BUILD.bazel rename to internal/e2e/typescript_3.1/BUILD.bazel diff --git a/internal/e2e/package_typescript_3.0/WORKSPACE b/internal/e2e/typescript_3.1/WORKSPACE similarity index 88% rename from internal/e2e/package_typescript_3.0/WORKSPACE rename to internal/e2e/typescript_3.1/WORKSPACE index 6ac19531..6b022fa7 100644 --- a/internal/e2e/package_typescript_3.0/WORKSPACE +++ b/internal/e2e/typescript_3.1/WORKSPACE @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_typescript_30_e2e") +workspace(name = "typescript_31") local_repository( name = "build_bazel_rules_typescript", @@ -23,10 +23,6 @@ load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependenci rules_typescript_dependencies() -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") - -rules_nodejs_dependencies() - load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = True) diff --git a/internal/e2e/package_typescript_3.1_no_npm/main.spec.ts b/internal/e2e/typescript_3.1/main.spec.ts similarity index 100% rename from internal/e2e/package_typescript_3.1_no_npm/main.spec.ts rename to internal/e2e/typescript_3.1/main.spec.ts diff --git a/internal/e2e/package_typescript_3.1_no_npm/main.ts b/internal/e2e/typescript_3.1/main.ts similarity index 100% rename from internal/e2e/package_typescript_3.1_no_npm/main.ts rename to internal/e2e/typescript_3.1/main.ts diff --git a/internal/e2e/package_typescript_3.1_no_npm/package.json b/internal/e2e/typescript_3.1/package.json similarity index 83% rename from internal/e2e/package_typescript_3.1_no_npm/package.json rename to internal/e2e/typescript_3.1/package.json index 44bb87ec..37929100 100644 --- a/internal/e2e/package_typescript_3.1_no_npm/package.json +++ b/internal/e2e/typescript_3.1/package.json @@ -8,5 +8,8 @@ "tsickle": "0.33.1", "tsutils": "2.27.2", "typescript": "3.1.x" + }, + "scripts": { + "test": "bazel test ..." } } diff --git a/internal/e2e/typescript_3.1/tsconfig.json b/internal/e2e/typescript_3.1/tsconfig.json new file mode 100644 index 00000000..e69de29b diff --git a/internal/e2e/package_typescript_3.1_no_npm/yarn.lock b/internal/e2e/typescript_3.1/yarn.lock similarity index 100% rename from internal/e2e/package_typescript_3.1_no_npm/yarn.lock rename to internal/e2e/typescript_3.1/yarn.lock diff --git a/package.bzl b/package.bzl index f0d3b321..68d1afd0 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.6.zip"], - strip_prefix = "rules_nodejs-0.16.6", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.7.zip"], + strip_prefix = "rules_nodejs-0.16.7", ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.json b/package.json index 1394247d..176f49fa 100644 --- a/package.json +++ b/package.json @@ -38,24 +38,16 @@ "which": "~1.0.5" }, "scripts": { - "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build examples/app:e2e && bazel build examples/protocol_buffers:e2e", - "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-package_karma && yarn e2e-package_karma_stack_trace && yarn e2e-package_typescript && yarn e2e-package_typescript_karma && yarn e2e-ts_auto_deps", + "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e //internal:npm_package //internal/karma:npm_package", + "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-npm_packages && yarn e2e-ts_auto_deps && yarn e2e-typescript_3.1", "e2e-bazel-external": "jasmine internal/e2e/default_tsconfig_test.js", - "e2e-examples-app-devserver": "concurrently \"bazel run examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", - "e2e-examples-app-prodserver": "concurrently \"bazel run examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", - "e2e-examples-protobuf-devserver": "concurrently \"bazel run examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", - "e2e-examples-protobuf-prodserver": "concurrently \"bazel run examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", - "e2e-package_karma": "cd internal/e2e/package_karma; bazel test ...", - "e2e-package_karma_stack_trace": "cd internal/e2e/package_karma_stack_trace; bazel test ...", - "e2e-package_typescript": "yarn e2e-package_typescript_2.7 && yarn e2e-package_typescript_2.8 && yarn e2e-package_typescript_2.9 && yarn e2e-package_typescript_3.0 && yarn e2e-package_typescript_3.1 && yarn e2e-package_typescript_3.1_no_npm", - "e2e-package_typescript_2.7": "cd internal/e2e/package_typescript_2.7; bazel test ...", - "e2e-package_typescript_2.8": "cd internal/e2e/package_typescript_2.8; bazel test ...", - "e2e-package_typescript_2.9": "cd internal/e2e/package_typescript_2.9; bazel test ...", - "e2e-package_typescript_3.0": "cd internal/e2e/package_typescript_3.0; bazel test ...", - "e2e-package_typescript_3.1": "cd internal/e2e/package_typescript_3.1; bazel test ...", - "e2e-package_typescript_3.1_no_npm": "cd internal/e2e/package_typescript_3.1_no_npm; bazel test ...", - "e2e-package_typescript_karma": "cd internal/e2e/package_typescript_karma; bazel test ...", - "e2e-ts_auto_deps": "cd internal/e2e/ts_auto_deps; bazel run @build_bazel_rules_typescript//ts_auto_deps -- -recursive && bazel build simple", + "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", + "e2e-examples-app-prodserver": "concurrently \"bazel run //examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", + "e2e-examples-protobuf-devserver": "concurrently \"bazel run //examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", + "e2e-examples-protobuf-prodserver": "concurrently \"bazel run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", + "e2e-npm_packages": "./internal/e2e/npm_packages/test.sh", + "e2e-ts_auto_deps": "cd internal/e2e/ts_auto_deps; yarn test", + "e2e-typescript_3.1": "cd internal/e2e/typescript_3.1; yarn test", "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", "version": "node ./on-version.js && git stage package.bzl", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", From 1785fa5638768868f8e4d53e980294e73a752439 Mon Sep 17 00:00:00 2001 From: radokirov Date: Thu, 31 Jan 2019 14:03:53 -0800 Subject: [PATCH 063/316] Exports emit_with_tsickle method for custom tsc_wrapped-like compilations. PiperOrigin-RevId: 231849528 --- internal/tsc_wrapped/tsc_wrapped.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index eb8bcbb5..983ac788 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -262,7 +262,14 @@ function emitWithTypescript( return diagnostics; } -function emitWithTsickle( +/** + * Runs the emit pipeline with Tsickle transformations - goog.module rewriting + * and Closure types emitted included. + * Exported to be used by the internal global refactoring tools. + * TODO(radokirov): investigate using runWithOptions and making this private + * again, if we can make compilerHosts match. + */ +export function emitWithTsickle( program: ts.Program, compilerHost: CompilerHost, compilationTargets: ts.SourceFile[], options: ts.CompilerOptions, bazelOpts: BazelOptions): ts.Diagnostic[] { From b91f12908062c23e8696272900c03e44862ba41e Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 31 Jan 2019 15:18:34 -0800 Subject: [PATCH 064/316] Remove the (unused) flag to control whether taze registers tests with all_tests libraries. PiperOrigin-RevId: 231864435 --- ts_auto_deps/main.go | 7 +++---- ts_auto_deps/updater/test_register.go | 2 +- ts_auto_deps/updater/updater.go | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ts_auto_deps/main.go b/ts_auto_deps/main.go index 2d1da26f..81542dc2 100644 --- a/ts_auto_deps/main.go +++ b/ts_auto_deps/main.go @@ -12,9 +12,8 @@ import ( var ( isRoot = flag.Bool("root", false, "the given path is the root of a TypeScript project "+ "(generates ts_config and ts_development_sources targets).") - recursive = flag.Bool("recursive", false, "recursively update all packages under the given root.") - files = flag.Bool("files", false, "treats arguments as file names. Filters .ts files, then runs on their dirnames.") - allowAllTestLibraries = flag.Bool("allow_all_test_libraries", false, "treats testonly ts_libraries named 'all_tests' as an alternative to ts_config/ts_dev_srcs for registering tests") + recursive = flag.Bool("recursive", false, "recursively update all packages under the given root.") + files = flag.Bool("files", false, "treats arguments as file names. Filters .ts files, then runs on their dirnames.") ) func usage() { @@ -59,7 +58,7 @@ func main() { } host := updater.New(false, false, updater.QueryBasedBazelAnalyze, updater.LocalUpdateFile) - if err := updater.Execute(host, paths, *isRoot, *recursive, *allowAllTestLibraries); err != nil { + if err := updater.Execute(host, paths, *isRoot, *recursive); err != nil { platform.Error(err) } } diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index 794dcecb..b5f9e67b 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -40,7 +40,7 @@ func getAllTestLibraries(bld *build.File) []*build.Rule { // with a testonly ts_library named "all_tests", which allows users to set up // their own BUILD layout. It's separated from UpdateBUILD since it's non-local, // multiple packages may all need to make writes to the same ts_config. -func (upd *Updater) RegisterTestRules(ctx context.Context, allowAllTestLibrary bool, paths ...string) (bool, error) { +func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (bool, error) { reg := &buildRegistry{make(map[string]*build.File), make(map[*build.File]bool)} var g3root string for _, path := range paths { diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index a45d04c8..f4f9a5e0 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -1221,7 +1221,7 @@ func Paths(isRoot bool, files bool, recursive bool) ([]string, error) { } // Execute runs ts_auto_deps on paths using host. -func Execute(host *Updater, paths []string, isRoot, recursive, allowAllTestLibraries bool) error { +func Execute(host *Updater, paths []string, isRoot, recursive bool) error { ctx := context.Background() for i, p := range paths { isLastAndRoot := isRoot && i == len(paths)-1 @@ -1240,7 +1240,7 @@ func Execute(host *Updater, paths []string, isRoot, recursive, allowAllTestLibra } } } - host.RegisterTestRules(ctx, allowAllTestLibraries, paths...) + host.RegisterTestRules(ctx, paths...) return nil } From 8ee5124875a173eaed0c6fa7188e6dcb2f81f95a Mon Sep 17 00:00:00 2001 From: Di Fan Date: Fri, 1 Feb 2019 07:58:40 -0800 Subject: [PATCH 065/316] Update README.md to latest version. Closes #386 PiperOrigin-RevId: 231971554 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ee41fe7..efd663a7 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.20.3", - "@bazel/karma": "0.20.3", + "@bazel/typescript": "0.22.1", + "@bazel/karma": "0.22.1", ... }, ... @@ -46,8 +46,8 @@ containing: ```python http_archive( name = "build_bazel_rules_typescript", - url = "https://github.com/bazelbuild/rules_typescript/archive/0.20.3.zip", - strip_prefix = "rules_typescript-0.20.3", + url = "https://github.com/bazelbuild/rules_typescript/archive/0.22.1.zip", + strip_prefix = "rules_typescript-0.22.1", ) # Fetch transitive Bazel dependencies of build_bazel_rules_typescript From 3a5c2661bb011756ed85727dd541a9630efaa3e5 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 1 Feb 2019 08:25:16 -0800 Subject: [PATCH 066/316] Include pre-built ts_auto_deps binaries in the distribution of rules_typescript. This avoids another .go source file dependency in users projects. PiperOrigin-RevId: 231975183 --- BUILD.bazel | 1 + ts_auto_deps/BUILD.bazel | 78 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index c11b189c..dfd563cb 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -89,5 +89,6 @@ pkg_tar( "//devserver:package", "//internal:package", "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:package", + "//ts_auto_deps:package", ], ) diff --git a/ts_auto_deps/BUILD.bazel b/ts_auto_deps/BUILD.bazel index 827fc90a..b3d05fee 100644 --- a/ts_auto_deps/BUILD.bazel +++ b/ts_auto_deps/BUILD.bazel @@ -1,4 +1,5 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") go_library( name = "go_default_library", @@ -16,3 +17,80 @@ go_binary( embed = [":go_default_library"], visibility = ["//visibility:public"], ) + +config_setting( + name = "darwin_amd64", + constraint_values = [ + "@bazel_tools//platforms:osx", + "@bazel_tools//platforms:x86_64", + ], +) + +config_setting( + name = "linux_amd64", + constraint_values = [ + "@bazel_tools//platforms:linux", + "@bazel_tools//platforms:x86_64", + ], +) + +config_setting( + name = "windows_amd64", + constraint_values = [ + "@bazel_tools//platforms:windows", + "@bazel_tools//platforms:x86_64", + ], +) + +filegroup( + name = "auto_deps", + srcs = select({ + ":darwin_amd64": ["ts_auto_deps-darwin_amd64"], + ":linux_amd64": ["ts_auto_deps-linux_amd64"], + ":windows_amd64": ["ts_auto_deps-windows_amd64.exe"], + }), + # Don't build on CI + tags = ["manual"], +) + +go_binary( + name = "ts_auto_deps-windows", + out = "ts_auto_deps-windows_amd64.exe", + embed = [":go_default_library"], + goarch = "amd64", + goos = "windows", + pure = "on", + visibility = ["//visibility:public"], +) + +go_binary( + name = "ts_auto_deps-darwin", + out = "ts_auto_deps-darwin_amd64", + embed = [":go_default_library"], + goarch = "amd64", + goos = "darwin", + pure = "on", + visibility = ["//visibility:public"], +) + +go_binary( + name = "ts_auto_deps-linux", + out = "ts_auto_deps-linux_amd64", + embed = [":go_default_library"], + goarch = "amd64", + goos = "linux", + pure = "on", + visibility = ["//visibility:public"], +) + +pkg_tar( + name = "package", + srcs = [ + "BUILD.bazel", + ":ts_auto_deps-darwin", + ":ts_auto_deps-linux", + ":ts_auto_deps-windows", + ], + package_dir = "ts_auto_deps", + visibility = ["//:__pkg__"], +) From 85cad1d9fb060e1ae36b6aae73a2ef07b9f54e19 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 1 Feb 2019 10:07:38 -0800 Subject: [PATCH 067/316] Release automation: update README tags to latest also fix a lint error (we really need bazelci to run the linter...) Closes #399 PiperOrigin-RevId: 231991321 --- on-version.js | 3 +++ package.json | 2 +- ts_auto_deps/BUILD.bazel | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/on-version.js b/on-version.js index 33a7c04f..61c881b2 100644 --- a/on-version.js +++ b/on-version.js @@ -28,3 +28,6 @@ const shell = require('shelljs'); const version = require('./package.json').version; shell.sed('-i', 'VERSION \= \"[0-9\.]*\"', `VERSION = "${version}"`, 'package.bzl') +shell.sed('-i', '\"@bazel/typescript\": \"[0-9\.]*\"', `"@bazel/typescript": "${version}"`, 'README.md') +shell.sed('-i', 'https://github.com/bazelbuild/rules_typescript/archive/[0-9\.]*\.zip', `https://github.com/bazelbuild/rules_typescript/archive/${version}.zip`, 'README.md') +shell.sed('-i', 'strip_prefix \= \"rules_typescript-[0-9\.]*\"', `strip_prefix = "rules_typescript-${version}"`, 'README.md') diff --git a/package.json b/package.json index 176f49fa..9577f6f8 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "e2e-ts_auto_deps": "cd internal/e2e/ts_auto_deps; yarn test", "e2e-typescript_3.1": "cd internal/e2e/typescript_3.1; yarn test", "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", - "version": "node ./on-version.js && git stage package.bzl", + "version": "node ./on-version.js && git stage package.bzl README.md", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", "bazel:lint-fix": "yarn bazel:format --lint=fix" diff --git a/ts_auto_deps/BUILD.bazel b/ts_auto_deps/BUILD.bazel index b3d05fee..0ab24a73 100644 --- a/ts_auto_deps/BUILD.bazel +++ b/ts_auto_deps/BUILD.bazel @@ -1,5 +1,5 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( name = "go_default_library", From 7a2ebc26b6c6fe225daec79827dda8fc7ae35b0b Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 1 Feb 2019 10:22:25 -0800 Subject: [PATCH 068/316] Fix for Bazel incompatible changes - Update to the new args API - Update the dependencies - Avoid depset concatenation Fixes #342 Tested: `bazel-0.21 test //... --all_incompatible_changes --incompatible_disable_deprecated_attr_params=false --incompatible_depset_is_not_iterable=false` Closes #378 PiperOrigin-RevId: 231994159 --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ internal/build_defs.bzl | 2 +- internal/common/compilation.bzl | 12 ++++++------ internal/protobufjs/ts_proto_library.bzl | 10 +++++----- package.bzl | 9 +++++---- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1f8ff5ec..f705ad6e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,5 @@ +*Attention Googlers:* This repo has its Source of Truth in Piper. After sending a PR, you can follow http://g3doc/third_party/bazel_rules/rules_typescript/README.google.md#merging-changes to get your change merged. + ## PR Checklist Please check if your PR fulfills the following requirements: diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index d194f7e9..fbf93d4d 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -103,7 +103,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description # These deps are identified by the NodeModuleInfo provider. for d in ctx.attr.deps: if NodeModuleInfo in d: - action_inputs.extend(_filter_ts_inputs(d.files)) + action_inputs.extend(_filter_ts_inputs(d.files.to_list())) if ctx.file.tsconfig: action_inputs.append(ctx.file.tsconfig) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 36720443..99b043ac 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -256,7 +256,7 @@ def compile_ts( tsickle_externs = [ctx.actions.declare_file(ctx.label.name + ".externs.js")] dep_declarations = _collect_dep_declarations(ctx, deps) - input_declarations = dep_declarations.transitive + src_declarations + input_declarations = depset(src_declarations, transitive = [dep_declarations.transitive]) type_blacklisted_declarations = dep_declarations.type_blacklisted if not is_library and not ctx.attr.generate_externs: type_blacklisted_declarations += srcs_files @@ -276,7 +276,7 @@ def compile_ts( if "TYPESCRIPT_PERF_TRACE_TARGET" in ctx.var: perf_trace = str(ctx.label) == ctx.var["TYPESCRIPT_PERF_TRACE_TARGET"] - compilation_inputs = input_declarations + srcs_files + compilation_inputs = depset(srcs_files, transitive = [input_declarations]) tsickle_externs_path = tsickle_externs[0] if tsickle_externs else None # Calculate allowed dependencies for strict deps enforcement. @@ -293,7 +293,7 @@ def compile_ts( srcs_files, jsx_factory = jsx_factory, tsickle_externs = tsickle_externs_path, - type_blacklisted_declarations = type_blacklisted_declarations, + type_blacklisted_declarations = type_blacklisted_declarations.to_list(), allowed_deps = allowed_deps, ) @@ -332,7 +332,7 @@ def compile_ts( replay_params = None if has_sources: - inputs = compilation_inputs + [ctx.outputs.tsconfig] + inputs = depset([ctx.outputs.tsconfig], transitive = [compilation_inputs]) replay_params = compile_action( ctx, inputs, @@ -376,7 +376,7 @@ def compile_ts( ctx.actions.write(output = tsconfig_json_es5, content = json_marshal( tsconfig_es5, )) - inputs = compilation_inputs + [tsconfig_json_es5] + inputs = depset([tsconfig_json_es5], transitive = [compilation_inputs]) devmode_compile_action( ctx, inputs, @@ -387,7 +387,7 @@ def compile_ts( # TODO(martinprobst): Merge the generated .d.ts files, and enforce strict # deps (do not re-export transitive types from the transitive closure). - transitive_decls = dep_declarations.transitive + src_declarations + gen_declarations + transitive_decls = depset(src_declarations + gen_declarations, transitive = [dep_declarations.transitive]) # both ts_library and ts_declarations generate .closure.js files: # - for libraries, this is the ES6/production code diff --git a/internal/protobufjs/ts_proto_library.bzl b/internal/protobufjs/ts_proto_library.bzl index 07ae0d30..ee2ea3e1 100644 --- a/internal/protobufjs/ts_proto_library.bzl +++ b/internal/protobufjs/ts_proto_library.bzl @@ -23,11 +23,11 @@ def _run_pbjs(actions, executable, output_name, proto_files, suffix = ".js", wra # Reference of arguments: # https://github.com/dcodeIO/ProtoBuf.js/#pbjs-for-javascript args = actions.args() - args.add(["--target", "static-module"]) - args.add(["--wrap", wrap]) + args.add_all(["--target", "static-module"]) + args.add_all(["--wrap", wrap]) args.add("--strict-long") # Force usage of Long type with int64 fields - args.add(["--out", js_file.path + ".tmpl"]) - args.add([f.path for f in proto_files]) + args.add_all(["--out", js_file.path + ".tmpl"]) + args.add_all(proto_files) actions.run( executable = executable._pbjs, @@ -55,7 +55,7 @@ def _run_pbts(actions, executable, js_file): # Reference of arguments: # https://github.com/dcodeIO/ProtoBuf.js/#pbts-for-typescript args = actions.args() - args.add(["--out", ts_file.path]) + args.add_all(["--out", ts_file.path]) args.add(js_file.path) actions.run( diff --git a/package.bzl b/package.bzl index 68d1afd0..5ba34e36 100644 --- a/package.bzl +++ b/package.bzl @@ -104,7 +104,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "io_bazel", - urls = ["https://github.com/bazelbuild/bazel/releases/download/0.17.1/bazel-0.17.1-dist.zip"], + urls = ["https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-dist.zip"], + sha256 = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4", ) ############################################# @@ -120,9 +121,9 @@ def rules_typescript_dev_dependencies(): http_archive( name = "io_bazel_skydoc", - url = "https://github.com/bazelbuild/skydoc/archive/9bbdf62c03b5c3fed231604f78d3976f47753d79.zip", # 2018-11-20 - strip_prefix = "skydoc-9bbdf62c03b5c3fed231604f78d3976f47753d79", - sha256 = "07ae937026cb56000fb268d4986b220e868c1bdfe6aac27ecada4b4b3dae246f", + url = "https://github.com/bazelbuild/skydoc/archive/82fdbfe797c6591d8732df0c0389a2b1c3e50992.zip", # 2018-12-12 + strip_prefix = "skydoc-82fdbfe797c6591d8732df0c0389a2b1c3e50992", + sha256 = "75fd965a71ca1f0d0406d0d0fb0964d24090146a853f58b432761a1a6c6b47b9", ) def _maybe(repo_rule, name, **kwargs): From b533c2442180f119c644bab7664128bce0a92e8b Mon Sep 17 00:00:00 2001 From: clydin <19598772+clydin@users.noreply.github.com> Date: Fri, 1 Feb 2019 10:26:46 -0800 Subject: [PATCH 069/316] fix(tsetse): avoid double type discover in failure condition for ban-expect-truthy-promise rule Also optimize must-use-promises rule via removal of unneeded type/node checks Closes #372 PiperOrigin-RevId: 231994937 --- .../rules/ban_expect_truthy_promise_rule.ts | 4 +-- .../tsetse/rules/must_use_promises_rule.ts | 35 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts b/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts index fbbefd96..d1e79c02 100644 --- a/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts +++ b/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts @@ -56,11 +56,11 @@ function checkForTruthy(checker: Checker, node: ts.PropertyAccessExpression) { return; } - if (!tsutils.isThenableType(tc, expectCallNode.arguments[0])) { + const argType = tc.getTypeAtLocation(expectCallNode.arguments[0]); + if (!tsutils.isThenableType(tc, expectCallNode.arguments[0], argType)) { return; } - const argType = tc.getTypeAtLocation(expectCallNode.arguments[0]); checker.addFailureAtNode( node, `Value passed to expect() is of type ${tc.typeToString(argType)}, which` + diff --git a/internal/tsetse/rules/must_use_promises_rule.ts b/internal/tsetse/rules/must_use_promises_rule.ts index 5c39fe50..7e4905a3 100644 --- a/internal/tsetse/rules/must_use_promises_rule.ts +++ b/internal/tsetse/rules/must_use_promises_rule.ts @@ -30,30 +30,29 @@ function checkCallExpression(checker: Checker, node: ts.CallExpression) { return; } - const signature = checker.typeChecker.getResolvedSignature(node); - if (signature === undefined) { - return; - } - - const returnType = checker.typeChecker.getReturnTypeOfSignature(signature); - if (!!(returnType.flags & ts.TypeFlags.Void)) { - return; - } - if (tsutils.isThenableType(checker.typeChecker, node)) { checker.addFailureAtNode(node, FAILURE_STRING); } } function inAsyncFunction(node: ts.Node): boolean { - const isFunction = tsutils.isFunctionDeclaration(node) || - tsutils.isArrowFunction(node) || tsutils.isMethodDeclaration(node) || - tsutils.isFunctionExpression(node); - if (isFunction) { - return tsutils.hasModifier(node.modifiers, ts.SyntaxKind.AsyncKeyword); - } - if (node.parent) { - return inAsyncFunction(node.parent); + for (let inode = node.parent; inode !== undefined; inode = inode.parent) { + switch (inode.kind) { + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.MethodDeclaration: + // Potentially async + return tsutils.hasModifier(inode.modifiers, ts.SyntaxKind.AsyncKeyword); + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + // These cannot be async + return false; + default: + // Loop and check parent + break; + } } + return false; } From c3cec89bc0e90b0d6da1c96fa16ba095503ea82e Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Fri, 1 Feb 2019 16:10:36 -0800 Subject: [PATCH 070/316] Adds bazelWorkspaces support to @bazel/typescript and @bazel/karma npm packages Work-around for https://github.com/bazelbuild/rules_typescript/issues/400 in ts_auto_deps e2e test Pin chromedriver version Rename ts_auto_deps-windows_x64.exe to ts_auto_deps-win32_x64.exe so it matches the node os.platform() naming Closes #374 PiperOrigin-RevId: 232055567 --- .bazelignore | 1 - .circleci/config.yml | 11 +- .gitignore | 6 +- BUILD.bazel | 75 +- README.md | 50 +- WORKSPACE | 46 +- defs.bzl | 41 +- devserver/BUILD.bazel | 97 +- docs/BUILD.bazel | 4 +- examples/devserver/BUILD.bazel | 3 +- examples/protocol_buffers/BUILD.bazel | 3 +- examples/testing/BUILD.bazel | 3 +- internal/BUILD.bazel | 75 +- internal/README.md | 5 - internal/defaults.bzl | 17 - internal/devserver/BUILD | 28 +- internal/devserver/ts_devserver.bzl | 2 +- internal/e2e/default_tsconfig_test.js | 10 +- internal/e2e/npm_packages/README.md | 4 +- internal/e2e/npm_packages/karma/BUILD.bazel | 2 +- internal/e2e/npm_packages/karma/WORKSPACE | 27 +- .../karma}/tsconfig.json | 0 internal/e2e/npm_packages/karma/yarn.lock | 1910 -------------- .../karma_stack_trace/BUILD.bazel | 3 +- .../npm_packages/karma_stack_trace/WORKSPACE | 27 +- .../npm_packages/karma_typescript/BUILD.bazel | 3 +- .../npm_packages/karma_typescript/WORKSPACE | 27 +- internal/e2e/npm_packages/test.sh | 15 +- .../{ => npm_packages}/ts_auto_deps/.bazelrc | 0 .../ts_auto_deps/BUILD.bazel | 0 .../e2e/npm_packages/ts_auto_deps/WORKSPACE | 45 + .../ts_auto_deps/package-template.json | 9 + .../ts_auto_deps/simple/file.ts | 0 .../ts_auto_deps/tsconfig.json} | 0 .../{ => npm_packages}/ts_auto_deps/yarn.lock | 2 +- .../e2e/npm_packages/typescript_2.7/WORKSPACE | 23 +- .../e2e/npm_packages/typescript_2.7/yarn.lock | 253 -- .../e2e/npm_packages/typescript_2.8/WORKSPACE | 23 +- .../e2e/npm_packages/typescript_2.8/yarn.lock | 253 -- .../e2e/npm_packages/typescript_2.9/WORKSPACE | 23 +- .../e2e/npm_packages/typescript_2.9/yarn.lock | 253 -- .../e2e/npm_packages/typescript_3.0/WORKSPACE | 23 +- .../e2e/npm_packages/typescript_3.0/yarn.lock | 253 -- .../e2e/npm_packages/typescript_3.1/WORKSPACE | 23 +- .../e2e/npm_packages/typescript_3.1/yarn.lock | 254 -- .../package_typescript_2.7/tsconfig.json.oss | 0 .../package_typescript_2.8/tsconfig.json.oss | 0 .../package_typescript_2.9/tsconfig.json.oss | 0 .../package_typescript_3.0/tsconfig.json.oss | 0 .../package_typescript_3.1/tsconfig.json.oss | 0 .../tsconfig.json.oss | 0 .../tsconfig.json.oss | 0 internal/e2e/ts_auto_deps/package.json | 9 - internal/e2e/typescript_3.1/WORKSPACE | 6 +- internal/karma/BUILD.bazel | 60 +- internal/karma/README.md | 5 - .../{e2e/ts_auto_deps => karma}/WORKSPACE | 28 +- internal/karma/defaults.bzl | 37 + internal/karma/defs.bzl | 33 + internal/karma/karma.conf.js | 2 +- internal/karma/karma_web_test.bzl | 4 +- internal/karma/package.bzl | 46 + internal/karma/package.json | 21 +- internal/karma/yarn.lock | 2320 +++++++++++++++++ internal/package.json | 32 - internal/protobufjs/BUILD.bazel | 20 +- internal/protobufjs/ts_proto_library.bzl | 2 +- internal/ts_repositories.bzl | 44 +- package.bzl | 51 +- package.json | 55 +- .../bazel/src/main/protobuf/BUILD.bazel | 7 +- tools/BUILD.bazel | 3 - tools/check_version.js | 93 - ts_auto_deps/BUILD.bazel | 68 +- ts_auto_deps/ts_auto_deps.js | 34 + version.bzl | 56 + yarn.lock | 5 + 77 files changed, 3099 insertions(+), 3874 deletions(-) delete mode 100644 internal/README.md rename internal/e2e/{ts_auto_deps => npm_packages/karma}/tsconfig.json (100%) rename internal/e2e/{ => npm_packages}/ts_auto_deps/.bazelrc (100%) rename internal/e2e/{ => npm_packages}/ts_auto_deps/BUILD.bazel (100%) create mode 100644 internal/e2e/npm_packages/ts_auto_deps/WORKSPACE create mode 100644 internal/e2e/npm_packages/ts_auto_deps/package-template.json rename internal/e2e/{ => npm_packages}/ts_auto_deps/simple/file.ts (100%) rename internal/e2e/{package_karma_stack_trace/tsconfig.json.oss => npm_packages/ts_auto_deps/tsconfig.json} (100%) rename internal/e2e/{ => npm_packages}/ts_auto_deps/yarn.lock (98%) delete mode 100644 internal/e2e/package_typescript_2.7/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_2.8/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_2.9/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_3.0/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_3.1/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_3.1_no_npm/tsconfig.json.oss delete mode 100644 internal/e2e/package_typescript_karma/tsconfig.json.oss delete mode 100644 internal/e2e/ts_auto_deps/package.json delete mode 100644 internal/karma/README.md rename internal/{e2e/ts_auto_deps => karma}/WORKSPACE (71%) create mode 100644 internal/karma/defaults.bzl create mode 100644 internal/karma/defs.bzl create mode 100644 internal/karma/package.bzl create mode 100644 internal/karma/yarn.lock delete mode 100644 internal/package.json delete mode 100644 tools/BUILD.bazel delete mode 100644 tools/check_version.js create mode 100644 ts_auto_deps/ts_auto_deps.js create mode 100644 version.bzl diff --git a/.bazelignore b/.bazelignore index f4b9e2b2..8f1d7b0f 100644 --- a/.bazelignore +++ b/.bazelignore @@ -2,5 +2,4 @@ node_modules devserver/devserver/test/test-workspace internal/e2e/disable_tsetse_for_external internal/e2e/npm_packages -internal/e2e/ts_auto_deps internal/e2e/typescript_3.1 diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c19ed02..883705f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ ## IMPORTANT # If you change the `docker_image` version, also change the `cache_key` suffix var_1: &docker_image circleci/node:10.12-browsers -var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-node:10.12-browsers +var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-internal/karma:node:{{ checksum "internal/karma/yarn.lock" }}-10.12-browsers var_3: &setup-bazel-remote-cache run: name: Start up bazel remote cache proxy @@ -47,6 +47,9 @@ jobs: - run: yarn bazel info release - run: yarn bazel build ... - run: yarn bazel test ... + - run: 'cd internal/karma && + yarn install && + yarn bazel build ...' - run: yarn bazel build @disable_tsetse_for_external_test//... # This job tests the same stuff, but without the .bazelrc file. @@ -69,17 +72,23 @@ jobs: # is required to keep Bazel from exhausting the memory. - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0 - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0 + - run: 'cd internal/karma && + yarn install && + yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0' - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build @disable_tsetse_for_external_test//... --local_resources=2560,1.0,1.0 - save_cache: key: *cache_key paths: - "node_modules" + - "internal/karma/node_modules" # Runs end-to-end browser tests. test: <<: *job_defaults resource_class: xlarge + environment: + CHROMEDRIVER_VERSION_ARG: --versions.chrome 2.41 steps: - checkout: <<: *post_checkout diff --git a/.gitignore b/.gitignore index be15be3d..eea1acf5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,6 @@ node_modules /bazel-* /internal/e2e/npm_packages/*/bazel-* /internal/e2e/npm_packages/*/package.json -/internal/e2e/ts_auto_deps/bazel-* -/internal/e2e/ts_auto_deps/simple/BUILD -/internal/e2e/ts_auto_deps/simple/BUILD.bazel +/internal/e2e/npm_packages/ts_auto_deps/simple/BUILD +/internal/e2e/npm_packages/ts_auto_deps/simple/BUILD.bazel +/internal/karma/bazel-* diff --git a/BUILD.bazel b/BUILD.bazel index dfd563cb..1dffb818 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,9 +19,9 @@ # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") +load("//:version.bzl", "COMPAT_VERSION") # ts_library defaults to this label in the top-level package. # Point to where the file actually lives. @@ -55,40 +55,61 @@ js_library( visibility = ["//visibility:public"], ) +npm_package( + name = "npm_package", + srcs = [ + "BUILD.bazel", + "LICENSE", + "README.md", + "WORKSPACE", + "defs.bzl", + "package.bzl", + "package.json", + "version.bzl", + "//devserver:npm_package_assets", + "//internal:npm_package_assets", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", + "//ts_auto_deps:npm_package_assets", + ], + replacements = { + # Do a simple replacement needed to make the local development differ + # from how our release is used. + "//devserver:devserver_bin": "//devserver", + "0.0.0-COMPAT_VERSION": COMPAT_VERSION, + }, + deps = [ + "//devserver:devserver-darwin", + "//devserver:devserver-linux", + "//devserver:devserver-windows", + "//internal:tsc_wrapped", + "//ts_auto_deps:ts_auto_deps-darwin", + "//ts_auto_deps:ts_auto_deps-linux", + "//ts_auto_deps:ts_auto_deps-windows", + ], +) + +# Produces the release we publish to GitHub. Users download this starlark package +# to get the @build_bazel_rules_typescript workspace. +# FIXME(gregmagolan): strip the npm_package prefix from within the generated archive +# pkg_tar( +# name = "release", +# srcs = ["//:npm_package"], +# extension = "tgz", +# ) + + # A nodejs_binary for @bazel/typescript/tsc_wrapped to use by default in # ts_library that depends on @npm//@bazel/typescript instead of the # output of the //internal/tsc_wrapped ts_library rule. This # default is for downstream users that depend on the @bazel/typescript npm -# package. The generated @npm//@bazel/typescript/bin:tsc_wrapped target -# does not work because it does not have the node `--expose-gc` flag +# package. A generated @npm//@bazel/typescript/bin:tsc_wrapped target +# would not work because it does not have the node `--expose-gc` flag # set which is required to support the call to `global.gc()`. nodejs_binary( name = "@bazel/typescript/tsc_wrapped", data = ["@npm//@bazel/typescript"], - entry_point = "@bazel/typescript/tsc_wrapped/tsc_wrapped.js", + entry_point = "@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js", install_source_map_support = False, templated_args = ["--node_options=--expose-gc"], visibility = ["//visibility:public"], ) - -# Produces the release we publish to GitHub. Users download this starlark package -# to get the @build_bazel_rules_typescript workspace. -# It's the companion of the @bazel/typescript, @bazel/karma, etc npm packages. -pkg_tar( - name = "release", - srcs = [ - "AUTHORS", - "BUILD.bazel", - "LICENSE", - "WORKSPACE", - "defs.bzl", - "package.bzl", - ], - extension = "tgz", - deps = [ - "//devserver:package", - "//internal:package", - "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:package", - "//ts_auto_deps:package", - ], -) diff --git a/README.md b/README.md index efd663a7..df68fecd 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,14 @@ First, install a current Bazel distribution. Add the `@bazel/typescript` npm package to your `package.json` `devDependencies`. Optionally add the `@bazel/karma` npm package if you would like to use the -`ts_web_test_suite` rule. +`ts_web_test`, `ts_web_test_suite`, `karma_web_test` or `karma_web_test_suite` rules. ``` { ... "devDependencies": { - "@bazel/typescript": "0.22.1", - "@bazel/karma": "0.22.1", + "@bazel/typescript": "0.23.0", + "@bazel/karma": "0.23.0", ... }, ... @@ -44,24 +44,15 @@ Next create a `WORKSPACE` file in your project root (or edit the existing one) containing: ```python +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# Fetch rules_nodejs http_archive( - name = "build_bazel_rules_typescript", - url = "https://github.com/bazelbuild/rules_typescript/archive/0.22.1.zip", - strip_prefix = "rules_typescript-0.22.1", + name = "build_bazel_rules_nodejs", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + strip_prefix = "rules_nodejs-0.16.8", ) -# Fetch transitive Bazel dependencies of build_bazel_rules_typescript -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") -rules_typescript_dependencies() - -# Fetch transitive Bazel dependencies of build_bazel_rules_nodejs -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") -rules_nodejs_dependencies() - -# Setup TypeScript toolchain -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") -ts_setup_workspace() - # Setup the NodeJS toolchain load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories() @@ -77,12 +68,25 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -# Setup Go toolchain -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") -go_rules_dependencies() -go_register_toolchains() +# Install all Bazel dependencies needed for npm packages that supply Bazel rules +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") +install_bazel_dependencies() + +# Fetch transitive Bazel dependencies of build_bazel_rules_typescript +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +rules_typescript_dependencies() + +# Fetch transitive Bazel dependencies of build_bazel_rules_karma +# ONLY REQUIRED if you are using the @bazel/karma npm package +load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") +rules_karma_dependencies() + +# Setup TypeScript toolchain +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +ts_setup_workspace() # Setup web testing, choose browsers we can test on +# ONLY REQUIRED if you are using the @bazel/karma npm package load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") web_test_repositories() @@ -138,7 +142,7 @@ filegroup( # compiler attribute when using self-managed dependencies nodejs_binary( name = "@bazel/typescript/tsc_wrapped", - entry_point = "@bazel/typescript/tsc_wrapped/tsc_wrapped.js", + entry_point = "@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js", # The --expose-gc node option is required for tsc_wrapped templated_args = ["--node_options=--expose-gc"], # Point bazel to your node_modules to find the entry point diff --git a/WORKSPACE b/WORKSPACE index 49d4fde2..2c90799d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -14,16 +14,23 @@ workspace(name = "build_bazel_rules_typescript") -load( - "@build_bazel_rules_typescript//:package.bzl", - "rules_typescript_dependencies", - "rules_typescript_dev_dependencies", +# Load nested build_bazel_rules_karma repository +local_repository( + name = "build_bazel_rules_karma", + path = "internal/karma", ) -rules_typescript_dependencies() +# Load our dependencies +load("//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() +# Load rules_karma dependencies +load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") + +rules_karma_dependencies() + +# Setup nodejs toolchain load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") # Use a bazel-managed npm dependency, allowing us to test resolution to these paths @@ -41,39 +48,36 @@ yarn_install( ) # Install a hermetic version of node. -node_repositories(preserve_symlinks = True) +node_repositories() -# Note: We depend on @bazel/typescript in package.json -# so that the target @npm//@bazel/typescript is defined -# as it is referenced in /BUILD.bazel for use downstream. -# This target and package is not used locally so -# the version of this dependency does not matter. +# Download npm dependencies yarn_install( name = "npm", package_json = "//:package.json", yarn_lock = "//:yarn.lock", ) +# Setup rules_go toolchain load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains() +# Setup gazelle toolchain load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") gazelle_dependencies() -load( - "@build_bazel_rules_typescript//:defs.bzl", - "check_rules_typescript_version", - "ts_setup_workspace", -) +# Setup typescript toolchain +load("//internal:ts_repositories.bzl", "ts_setup_dev_workspace") -ts_setup_workspace() +ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected -check_rules_typescript_version(minimum_version_string = "0.15.3") +load("//:defs.bzl", "check_rules_typescript_version") + +check_rules_typescript_version(version_string = "0.22.0") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") @@ -84,12 +88,14 @@ load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories") skydoc_repositories() -# Load pinned browser versions for rules_webtesting. +# Setup rules_webtesting toolchain load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") -load("@io_bazel_rules_webtesting//web/internal:platform_http_file.bzl", "platform_http_file") web_test_repositories() +# Load pinned browser versions for rules_webtesting. +load("@io_bazel_rules_webtesting//web/internal:platform_http_file.bzl", "platform_http_file") + platform_http_file( name = "org_chromium_chromium", amd64_sha256 = diff --git a/defs.bzl b/defs.bzl index 4f68fa23..7ae01391 100644 --- a/defs.bzl +++ b/defs.bzl @@ -17,56 +17,19 @@ Users should not load files under "/internal" """ -load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -load("//:package.bzl", "VERSION") +load("//:version.bzl", _check_rules_typescript_version = "check_rules_typescript_version") load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") -load( - "//internal/karma:karma_web_test.bzl", - _karma_web_test = "karma_web_test", - _karma_web_test_suite = "karma_web_test_suite", -) -load( - "//internal/karma:ts_web_test.bzl", - _ts_web_test = "ts_web_test", - _ts_web_test_suite = "ts_web_test_suite", -) load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") load("//internal:ts_config.bzl", _ts_config = "ts_config") load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") +check_rules_typescript_version = _check_rules_typescript_version ts_setup_workspace = _ts_setup_workspace ts_library = _ts_library ts_config = _ts_config ts_devserver = _ts_devserver -# TODO(alexeagle): make ts_web_test && ts_web_test_suite work in google3 -ts_web_test = _ts_web_test -ts_web_test_suite = _ts_web_test_suite -karma_web_test = _karma_web_test -karma_web_test_suite = _karma_web_test_suite ts_proto_library = _ts_proto_library # DO NOT ADD MORE rules here unless they appear in the generated docsite. # Run yarn skydoc to re-generate the docsite. - -def check_rules_typescript_version(minimum_version_string): - """ - Verify that a minimum build_bazel_rules_typescript is loaded a WORKSPACE. - - This should be called from the `WORKSPACE` file so that the build fails as - early as possible. For example: - - ``` - # in WORKSPACE: - load("@build_bazel_rules_typescript//:defs.bzl", "check_rules_typescript_version") - check_rules_typescript_version("0.15.3") - ``` - - Args: - minimum_version_string: a string indicating the minimum version - """ - if not check_version(VERSION, minimum_version_string): - fail("\nCurrent build_bazel_rules_typescript version is {}, expected at least {}\n".format( - VERSION, - minimum_version_string, - )) diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel index a79f5459..07e8907a 100644 --- a/devserver/BUILD.bazel +++ b/devserver/BUILD.bazel @@ -1,8 +1,5 @@ -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") -package(default_visibility = ["//visibility:public"]) - go_library( name = "go_default_library", srcs = [ @@ -19,13 +16,51 @@ go_library( ) go_binary( - name = "devserver", + name = "devserver_bin", + embed = [":go_default_library"], + visibility = ["//visibility:public"], +) + +go_binary( + name = "devserver-darwin", + out = "devserver-darwin_x64", + embed = [":go_default_library"], + goarch = "amd64", + goos = "darwin", + pure = "on", + visibility = ["//visibility:public"], +) + +go_binary( + name = "devserver-linux", + out = "devserver-linux_x64", embed = [":go_default_library"], + goarch = "amd64", + goos = "linux", + pure = "on", + visibility = ["//visibility:public"], +) + +go_binary( + name = "devserver-windows", + out = "devserver-windows_x64.exe", + embed = [":go_default_library"], + goarch = "amd64", + goos = "windows", + pure = "on", + visibility = ["//visibility:public"], +) + +filegroup( + name = "npm_package_assets", + srcs = [ + "BUILD.bazel", + ], visibility = ["//visibility:public"], ) config_setting( - name = "darwin_amd64", + name = "darwin_x64", constraint_values = [ "@bazel_tools//platforms:osx", "@bazel_tools//platforms:x86_64", @@ -33,7 +68,7 @@ config_setting( ) config_setting( - name = "linux_amd64", + name = "linux_x64", constraint_values = [ "@bazel_tools//platforms:linux", "@bazel_tools//platforms:x86_64", @@ -41,7 +76,7 @@ config_setting( ) config_setting( - name = "windows_amd64", + name = "windows_x64", constraint_values = [ "@bazel_tools//platforms:windows", "@bazel_tools//platforms:x86_64", @@ -49,53 +84,13 @@ config_setting( ) filegroup( - name = "server", + name = "devserver", srcs = select({ - ":darwin_amd64": ["devserver-darwin_amd64"], - ":linux_amd64": ["devserver-linux_amd64"], - ":windows_amd64": ["devserver-windows_amd64.exe"], + ":darwin_x64": ["devserver-darwin_x64"], + ":linux_x64": ["devserver-linux_x64"], + ":windows_x64": ["devserver-windows_x64.exe"], }), # Don't build on CI tags = ["manual"], -) - -go_binary( - name = "devserver-windows", - out = "devserver-windows_amd64.exe", - embed = [":go_default_library"], - goarch = "amd64", - goos = "windows", - pure = "on", - visibility = ["//visibility:public"], -) - -go_binary( - name = "devserver-darwin", - out = "devserver-darwin_amd64", - embed = [":go_default_library"], - goarch = "amd64", - goos = "darwin", - pure = "on", visibility = ["//visibility:public"], ) - -go_binary( - name = "devserver-linux", - out = "devserver-linux_amd64", - embed = [":go_default_library"], - goarch = "amd64", - goos = "linux", - pure = "on", - visibility = ["//visibility:public"], -) - -pkg_tar( - name = "package", - srcs = [ - "BUILD.bazel", - ":devserver-darwin", - ":devserver-linux", - ":devserver-windows", - ], - package_dir = "devserver", -) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index c5fa3966..c8c686b6 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -7,8 +7,10 @@ skylark_doc( "//internal:ts_config.bzl", "//internal:ts_repositories.bzl", "//internal/devserver:ts_devserver.bzl", - "//internal/karma:ts_web_test.bzl", "//internal/protobufjs:ts_proto_library.bzl", + # TODO(gregmagolan): fix docs for build_bazel_rules_karma + # "@build_bazel_rules_karma//:karma_web_test.bzl", + # "@build_bazel_rules_karma//:ts_web_test.bzl", ], format = "html", # The site is served at http://tsetse.info so the URL doesn't include a diff --git a/examples/devserver/BUILD.bazel b/examples/devserver/BUILD.bazel index f29149e9..efa1f628 100644 --- a/examples/devserver/BUILD.bazel +++ b/examples/devserver/BUILD.bazel @@ -1,4 +1,5 @@ -load("//:defs.bzl", "ts_devserver", "ts_library") +load("//:defs.bzl", "ts_devserver") +load("//internal:defaults.bzl", "ts_library") ts_library( name = "app", diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel index 89a2cbb4..16452de7 100644 --- a/examples/protocol_buffers/BUILD.bazel +++ b/examples/protocol_buffers/BUILD.bazel @@ -1,3 +1,4 @@ +load("@build_bazel_rules_karma//:defaults.bzl", "ts_web_test_suite") load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") @@ -6,7 +7,7 @@ load( "ts_devserver", "ts_proto_library", ) -load("//internal:defaults.bzl", "ts_library", "ts_web_test_suite") +load("//internal:defaults.bzl", "ts_library") proto_library( name = "tire_proto", diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel index d2d7e287..287a3b9d 100644 --- a/examples/testing/BUILD.bazel +++ b/examples/testing/BUILD.bazel @@ -1,4 +1,5 @@ -load("//internal:defaults.bzl", "karma_web_test_suite", "ts_library", "ts_web_test_suite") +load("@build_bazel_rules_karma//:defaults.bzl", "karma_web_test_suite", "ts_web_test_suite") +load("//internal:defaults.bzl", "ts_library") ts_library( name = "lib", diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 5a4932cc..44372313 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -14,8 +14,7 @@ # gazelle:exclude worker_protocol.proto -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary") load("//internal:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) @@ -117,75 +116,21 @@ jasmine_node_test( ], ) -genrule( - name = "license_copy", - srcs = ["//:LICENSE"], - outs = ["LICENSE"], - cmd = "cp $< $@", -) - -genrule( - name = "worker_protocol_copy", - srcs = ["//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto"], - outs = ["worker_protocol.proto"], - cmd = "cp $< $@", -) - -genrule( - name = "check_version_copy", - srcs = ["//tools:check_version.js"], - outs = ["check_version.js"], - cmd = "cp $< $@", -) - -npm_package( - name = "npm_package", - srcs = [ - "README.md", - "package.json", - ], - deps = [ - ":check_version_copy", - ":license_copy", - ":tsc_wrapped", - ":worker_protocol_copy", - ], -) - -pkg_tar( - name = "tsc_wrapped_pkg", - srcs = glob([ - "tsc_wrapped/**", - ]), - package_dir = "tsc_wrapped", -) - -pkg_tar( - name = "common_pkg", +filegroup( + name = "npm_package_assets", srcs = [ + "BUILD.bazel", + "build_defs.bzl", "common/compilation.bzl", "common/json_marshal.bzl", "common/module_mappings.bzl", "common/tsconfig.bzl", - ], - package_dir = "common", -) - -pkg_tar( - name = "package", - srcs = [ - "BUILD.bazel", - "build_defs.bzl", - "package.json", + "defaults.bzl", "ts_config.bzl", "ts_repositories.bzl", - ], - package_dir = "internal", - deps = [ - ":common_pkg", - ":tsc_wrapped_pkg", - "//internal/devserver:package", - "//internal/karma:package", - "//internal/protobufjs:package", + "tsc_wrapped/package.json", + "tsc_wrapped/yarn.lock", + "//internal/devserver:npm_package_assets", + "//internal/protobufjs:npm_package_assets", ], ) diff --git a/internal/README.md b/internal/README.md deleted file mode 100644 index f613e96f..00000000 --- a/internal/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Bazel TypeScript compiler - -This npm package provides the JavaScript code needed by the `ts_library` Bazel rule. - -See http://tsetse.info/api/build_defs.html#ts_library for documentation. diff --git a/internal/defaults.bzl b/internal/defaults.bzl index ca2f4235..1823e308 100644 --- a/internal/defaults.bzl +++ b/internal/defaults.bzl @@ -16,30 +16,13 @@ load( "@build_bazel_rules_typescript//:defs.bzl", - _karma_web_test = "karma_web_test", - _karma_web_test_suite = "karma_web_test_suite", _ts_library = "ts_library", - _ts_web_test = "ts_web_test", - _ts_web_test_suite = "ts_web_test_suite", ) # We can't use the defaults for ts_library compiler and ts_web_test_suite karma # internally because the defaults are .js dependencies on the npm packages that are # published and internally we are building the things themselves to publish to npm INTERNAL_TS_LIBRARY_COMPILER = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin" -INTERNAL_KARMA_BIN = "@build_bazel_rules_typescript//internal/karma:karma_bin" - -def karma_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): - _karma_web_test(karma = karma, **kwargs) - -def karma_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): - _karma_web_test_suite(karma = karma, **kwargs) def ts_library(compiler = INTERNAL_TS_LIBRARY_COMPILER, **kwargs): _ts_library(compiler = compiler, **kwargs) - -def ts_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): - _ts_web_test(karma = karma, **kwargs) - -def ts_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): - _ts_web_test_suite(karma = karma, **kwargs) diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD index 0f8171f1..d6e97331 100644 --- a/internal/devserver/BUILD +++ b/internal/devserver/BUILD @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") - licenses(["notice"]) # Apache 2.0 package(default_visibility = [ @@ -30,29 +28,13 @@ filegroup( srcs = glob(["**/*"]), ) -# Do a simple replacement needed to make the local development differ from how -# our release is used. -# NB: doesn't work on Windows, so we have to release from Mac/Linux for now. -genrule( - name = "patched_devserver_bzl", - srcs = ["ts_devserver.bzl"], - outs = ["patched/ts_devserver.bzl"], - cmd = """sed 's#"//devserver:devserver"#"//devserver:server"#' < $< > $@""", -) - -# Remove the "patched/" directory prefix so that the ts_devserver.bzl ends up in -# the same path in the final tar as it had in our local repo. -pkg_tar( - name = "strip_workaround", - srcs = [":patched_devserver_bzl"], -) - -pkg_tar( - name = "package", +filegroup( + name = "npm_package_assets", srcs = [ "BUILD", + "package.json", + "ts_devserver.bzl", + "yarn.lock", ], - package_dir = "devserver", visibility = ["//internal:__pkg__"], - deps = ["strip_workaround"], ) diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index eee9b69e..0667c98f 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -200,7 +200,7 @@ ts_devserver = rule( # NB: this value is replaced by "//devserver:server" in the packaged distro # //devserver:server is the pre-compiled binary. # That means that our users don't need the go toolchain. - default = Label("//devserver:devserver"), + default = Label("//devserver:devserver_bin"), executable = True, cfg = "host", ), diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index b0792718..77115213 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -26,8 +26,9 @@ local_repository( name = "build_bazel_rules_typescript", path = "${process.cwd()}", ) -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") -rules_typescript_dependencies() +# Using rules_typescript_dev_dependencies for this test since we're not depending on the generated npm package +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") +rules_typescript_dev_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories() yarn_install( @@ -35,8 +36,9 @@ yarn_install( package_json = "//:package.json", yarn_lock = "//:yarn.lock", ) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") -ts_setup_workspace() +# Using ts_setup_dev_workspace for this test since we're not depending on the generated npm package +load("@build_bazel_rules_typescript//internal:ts_repositories.bzl", "ts_setup_dev_workspace") +ts_setup_dev_workspace() `; const PACKAGE_JSON = `{ diff --git a/internal/e2e/npm_packages/README.md b/internal/e2e/npm_packages/README.md index 183e15cd..240a6229 100644 --- a/internal/e2e/npm_packages/README.md +++ b/internal/e2e/npm_packages/README.md @@ -11,9 +11,9 @@ the generated npm packages are substituted in when generating the `package.json` ### Running an individual test -To run a specific test run this script with `./internal/e2e/npm_packages/test.sh --test ` where `` +To run a specific test run `yarn e2e-npm_packages --test ` where `` is the name of the test folder to run. ### Updating yarn.lock file -To update the `yarn.lock` files for these tests run `./internal/e2e/npm_packages/test.sh --update-lock-files`. +To update the `yarn.lock` files for these tests run `yarn e2e-npm_packages --update-lock-files`. diff --git a/internal/e2e/npm_packages/karma/BUILD.bazel b/internal/e2e/npm_packages/karma/BUILD.bazel index 4db820d4..85122f3d 100644 --- a/internal/e2e/npm_packages/karma/BUILD.bazel +++ b/internal/e2e/npm_packages/karma/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test_suite") +load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") ts_web_test_suite( name = "testing", diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE index c2e453c1..5a409ea8 100644 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_karma_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,11 +32,13 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") -go_rules_dependencies() +install_bazel_dependencies() -go_register_toolchains() +load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") + +rules_karma_dependencies() load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") @@ -47,7 +48,3 @@ browser_repositories( chromium = True, firefox = True, ) - -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/ts_auto_deps/tsconfig.json b/internal/e2e/npm_packages/karma/tsconfig.json similarity index 100% rename from internal/e2e/ts_auto_deps/tsconfig.json rename to internal/e2e/npm_packages/karma/tsconfig.json diff --git a/internal/e2e/npm_packages/karma/yarn.lock b/internal/e2e/npm_packages/karma/yarn.lock index 5d4f3b09..4a580188 100644 --- a/internal/e2e/npm_packages/karma/yarn.lock +++ b/internal/e2e/npm_packages/karma/yarn.lock @@ -1,1912 +1,2 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/karma/npm_package": - version "0.22.1-19-gecef600" - dependencies: - jasmine-core "2.8.0" - karma "^4.0.0" - karma-chrome-launcher "2.2.0" - karma-firefox-launcher "1.1.0" - karma-jasmine "1.1.1" - karma-requirejs "1.1.0" - karma-sauce-launcher "2.0.2" - karma-sourcemap-loader "0.3.7" - requirejs "2.3.5" - semver "5.6.0" - tmp "0.0.33" - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -adm-zip@~0.4.3: - version "0.4.11" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a" - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - dependencies: - es6-promisify "^5.0.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - -async@^2.1.2: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - dependencies: - lodash "^4.17.10" - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - -blob@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" - -bluebird@^3.3.0: - version "3.5.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" - -body-parser@^1.16.1: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - dependencies: - expand-range "^0.1.0" - -braces@^2.3.0, braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - -chokidar@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - dependencies: - anymatch "^2.0.0" - async-each "^1.0.0" - braces "^2.3.0" - glob-parent "^3.1.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - lodash.debounce "^4.0.8" - normalize-path "^2.1.1" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - upath "^1.0.5" - optionalDependencies: - fsevents "^1.2.2" - -chownr@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - -circular-json@^0.5.5: - version "0.5.7" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.7.tgz#b8be478d72ea58c7eeda26bf1cf1fba43d188842" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -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" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -colors@^1.1.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - dependencies: - lodash "^4.5.0" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - -component-emitter@1.2.1, component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - -core-js@^2.2.0: - version "2.5.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - -core-js@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" - integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -debug@=3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407" - dependencies: - ms "^2.1.1" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196" - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.4" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.0.tgz#54332506f42f2edc71690d2f2a42349359f3bf7d" - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - -es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" - -es6-promise@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" - integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== - -follow-redirects@^1.0.0: - version "1.5.8" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.8.tgz#1dbfe13e45ad969f813e86c00e5296f525c885a1" - dependencies: - debug "=3.1.0" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - dependencies: - map-cache "^0.2.2" - -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - dependencies: - null-check "^1.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -fsevents@^1.2.2: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@^7.0.5, glob@^7.1.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -http-errors@1.6.3, http-errors@~1.6.3: - version "1.6.3" - resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - dependencies: - minimatch "^3.0.4" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - -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" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - dependencies: - is-extglob "^2.1.1" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - dependencies: - kind-of "^3.0.2" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - dependencies: - isobject "^3.0.1" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - dependencies: - buffer-alloc "^1.2.0" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jszip@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" - integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== - dependencies: - core-js "~2.3.0" - es6-promise "~3.0.2" - lie "~3.1.0" - pako "~1.0.2" - readable-stream "~2.0.6" - -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - -karma-jasmine@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" - -karma-requirejs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" - -karma-sauce-launcher@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" - integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== - dependencies: - sauce-connect-launcher "^1.2.4" - saucelabs "^1.5.0" - selenium-webdriver "^4.0.0-alpha.1" - -karma-sourcemap-loader@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" - dependencies: - graceful-fs "^4.1.2" - -karma@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-3.0.0.tgz#6da83461a8a28d8224575c3b5b874e271b4730c3" - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.2.1" - -karma@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" - integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.5" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.3.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -lie@~3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - -lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.5.0: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - -log4js@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.5.tgz#b80146bfebad68b430d4f3569556d8a6edfef303" - dependencies: - circular-json "^0.5.5" - date-format "^1.2.0" - debug "^3.1.0" - rfdc "^1.1.2" - streamroller "0.7.0" - -lru-cache@2.2.x: - version "2.2.4" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d" - -lru-cache@4.1.x: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - dependencies: - object-visit "^1.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@~1.36.0: - version "1.36.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" - -mime-types@~2.1.18: - version "2.1.20" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" - dependencies: - mime-db "~1.36.0" - -mime@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minimist@~0.0.1: - version "0.0.10" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - -minipass@^2.2.1, minipass@^2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - -nan@^2.9.2: - version "2.11.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -needle@^2.2.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.3.tgz#c1b04da378cd634d8befe2de965dc2cfb0fd65ca" - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - -npm-packlist@^1.1.6: - version "1.1.11" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - dependencies: - isobject "^3.0.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -pako@~1.0.2: - version "1.0.8" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" - integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - -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" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -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" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: - version "2.3.6" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - -rfdc@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" - -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -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" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - -sauce-connect-launcher@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" - integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^2.2.1" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -sax@>=0.6.0, sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - -selenium-webdriver@^4.0.0-alpha.1: - version "4.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" - integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== - dependencies: - jszip "^3.1.3" - rimraf "^2.5.4" - tmp "0.0.30" - xml2js "^0.4.17" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -semver@^5.3.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - dependencies: - extend-shallow "^3.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -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" - -tar@^4: - version "4.4.6" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" - dependencies: - chownr "^1.0.1" - fs-minipass "^1.2.5" - minipass "^2.3.3" - minizlib "^1.1.0" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tmp@0.0.33, tmp@0.0.x: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - -useragent@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.2.1.tgz#cf593ef4f2d175875e8bb658ea92e18a4fd06d8e" - dependencies: - lru-cache "2.2.x" - tmp "0.0.x" - -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - -which@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xml2js@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" diff --git a/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel index fbd169e9..6a0ed246 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel +++ b/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test_suite") +load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index 5cad07ea..cc1d388d 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_karma_stack_trace") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,11 +32,17 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() -go_rules_dependencies() +load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") -go_register_toolchains() +rules_karma_dependencies() load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") diff --git a/internal/e2e/npm_packages/karma_typescript/BUILD.bazel b/internal/e2e/npm_packages/karma_typescript/BUILD.bazel index 78f068e6..c42feee3 100644 --- a/internal/e2e/npm_packages/karma_typescript/BUILD.bazel +++ b/internal/e2e/npm_packages/karma_typescript/BUILD.bazel @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test_suite") +load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") ts_library( name = "lib", diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index aab8aa70..c10ae4af 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_package_karma_typescript_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,11 +32,17 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() -go_rules_dependencies() +load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") -go_register_toolchains() +rules_karma_dependencies() load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") diff --git a/internal/e2e/npm_packages/test.sh b/internal/e2e/npm_packages/test.sh index cb769dad..12be17e9 100755 --- a/internal/e2e/npm_packages/test.sh +++ b/internal/e2e/npm_packages/test.sh @@ -9,11 +9,10 @@ echo "" echo "#################################################################################" echo "Running all npm package e2e tests under $TESTS_ROOT_DIR" echo "" -echo "To run a specific test run this script with `--test ` where " +echo "To run a specific test run this script with '--test ' where " echo "is the name of the test folder to run" echo "" -echo "Run this script with `--update-lock-files` to update yarn.lock files" -echo "instead of running tests" +echo "Run this script with '--update-lock-files' to update yarn.lock files instead of running tests" echo "" # Determine the absolute paths to the generated @bazel/typescript and @bazel/karma npm packages @@ -23,9 +22,11 @@ if [[ ! -f $BAZEL ]] ; then echo "Bazel not found under $BAZEL" exit 1 fi -BAZEL_BIN=$($BAZEL info bazel-bin) -BAZEL_TYPESCRIPT_NPM_PACKAGE=$BAZEL_BIN/internal/npm_package -BAZEL_KARMA_NPM_PACKAGE=$BAZEL_BIN/internal/karma/npm_package +BAZEL_BIN_TYPESCRIPT=$($BAZEL info bazel-bin) +BAZEL_TYPESCRIPT_NPM_PACKAGE=$BAZEL_BIN_TYPESCRIPT/npm_package +cd $TESTS_ROOT_DIR/../../../internal/karma +BAZEL_BIN_KARMA=$($BAZEL info bazel-bin) +BAZEL_KARMA_NPM_PACKAGE=$BAZEL_BIN_KARMA/npm_package echo "@bazel/typescript: $BAZEL_TYPESCRIPT_NPM_PACKAGE" echo "@bazel/karma: $BAZEL_KARMA_NPM_PACKAGE" @@ -57,6 +58,8 @@ for testDir in $(ls) ; do # Skip this test echo "Skipping test that was not specified in --test argument" else + # Some tests like ts_auto_deps depend on node_modules + yarn install # Run tests yarn test fi diff --git a/internal/e2e/ts_auto_deps/.bazelrc b/internal/e2e/npm_packages/ts_auto_deps/.bazelrc similarity index 100% rename from internal/e2e/ts_auto_deps/.bazelrc rename to internal/e2e/npm_packages/ts_auto_deps/.bazelrc diff --git a/internal/e2e/ts_auto_deps/BUILD.bazel b/internal/e2e/npm_packages/ts_auto_deps/BUILD.bazel similarity index 100% rename from internal/e2e/ts_auto_deps/BUILD.bazel rename to internal/e2e/npm_packages/ts_auto_deps/BUILD.bazel diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE new file mode 100644 index 00000000..4635bbd1 --- /dev/null +++ b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE @@ -0,0 +1,45 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "npm_packages_ts_auto_deps_e2e") + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories() + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/npm_packages/ts_auto_deps/package-template.json b/internal/e2e/npm_packages/ts_auto_deps/package-template.json new file mode 100644 index 00000000..848840ee --- /dev/null +++ b/internal/e2e/npm_packages/ts_auto_deps/package-template.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", + "typescript": "2.9.2" + }, + "scripts": { + "test": "cd simple; ts_auto_deps && bazel build simple" + } +} diff --git a/internal/e2e/ts_auto_deps/simple/file.ts b/internal/e2e/npm_packages/ts_auto_deps/simple/file.ts similarity index 100% rename from internal/e2e/ts_auto_deps/simple/file.ts rename to internal/e2e/npm_packages/ts_auto_deps/simple/file.ts diff --git a/internal/e2e/package_karma_stack_trace/tsconfig.json.oss b/internal/e2e/npm_packages/ts_auto_deps/tsconfig.json similarity index 100% rename from internal/e2e/package_karma_stack_trace/tsconfig.json.oss rename to internal/e2e/npm_packages/ts_auto_deps/tsconfig.json diff --git a/internal/e2e/ts_auto_deps/yarn.lock b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock similarity index 98% rename from internal/e2e/ts_auto_deps/yarn.lock rename to internal/e2e/npm_packages/ts_auto_deps/yarn.lock index 0cd0cad3..6f96f90a 100644 --- a/internal/e2e/ts_auto_deps/yarn.lock +++ b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": +"@bazel/typescript@file:../local_typescript/bazel-bin/npm_package": version "0.17.0-20-g8657b80" dependencies: protobufjs "5.0.0" diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE index f585fb66..8a542580 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_typescript_27_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,6 +32,14 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.7/yarn.lock b/internal/e2e/npm_packages/typescript_2.7/yarn.lock index 3f71f88b..4a580188 100644 --- a/internal/e2e/npm_packages/typescript_2.7/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.7/yarn.lock @@ -1,255 +1,2 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": - version "0.22.1-18-g169a278" - dependencies: - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -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" - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - dependencies: - tslib "^1.8.1" - -typescript@2.7.x: - version "2.7.2" - resolved "http://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE index 8866bbd6..4aa41ec7 100644 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_typescript_28_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,6 +32,14 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.8/yarn.lock b/internal/e2e/npm_packages/typescript_2.8/yarn.lock index 6edcd7e8..4a580188 100644 --- a/internal/e2e/npm_packages/typescript_2.8/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.8/yarn.lock @@ -1,255 +1,2 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": - version "0.22.1-18-g169a278" - dependencies: - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -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" - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - dependencies: - tslib "^1.8.1" - -typescript@2.8.x: - version "2.8.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.4.tgz#0b1db68e6bdfb0b767fa2ab642136a35b059b199" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE index 1758dec3..ce12fa90 100644 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_typescript_29_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,6 +32,14 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.9/yarn.lock b/internal/e2e/npm_packages/typescript_2.9/yarn.lock index a0a84fcc..4a580188 100644 --- a/internal/e2e/npm_packages/typescript_2.9/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.9/yarn.lock @@ -1,255 +1,2 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": - version "0.22.1-18-g169a278" - dependencies: - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -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" - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - dependencies: - tslib "^1.8.1" - -typescript@2.9.x: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE index 92816e4f..8e0d2f14 100644 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_typescript_30_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,6 +32,14 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.0/yarn.lock b/internal/e2e/npm_packages/typescript_3.0/yarn.lock index 6177ba67..4a580188 100644 --- a/internal/e2e/npm_packages/typescript_3.0/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.0/yarn.lock @@ -1,255 +1,2 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": - version "0.22.1-18-g169a278" - dependencies: - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -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" - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - dependencies: - tslib "^1.8.1" - -typescript@3.0.x: - version "3.0.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.3.tgz#4853b3e275ecdaa27f78fda46dc273a7eb7fc1c8" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE index 92816e4f..8e0d2f14 100644 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -14,18 +14,17 @@ workspace(name = "npm_packages_typescript_30_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_typescript_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -33,6 +32,14 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.1/yarn.lock b/internal/e2e/npm_packages/typescript_3.1/yarn.lock index 2fdc680e..4a580188 100644 --- a/internal/e2e/npm_packages/typescript_3.1/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.1/yarn.lock @@ -1,256 +1,2 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": - version "0.22.1-18-g169a278" - dependencies: - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -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" - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - dependencies: - tslib "^1.8.1" - -typescript@3.1.x: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/package_typescript_2.7/tsconfig.json.oss b/internal/e2e/package_typescript_2.7/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/package_typescript_2.8/tsconfig.json.oss b/internal/e2e/package_typescript_2.8/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/package_typescript_2.9/tsconfig.json.oss b/internal/e2e/package_typescript_2.9/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/package_typescript_3.0/tsconfig.json.oss b/internal/e2e/package_typescript_3.0/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/package_typescript_3.1/tsconfig.json.oss b/internal/e2e/package_typescript_3.1/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json.oss b/internal/e2e/package_typescript_3.1_no_npm/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/package_typescript_karma/tsconfig.json.oss b/internal/e2e/package_typescript_karma/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/ts_auto_deps/package.json b/internal/e2e/ts_auto_deps/package.json deleted file mode 100644 index b51c2ea1..00000000 --- a/internal/e2e/ts_auto_deps/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package", - "typescript": "2.9.2" - }, - "scripts": { - "test": "bazel run @build_bazel_rules_typescript//ts_auto_deps -- -recursive && bazel build simple" - } -} diff --git a/internal/e2e/typescript_3.1/WORKSPACE b/internal/e2e/typescript_3.1/WORKSPACE index 6b022fa7..ab0e7c3d 100644 --- a/internal/e2e/typescript_3.1/WORKSPACE +++ b/internal/e2e/typescript_3.1/WORKSPACE @@ -19,13 +19,13 @@ local_repository( path = "../../..", ) -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") -rules_typescript_dependencies() +rules_typescript_dev_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index dc8a50dd..b2dd97d1 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -1,22 +1,35 @@ -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") -load("//internal:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:version.bzl", "COMPAT_VERSION") +load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) +# Exports to be consumed for generating skydoc. exports_files([ - "test-main.js", - "karma.conf.js", - # Exported to be consumed for generating skydoc. + "karma_web_test.bzl", "ts_web_test.bzl", - "ts_web_test_suite.bzl", + "web_test.bzl", ]) ts_library( name = "bazel_karma", srcs = glob(["*.ts"]), module_name = "@bazel/karma", - tsconfig = "//internal/karma:tsconfig.json", + tsconfig = ":tsconfig.json", deps = [ "@npm//@types/node", "@npm//tmp", @@ -44,38 +57,33 @@ nodejs_binary( genrule( name = "license_copy", - srcs = ["//:LICENSE"], + srcs = ["@build_bazel_rules_typescript//:LICENSE"], outs = ["LICENSE"], cmd = "cp $< $@", ) -genrule( - name = "check_version_copy", - srcs = ["//tools:check_version.js"], - outs = ["check_version.js"], - cmd = "cp $< $@", -) - npm_package( name = "npm_package", srcs = [ - "README.md", + "BUILD.bazel", + "WORKSPACE", + "defaults.bzl", + "defs.bzl", + "karma.conf.js", "karma.js", + "karma_web_test.bzl", + "package.bzl", "package.json", + "ts_web_test.bzl", + "web_test.bzl", ], + replacements = { + "0.0.0-COMPAT_VERSION": COMPAT_VERSION, + }, deps = [ ":bazel_karma", - ":check_version_copy", ":license_copy", ], ) -pkg_tar( - name = "package", - srcs = [ - "BUILD.bazel", - "package.json", - "ts_web_test.bzl", - ], - package_dir = "karma", -) +exports_files(["karma.conf.js"]) diff --git a/internal/karma/README.md b/internal/karma/README.md deleted file mode 100644 index d325a800..00000000 --- a/internal/karma/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Bazel web unit tests with karma - -This npm package provides the JavaScript code needed by the `ts_web_test_suite` and `ts_web_test` Bazel rule. - -See http://tsetse.info/api/karma/ts_web_test.html for documentation. diff --git a/internal/e2e/ts_auto_deps/WORKSPACE b/internal/karma/WORKSPACE similarity index 71% rename from internal/e2e/ts_auto_deps/WORKSPACE rename to internal/karma/WORKSPACE index 49f673db..3e166d87 100644 --- a/internal/e2e/ts_auto_deps/WORKSPACE +++ b/internal/karma/WORKSPACE @@ -12,39 +12,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "ts_auto_deps_e2e") +workspace(name = "build_bazel_rules_karma") +# Load nested build_bazel_rules_typescript repository local_repository( name = "build_bazel_rules_typescript", - path = "../../..", + path = "../..", ) -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies", "rules_typescript_dev_dependencies") - -rules_typescript_dependencies() +# Load our dependencies +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() +# Load rules_karma dependencies +load("//:package.bzl", "rules_karma_dependencies") + +rules_karma_dependencies() + +# Setup nodejs toolchain load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +# Install a hermetic version of node. +node_repositories() +# Download npm dependencies yarn_install( name = "npm", package_json = "//:package.json", yarn_lock = "//:yarn.lock", ) -load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") - -go_rules_dependencies() - -go_register_toolchains() - +# Setup gazelle toolchain load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") gazelle_dependencies() +# Setup typescript toolchain load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/karma/defaults.bzl b/internal/karma/defaults.bzl new file mode 100644 index 00000000..7e891dd7 --- /dev/null +++ b/internal/karma/defaults.bzl @@ -0,0 +1,37 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"Defaults for rules_karma repository not meant to be used downstream" + +load( + "@build_bazel_rules_karma//:defs.bzl", + _karma_web_test = "karma_web_test", + _karma_web_test_suite = "karma_web_test_suite", + _ts_web_test = "ts_web_test", + _ts_web_test_suite = "ts_web_test_suite", +) + +INTERNAL_KARMA_BIN = "@build_bazel_rules_karma//:karma_bin" + +def karma_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): + _karma_web_test(karma = karma, **kwargs) + +def karma_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): + _karma_web_test_suite(karma = karma, **kwargs) + +def ts_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): + _ts_web_test(karma = karma, **kwargs) + +def ts_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): + _ts_web_test_suite(karma = karma, **kwargs) diff --git a/internal/karma/defs.bzl b/internal/karma/defs.bzl new file mode 100644 index 00000000..b8053b97 --- /dev/null +++ b/internal/karma/defs.bzl @@ -0,0 +1,33 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" Public API surface is re-exported here. +""" + +load( + ":karma_web_test.bzl", + _karma_web_test = "karma_web_test", + _karma_web_test_suite = "karma_web_test_suite", +) +load( + ":ts_web_test.bzl", + _ts_web_test = "ts_web_test", + _ts_web_test_suite = "ts_web_test_suite", +) + +# TODO(alexeagle): make ts_web_test && ts_web_test_suite work in google3 +ts_web_test = _ts_web_test +ts_web_test_suite = _ts_web_test_suite +karma_web_test = _karma_web_test +karma_web_test_suite = _karma_web_test_suite diff --git a/internal/karma/karma.conf.js b/internal/karma/karma.conf.js index 76c2343e..dae40a93 100644 --- a/internal/karma/karma.conf.js +++ b/internal/karma/karma.conf.js @@ -178,7 +178,7 @@ try ].map(f => { if (f.startsWith('NODE_MODULES/')) { try { - // attempt to resolve in @bazel/karma nested node_modules first + // attempt to resolve in @bazel/typescript nested node_modules first return require.resolve(f.replace(/^NODE_MODULES\//, '@bazel/karma/node_modules/')); } catch (e) { // if that failed then attempt to resolve in root node_modules diff --git a/internal/karma/karma_web_test.bzl b/internal/karma/karma_web_test.bzl index 99ea1505..28526d73 100644 --- a/internal/karma/karma_web_test.bzl +++ b/internal/karma/karma_web_test.bzl @@ -23,7 +23,7 @@ load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_ load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") load(":web_test.bzl", "COMMON_WEB_TEST_ATTRS") -_CONF_TMPL = "//internal/karma:karma.conf.js" +_CONF_TMPL = "//:karma.conf.js" _DEFAULT_KARMA_BIN = "@npm//@bazel/karma/bin:karma" # Attributes for karma_web_test that are shared with ts_web_test which @@ -123,7 +123,7 @@ def _write_karma_config(ctx, files, amd_names_shim): # polyfilling before test libraries load. # See https://github.com/karma-runner/karma/issues/699 # `NODE_MODULES/` is a prefix recogized by karma.conf.js to allow - # for a priority require of nested `@bazel/karma/node_modules` before + # for a priority require of nested `@bazel/typescript/node_modules` before # looking in root node_modules. bootstrap_entries += [ "NODE_MODULES/requirejs/require.js", diff --git a/internal/karma/package.bzl b/internal/karma/package.bzl new file mode 100644 index 00000000..564cb3c9 --- /dev/null +++ b/internal/karma/package.bzl @@ -0,0 +1,46 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Package file which defines build_bazel_rules_karma dependencies +""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def rules_karma_dependencies(): + """ + Fetch our transitive dependencies. + + If the user wants to get a different version of these, they can just fetch it + from their WORKSPACE before calling this function, or not call this function at all. + """ + + # TypeScript compiler runs on node.js runtime + _maybe( + http_archive, + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + ) + + # ts_web_test depends on the web testing rules to provision browsers. + _maybe( + http_archive, + name = "io_bazel_rules_webtesting", + urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.0/rules_webtesting.tar.gz"], + sha256 = "1c0900547bdbe33d22aa258637dc560ce6042230e41e9ea9dad5d7d2fca8bc42", + ) + +def _maybe(repo_rule, name, **kwargs): + if name not in native.existing_rules(): + repo_rule(name = name, **kwargs) diff --git a/internal/karma/package.json b/internal/karma/package.json index be1c6eb4..9f04bff1 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -1,6 +1,6 @@ { "name": "@bazel/karma", - "description": "runtime dependences for web test rules", + "description": "Karma rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", "version": "0.0.0-PLACEHOLDER", @@ -26,7 +26,22 @@ "semver": "5.6.0", "tmp": "0.0.33" }, - "scripts": { - "postinstall": "node ./check_version.js" + "devDependencies": { + "@bazel/bazel": "~0.22.0", + "@types/node": "7.0.18", + "protobufjs": "5.0.3", + "semver": "5.6.0", + "source-map-support": "0.5.9", + "tsickle": "0.33.1", + "tsutils": "2.27.2", + "typescript": "~3.1.6", + "jasmine-core": "2.8.0" + }, + "bazelWorkspaces": { + "build_bazel_rules_karma": { + "version": "0.0.0-PLACEHOLDER", + "compatVersion": "0.0.0-COMPAT_VERSION", + "rootPath": "." + } } } diff --git a/internal/karma/yarn.lock b/internal/karma/yarn.lock new file mode 100644 index 00000000..1d21df68 --- /dev/null +++ b/internal/karma/yarn.lock @@ -0,0 +1,2320 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@bazel/bazel-darwin_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.22.0.tgz#a2bea5922dba9a32554a218ba4849a200115b248" + integrity sha512-LFxkyQgPATeB64z/1IvOWZhK+lc3JVHejbmdo96qB4lsoD8zselvOlgHvVXxlAjRxVZ9mlmXDvDRDyaXyyRdwA== + +"@bazel/bazel-linux_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.22.0.tgz#12e5884f2a7b7f3b62afbef9f8da4de0976f3bc8" + integrity sha512-xDs8cb2bbGZ9uvzYZOzCVrMBywzRhLj0J/t+py+FYZj+VO5B3wVg9eUf6nWWR0oJ2mzvToI9h31t2tNdqwy2kQ== + +"@bazel/bazel-win32_x64@0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.22.0.tgz#a8a65986639583a8cc7b018e001aedfdafe41b50" + integrity sha512-FbJaXVDoCLnpIFLnPHFkQdfriYPXfnfQNuf9EXMliERdRuoeBVbwEZfwcuArxZWNFus7bD8QiTj0XzKVWO+Wbw== + +"@bazel/bazel@~0.22.0": + version "0.22.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.22.0.tgz#feb0f2d82f9d169cb47951d95d55e512eda72bc9" + integrity sha512-uaXZsfCXOASBXzmge56akRIhJnKYdShn1X3AdEBzq2NNCf2llkc1H25gKGm4BfuWDBXRbXDMmcXup+fw39h+WQ== + optionalDependencies: + "@bazel/bazel-darwin_x64" "0.22.0" + "@bazel/bazel-linux_x64" "0.22.0" + "@bazel/bazel-win32_x64" "0.22.0" + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +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== + +accepts@~1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" + integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= + dependencies: + mime-types "~2.1.18" + negotiator "0.6.1" + +adm-zip@~0.4.3: + version "0.4.13" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" + integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== + +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" + integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= + +agent-base@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== + dependencies: + es6-promisify "^5.0.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-slice@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" + integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" + integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + integrity sha1-GdOGodntxufByF04iu28xW0zYC0= + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +async@^2.1.2: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== + dependencies: + lodash "^4.17.10" + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +backo2@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-arraybuffer@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" + integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= + +base64id@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" + integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +better-assert@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" + integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= + dependencies: + callsite "1.0.0" + +binary-extensions@^1.0.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" + integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== + +blob@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" + integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== + +bluebird@^3.3.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" + integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== + +body-parser@^1.16.1: + version "1.18.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" + integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "~1.6.3" + iconv-lite "0.4.23" + on-finished "~2.3.0" + qs "6.5.2" + raw-body "2.3.3" + type-is "~1.6.16" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^0.1.2: + version "0.1.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" + integrity sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY= + dependencies: + expand-range "^0.1.0" + +braces@^2.3.0, braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsite@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +chokidar@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.5" + optionalDependencies: + fsevents "^1.2.2" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +circular-json@^0.5.5: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +colors@^1.1.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" + integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +combine-lists@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" + integrity sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y= + dependencies: + lodash "^4.5.0" + +component-bind@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" + integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= + +component-emitter@1.2.1, component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +component-inherit@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" + integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +connect@^3.6.0: + version "3.6.6" + resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" + integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= + dependencies: + debug "2.6.9" + finalhandler "1.1.0" + parseurl "~1.3.2" + utils-merge "1.0.1" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.2.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" + integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== + +core-js@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" + integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +custom-event@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" + integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= + +date-format@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" + integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= + +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@=3.1.0, debug@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +di@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" + integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + +dom-serialize@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" + integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= + dependencies: + custom-event "~1.0.0" + ent "~2.2.0" + extend "^3.0.0" + void-elements "^2.0.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +encodeurl@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +engine.io-client@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" + integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== + dependencies: + component-emitter "1.2.1" + component-inherit "0.0.3" + debug "~3.1.0" + engine.io-parser "~2.1.1" + has-cors "1.1.0" + indexof "0.0.1" + parseqs "0.0.5" + parseuri "0.0.5" + ws "~3.3.1" + xmlhttprequest-ssl "~1.5.4" + yeast "0.1.2" + +engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" + integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== + dependencies: + after "0.8.2" + arraybuffer.slice "~0.0.7" + base64-arraybuffer "0.1.5" + blob "0.0.5" + has-binary2 "~1.0.2" + +engine.io@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" + integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== + dependencies: + accepts "~1.3.4" + base64id "1.0.0" + cookie "0.3.1" + debug "~3.1.0" + engine.io-parser "~2.1.0" + ws "~3.3.1" + +ent@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" + integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= + +es6-promise@^4.0.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== + +es6-promise@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" + integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +eventemitter3@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" + integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== + +expand-braces@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" + integrity sha1-SIsdHSRRyz06axks/AMPRMWFX+o= + dependencies: + array-slice "^0.2.3" + array-unique "^0.2.1" + braces "^0.1.2" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" + integrity sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ= + dependencies: + is-number "^0.1.1" + repeat-string "^0.2.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +finalhandler@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" + integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= + dependencies: + debug "2.6.9" + encodeurl "~1.0.1" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.2" + statuses "~1.3.1" + unpipe "~1.0.0" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +follow-redirects@^1.0.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" + integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== + dependencies: + debug "=3.1.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-access@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" + integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= + dependencies: + null-check "^1.0.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.2: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@^7.0.5, glob@^7.1.1, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +has-binary2@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" + integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== + dependencies: + isarray "2.0.1" + +has-cors@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" + integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= + +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= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +http-errors@1.6.3, http-errors@~1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-proxy@^1.13.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" + integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== + dependencies: + eventemitter3 "^3.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +iconv-lite@0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.4.4: + 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-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= + dependencies: + is-extglob "^2.1.1" + +is-number@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" + integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= + +isbinaryfile@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" + integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== + dependencies: + buffer-alloc "^1.2.0" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +jasmine-core@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jszip@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" + integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== + dependencies: + core-js "~2.3.0" + es6-promise "~3.0.2" + lie "~3.1.0" + pako "~1.0.2" + readable-stream "~2.0.6" + +karma-chrome-launcher@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" + integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== + dependencies: + fs-access "^1.0.0" + which "^1.2.1" + +karma-firefox-launcher@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" + integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== + +karma-jasmine@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" + integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= + +karma-requirejs@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" + integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= + +karma-sauce-launcher@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" + integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== + dependencies: + sauce-connect-launcher "^1.2.4" + saucelabs "^1.5.0" + selenium-webdriver "^4.0.0-alpha.1" + +karma-sourcemap-loader@0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" + integrity sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg= + dependencies: + graceful-fs "^4.1.2" + +karma@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" + integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== + dependencies: + bluebird "^3.3.0" + body-parser "^1.16.1" + chokidar "^2.0.3" + colors "^1.1.0" + combine-lists "^1.0.0" + connect "^3.6.0" + core-js "^2.2.0" + di "^0.0.1" + dom-serialize "^2.2.0" + expand-braces "^0.1.1" + flatted "^2.0.0" + glob "^7.1.1" + graceful-fs "^4.1.2" + http-proxy "^1.13.0" + isbinaryfile "^3.0.0" + lodash "^4.17.5" + log4js "^3.0.0" + mime "^2.3.1" + minimatch "^3.0.2" + optimist "^0.6.1" + qjobs "^1.1.4" + range-parser "^1.2.0" + rimraf "^2.6.0" + safe-buffer "^5.0.1" + socket.io "2.1.1" + source-map "^0.6.1" + tmp "0.0.33" + useragent "2.3.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +lie@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= + dependencies: + immediate "~3.0.5" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + +lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log4js@^3.0.0: + version "3.0.6" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" + integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== + dependencies: + circular-json "^0.5.5" + date-format "^1.2.0" + debug "^3.1.0" + rfdc "^1.1.2" + streamroller "0.7.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +lru-cache@4.1.x: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== + +mime-types@~2.1.18: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== + dependencies: + mime-db "~1.37.0" + +mime@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +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== + +nan@^2.9.2: + version "2.12.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" + integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +needle@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== + +npm-packlist@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" + integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +null-check@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" + integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +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= + +object-component@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" + integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +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-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, 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= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +pako@~1.0.2: + version "1.0.8" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" + integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== + +parseqs@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" + integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= + dependencies: + better-assert "~1.0.0" + +parseuri@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" + integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= + dependencies: + better-assert "~1.0.0" + +parseurl@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +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= + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= + +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== + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +qjobs@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" + integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== + +qs@6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +range-parser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= + +raw-body@2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" + integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== + dependencies: + bytes "3.0.0" + http-errors "1.6.3" + iconv-lite "0.4.23" + unpipe "1.0.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" + integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +requirejs@2.3.5: + version "2.3.5" + resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" + integrity sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rfdc@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" + integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== + +rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: + 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" + +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== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sauce-connect-launcher@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" + integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== + dependencies: + adm-zip "~0.4.3" + async "^2.1.2" + https-proxy-agent "^2.2.1" + lodash "^4.16.6" + rimraf "^2.5.4" + +saucelabs@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" + integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== + dependencies: + https-proxy-agent "^2.2.1" + +sax@>=0.6.0, sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +selenium-webdriver@^4.0.0-alpha.1: + version "4.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" + integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + +semver@5.6.0, semver@^5.3.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +socket.io-adapter@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" + integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= + +socket.io-client@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" + integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== + dependencies: + backo2 "1.0.2" + base64-arraybuffer "0.1.5" + component-bind "1.0.0" + component-emitter "1.2.1" + debug "~3.1.0" + engine.io-client "~3.2.0" + has-binary2 "~1.0.2" + has-cors "1.1.0" + indexof "0.0.1" + object-component "0.0.3" + parseqs "0.0.5" + parseuri "0.0.5" + socket.io-parser "~3.2.0" + to-array "0.1.4" + +socket.io-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" + integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== + dependencies: + component-emitter "1.2.1" + debug "~3.1.0" + isarray "2.0.1" + +socket.io@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" + integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== + dependencies: + debug "~3.1.0" + engine.io "~3.2.0" + has-binary2 "~1.0.2" + socket.io-adapter "~1.1.0" + socket.io-client "2.1.1" + socket.io-parser "~3.2.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +statuses@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= + +streamroller@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" + integrity sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ== + dependencies: + date-format "^1.2.0" + debug "^3.1.0" + mkdirp "^0.5.1" + readable-stream "^2.3.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-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= + +tar@^4: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +tmp@0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + dependencies: + os-tmpdir "~1.0.1" + +tmp@0.0.33, tmp@0.0.x: + 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" + +to-array@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" + integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tsickle@0.33.1: + version "0.33.1" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" + integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== + dependencies: + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map "^0.7.3" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +type-is@~1.6.16: + version "1.6.16" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" + integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.18" + +typescript@~3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== + +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +useragent@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" + integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== + dependencies: + lru-cache "4.1.x" + tmp "0.0.x" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +void-elements@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" + integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= + +which@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +ws@~3.3.1: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +xml2js@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= + +xmlhttprequest-ssl@~1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" + integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" + +yeast@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" + integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= diff --git a/internal/package.json b/internal/package.json deleted file mode 100644 index 3387c544..00000000 --- a/internal/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@bazel/typescript", - "description": "Custom TypeScript compiler for hosting on Bazel", - "homepage": "https://github.com/bazelbuild/rules_typescript", - "license": "Apache-2.0", - "version": "0.0.0-PLACEHOLDER", - "keywords": [ - "typescript", - "bazel" - ], - "main": "./tsc_wrapped/index.js", - "typings": "./tsc_wrapped/index.d.ts", - "peerDependencies": { - "typescript": ">=2.4.2" - }, - "dependencies": { - "protobufjs": "5.0.3", - "semver": "5.6.0", - "source-map-support": "0.5.9", - "tsutils": "2.27.2" - }, - "devDependencies": { - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "@types/tmp": "0.0.33", - "tmp": "0.0.33", - "typescript": "2.7.2" - }, - "scripts": { - "postinstall": "node ./check_version.js" - } -} diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel index 9f8522ef..b9ce1610 100644 --- a/internal/protobufjs/BUILD.bazel +++ b/internal/protobufjs/BUILD.bazel @@ -1,4 +1,17 @@ -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") package(default_visibility = ["//visibility:public"]) @@ -55,13 +68,12 @@ nodejs_binary( install_source_map_support = False, ) -pkg_tar( - name = "package", +filegroup( + name = "npm_package_assets", srcs = [ "BUILD.bazel", "package.json", "ts_proto_library.bzl", "yarn.lock", ], - package_dir = "protobufjs", ) diff --git a/internal/protobufjs/ts_proto_library.bzl b/internal/protobufjs/ts_proto_library.bzl index ee2ea3e1..7c6e58e1 100644 --- a/internal/protobufjs/ts_proto_library.bzl +++ b/internal/protobufjs/ts_proto_library.bzl @@ -178,7 +178,7 @@ in the `bootstrap` attribute of `ts_web_test_suite` or `ts_devserver`. To complete the example above, you could write a `ts_web_test_suite`: ``` -load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test_suite") +load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") ts_web_test_suite( name = "test", diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index 87327f95..6a37d984 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -24,29 +24,11 @@ def ts_setup_workspace(): by the TypeScript rules. """ - # 0.14.0: @bazel_tools//tools/bash/runfiles is required - # 0.15.0: "data" attributes don't need 'cfg = "data"' - # 0.17.1: allow @ in package names is required for fine grained deps # 0.18.0: support for .bazelignore check_bazel_version("0.18.0") - go_repository( - name = "com_github_kylelemons_godebug", - commit = "d65d576e9348f5982d7f6d83682b694e731a45c6", - importpath = "github.com/kylelemons/godebug", - ) - - go_repository( - name = "com_github_mattn_go_isatty", - commit = "3fb116b820352b7f0c281308a4d6250c22d94e27", - importpath = "github.com/mattn/go-isatty", - ) - - # 0.11.3: node module resolution fixes & check_rules_nodejs_version - # 0.14.0: fine grained npm dependencies support for ts_library - # 0.14.1: fine grained npm dependencies fix for npm_install - # 0.15.0: fine grained npm dependencies breaking change - check_rules_nodejs_version("0.15.0") + # 0.16.8: ng_package fix for packaging binary files + check_rules_nodejs_version("0.16.8") # Included here for backward compatability for downstream repositories # that use @build_bazel_rules_typescript_tsc_wrapped_deps such as rxjs. @@ -68,3 +50,25 @@ def ts_setup_workspace(): package_json = "@build_bazel_rules_typescript//internal/protobufjs:package.json", yarn_lock = "@build_bazel_rules_typescript//internal/protobufjs:yarn.lock", ) + +def ts_setup_dev_workspace(): + """ + Setup the toolchain needed for local development, but not needed by users. + + These needs to be in a separate file from ts_setup_workspace() so as not + to leak load statements. + """ + + ts_setup_workspace() + + go_repository( + name = "com_github_kylelemons_godebug", + commit = "d65d576e9348f5982d7f6d83682b694e731a45c6", + importpath = "github.com/kylelemons/godebug", + ) + + go_repository( + name = "com_github_mattn_go_isatty", + commit = "3fb116b820352b7f0c281308a4d6250c22d94e27", + importpath = "github.com/mattn/go-isatty", + ) diff --git a/package.bzl b/package.bzl index 5ba34e36..69ae928c 100644 --- a/package.bzl +++ b/package.bzl @@ -12,20 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Package file which defines build_bazel_rules_typescript version in skylark - -check_rules_typescript_version can be used in downstream WORKSPACES to check -against a minimum dependent build_bazel_rules_typescript version. +"""Package file which defines build_bazel_rules_typescript dependencies """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -# This version is synced with the version in package.json. -# It will be automatically synced via the npm "version" script -# that is run when running `npm version` during the release -# process. See `Releasing` section in README.md. -VERSION = "0.22.1" - def rules_typescript_dependencies(): """ Fetch our transitive dependencies. @@ -38,19 +29,29 @@ def rules_typescript_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.7.zip"], - strip_prefix = "rules_nodejs-0.16.7", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], ) - # ts_web_test depends on the web testing rules to provision browsers. +def rules_typescript_dev_dependencies(): + """ + Fetch dependencies needed for local development, but not needed by users. + + These are in this file to keep version information in one place, and make the WORKSPACE + shorter. + """ + + rules_typescript_dependencies() + + # For running skylint _maybe( http_archive, - name = "io_bazel_rules_webtesting", - urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.0/rules_webtesting.tar.gz"], - sha256 = "1c0900547bdbe33d22aa258637dc560ce6042230e41e9ea9dad5d7d2fca8bc42", + name = "io_bazel", + urls = ["https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-dist.zip"], + sha256 = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4", ) - # ts_devserver depends on the Go rules. + # For building ts_devserver and ts_auto_deps binaries # See https://github.com/bazelbuild/rules_go#setup for the latest version. _maybe( http_archive, @@ -92,22 +93,6 @@ def rules_typescript_dependencies(): strip_prefix = "bazel-skylib-d7c5518fa061ae18a20d00b14082705d3d2d885d", ) -def rules_typescript_dev_dependencies(): - """ - Fetch dependencies needed for local development, but not needed by users. - - These are in this file to keep version information in one place, and make the WORKSPACE - shorter. - """ - - # For running skylint - _maybe( - http_archive, - name = "io_bazel", - urls = ["https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-dist.zip"], - sha256 = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4", - ) - ############################################# # Dependencies for generating documentation # ############################################# diff --git a/package.json b/package.json index 9577f6f8..a2ec9177 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,24 @@ { - "description": "Monorepo for TypeScript Bazel support. Published packages are in subdirectories under internal/", - "private": true, - "version": "0.22.1", + "name": "@bazel/typescript", + "description": "TypeScript rules for Bazel", + "homepage": "https://github.com/bazelbuild/rules_typescript", + "license": "Apache-2.0", + "version": "0.0.0-PLACEHOLDER", + "keywords": [ + "typescript", + "bazel" + ], + "main": "./internal/tsc_wrapped/index.js", + "typings": "./internal/tsc_wrapped/index.d.ts", + "bin": { + "ts_auto_deps": "./ts_auto_deps/ts_auto_deps.js" + }, "dependencies": { - "jasmine-core": "2.8.0", - "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", - "karma-chrome-launcher": "2.2.0", - "karma-firefox-launcher": "1.1.0", - "karma-jasmine": "1.1.1", - "karma-json-result-reporter": "1.0.0", - "karma-requirejs": "1.1.0", - "karma-sauce-launcher": "2.0.2", - "karma-sourcemap-loader": "0.3.7", "protobufjs": "5.0.3", - "requirejs": "2.3.5", + "semver": "5.6.0", "source-map-support": "0.5.9", - "tmp": "0.0.33", - "tsutils": "2.27.2" + "tsutils": "2.27.2", + "jasmine-core": "2.8.0" }, "devDependencies": { "@bazel/bazel": "~0.22.0", @@ -31,25 +33,40 @@ "clang-format": "1.0.49", "concurrently": "^3.5.1", "http-server": "^0.11.1", + "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", + "karma-chrome-launcher": "2.2.0", + "karma-firefox-launcher": "1.1.0", + "karma-jasmine": "1.1.1", + "karma-json-result-reporter": "1.0.0", + "karma-requirejs": "1.1.0", + "karma-sauce-launcher": "2.0.2", + "karma-sourcemap-loader": "0.3.7", "protractor": "^5.2.0", + "requirejs": "2.3.5", "shelljs": "^0.8.2", + "tmp": "0.0.33", "tsickle": "0.33.1", "typescript": "~3.1.6", "which": "~1.0.5" }, + "bazelWorkspaces": { + "build_bazel_rules_typescript": { + "version": "0.0.0-PLACEHOLDER", + "compatVersion": "0.0.0-COMPAT_VERSION", + "rootPath": "." + } + }, "scripts": { - "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e //internal:npm_package //internal/karma:npm_package", - "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-npm_packages && yarn e2e-ts_auto_deps && yarn e2e-typescript_3.1", + "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e //:npm_package && cd internal/karma; bazel build //:npm_package", + "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-npm_packages && yarn e2e-typescript_3.1", "e2e-bazel-external": "jasmine internal/e2e/default_tsconfig_test.js", "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-app-prodserver": "concurrently \"bazel run //examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-protobuf-devserver": "concurrently \"bazel run //examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-examples-protobuf-prodserver": "concurrently \"bazel run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-npm_packages": "./internal/e2e/npm_packages/test.sh", - "e2e-ts_auto_deps": "cd internal/e2e/ts_auto_deps; yarn test", "e2e-typescript_3.1": "cd internal/e2e/typescript_3.1; yarn test", "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", - "version": "node ./on-version.js && git stage package.bzl README.md", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", "bazel:lint-fix": "yarn bazel:format --lint=fix" diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel index ce4c4152..38af0d0a 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel @@ -1,4 +1,3 @@ -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") @@ -29,11 +28,9 @@ go_library( visibility = ["//visibility:public"], ) -pkg_tar( - name = "package", +filegroup( + name = "npm_package_assets", srcs = [ - "BUILD.bazel", "worker_protocol.proto", ], - package_dir = "third_party/github.com/bazelbuild/bazel/src/main/protobuf", ) diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel deleted file mode 100644 index ebae899d..00000000 --- a/tools/BUILD.bazel +++ /dev/null @@ -1,3 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -exports_files(["check_version.js"]) diff --git a/tools/check_version.js b/tools/check_version.js deleted file mode 100644 index bff8a101..00000000 --- a/tools/check_version.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * Copyright 2017 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview This script runs as a postinstall in the published npm packages - * and checks that the version of the build_bazel_rules_typescript external - * repository matches that of the published npm package. - * - * Note, this check is only performed with bazel managed deps when the yarn or - * npm install is from a yarn_install or npm_install repository rule. For self - * managed bazel deps this check is not performed and it is the responsibility - * of the user to ensure that the versions match. - */ -'use strict'; - -const path = require('path'); -const fs = require('fs'); -const semver = require('semver'); - -// If this is a bazel managed deps yarn_install or npm_install then the -// cwd is $(bazel info -// output_base)/external//node_modules/@bazel/typescript and there should -// be $(bazel info output_base)/external//generate_build_file.js -// folder -function isBazelManagedDeps() { - try { - fs.statSync('../../../generate_build_file.js'); - return true; - } catch (e) { - return false; - } -} - -if (isBazelManagedDeps()) { - let contents; - try { - // If this is a yarn_install or npm_install then the cwd is $(bazel info - // output_base)/external//node_modules/@bazel/ - // so we can look for the package.bzl file under $(bazel info - // output_base)/external/build_bazel_rules_typescript/package.bzl - const packagePath = path.resolve( - process.cwd(), '../../../../build_bazel_rules_typescript/package.bzl'); - contents = fs.readFileSync(packagePath, 'utf8'); - } catch (e) { - throw new Error( - 'The build_bazel_rules_typescript repository is not installed in your Bazel WORKSPACE file'); - } - - // Sanity check that this is build_bazel_rules_typescript since - // other repos will follow the same pattern and have a VERSION - // in a root pacakge.bzl file - if (!contents.includes('def rules_typescript_dependencies():')) { - throw new Error('Invalid package.bzl in build_bazel_rules_typescript'); - } - - const matchVersion = contents.match(/VERSION \= \"([0-9\.]*)\"/); - if (!matchVersion) { - throw new Error('Invalid package.bzl in build_bazel_rules_typescript'); - } - - const bazelPackageVersion = matchVersion[1]; - const bazelPackageVersionRange = `${semver.major(bazelPackageVersion)}.${semver.minor(bazelPackageVersion)}.x`; // should match patch version - - // Should be tolerant of development stamped versions such as "0.17.0-7-g76dc057" - const npmPackageVersion = process.env.npm_package_version.split('-')[0]; - - if (!semver.satisfies(npmPackageVersion, bazelPackageVersionRange)) { - throw new Error( - `Expected ${process.env.npm_package_name} version ${npmPackageVersion} to satisfy ${bazelPackageVersionRange}. ` + - `Please update the build_bazel_rules_typescript version in WORKSPACE file to match ${npmPackageVersion} or ` + - `update the ${process.env.npm_package_name} version in your package.json to satisfy ${bazelPackageVersionRange}.`); - } -} else { - // No version check - console.warn( - `WARNING: With self managed deps you must ensure the @bazel/typescript -and @bazel/karma npm package versions match the build_bazel_rules_typescript -repository version. Use yarn_install or npm_install for this version to be checked -automatically.`); -} diff --git a/ts_auto_deps/BUILD.bazel b/ts_auto_deps/BUILD.bazel index 0ab24a73..a1e0f2df 100644 --- a/ts_auto_deps/BUILD.bazel +++ b/ts_auto_deps/BUILD.bazel @@ -1,4 +1,3 @@ -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( @@ -13,84 +12,45 @@ go_library( ) go_binary( - name = "ts_auto_deps", + name = "ts_auto_deps_bin", embed = [":go_default_library"], visibility = ["//visibility:public"], ) -config_setting( - name = "darwin_amd64", - constraint_values = [ - "@bazel_tools//platforms:osx", - "@bazel_tools//platforms:x86_64", - ], -) - -config_setting( - name = "linux_amd64", - constraint_values = [ - "@bazel_tools//platforms:linux", - "@bazel_tools//platforms:x86_64", - ], -) - -config_setting( - name = "windows_amd64", - constraint_values = [ - "@bazel_tools//platforms:windows", - "@bazel_tools//platforms:x86_64", - ], -) - -filegroup( - name = "auto_deps", - srcs = select({ - ":darwin_amd64": ["ts_auto_deps-darwin_amd64"], - ":linux_amd64": ["ts_auto_deps-linux_amd64"], - ":windows_amd64": ["ts_auto_deps-windows_amd64.exe"], - }), - # Don't build on CI - tags = ["manual"], -) - go_binary( - name = "ts_auto_deps-windows", - out = "ts_auto_deps-windows_amd64.exe", + name = "ts_auto_deps-darwin", + out = "ts_auto_deps-darwin_x64", embed = [":go_default_library"], goarch = "amd64", - goos = "windows", + goos = "darwin", pure = "on", visibility = ["//visibility:public"], ) go_binary( - name = "ts_auto_deps-darwin", - out = "ts_auto_deps-darwin_amd64", + name = "ts_auto_deps-linux", + out = "ts_auto_deps-linux_x64", embed = [":go_default_library"], goarch = "amd64", - goos = "darwin", + goos = "linux", pure = "on", visibility = ["//visibility:public"], ) go_binary( - name = "ts_auto_deps-linux", - out = "ts_auto_deps-linux_amd64", + name = "ts_auto_deps-windows", + out = "ts_auto_deps-win32_x64.exe", embed = [":go_default_library"], goarch = "amd64", - goos = "linux", + goos = "windows", pure = "on", visibility = ["//visibility:public"], ) -pkg_tar( - name = "package", +filegroup( + name = "npm_package_assets", srcs = [ - "BUILD.bazel", - ":ts_auto_deps-darwin", - ":ts_auto_deps-linux", - ":ts_auto_deps-windows", + "ts_auto_deps.js", ], - package_dir = "ts_auto_deps", - visibility = ["//:__pkg__"], + visibility = ["//visibility:public"], ) diff --git a/ts_auto_deps/ts_auto_deps.js b/ts_auto_deps/ts_auto_deps.js new file mode 100644 index 00000000..68f4f7e8 --- /dev/null +++ b/ts_auto_deps/ts_auto_deps.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +// This file is a shim to execute the ts_auto_deps binary from the right platform-specific package. +const os = require('os'); +const fs = require('fs'); +const path = require('path'); +const spawnSync = require('child_process').spawnSync; + +/** + * @return '.exe' for Windows and '' for all other platforms + */ +function getNativeBinaryExt() { + return os.platform() === 'win32' ? '.exe' : ''; +} + +/** + * @return the native `ts_auto_deps` binary for the current platform + * @throws when the `ts_auto_deps` executable can not be found + */ +function getNativeBinary() { + try { + return require.resolve(`./ts_auto_deps-${os.platform()}_${os.arch()}${getNativeBinaryExt()}`); + } catch (e) { + const message = 'ts_auto_deps executable not found for your platform: ' + + `(${os.platform()}_${os.arch()})\n`; + throw new Error(message); + } +} + +/** Starts a new synchronous child process that runs with the specified arguments. */ +const spawnedProcess = spawnSync(getNativeBinary(), process.argv.slice(2), {stdio: 'inherit'}); + +// Ensure that this wrapper script exits with the same exit code as the child process. +process.exit(spawnedProcess.status); diff --git a/version.bzl b/version.bzl new file mode 100644 index 00000000..38d61191 --- /dev/null +++ b/version.bzl @@ -0,0 +1,56 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Package file which defines build_bazel_rules_typescript version in skylark +""" + +load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") + +VERSION = "0.22.1" + +# This version is the minimum version that is API compatible with this version +# of rules_typescript. This version should be updated to equal VERSION for +# releases with breaking changes and/or new features. +COMPAT_VERSION = "0.22.0" + +def check_rules_typescript_version(version_string): + """ + Verify that a compatible build_bazel_rules_typescript is loaded a WORKSPACE. + + Where COMPAT_VERSION and VERSION come from the build_bazel_rules_typescript that + is loaded in a WORKSPACE, this function will check: + + VERSION >= version_string >= COMPAT_VERSION + + This should be called from the `WORKSPACE` file so that the build fails as + early as possible. For example: + + ``` + # in WORKSPACE: + load("@build_bazel_rules_typescript//:defs.bzl", "check_rules_typescript_version") + check_rules_typescript_version(version_string = "0.22.0") + ``` + + Args: + version_string: A version string to check for compatibility with the loaded version + of build_bazel_rules_typescript. The version check performed is + `VERSION >= version_string >= COMPAT_VERSION` where VERSION and COMPAT_VERSION + come from the loaded version of build_bazel_rules_typescript. + """ + if not check_version(VERSION, version_string) or not check_version(version_string, COMPAT_VERSION): + fail("\nLoaded build_bazel_rules_typescript version {} with mimimum compat version of {} is not compatible with checked version {}!\n\n".format( + VERSION, + COMPAT_VERSION, + version_string, + )) diff --git a/yarn.lock b/yarn.lock index db0c286b..3c74b43f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3415,6 +3415,11 @@ selenium-webdriver@^4.0.0-alpha.1: tmp "0.0.30" xml2js "^0.4.17" +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" From 973738fccd0ecac87f13c3fdb6b8a42e954216a1 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 1 Feb 2019 16:42:16 -0800 Subject: [PATCH 071/316] Use fences to elide code from the published npm package. This prevents users having a transitive dependency on go rules. PiperOrigin-RevId: 232060510 --- BUILD.bazel | 11 ++++++++++- devserver/BUILD.bazel | 18 ++++++++++++++++++ internal/karma/BUILD.bazel | 5 +++++ internal/ts_repositories.bzl | 8 ++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 1dffb818..df7e9b75 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +# BEGIN-DEV-ONLY +# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. +# The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. +# # To update BUILD.bazel files after changing Go code, run # bazel run //:gazelle # @@ -19,7 +23,11 @@ # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") + +# END-DEV-ONLY load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") + +# BEGIN-DEV-ONLY load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") load("//:version.bzl", "COMPAT_VERSION") @@ -76,6 +84,7 @@ npm_package( # from how our release is used. "//devserver:devserver_bin": "//devserver", "0.0.0-COMPAT_VERSION": COMPAT_VERSION, + "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", }, deps = [ "//devserver:devserver-darwin", @@ -97,7 +106,7 @@ npm_package( # extension = "tgz", # ) - +# END-DEV-ONLY # A nodejs_binary for @bazel/typescript/tsc_wrapped to use by default in # ts_library that depends on @npm//@bazel/typescript instead of the # output of the //internal/tsc_wrapped ts_library rule. This diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel index 07e8907a..a04d169b 100644 --- a/devserver/BUILD.bazel +++ b/devserver/BUILD.bazel @@ -1,3 +1,20 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# BEGIN-DEV-ONLY +# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. +# The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( @@ -59,6 +76,7 @@ filegroup( visibility = ["//visibility:public"], ) +# END-DEV-ONLY config_setting( name = "darwin_x64", constraint_values = [ diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index b2dd97d1..815b6da6 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# BEGIN-DEV-ONLY +# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. +# The generated `@bazel/karma` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") load("@build_bazel_rules_typescript//:version.bzl", "COMPAT_VERSION") load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") @@ -79,6 +82,7 @@ npm_package( ], replacements = { "0.0.0-COMPAT_VERSION": COMPAT_VERSION, + "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", }, deps = [ ":bazel_karma", @@ -86,4 +90,5 @@ npm_package( ], ) +# END-DEV-ONLY exports_files(["karma.conf.js"]) diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index 6a37d984..2a90a70f 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -14,7 +14,12 @@ "Install toolchain dependencies" +# BEGIN-DEV-ONLY +# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. +# The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@bazel_gazelle//:deps.bzl", "go_repository") + +# END-DEV-ONLY load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version", "yarn_install") def ts_setup_workspace(): @@ -51,6 +56,7 @@ def ts_setup_workspace(): yarn_lock = "@build_bazel_rules_typescript//internal/protobufjs:yarn.lock", ) +# BEGIN-DEV-ONLY def ts_setup_dev_workspace(): """ Setup the toolchain needed for local development, but not needed by users. @@ -72,3 +78,5 @@ def ts_setup_dev_workspace(): commit = "3fb116b820352b7f0c281308a4d6250c22d94e27", importpath = "github.com/mattn/go-isatty", ) + +# END-DEV-ONLY From 12b12d758b6ce3aedcd149e083a1e00c4df87d37 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 4 Feb 2019 11:45:53 -0800 Subject: [PATCH 072/316] Fence out the content of /internal/BUILD.bazel Since we don't want any of the content, generate an empty BUILD file. PiperOrigin-RevId: 232337263 --- internal/BUILD.bazel | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 44372313..73041a93 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -116,10 +116,20 @@ jasmine_node_test( ], ) +# We don't need to distribute any of the content of the BUILD.bazel file in this package +# So generate an empty marker file +genrule( + name = "generated_BUILD", + srcs = [], + # Name the output "BUILD" so it doesn't collide with InputArtifact "BUILD.bazel" + outs = ["BUILD"], + cmd = "echo \"# Marker that this directory is a Bazel package\" > $@", +) + filegroup( name = "npm_package_assets", srcs = [ - "BUILD.bazel", + ":generated_BUILD", "build_defs.bzl", "common/compilation.bzl", "common/json_marshal.bzl", From a9f81a5b0cdb10b7213995819dce105f874edeac Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 4 Feb 2019 12:34:39 -0800 Subject: [PATCH 073/316] Add e2e/npm_packages/ts_devserver test Fix npm script syntax to run on Windows Closes #401 PiperOrigin-RevId: 232346165 --- internal/e2e/npm_packages/karma/yarn.lock | 2197 +++++++++++++++++ .../npm_packages/karma_stack_trace/yarn.lock | 9 +- .../npm_packages/karma_typescript/yarn.lock | 9 +- .../ts_auto_deps/package-template.json | 2 +- .../e2e/npm_packages/ts_auto_deps/yarn.lock | 80 +- .../BUILD.bazel | 35 +- .../WORKSPACE | 2 +- internal/e2e/npm_packages/ts_devserver/app.ts | 4 + .../npm_packages/ts_devserver/app_e2e_test.ts | 25 + .../e2e/npm_packages/ts_devserver/index.html | 21 + .../ts_devserver/package-template.json | 15 + .../ts_devserver/protractor.conf.js | 12 + .../tsconfig.json | 0 .../e2e/npm_packages/ts_devserver/yarn.lock | 1261 ++++++++++ .../e2e/npm_packages/typescript_2.7/yarn.lock | 298 +++ .../e2e/npm_packages/typescript_2.8/yarn.lock | 298 +++ .../e2e/npm_packages/typescript_2.9/yarn.lock | 298 +++ .../e2e/npm_packages/typescript_3.0/yarn.lock | 298 +++ .../e2e/npm_packages/typescript_3.1/yarn.lock | 298 +++ 19 files changed, 5094 insertions(+), 68 deletions(-) rename internal/e2e/npm_packages/{typescript_2.7 => ts_devserver}/BUILD.bazel (55%) rename internal/e2e/npm_packages/{typescript_2.7 => ts_devserver}/WORKSPACE (96%) create mode 100644 internal/e2e/npm_packages/ts_devserver/app.ts create mode 100644 internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts create mode 100644 internal/e2e/npm_packages/ts_devserver/index.html create mode 100644 internal/e2e/npm_packages/ts_devserver/package-template.json create mode 100644 internal/e2e/npm_packages/ts_devserver/protractor.conf.js rename internal/e2e/npm_packages/{typescript_2.7 => ts_devserver}/tsconfig.json (100%) create mode 100644 internal/e2e/npm_packages/ts_devserver/yarn.lock diff --git a/internal/e2e/npm_packages/karma/yarn.lock b/internal/e2e/npm_packages/karma/yarn.lock index 4a580188..00bda136 100644 --- a/internal/e2e/npm_packages/karma/yarn.lock +++ b/internal/e2e/npm_packages/karma/yarn.lock @@ -1,2 +1,2199 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/build_bazel_rules_karma/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.0.0" + dependencies: + jasmine-core "2.8.0" + karma "^4.0.0" + karma-chrome-launcher "2.2.0" + karma-firefox-launcher "1.1.0" + karma-jasmine "1.1.1" + karma-requirejs "1.1.0" + karma-sauce-launcher "2.0.2" + karma-sourcemap-loader "0.3.7" + requirejs "2.3.5" + semver "5.6.0" + tmp "0.0.33" + +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== + +accepts@~1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" + integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= + dependencies: + mime-types "~2.1.18" + negotiator "0.6.1" + +adm-zip@~0.4.3: + version "0.4.13" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" + integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== + +after@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" + integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= + +agent-base@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== + dependencies: + es6-promisify "^5.0.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-slice@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" + integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arraybuffer.slice@~0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" + integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + integrity sha1-GdOGodntxufByF04iu28xW0zYC0= + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +async@^2.1.2: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== + dependencies: + lodash "^4.17.10" + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +backo2@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-arraybuffer@0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" + integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= + +base64id@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" + integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +better-assert@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" + integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= + dependencies: + callsite "1.0.0" + +binary-extensions@^1.0.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" + integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== + +blob@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" + integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== + +bluebird@^3.3.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" + integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== + +body-parser@^1.16.1: + version "1.18.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" + integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "~1.6.3" + iconv-lite "0.4.23" + on-finished "~2.3.0" + qs "6.5.2" + raw-body "2.3.3" + type-is "~1.6.16" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^0.1.2: + version "0.1.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" + integrity sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY= + dependencies: + expand-range "^0.1.0" + +braces@^2.3.0, braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsite@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" + integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= + +chokidar@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.5" + optionalDependencies: + fsevents "^1.2.2" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +circular-json@^0.5.5: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +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= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +colors@^1.1.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" + integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== + +combine-lists@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" + integrity sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y= + dependencies: + lodash "^4.5.0" + +component-bind@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" + integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= + +component-emitter@1.2.1, component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +component-inherit@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" + integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +connect@^3.6.0: + version "3.6.6" + resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" + integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= + dependencies: + debug "2.6.9" + finalhandler "1.1.0" + parseurl "~1.3.2" + utils-merge "1.0.1" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.2.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" + integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== + +core-js@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" + integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +custom-event@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" + integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= + +date-format@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" + integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= + +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@=3.1.0, debug@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +di@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" + integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= + +dom-serialize@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" + integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= + dependencies: + custom-event "~1.0.0" + ent "~2.2.0" + extend "^3.0.0" + void-elements "^2.0.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +encodeurl@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +engine.io-client@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" + integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== + dependencies: + component-emitter "1.2.1" + component-inherit "0.0.3" + debug "~3.1.0" + engine.io-parser "~2.1.1" + has-cors "1.1.0" + indexof "0.0.1" + parseqs "0.0.5" + parseuri "0.0.5" + ws "~3.3.1" + xmlhttprequest-ssl "~1.5.4" + yeast "0.1.2" + +engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" + integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== + dependencies: + after "0.8.2" + arraybuffer.slice "~0.0.7" + base64-arraybuffer "0.1.5" + blob "0.0.5" + has-binary2 "~1.0.2" + +engine.io@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" + integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== + dependencies: + accepts "~1.3.4" + base64id "1.0.0" + cookie "0.3.1" + debug "~3.1.0" + engine.io-parser "~2.1.0" + ws "~3.3.1" + +ent@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" + integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= + +es6-promise@^4.0.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== + +es6-promise@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" + integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +eventemitter3@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" + integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== + +expand-braces@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" + integrity sha1-SIsdHSRRyz06axks/AMPRMWFX+o= + dependencies: + array-slice "^0.2.3" + array-unique "^0.2.1" + braces "^0.1.2" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" + integrity sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ= + dependencies: + is-number "^0.1.1" + repeat-string "^0.2.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +finalhandler@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" + integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= + dependencies: + debug "2.6.9" + encodeurl "~1.0.1" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.2" + statuses "~1.3.1" + unpipe "~1.0.0" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +follow-redirects@^1.0.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" + integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== + dependencies: + debug "=3.1.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-access@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" + integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= + dependencies: + null-check "^1.0.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.2: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@^7.1.1, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +has-binary2@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" + integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== + dependencies: + isarray "2.0.1" + +has-cors@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" + integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= + +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= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +http-errors@1.6.3, http-errors@~1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-proxy@^1.13.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" + integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== + dependencies: + eventemitter3 "^3.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +iconv-lite@0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.4.4: + 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-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= + dependencies: + is-extglob "^2.1.1" + +is-number@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" + integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isarray@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= + +isbinaryfile@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" + integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== + dependencies: + buffer-alloc "^1.2.0" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +jasmine-core@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jszip@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" + integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== + dependencies: + core-js "~2.3.0" + es6-promise "~3.0.2" + lie "~3.1.0" + pako "~1.0.2" + readable-stream "~2.0.6" + +karma-chrome-launcher@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" + integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== + dependencies: + fs-access "^1.0.0" + which "^1.2.1" + +karma-firefox-launcher@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" + integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== + +karma-jasmine@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" + integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= + +karma-requirejs@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" + integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= + +karma-sauce-launcher@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" + integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== + dependencies: + sauce-connect-launcher "^1.2.4" + saucelabs "^1.5.0" + selenium-webdriver "^4.0.0-alpha.1" + +karma-sourcemap-loader@0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" + integrity sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg= + dependencies: + graceful-fs "^4.1.2" + +karma@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-3.0.0.tgz#6da83461a8a28d8224575c3b5b874e271b4730c3" + integrity sha512-ZTjyuDXVXhXsvJ1E4CnZzbCjSxD6sEdzEsFYogLuZM0yqvg/mgz+O+R1jb0J7uAQeuzdY8kJgx6hSNXLwFuHIQ== + dependencies: + bluebird "^3.3.0" + body-parser "^1.16.1" + chokidar "^2.0.3" + colors "^1.1.0" + combine-lists "^1.0.0" + connect "^3.6.0" + core-js "^2.2.0" + di "^0.0.1" + dom-serialize "^2.2.0" + expand-braces "^0.1.1" + glob "^7.1.1" + graceful-fs "^4.1.2" + http-proxy "^1.13.0" + isbinaryfile "^3.0.0" + lodash "^4.17.4" + log4js "^3.0.0" + mime "^2.3.1" + minimatch "^3.0.2" + optimist "^0.6.1" + qjobs "^1.1.4" + range-parser "^1.2.0" + rimraf "^2.6.0" + safe-buffer "^5.0.1" + socket.io "2.1.1" + source-map "^0.6.1" + tmp "0.0.33" + useragent "2.2.1" + +karma@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" + integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== + dependencies: + bluebird "^3.3.0" + body-parser "^1.16.1" + chokidar "^2.0.3" + colors "^1.1.0" + combine-lists "^1.0.0" + connect "^3.6.0" + core-js "^2.2.0" + di "^0.0.1" + dom-serialize "^2.2.0" + expand-braces "^0.1.1" + flatted "^2.0.0" + glob "^7.1.1" + graceful-fs "^4.1.2" + http-proxy "^1.13.0" + isbinaryfile "^3.0.0" + lodash "^4.17.5" + log4js "^3.0.0" + mime "^2.3.1" + minimatch "^3.0.2" + optimist "^0.6.1" + qjobs "^1.1.4" + range-parser "^1.2.0" + rimraf "^2.6.0" + safe-buffer "^5.0.1" + socket.io "2.1.1" + source-map "^0.6.1" + tmp "0.0.33" + useragent "2.3.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +lie@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= + dependencies: + immediate "~3.0.5" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + +lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.5.0: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log4js@^3.0.0: + version "3.0.6" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" + integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== + dependencies: + circular-json "^0.5.5" + date-format "^1.2.0" + debug "^3.1.0" + rfdc "^1.1.2" + streamroller "0.7.0" + +lru-cache@2.2.x: + version "2.2.4" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d" + integrity sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0= + +lru-cache@4.1.x: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== + +mime-types@~2.1.18: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== + dependencies: + mime-db "~1.37.0" + +mime@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +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== + +nan@^2.9.2: + version "2.12.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" + integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +needle@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== + +npm-packlist@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" + integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +null-check@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" + integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +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= + +object-component@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" + integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +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.1, 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= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +pako@~1.0.2: + version "1.0.8" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" + integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== + +parseqs@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" + integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= + dependencies: + better-assert "~1.0.0" + +parseuri@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" + integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= + dependencies: + better-assert "~1.0.0" + +parseurl@~1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +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= + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= + +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== + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +qjobs@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" + integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== + +qs@6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +range-parser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= + +raw-body@2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" + integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== + dependencies: + bytes "3.0.0" + http-errors "1.6.3" + iconv-lite "0.4.23" + unpipe "1.0.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" + integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +requirejs@2.3.5: + version "2.3.5" + resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" + integrity sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rfdc@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" + integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== + +rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: + 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" + +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== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sauce-connect-launcher@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" + integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== + dependencies: + adm-zip "~0.4.3" + async "^2.1.2" + https-proxy-agent "^2.2.1" + lodash "^4.16.6" + rimraf "^2.5.4" + +saucelabs@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" + integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== + dependencies: + https-proxy-agent "^2.2.1" + +sax@>=0.6.0, sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +selenium-webdriver@^4.0.0-alpha.1: + version "4.0.0-alpha.1" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" + integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + +semver@5.6.0, semver@^5.3.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +socket.io-adapter@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" + integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= + +socket.io-client@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" + integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== + dependencies: + backo2 "1.0.2" + base64-arraybuffer "0.1.5" + component-bind "1.0.0" + component-emitter "1.2.1" + debug "~3.1.0" + engine.io-client "~3.2.0" + has-binary2 "~1.0.2" + has-cors "1.1.0" + indexof "0.0.1" + object-component "0.0.3" + parseqs "0.0.5" + parseuri "0.0.5" + socket.io-parser "~3.2.0" + to-array "0.1.4" + +socket.io-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" + integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== + dependencies: + component-emitter "1.2.1" + debug "~3.1.0" + isarray "2.0.1" + +socket.io@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" + integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== + dependencies: + debug "~3.1.0" + engine.io "~3.2.0" + has-binary2 "~1.0.2" + socket.io-adapter "~1.1.0" + socket.io-client "2.1.1" + socket.io-parser "~3.2.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +statuses@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= + +streamroller@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" + integrity sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ== + dependencies: + date-format "^1.2.0" + debug "^3.1.0" + mkdirp "^0.5.1" + readable-stream "^2.3.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-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= + +tar@^4: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +tmp@0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + dependencies: + os-tmpdir "~1.0.1" + +tmp@0.0.33, tmp@0.0.x: + 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" + +to-array@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" + integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +type-is@~1.6.16: + version "1.6.16" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" + integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.18" + +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +useragent@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.2.1.tgz#cf593ef4f2d175875e8bb658ea92e18a4fd06d8e" + integrity sha1-z1k+9PLRdYdei7ZY6pLhik/QbY4= + dependencies: + lru-cache "2.2.x" + tmp "0.0.x" + +useragent@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" + integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== + dependencies: + lru-cache "4.1.x" + tmp "0.0.x" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +void-elements@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" + integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= + +which@^1.2.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +ws@~3.3.1: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +xml2js@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= + +xmlhttprequest-ssl@~1.5.4: + version "1.5.5" + resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" + integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yeast@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" + integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= diff --git a/internal/e2e/npm_packages/karma_stack_trace/yarn.lock b/internal/e2e/npm_packages/karma_stack_trace/yarn.lock index 24ba869e..7436e473 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/yarn.lock +++ b/internal/e2e/npm_packages/karma_stack_trace/yarn.lock @@ -2,8 +2,8 @@ # yarn lockfile v1 -"@bazel/karma@file:../build_bazel_rules_typescript/bazel-bin/internal/karma/npm_package": - version "0.22.1-10-g1bac7de" +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/build_bazel_rules_karma/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.0.0" dependencies: jasmine-core "2.8.0" karma "^4.0.0" @@ -17,9 +17,10 @@ semver "5.6.0" tmp "0.0.33" -"@bazel/typescript@file:../build_bazel_rules_typescript/bazel-bin/internal/npm_package": - version "0.22.1-10-g63696af" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" dependencies: + jasmine-core "2.8.0" protobufjs "5.0.3" semver "5.6.0" source-map-support "0.5.9" diff --git a/internal/e2e/npm_packages/karma_typescript/yarn.lock b/internal/e2e/npm_packages/karma_typescript/yarn.lock index 44341146..d6c33442 100644 --- a/internal/e2e/npm_packages/karma_typescript/yarn.lock +++ b/internal/e2e/npm_packages/karma_typescript/yarn.lock @@ -2,8 +2,8 @@ # yarn lockfile v1 -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/karma/npm_package": - version "0.22.1-19-gecef600" +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/build_bazel_rules_karma/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.0.0" dependencies: jasmine-core "2.8.0" karma "^4.0.0" @@ -17,9 +17,10 @@ semver "5.6.0" tmp "0.0.33" -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/2c1df01758b58adaef1f5cb29a065852/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/internal/npm_package": - version "0.22.1-18-g169a278" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" dependencies: + jasmine-core "2.8.0" protobufjs "5.0.3" semver "5.6.0" source-map-support "0.5.9" diff --git a/internal/e2e/npm_packages/ts_auto_deps/package-template.json b/internal/e2e/npm_packages/ts_auto_deps/package-template.json index 848840ee..44bcfa3b 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/package-template.json +++ b/internal/e2e/npm_packages/ts_auto_deps/package-template.json @@ -4,6 +4,6 @@ "typescript": "2.9.2" }, "scripts": { - "test": "cd simple; ts_auto_deps && bazel build simple" + "test": "cd simple && ts_auto_deps && bazel build simple" } } diff --git a/internal/e2e/npm_packages/ts_auto_deps/yarn.lock b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock index 6f96f90a..cff6e8d9 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/yarn.lock +++ b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock @@ -2,13 +2,14 @@ # yarn lockfile v1 -"@bazel/typescript@file:../local_typescript/bazel-bin/npm_package": - version "0.17.0-20-g8657b80" +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" dependencies: - protobufjs "5.0.0" + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" - tsickle "0.28.0" - tsutils "2.20.0" + tsutils "2.27.2" ansi-regex@^2.0.0: version "2.1.1" @@ -70,13 +71,20 @@ decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -glob@^5.0.10: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.5: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: + fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "2 || 3" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" @@ -101,6 +109,11 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +jasmine-core@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" @@ -111,26 +124,13 @@ long@~3: version "3.2.0" resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" -"minimatch@2 || 3": +minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -155,16 +155,22 @@ 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" -protobufjs@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1" +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== dependencies: ascli "~1" bytebuffer "~5" - glob "^5.0.10" + glob "^7.0.5" yargs "^3.10.0" -source-map-support@0.5.9, source-map-support@^0.5.0: +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" dependencies: @@ -189,22 +195,14 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tslib@^1.8.1: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" -tsutils@2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3" +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== dependencies: tslib "^1.8.1" diff --git a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel similarity index 55% rename from internal/e2e/npm_packages/typescript_2.7/BUILD.bazel rename to internal/e2e/npm_packages/ts_devserver/BUILD.bazel index db3403d9..0b4ec011 100644 --- a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel +++ b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel @@ -12,30 +12,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver", "ts_library") ts_library( - name = "main", - srcs = ["main.ts"], + name = "app", + srcs = ["app.ts"], +) + +ts_devserver( + name = "devserver", + port = 8080, + # This is the path we'll request from the browser, see index.html + serving_path = "/bundle.min.js", + # The devserver can serve our static files too + static_files = ["index.html"], + # We'll collect all the devmode JS sources from these TypeScript libraries + deps = [":app"], ) ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), + name = "e2e", + testonly = 1, + srcs = ["app_e2e_test.ts"], deps = [ - ":main", - "@npm//@bazel/typescript", "@npm//@types/jasmine", "@npm//@types/node", - ], -) - -jasmine_node_test( - name = "test", - deps = [ - ":test_lib", - "@npm//jasmine", + "@npm//protractor", ], ) diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE similarity index 96% rename from internal/e2e/npm_packages/typescript_2.7/WORKSPACE rename to internal/e2e/npm_packages/ts_devserver/WORKSPACE index 8a542580..586927ac 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/ts_devserver/WORKSPACE @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "npm_packages_typescript_27_e2e") +workspace(name = "npm_packages_ts_devserver") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") diff --git a/internal/e2e/npm_packages/ts_devserver/app.ts b/internal/e2e/npm_packages/ts_devserver/app.ts new file mode 100644 index 00000000..6c1c6e9d --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/app.ts @@ -0,0 +1,4 @@ +const el: HTMLDivElement = document.createElement('div'); +el.innerText = 'Hello, TypeScript'; +el.className = 'ts1'; +document.body.appendChild(el); diff --git a/internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts b/internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts new file mode 100644 index 00000000..1ce56fbc --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts @@ -0,0 +1,25 @@ +import {browser, by, element, ExpectedConditions} from 'protractor'; + +// This test uses Protractor without Angular, so disable Angular features +browser.waitForAngularEnabled(false); + +// Since we don't have a protractor bazel rule yet, the test is brought up in +// parallel with building the service under test. So the timeout must include +// compiling the application as well as starting the server. +const timeoutMs = 90 * 1000; + +describe('app', () => { + beforeAll(() => { + browser.get(''); + // Don't run any specs until we see a
on the page. + browser.wait( + ExpectedConditions.presenceOf(element(by.css('div.ts1'))), + timeoutMs); + }, timeoutMs); + + it('should display: Hello, TypeScript', (done) => { + const div = element(by.css('div.ts1')); + div.getText().then(t => expect(t).toEqual(`Hello, TypeScript`)); + done(); + }); +}); diff --git a/internal/e2e/npm_packages/ts_devserver/index.html b/internal/e2e/npm_packages/ts_devserver/index.html new file mode 100644 index 00000000..8af1e7f6 --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/index.html @@ -0,0 +1,21 @@ + + + + + + ts_devserver example + + + + + + diff --git a/internal/e2e/npm_packages/ts_devserver/package-template.json b/internal/e2e/npm_packages/ts_devserver/package-template.json new file mode 100644 index 00000000..7001bfac --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/package-template.json @@ -0,0 +1,15 @@ +{ + "dependencies": { + "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", + "@types/jasmine": "2.8.2", + "@types/node": "7.0.18", + "concurrently": "^3.5.1", + "jasmine": "2.8.0", + "protractor": "^5.2.0", + "typescript": "2.7.x" + }, + "scripts": { + "pretest": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG", + "test": "bazel build ... && concurrently \"bazel run //:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor\" --kill-others --success first" + } +} diff --git a/internal/e2e/npm_packages/ts_devserver/protractor.conf.js b/internal/e2e/npm_packages/ts_devserver/protractor.conf.js new file mode 100644 index 00000000..9691a646 --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/protractor.conf.js @@ -0,0 +1,12 @@ +exports.config = { + specs: [ + 'bazel-bin/*_e2e_test.js', + ], + capabilities: { + browserName: 'chrome', + chromeOptions: {args: ['--no-sandbox']} + }, + directConnect: true, + baseUrl: 'http://localhost:8080/', + framework: 'jasmine', +}; diff --git a/internal/e2e/npm_packages/typescript_2.7/tsconfig.json b/internal/e2e/npm_packages/ts_devserver/tsconfig.json similarity index 100% rename from internal/e2e/npm_packages/typescript_2.7/tsconfig.json rename to internal/e2e/npm_packages/ts_devserver/tsconfig.json diff --git a/internal/e2e/npm_packages/ts_devserver/yarn.lock b/internal/e2e/npm_packages/ts_devserver/yarn.lock new file mode 100644 index 00000000..0f87dee2 --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/yarn.lock @@ -0,0 +1,1261 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" + dependencies: + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +"@types/q@^0.0.32": + version "0.0.32" + resolved "https://registry.yarnpkg.com/@types/q/-/q-0.0.32.tgz#bd284e57c84f1325da702babfc82a5328190c0c5" + integrity sha1-vShOV8hPEyXacCur/IKlMoGQwMU= + +"@types/selenium-webdriver@^3.0.0": + version "3.0.14" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz#0b20a2370e6b1b8322c9c3dfcaa409e6c7c0c0a9" + integrity sha512-4GbNCDs98uHCT/OMv40qQC/OpoPbYn9XdXeTiFwHBBFO6eJhYEPUu2zDKirXSbHlvDV8oZ9l8EQ+HrEx/YS9DQ== + +adm-zip@^0.4.9: + version "0.4.13" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" + integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== + +agent-base@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== + dependencies: + es6-promisify "^5.0.0" + +ajv@^6.5.5: + version "6.7.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.7.0.tgz#e3ce7bb372d6577bb1839f1dfdfcbf5ad2948d96" + integrity sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg== + 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-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +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" + +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= + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +blocking-proxy@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/blocking-proxy/-/blocking-proxy-1.0.1.tgz#81d6fd1fe13a4c0d6957df7f91b75e98dac40cb2" + integrity sha512-KE8NFMZr3mN2E0HcvCgRtX7DjhiIQrwle+nSVJVC/yqFb9+xznHl2ZcoBp2L9qzkI4t4cBFJ1efXF8Dwi132RA== + dependencies: + minimist "^1.2.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +browserstack@^1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/browserstack/-/browserstack-1.5.2.tgz#17d8bb76127a1cc0ea416424df80d218f803673f" + integrity sha512-+6AFt9HzhKykcPF79W6yjEUJcdvZOV0lIXdkORXMJftGrDl0OKWqRF4GHqpDNkxiceDT/uB7Fb/aDwktvXX7dg== + dependencies: + https-proxy-agent "^2.2.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + 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@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +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" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" + integrity sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concurrently@^3.5.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.6.1.tgz#2f95baec5c4051294dfbb55b57a3b98a3e2b45ec" + integrity sha512-/+ugz+gwFSEfTGUxn0KHkY+19XPRTXR8+7oUK/HxgiN1n7FjeJmkrbSiXAJfyQ0zORgJYPaenmymwon51YXH9Q== + dependencies: + chalk "^2.4.1" + commander "2.6.0" + date-fns "^1.23.0" + lodash "^4.5.1" + read-pkg "^3.0.0" + rx "2.3.24" + spawn-command "^0.0.2-1" + supports-color "^3.2.3" + tree-kill "^1.1.0" + +core-js@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" + integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +date-fns@^1.23.0: + version "1.30.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" + integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +del@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es6-promise@^4.0.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== + +es6-promise@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" + integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escape-string-regexp@^1.0.2, 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= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +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== + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "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-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= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + 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" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +hosted-git-info@^2.1.4: + version "2.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" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +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-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= + dependencies: + builtin-modules "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= + +is-path-in-cwd@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= + dependencies: + path-is-inside "^1.0.1" + +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= + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +jasmine-core@2.8.0, jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +jasminewd2@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-2.2.0.tgz#e37cf0b17f199cce23bea71b2039395246b4ec4e" + integrity sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4= + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +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" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +jszip@^3.1.3: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" + integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== + dependencies: + core-js "~2.3.0" + es6-promise "~3.0.2" + lie "~3.1.0" + pako "~1.0.2" + readable-stream "~2.0.6" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +lie@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= + dependencies: + immediate "~3.0.5" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +lodash@^4.5.1: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== + dependencies: + mime-db "~1.37.0" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +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== + +normalize-package-data@^2.3.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.2.tgz#6b2abd85774e51f7936f1395e45acb905dc849b2" + integrity sha512-YcMnjqeoUckXTPKZSAsPjUPLxH85XotbpqK3w4RyCwdFQSU5FxxBys8buehkSfg0j9fKvV1hn7O0+8reEgkAiw== + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optimist@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + +os-tmpdir@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +pako@~1.0.2: + version "1.0.8" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" + integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +path-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.1: + 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-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.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= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + 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= + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +protractor@^5.2.0: + version "5.4.2" + resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.4.2.tgz#329efe37f48b2141ab9467799be2d4d12eb48c13" + integrity sha512-zlIj64Cr6IOWP7RwxVeD8O4UskLYPoyIcg0HboWJL9T79F1F0VWtKkGTr/9GN6BKL+/Q/GmM7C9kFVCfDbP5sA== + dependencies: + "@types/q" "^0.0.32" + "@types/selenium-webdriver" "^3.0.0" + blocking-proxy "^1.0.0" + browserstack "^1.5.1" + chalk "^1.1.3" + glob "^7.0.3" + jasmine "2.8.0" + jasminewd2 "^2.1.0" + optimist "~0.6.0" + q "1.4.1" + saucelabs "^1.5.0" + selenium-webdriver "3.6.0" + source-map-support "~0.4.0" + webdriver-js-extender "2.1.0" + webdriver-manager "^12.0.6" + +psl@^1.1.24: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +q@1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" + integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4= + +q@^1.4.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + +qs@~6.5.2: + version "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@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4: + 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" + +rx@2.3.24: + version "2.3.24" + resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" + integrity sha1-FPlQpCF9fjXapxu8vljv9o6ksrc= + +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + 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: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +saucelabs@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" + integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== + dependencies: + https-proxy-agent "^2.2.1" + +sax@>=0.6.0: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: + version "3.6.0" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz#2ba87a1662c020b8988c981ae62cb2a01298eafc" + integrity sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q== + dependencies: + jszip "^3.1.3" + rimraf "^2.5.4" + tmp "0.0.30" + xml2js "^0.4.17" + +"semver@2 || 3 || 4 || 5", semver@5.6.0, semver@^5.3.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@~0.4.0: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spawn-command@^0.0.2-1: + version "0.0.2-1" + resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= + +spdx-correct@^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== + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +tmp@0.0.30: + version "0.0.30" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" + integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= + dependencies: + os-tmpdir "~1.0.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tree-kill@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.1.tgz#5398f374e2f292b9dcc7b2e71e30a5c3bb6c743a" + integrity sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q== + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + 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" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +typescript@2.7.x: + version "2.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" + integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +uuid@^3.3.2: + version "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" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +webdriver-js-extender@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz#57d7a93c00db4cc8d556e4d3db4b5db0a80c3bb7" + integrity sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ== + dependencies: + "@types/selenium-webdriver" "^3.0.0" + selenium-webdriver "^3.0.1" + +webdriver-manager@^12.0.6: + version "12.1.1" + resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.1.tgz#66c3271f69cefdaa9fdfca617ae95afae41c3c62" + integrity sha512-L9TEQmZs6JbMMRQI1w60mfps265/NCr0toYJl7p/R2OAk6oXAfwI6jqYP7EWae+d7Ad2S2Aj4+rzxoSjqk3ZuA== + dependencies: + adm-zip "^0.4.9" + chalk "^1.1.1" + del "^2.2.0" + glob "^7.0.3" + ini "^1.3.4" + minimist "^1.2.0" + q "^1.4.1" + request "^2.87.0" + rimraf "^2.5.2" + semver "^5.3.0" + xml2js "^0.4.17" + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xml2js@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" + integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== + dependencies: + sax ">=0.6.0" + xmlbuilder "~9.0.1" + +xmlbuilder@~9.0.1: + version "9.0.7" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" + integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.7/yarn.lock b/internal/e2e/npm_packages/typescript_2.7/yarn.lock index 4a580188..00b356bc 100644 --- a/internal/e2e/npm_packages/typescript_2.7/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.7/yarn.lock @@ -1,2 +1,300 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" + dependencies: + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@2.8.0, jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.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= + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +typescript@2.7.x: + version "2.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" + integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.8/yarn.lock b/internal/e2e/npm_packages/typescript_2.8/yarn.lock index 4a580188..0f79fc4c 100644 --- a/internal/e2e/npm_packages/typescript_2.8/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.8/yarn.lock @@ -1,2 +1,300 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" + dependencies: + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@2.8.0, jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.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= + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +typescript@2.8.x: + version "2.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.4.tgz#0b1db68e6bdfb0b767fa2ab642136a35b059b199" + integrity sha512-IIU5cN1mR5J3z9jjdESJbnxikTrEz3lzAw/D0Tf45jHpBp55nY31UkUvmVHoffCfKHTqJs3fCLPDxknQTTFegQ== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.9/yarn.lock b/internal/e2e/npm_packages/typescript_2.9/yarn.lock index 4a580188..36885d19 100644 --- a/internal/e2e/npm_packages/typescript_2.9/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.9/yarn.lock @@ -1,2 +1,300 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" + dependencies: + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@2.8.0, jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.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= + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +typescript@2.9.x: + version "2.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" + integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_3.0/yarn.lock b/internal/e2e/npm_packages/typescript_3.0/yarn.lock index 4a580188..88ed70c0 100644 --- a/internal/e2e/npm_packages/typescript_3.0/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.0/yarn.lock @@ -1,2 +1,300 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" + dependencies: + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@2.8.0, jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.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= + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +typescript@3.0.x: + version "3.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.3.tgz#4853b3e275ecdaa27f78fda46dc273a7eb7fc1c8" + integrity sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_3.1/yarn.lock b/internal/e2e/npm_packages/typescript_3.1/yarn.lock index 4a580188..2b156164 100644 --- a/internal/e2e/npm_packages/typescript_3.1/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.1/yarn.lock @@ -1,2 +1,300 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": + version "0.22.1-41-gc1f5737" + dependencies: + jasmine-core "2.8.0" + protobufjs "5.0.3" + semver "5.6.0" + source-map-support "0.5.9" + tsutils "2.27.2" + +"@types/jasmine@2.8.2": + version "2.8.2" + resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" + integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== + +"@types/node@7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= + dependencies: + long "~3" + +camelcase@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= + +cliui@^3.0.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.5, glob@^7.0.6: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +jasmine-core@2.8.0, jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.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= + +protobufjs@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +semver@5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +tslib@^1.8.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@2.27.2: + version "2.27.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" + integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== + dependencies: + tslib "^1.8.1" + +typescript@3.1.x: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== + +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" From c6ddef3c3a4e7eb802ef8f04af4b15c5aa2b8c9f Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 4 Feb 2019 12:57:34 -0800 Subject: [PATCH 074/316] Cleanups of rules_typescript: - fix lint/formatting of .bzl files as observed by CircleCI - restore some files which were dropped in the move to e2e/npm_packages PiperOrigin-RevId: 232350070 --- BUILD.bazel | 2 +- internal/common/compilation.bzl | 1 - internal/common/module_mappings.bzl | 1 - .../npm_packages/typescript_2.7/BUILD.bazel | 41 ++++++++++++++++++ .../e2e/npm_packages/typescript_2.7/WORKSPACE | 42 +++++++++++++++++++ .../npm_packages/typescript_2.7/tsconfig.json | 0 internal/karma/BUILD.bazel | 2 +- 7 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 internal/e2e/npm_packages/typescript_2.7/BUILD.bazel create mode 100644 internal/e2e/npm_packages/typescript_2.7/WORKSPACE create mode 100644 internal/e2e/npm_packages/typescript_2.7/tsconfig.json diff --git a/BUILD.bazel b/BUILD.bazel index df7e9b75..7594bf81 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -80,11 +80,11 @@ npm_package( "//ts_auto_deps:npm_package_assets", ], replacements = { + "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", # Do a simple replacement needed to make the local development differ # from how our release is used. "//devserver:devserver_bin": "//devserver", "0.0.0-COMPAT_VERSION": COMPAT_VERSION, - "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", }, deps = [ "//devserver:devserver-darwin", diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 99b043ac..44483cbf 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -18,7 +18,6 @@ load(":common/json_marshal.bzl", "json_marshal") load(":common/module_mappings.bzl", "module_mappings_aspect") - _DEBUG = False DEPS_ASPECTS = [ diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index d085d726..a28b3279 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -33,7 +33,6 @@ def _get_deps(attrs, names): # Traverse 'srcs' in addition so that we can go across a genrule _MODULE_MAPPINGS_DEPS_NAMES = ["deps", "srcs", "_helpers"] - _DEBUG = False def debug(msg, values = ()): diff --git a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel new file mode 100644 index 00000000..db3403d9 --- /dev/null +++ b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel @@ -0,0 +1,41 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") + +ts_library( + name = "main", + srcs = ["main.ts"], +) + +ts_library( + name = "test_lib", + testonly = True, + srcs = glob(["*.spec.ts"]), + deps = [ + ":main", + "@npm//@bazel/typescript", + "@npm//@types/jasmine", + "@npm//@types/node", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "@npm//jasmine", + ], +) diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE new file mode 100644 index 00000000..ec663136 --- /dev/null +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -0,0 +1,42 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +workspace(name = "package_typescript_27_e2e") + +local_repository( + name = "build_bazel_rules_typescript", + path = "../../..", +) + +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + +rules_typescript_dependencies() + +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") + +rules_nodejs_dependencies() + +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") + +node_repositories(preserve_symlinks = True) + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") + +ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.7/tsconfig.json b/internal/e2e/npm_packages/typescript_2.7/tsconfig.json new file mode 100644 index 00000000..e69de29b diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 815b6da6..7fcc0b85 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -81,8 +81,8 @@ npm_package( "web_test.bzl", ], replacements = { - "0.0.0-COMPAT_VERSION": COMPAT_VERSION, "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", + "0.0.0-COMPAT_VERSION": COMPAT_VERSION, }, deps = [ ":bazel_karma", From 5a4061888e31f95b453aa9edd30cbd3547fefe03 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 4 Feb 2019 13:10:26 -0800 Subject: [PATCH 075/316] Update release bits --- DEVELOPING.md | 4 +--- README.md | 4 ++-- internal/BUILD.bazel | 2 +- internal/karma/.bazelrc | 1 + on-version.js | 14 ++++++++++---- package.json | 11 ++++++----- 6 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 internal/karma/.bazelrc diff --git a/DEVELOPING.md b/DEVELOPING.md index 426443f1..8428d019 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -62,10 +62,8 @@ rule is that minors are breaking changes and patches are new features). 1. `git commit -a -m 'Update docs for release'` 1. `npm config set tag-version-prefix ''` 1. `npm version minor -m 'rel: %s'` (replace `minor` with `patch` if no breaking changes) -1. Build npm packages and publish them: `bazel run //internal:npm_package.publish && bazel run //internal/karma:npm_package.publish` -1. `bazel build :release` +1. Build npm packages and publish them: `TMP=$(mktemp -d -t bazel-release.XXXXXXX); bazel --output_base=$TMP run //:npm_package.publish && cd internal/karma && bazel --output_base=$TMP run //:npm_package.publish` 1. `git push && git push --tags` -1. (Manual for now) go to the [releases] page, edit the new release, and attach the `bazel-bin/release.tgz` file 1. (Temporary): submit a google3 CL to update the versions in package.bzl and package.json [releases]: https://github.com/bazelbuild/rules_typescript/releases diff --git a/README.md b/README.md index df68fecd..46f86f38 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.0", - "@bazel/karma": "0.23.0", + "@bazel/typescript": "0.22.1", + "@bazel/karma": "0.22.1", ... }, ... diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 73041a93..555e2fdd 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -129,7 +129,6 @@ genrule( filegroup( name = "npm_package_assets", srcs = [ - ":generated_BUILD", "build_defs.bzl", "common/compilation.bzl", "common/json_marshal.bzl", @@ -140,6 +139,7 @@ filegroup( "ts_repositories.bzl", "tsc_wrapped/package.json", "tsc_wrapped/yarn.lock", + ":generated_BUILD", "//internal/devserver:npm_package_assets", "//internal/protobufjs:npm_package_assets", ], diff --git a/internal/karma/.bazelrc b/internal/karma/.bazelrc new file mode 100644 index 00000000..ad69514f --- /dev/null +++ b/internal/karma/.bazelrc @@ -0,0 +1 @@ +build --workspace_status_command=../../tools/bazel_stamp_vars.sh diff --git a/on-version.js b/on-version.js index 61c881b2..18dee817 100644 --- a/on-version.js +++ b/on-version.js @@ -27,7 +27,13 @@ // in package.bzl to match that of package.json. const shell = require('shelljs'); const version = require('./package.json').version; -shell.sed('-i', 'VERSION \= \"[0-9\.]*\"', `VERSION = "${version}"`, 'package.bzl') -shell.sed('-i', '\"@bazel/typescript\": \"[0-9\.]*\"', `"@bazel/typescript": "${version}"`, 'README.md') -shell.sed('-i', 'https://github.com/bazelbuild/rules_typescript/archive/[0-9\.]*\.zip', `https://github.com/bazelbuild/rules_typescript/archive/${version}.zip`, 'README.md') -shell.sed('-i', 'strip_prefix \= \"rules_typescript-[0-9\.]*\"', `strip_prefix = "rules_typescript-${version}"`, 'README.md') +shell.sed('-i', '\"@bazel/typescript\": \"[0-9\.]*\"', `"@bazel/typescript": "${version}"`, 'README.md'); +shell.sed('-i', '\"@bazel/karma\": \"[0-9\.]*\"', `"@bazel/karma": "${version}"`, 'README.md'); +shell.sed('-i', 'VERSION \= \"[0-9\.]*\"', `VERSION = "${version}"`, 'version.bzl'); +shell.sed('-i', 'check_rules_typescript_version\\\(version_string \= \"[0-9\.]*\"', `check_rules_typescript_version(version_string = "${version}"`, 'WORKSPACE'); + +// Following instructions in version.bzl, we should update the minimal compatibility version whenever +// we have new features or breaking changes. So we assume that a patch number of 0 implies this. +if (version.endsWith('.0')) { + shell.sed('-i', 'COMPAT_VERSION \= \"[0-9\.]*\"', `COMPAT_VERSION = "${version}"`, 'version.bzl') +} diff --git a/package.json b/package.json index a2ec9177..52710e99 100644 --- a/package.json +++ b/package.json @@ -3,15 +3,15 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.0.0-PLACEHOLDER", + "version": "0.22.1", "keywords": [ - "typescript", - "bazel" + "typescript", + "bazel" ], "main": "./internal/tsc_wrapped/index.js", "typings": "./internal/tsc_wrapped/index.d.ts", "bin": { - "ts_auto_deps": "./ts_auto_deps/ts_auto_deps.js" + "ts_auto_deps": "./ts_auto_deps/ts_auto_deps.js" }, "dependencies": { "protobufjs": "5.0.3", @@ -69,6 +69,7 @@ "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", - "bazel:lint-fix": "yarn bazel:format --lint=fix" + "bazel:lint-fix": "yarn bazel:format --lint=fix", + "version": "node ./on-version.js && git stage README.md" } } From 6b0cb66a0c0014d6000c2b956fb1ec88d19ac530 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 4 Feb 2019 13:52:04 -0800 Subject: [PATCH 076/316] rel 0.23.0 --- README.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 46f86f38..df68fecd 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.22.1", - "@bazel/karma": "0.22.1", + "@bazel/typescript": "0.23.0", + "@bazel/karma": "0.23.0", ... }, ... diff --git a/package.json b/package.json index 52710e99..9303c95f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.22.1", + "version": "0.23.0", "keywords": [ "typescript", "bazel" From 6894692da5e9b4277a398451e182f6dd8738dc54 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 4 Feb 2019 14:50:45 -0800 Subject: [PATCH 077/316] Fixes for 0.23 release - files that weren't staged after on-version.js - karma version from upstream (for local dev) - missing internal/BUILD file in the npm package Also Deprecate rules_typescript_dependencies it contains only rules_nodejs which users will have to install first anyway Closes #403 PiperOrigin-RevId: 232371626 --- BUILD.bazel | 1 + README.md | 4 - WORKSPACE | 2 +- internal/BUILD.bazel | 1 - .../npm_packages/karma_stack_trace/WORKSPACE | 4 - .../npm_packages/karma_typescript/WORKSPACE | 4 - .../e2e/npm_packages/ts_auto_deps/WORKSPACE | 4 - .../e2e/npm_packages/ts_devserver/WORKSPACE | 4 - .../e2e/npm_packages/typescript_2.7/WORKSPACE | 25 +- .../e2e/npm_packages/typescript_2.8/WORKSPACE | 4 - .../e2e/npm_packages/typescript_2.9/WORKSPACE | 4 - .../e2e/npm_packages/typescript_3.0/WORKSPACE | 4 - .../e2e/npm_packages/typescript_3.1/WORKSPACE | 4 - package.bzl | 25 +- package.json | 4 +- version.bzl | 4 +- yarn.lock | 1260 ++--------------- 17 files changed, 181 insertions(+), 1177 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 7594bf81..09ee44b3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -90,6 +90,7 @@ npm_package( "//devserver:devserver-darwin", "//devserver:devserver-linux", "//devserver:devserver-windows", + "//internal:generated_BUILD", "//internal:tsc_wrapped", "//ts_auto_deps:ts_auto_deps-darwin", "//ts_auto_deps:ts_auto_deps-linux", diff --git a/README.md b/README.md index df68fecd..e334a93b 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,6 @@ yarn_install( load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -# Fetch transitive Bazel dependencies of build_bazel_rules_typescript -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") -rules_typescript_dependencies() - # Fetch transitive Bazel dependencies of build_bazel_rules_karma # ONLY REQUIRED if you are using the @bazel/karma npm package load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") diff --git a/WORKSPACE b/WORKSPACE index 2c90799d..2b644566 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.22.0") +check_rules_typescript_version(version_string = "0.23.0") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 555e2fdd..5132aa88 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -139,7 +139,6 @@ filegroup( "ts_repositories.bzl", "tsc_wrapped/package.json", "tsc_wrapped/yarn.lock", - ":generated_BUILD", "//internal/devserver:npm_package_assets", "//internal/protobufjs:npm_package_assets", ], diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index cc1d388d..03bfe1ea 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index c10ae4af..83983637 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE index 4635bbd1..a4662d5b 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE +++ b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/ts_devserver/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE index 586927ac..dc13223b 100644 --- a/internal/e2e/npm_packages/ts_devserver/WORKSPACE +++ b/internal/e2e/npm_packages/ts_devserver/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE index ec663136..d3abdb37 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -12,24 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "package_typescript_27_e2e") +workspace(name = "npm_packages_typescript_27_e2e") -local_repository( - name = "build_bazel_rules_typescript", - path = "../../..", -) - -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - -load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -rules_nodejs_dependencies() +http_archive( + name = "build_bazel_rules_nodejs", + strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], +) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories(preserve_symlinks = True) +node_repositories() yarn_install( name = "npm", @@ -37,6 +32,10 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") + +install_bazel_dependencies() + load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE index 4aa41ec7..54038640 100644 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE index ce12fa90..2ce03cdb 100644 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE index 8e0d2f14..1fb00c1d 100644 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE index 8e0d2f14..1fb00c1d 100644 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -36,10 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") - -rules_typescript_dependencies() - load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/package.bzl b/package.bzl index 69ae928c..ab74c671 100644 --- a/package.bzl +++ b/package.bzl @@ -18,14 +18,21 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def rules_typescript_dependencies(): + print("""DEPRECATION WARNING: + rules_typescript_dependencies is no longer needed, and will be removed in a future release. + We assume you will fetch rules_nodejs in your WORKSPACE file, and no other dependencies remain here. + Simply remove any calls to this function and the corresponding call to + load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + """) + +def rules_typescript_dev_dependencies(): """ - Fetch our transitive dependencies. + Fetch dependencies needed for local development. - If the user wants to get a different version of these, they can just fetch it - from their WORKSPACE before calling this function, or not call this function at all. + These are in this file to keep version information in one place, and make the WORKSPACE + shorter. """ - # TypeScript compiler runs on node.js runtime _maybe( http_archive, name = "build_bazel_rules_nodejs", @@ -33,16 +40,6 @@ def rules_typescript_dependencies(): urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], ) -def rules_typescript_dev_dependencies(): - """ - Fetch dependencies needed for local development, but not needed by users. - - These are in this file to keep version information in one place, and make the WORKSPACE - shorter. - """ - - rules_typescript_dependencies() - # For running skylint _maybe( http_archive, diff --git a/package.json b/package.json index 9303c95f..15f4a391 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "clang-format": "1.0.49", "concurrently": "^3.5.1", "http-server": "^0.11.1", - "karma": "alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a", + "karma": "^4.0.0", "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.1.0", "karma-jasmine": "1.1.1", @@ -70,6 +70,6 @@ "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", "bazel:lint-fix": "yarn bazel:format --lint=fix", - "version": "node ./on-version.js && git stage README.md" + "version": "node ./on-version.js && git stage README.md version.bzl WORKSPACE" } } diff --git a/version.bzl b/version.bzl index 38d61191..ec462f96 100644 --- a/version.bzl +++ b/version.bzl @@ -17,12 +17,12 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.22.1" +VERSION = "0.23.0" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for # releases with breaking changes and/or new features. -COMPAT_VERSION = "0.22.0" +COMPAT_VERSION = "0.23.0" def check_rules_typescript_version(version_string): """ diff --git a/yarn.lock b/yarn.lock index 3c74b43f..eb756630 100644 --- a/yarn.lock +++ b/yarn.lock @@ -112,11 +112,6 @@ accepts@~1.3.4: mime-types "~2.1.18" negotiator "0.6.1" -addressparser@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" - integrity sha1-R6++GiqSYhkdtoOOT9HTm0CCF0Y= - adm-zip@0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.4.tgz#a61ed5ae6905c3aea58b3a657d25033091052736" @@ -145,7 +140,7 @@ agent-base@2: extend "~3.0.0" semver "~5.0.1" -agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0, agent-base@~4.2.0: +agent-base@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== @@ -162,27 +157,6 @@ ajv@^5.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -amqplib@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63" - integrity sha512-l9mCs6LbydtHqRniRwYkKdqxVa6XMz3Vw1fh+2gJaaVgTM6Jk3o8RccAKWKtlhT1US5sWrFh+KKxsVUALURSIA== - dependencies: - bitsyntax "~0.0.4" - bluebird "^3.4.6" - buffer-more-ints "0.0.2" - readable-stream "1.x >=1.1.9" - safe-buffer "^5.0.1" - ansi-regex@^0.2.0, ansi-regex@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" @@ -208,13 +182,13 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" + micromatch "^3.1.4" + normalize-path "^2.1.1" aproba@^1.0.3: version "1.2.0" @@ -229,19 +203,12 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= -arr-flatten@^1.0.1, arr-flatten@^1.1.0: +arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== @@ -306,21 +273,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= -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - integrity sha1-104bh+ev/A24qttwIfP+SBAasjQ= - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types@0.x.x: - version "0.11.5" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.5.tgz#9890825d660c03c28339f315e9fa0a360e31ec28" - integrity sha512-oJjo+5e7/vEc2FBK8gUalV0pba4L3VdBIs2EKhOLHLcOd2FgQIVQN9xb0eZ9IjEWyAL7vq6fGJxOvVvdCHNyMw== - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -336,7 +293,7 @@ async@^1.5.2: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@^2.1.2, async@~2.6.0: +async@^2.1.2: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== @@ -353,33 +310,16 @@ atob@^2.1.1: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - integrity sha1-FDQt0428yU0OW4fXY81jYSwOeU8= - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= -aws4@^1.2.1, aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== - aws4@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" integrity sha1-g+9cqGCysy5KDe7e6MdxudtXRx4= -axios@^0.15.3: - version "0.15.3" - resolved "http://registry.npmjs.org/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" - integrity sha1-LJ1jiy4ZGgjqHWzJiOrda6W9wFM= - dependencies: - follow-redirects "1.0.0" - backo2@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" @@ -432,20 +372,6 @@ binary-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== -bitsyntax@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82" - integrity sha1-6xDMb4K4xJDj6FaY8H6D1G4MuoI= - dependencies: - buffer-more-ints "0.0.2" - -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" - integrity sha1-/cqHGplxOqANGeO7ukHER4emU5g= - dependencies: - readable-stream "~2.0.5" - blob@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" @@ -458,7 +384,7 @@ blocking-proxy@0.0.5: dependencies: minimist "^1.2.0" -bluebird@^3.3.0, bluebird@^3.4.6: +bluebird@^3.3.0: version "3.5.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" integrity sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg== @@ -479,13 +405,6 @@ body-parser@^1.16.1: raw-body "2.3.3" type-is "~1.6.16" -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - integrity sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8= - dependencies: - hoek "2.x.x" - boom@4.x.x: version "4.3.1" resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" @@ -515,16 +434,7 @@ braces@^0.1.2: dependencies: expand-range "^0.1.0" -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: +braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -563,24 +473,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -buffer-more-ints@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c" - integrity sha1-JrOIXRD6E9t/wBquOquHAZngEkw= - -buildmail@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" - integrity sha1-h393OLeHKYccmhBeO4N9K+EaenI= - dependencies: - addressparser "1.0.1" - libbase64 "0.1.0" - libmime "3.0.0" - libqp "1.1.0" - nodemailer-fetch "1.6.0" - nodemailer-shared "1.1.0" - punycode "1.4.1" - bytebuffer@~5: version "5.0.1" resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" @@ -618,11 +510,6 @@ camelcase@^2.0.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - integrity sha1-cVuW6phBWTzDMGeSP17GDr2k99c= - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -650,31 +537,35 @@ chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.4.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= +chokidar@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== dependencies: - anymatch "^1.3.0" + anymatch "^2.0.0" async-each "^1.0.0" - glob-parent "^2.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" inherits "^2.0.1" is-binary-path "^1.0.0" - is-glob "^2.0.0" + is-glob "^4.0.0" + lodash.debounce "^4.0.8" + normalize-path "^2.1.1" path-is-absolute "^1.0.0" readdirp "^2.0.0" + upath "^1.0.5" optionalDependencies: - fsevents "^1.0.0" + fsevents "^1.2.2" chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== -circular-json@^0.5.4: - version "0.5.5" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.5.tgz#64182ef359042d37cd8e767fc9de878b1e9447d3" - integrity sha512-13YaR6kiz0kBNmIVM87Io8Hp7bWOo4r61vkEANy8iH9R9bc6avud/1FT0SBpqR1RpIQADOh/Q+yHZDA1iL6ysA== +circular-json@^0.5.5: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== clang-format@1.0.49: version "1.0.49" @@ -744,13 +635,6 @@ combine-lists@^1.0.0: dependencies: lodash "^4.5.0" -combined-stream@1.0.6: - version "1.0.6" - resolved "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - integrity sha1-cj599ugBrFYTETp+RFqbactjKBg= - dependencies: - delayed-stream "~1.0.0" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -758,23 +642,11 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== - dependencies: - delayed-stream "~1.0.0" - commander@2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" integrity sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0= -commander@^2.9.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" - integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== - component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -859,13 +731,6 @@ corser@~2.0.0: resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87" integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c= -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - integrity sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g= - dependencies: - boom "2.x.x" - cryptiles@3.x.x: version "3.1.2" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" @@ -885,11 +750,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" - integrity sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ== - date-fns@^1.23.0: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" @@ -900,14 +760,14 @@ date-format@^1.2.0: resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= -debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@~2.6.4, debug@~2.6.6: +debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@3.1.0, debug@^3.1.0, debug@~3.1.0: +debug@^3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== @@ -929,11 +789,6 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -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= - define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -956,15 +811,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -degenerator@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" - integrity sha1-/PSQo37OJmRk2cxDGrmMWBnO0JU= - dependencies: - ast-types "0.x.x" - escodegen "1.x.x" - esprima "3.x.x" - del@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -1013,11 +859,6 @@ dom-serialize@^2.2.0: extend "^3.0.0" void-elements "^2.0.0" -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - integrity sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw= - ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" @@ -1045,10 +886,10 @@ encodeurl@~1.0.1: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -engine.io-client@~3.1.0: - version "3.1.6" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.6.tgz#5bdeb130f8b94a50ac5cbeb72583e7a4a063ddfd" - integrity sha512-hnuHsFluXnsKOndS4Hv6SvUrgdYx1pk2NqfaDMW+GWdgfU3+/V25Cj7I8a0x92idSpa5PIhJRKxPvp9mnoLsfg== +engine.io-client@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" + integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== dependencies: component-emitter "1.2.1" component-inherit "0.0.3" @@ -1073,10 +914,10 @@ engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: blob "0.0.4" has-binary2 "~1.0.2" -engine.io@~3.1.0: - version "3.1.5" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845" - integrity sha512-D06ivJkYxyRrcEe0bTpNnBQNgP9d3xog+qZlLbui8EsMr/DouQpf5o9FzJnWYHEYE0YsFHllUv2R1dkgYZXHcA== +engine.io@~3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" + integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== dependencies: accepts "~1.3.4" base64id "1.0.0" @@ -1084,8 +925,6 @@ engine.io@~3.1.0: debug "~3.1.0" engine.io-parser "~2.1.0" ws "~3.3.1" - optionalDependencies: - uws "~9.14.0" ent@~2.2.0: version "2.2.0" @@ -1119,33 +958,6 @@ escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@1.x.x: - version "1.11.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" - integrity sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -esprima@3.x.x, esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - -estraverse@^4.2.0: - 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= - eventemitter3@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" @@ -1165,13 +977,6 @@ expand-braces@^0.1.1: array-unique "^0.2.1" braces "^0.1.2" -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -1193,13 +998,6 @@ expand-range@^0.1.0: is-number "^0.1.1" repeat-string "^0.2.2" -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -1220,18 +1018,11 @@ extend@3, extend@~3.0.0, extend@~3.0.1: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" integrity sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ= -extend@^3.0.0, extend@~3.0.2: +extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -1261,32 +1052,6 @@ fast-json-stable-stringify@^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= - -file-uri-to-path@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1310,12 +1075,10 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" -follow-redirects@1.0.0: - version "1.0.0" - resolved "http://registry.npmjs.org/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" - integrity sha1-jjQpjL0uF28lTv/sdaHHjMhJ/Tc= - dependencies: - debug "^2.2.0" +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== follow-redirects@^1.0.0: version "1.4.1" @@ -1324,41 +1087,16 @@ follow-redirects@^1.0.0: dependencies: debug "^3.1.0" -for-in@^1.0.1, for-in@^1.0.2: +for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25" - integrity sha1-bwrrrcxdoWwT4ezBETfYX5uIOyU= - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.11" - -form-data@~2.3.0, form-data@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - integrity sha1-SXBJi+YEwgwAXU9cI67NIda0kJk= - dependencies: - asynckit "^0.4.0" - combined-stream "1.0.6" - mime-types "^2.1.12" - form-data@~2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" @@ -1394,22 +1132,14 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== +fsevents@^1.2.2: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" -ftp@~0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" - integrity sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0= - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - fun-map@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/fun-map/-/fun-map-3.3.1.tgz#6415fde3b93ad58f9ee9566236cff3e3c64b94cb" @@ -1429,32 +1159,6 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -generate-function@^2.0.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" - integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ== - dependencies: - is-property "^1.0.2" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - integrity sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA= - dependencies: - is-property "^1.0.0" - -get-uri@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.2.tgz#5c795e71326f6ca1286f2fc82575cd2bab2af578" - integrity sha512-ZD325dMZOgerGqF/rF6vZXyFGTAay62svjQIT+X/oU2PtxYpFxvSkbsdi+oxIrsNxlZVd4y8wUDqkaExWTI/Cw== - dependencies: - data-uri-to-buffer "1" - debug "2" - extend "3" - file-uri-to-path "1" - ftp "~0.3.10" - readable-stream "2" - get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -1467,20 +1171,13 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: - is-glob "^2.0.0" + is-glob "^3.1.0" + path-dirname "^1.0.0" glob@^5.0.10: version "5.0.15" @@ -1539,16 +1236,6 @@ har-schema@^2.0.0: resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - integrity sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0= - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - har-validator@~5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" @@ -1557,14 +1244,6 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" -har-validator@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" - integrity sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA== - dependencies: - ajv "^5.3.0" - har-schema "^2.0.0" - has-ansi@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" @@ -1632,16 +1311,6 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - integrity sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ= - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - hawk@~6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" @@ -1657,19 +1326,6 @@ he@^1.1.1: resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= -hipchat-notifier@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e" - integrity sha1-ttJJdVQ3wZEII2d5nTupoPI7Ix4= - dependencies: - lodash "^4.0.0" - request "^2.0.0" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - integrity sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0= - hoek@4.x.x: version "4.2.0" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" @@ -1685,14 +1341,6 @@ http-errors@1.6.3, http-errors@~1.6.3: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== - dependencies: - agent-base "4" - debug "3.1.0" - http-proxy@^1.13.0, http-proxy@^1.8.1: version "1.17.0" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" @@ -1716,15 +1364,6 @@ http-server@^0.11.1: portfinder "^1.0.13" union "~0.4.3" -http-signature@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - integrity sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8= - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -1734,19 +1373,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -httpntlm@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2" - integrity sha1-rQFScUOi6Hc8+uapb1hla7UqNLI= - dependencies: - httpreq ">=0.4.22" - underscore "~1.7.0" - -httpreq@>=0.4.22: - version "0.4.24" - resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f" - integrity sha1-QzX/2CzZaWaKOUZckprGHWOTYn8= - https-proxy-agent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6" @@ -1764,11 +1390,6 @@ https-proxy-agent@^2.2.1: agent-base "^4.1.0" debug "^3.1.0" -iconv-lite@0.4.15: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - integrity sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es= - iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" @@ -1800,16 +1421,6 @@ indexof@0.0.1: resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= -inflection@~1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" - integrity sha1-ogCTVlbW9fa8TcdQLhrstwMihBY= - -inflection@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e" - integrity sha1-y9Fg2p91sUw8xjV41POWeEvzAU4= - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1838,11 +1449,6 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= -ip@^1.1.2, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1901,18 +1507,6 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -1925,10 +1519,10 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^1.0.0: version "1.0.0" @@ -1942,41 +1536,25 @@ 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-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: - is-extglob "^1.0.0" - -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" - integrity sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ== + is-extglob "^2.1.0" -is-my-json-valid@^2.12.4: - version "2.19.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz#8fd6e40363cd06b963fa877d444bfb5eddc62175" - integrity sha512-mG0f/unGX1HZ5ep4uhRaPOS8EkAY8/j6mDRMJrutq4CqhoJWYp7qAlonIPy3TV7p3ju4TK9fo/PbnoksWmsp5Q== +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" + is-extglob "^2.1.1" is-number@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -1984,11 +1562,6 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -2015,26 +1588,6 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-property@^1.0.0, is-property@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ= - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -2045,11 +1598,6 @@ is-windows@^1.0.2: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2123,16 +1671,11 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= -json-stringify-safe@5.0.x, json-stringify-safe@~5.0.1: +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" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - integrity sha1-T9kss04OnbPInIYi7PUfm5eMbLk= - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -2200,13 +1743,14 @@ karma-sourcemap-loader@0.3.7: dependencies: graceful-fs "^4.1.2" -karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: - version "1.7.1" - resolved "https://codeload.github.com/alexeagle/karma/tar.gz/fa1a84ac881485b5657cb669e9b4e5da77b79f0a" +karma@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" + integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== dependencies: bluebird "^3.3.0" body-parser "^1.16.1" - chokidar "^1.4.1" + chokidar "^2.0.3" colors "^1.1.0" combine-lists "^1.0.0" connect "^3.6.0" @@ -2214,23 +1758,24 @@ karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a: di "^0.0.1" dom-serialize "^2.2.0" expand-braces "^0.1.1" + flatted "^2.0.0" glob "^7.1.1" graceful-fs "^4.1.2" http-proxy "^1.13.0" isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^2.3.9" - mime "^1.3.4" + lodash "^4.17.5" + log4js "^3.0.0" + mime "^2.3.1" minimatch "^3.0.2" optimist "^0.6.1" qjobs "^1.1.4" range-parser "^1.2.0" rimraf "^2.6.0" safe-buffer "^5.0.1" - socket.io "2.0.4" + socket.io "2.1.1" source-map "^0.6.1" tmp "0.0.33" - useragent "^2.1.12" + useragent "2.3.0" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" @@ -2263,33 +1808,6 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.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" - -libbase64@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6" - integrity sha1-YjUag5VjrF/1vSbxL2Dpgwu3UeY= - -libmime@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6" - integrity sha1-UaGp50SOy9Ms2lRCFnW7IbwJPaY= - dependencies: - iconv-lite "0.4.15" - libbase64 "0.1.0" - libqp "1.1.0" - -libqp@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" - integrity sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g= - lie@~3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" @@ -2297,7 +1815,12 @@ lie@~3.1.0: dependencies: immediate "~3.0.5" -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.5.0: +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + +lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -2307,41 +1830,23 @@ lodash@^4.5.1: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= -log4js@^2.3.9: - version "2.11.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.11.0.tgz#bf3902eff65c6923d9ce9cfbd2db54160e34005a" - integrity sha512-z1XdwyGFg8/WGkOyF6DPJjivCWNLKrklGdViywdYnSKOvgtEBo2UyEMZS5sD2mZrQlU3TvO8wDWLc8mzE1ncBQ== +log4js@^3.0.0: + version "3.0.6" + resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" + integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== dependencies: - circular-json "^0.5.4" + circular-json "^0.5.5" date-format "^1.2.0" debug "^3.1.0" - semver "^5.5.0" + rfdc "^1.1.2" streamroller "0.7.0" - optionalDependencies: - amqplib "^0.5.2" - axios "^0.15.3" - hipchat-notifier "^1.1.0" - loggly "^1.1.0" - mailgun-js "^0.18.0" - nodemailer "^2.5.0" - redis "^2.7.1" - slack-node "~0.2.0" - -loggly@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee" - integrity sha1-Cg/B0/o6XsRP3HuJe+uipGlc6+4= - dependencies: - json-stringify-safe "5.0.x" - request "2.75.x" - timespan "2.3.x" long@~3: version "3.2.0" resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= -lru-cache@4.1.x, lru-cache@^4.1.2: +lru-cache@4.1.x: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" integrity sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA== @@ -2349,29 +1854,6 @@ lru-cache@4.1.x, lru-cache@^4.1.2: pseudomap "^1.0.2" yallist "^2.1.2" -mailcomposer@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4" - integrity sha1-DhxEsqB890DuF9wUm6AJ8Zyt/rQ= - dependencies: - buildmail "4.0.1" - libmime "3.0.0" - -mailgun-js@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.1.tgz#ee39aa18d7bb598a5ce9ede84afb681defc8a6b0" - integrity sha512-lvuMP14u24HS2uBsJEnzSyPMxzU2b99tQsIx1o6QNjqxjk8b3WvR+vq5oG1mjqz/IBYo+5gF+uSoDS0RkMVHmg== - dependencies: - async "~2.6.0" - debug "~3.1.0" - form-data "~2.3.0" - inflection "~1.12.0" - is-stream "^1.1.0" - path-proxy "~1.0.0" - promisify-call "^2.0.2" - proxy-agent "~3.0.0" - tsscmp "~1.0.0" - map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -2384,36 +1866,12 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -math-random@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10: +micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -2442,13 +1900,6 @@ mime-db@~1.36.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" integrity sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw== -mime-types@^2.1.11, mime-types@~2.1.18, mime-types@~2.1.19, mime-types@~2.1.7: - version "2.1.20" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" - integrity sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A== - dependencies: - mime-db "~1.36.0" - mime-types@^2.1.12, mime-types@~2.1.17: version "2.1.17" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" @@ -2456,11 +1907,23 @@ mime-types@^2.1.12, mime-types@~2.1.17: dependencies: mime-db "~1.30.0" -mime@^1.3.4, mime@^1.4.1: +mime-types@~2.1.18: + version "2.1.20" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" + integrity sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A== + dependencies: + mime-db "~1.36.0" + +mime@^1.4.1: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mime@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== + "minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -2549,11 +2012,6 @@ negotiator@0.6.1: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= -netmask@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" - integrity sha1-ICl+idhvb2QA8lDZ9Pa0wZRfzTU= - node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" @@ -2570,67 +2028,6 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - integrity sha1-sEDrCSOWivq/jTL7HxfxFn/auQc= - -nodemailer-direct-transport@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86" - integrity sha1-6W+vuQNYVglH5WkBfZfmBzilCoY= - dependencies: - nodemailer-shared "1.1.0" - smtp-connection "2.12.0" - -nodemailer-fetch@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4" - integrity sha1-ecSQihwPXzdbc/6IjamCj23JY6Q= - -nodemailer-shared@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0" - integrity sha1-z1mU4v0mjQD1zw+nZ6CBae2wfsA= - dependencies: - nodemailer-fetch "1.6.0" - -nodemailer-smtp-pool@2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72" - integrity sha1-LrlNbPhXgLG0clzoU7nL1ejajHI= - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-smtp-transport@2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77" - integrity sha1-A9ccdjFPFKx9vHvwM6am0W1n+3c= - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-wellknown@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5" - integrity sha1-WG24EB2zDLRDjrVGc3pBqtDPE9U= - -nodemailer@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9" - integrity sha1-8kLmSa7q45tsftdA73sGHEBNMPk= - dependencies: - libmime "3.0.0" - mailcomposer "4.0.1" - nodemailer-direct-transport "3.3.2" - nodemailer-shared "1.1.0" - nodemailer-smtp-pool "2.8.2" - nodemailer-smtp-transport "2.7.2" - socks "1.1.9" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -2639,7 +2036,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= @@ -2679,16 +2076,11 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -oauth-sign@~0.8.1, oauth-sign@~0.8.2: +oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" integrity sha1-Rqarfwrq2N6unsBWV4C31O/rnUM= -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - 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" @@ -2715,14 +2107,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -2757,18 +2141,6 @@ optimist@0.6.x, optimist@^0.6.1, optimist@~0.6.0: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: - 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" - options@>=0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" @@ -2804,46 +2176,11 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -pac-proxy-agent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-3.0.0.tgz#11d578b72a164ad74bf9d5bac9ff462a38282432" - integrity sha512-AOUX9jES/EkQX2zRz0AW7lSx9jD//hQS8wFXBvcnd/J2Py9KaMJMqV/LPqJssj1tgGufotb2mmopGPR15ODv1Q== - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - get-uri "^2.0.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - pac-resolver "^3.0.0" - raw-body "^2.2.0" - socks-proxy-agent "^4.0.1" - -pac-resolver@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-3.0.0.tgz#6aea30787db0a891704deb7800a722a7615a6f26" - integrity sha512-tcc38bsjuE3XZ5+4vP96OfhOugrX+JcnpUbhfuc4LuXBLQhoTthOstZeoQJBDnQUDYzYmdImKsbz0xSl1/9qeA== - dependencies: - co "^4.6.0" - degenerator "^1.0.4" - ip "^1.1.5" - netmask "^1.0.6" - thunkify "^2.1.2" - pako@~1.0.2: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - parseqs@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" @@ -2868,6 +2205,11 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + 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" @@ -2883,13 +2225,6 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= -path-proxy@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e" - integrity sha1-GOijaFn8nS8aU7SN7hOFQ8Ag3l4= - dependencies: - inflection "~1.3.0" - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -2926,16 +2261,6 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= -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= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -2946,13 +2271,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== -promisify-call@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba" - integrity sha1-1IwtRWUszM1SgB3ey9UzptS9X7o= - dependencies: - with-callback "^1.0.2" - protobufjs@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1" @@ -2994,36 +2312,12 @@ protractor@^5.2.0: webdriver-js-extender "^1.0.0" webdriver-manager "^12.0.6" -proxy-agent@~3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.3.tgz#1c1a33db60ef5f2e9e35b876fd63c2bc681c611d" - integrity sha512-PXVVVuH9tiQuxQltFJVSnXWuDtNr+8aNBP6XVDDCDiUuDN8eRCm+ii4/mFWmXWEA0w8jjJSlePa4LXlM4jIzNA== - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" - pac-proxy-agent "^3.0.0" - proxy-from-env "^1.0.0" - socks-proxy-agent "^4.0.1" - -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= - pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24: - version "1.1.29" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" - integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== - -punycode@1.4.1, punycode@^1.4.1: +punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= @@ -3038,7 +2332,7 @@ qjobs@^1.1.4: resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== -qs@6.5.2, qs@~6.5.2: +qs@6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== @@ -3048,31 +2342,17 @@ qs@~2.3.3: resolved "https://registry.yarnpkg.com/qs/-/qs-2.3.3.tgz#e9e85adbe75da0bbe4c8e0476a086290f863b404" integrity sha1-6eha2+ddoLvkyOBHaghikPhjtAQ= -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - integrity sha1-HPyyXBCpsrSDBT/zn138kjOQjP4= - qs@~6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" integrity sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A== -randomatic@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" - integrity sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - range-parser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= -raw-body@2.3.3, raw-body@^2.2.0: +raw-body@2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== @@ -3092,17 +2372,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -readable-stream@1.1.x, "readable-stream@1.x >=1.1.9": - version "1.1.14" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@2, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: version "2.3.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -3115,7 +2385,7 @@ readable-stream@2, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stre string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@~2.0.5, readable-stream@~2.0.6: +readable-stream@~2.0.6: version "2.0.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= @@ -3143,32 +2413,6 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" -redis-commands@^1.2.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2" - integrity sha512-foGF8u6MXGFF++1TZVC6icGXuMYPftKXt1FBT2vrfU9ZATNtZJ8duRC5d1lEfE8hyVe3jhelHGB91oB7I6qLsA== - -redis-parser@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" - integrity sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs= - -redis@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" - integrity sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A== - dependencies: - double-ended-queue "^2.1.0-0" - redis-commands "^1.2.0" - redis-parser "^2.6.0" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -3192,64 +2436,11 @@ repeat-string@^0.2.2: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= -repeat-string@^1.5.2, repeat-string@^1.6.1: +repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -request@2.75.x: - version "2.75.0" - resolved "http://registry.npmjs.org/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93" - integrity sha1-0rgmiihtoT6qXQGt9dGMyQ9lfZM= - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.0.0" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - -request@^2.0.0, request@^2.74.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - request@^2.78.0: version "2.83.0" resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" @@ -3278,16 +2469,6 @@ request@^2.78.0: tunnel-agent "^0.6.0" uuid "^3.1.0" -requestretry@^1.2.2: - version "1.13.0" - resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94" - integrity sha512-Lmh9qMvnQXADGAQxsXHP4rbgO6pffCfuR8XUBdP9aitJcLQJxhp7YZK4xAVYXnPJ5E52mwrfiKQtKonPL8xsmg== - dependencies: - extend "^3.0.0" - lodash "^4.15.0" - request "^2.74.0" - when "^3.7.7" - requirejs@2.3.5: version "2.3.5" resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" @@ -3315,6 +2496,11 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +rfdc@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" + integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== + rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" @@ -3425,11 +2611,6 @@ semver@^5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== -semver@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" - integrity sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw== - semver@~5.0.1: version "5.0.3" resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a" @@ -3479,31 +2660,6 @@ signal-exit@^3.0.0: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -slack-node@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30" - integrity sha1-3kuN3aqLeT9h29KTgQT9q/N9+jA= - dependencies: - requestretry "^1.2.2" - -smart-buffer@^1.0.4: - version "1.1.15" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" - integrity sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY= - -smart-buffer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" - integrity sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg== - -smtp-connection@2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" - integrity sha1-1275EnyyPCJZ7bHoNJwujV4tdME= - dependencies: - httpntlm "1.6.1" - nodemailer-shared "1.1.0" - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -3534,13 +2690,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - integrity sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg= - dependencies: - hoek "2.x.x" - sntp@2.x.x: version "2.1.0" resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" @@ -3553,69 +2702,46 @@ socket.io-adapter@~1.1.0: resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= -socket.io-client@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e" - integrity sha1-CRilUkBtxeVAs4Dc2Xr8SmQzL44= +socket.io-client@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" + integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== dependencies: backo2 "1.0.2" base64-arraybuffer "0.1.5" component-bind "1.0.0" component-emitter "1.2.1" - debug "~2.6.4" - engine.io-client "~3.1.0" + debug "~3.1.0" + engine.io-client "~3.2.0" + has-binary2 "~1.0.2" has-cors "1.1.0" indexof "0.0.1" object-component "0.0.3" parseqs "0.0.5" parseuri "0.0.5" - socket.io-parser "~3.1.1" + socket.io-parser "~3.2.0" to-array "0.1.4" -socket.io-parser@~3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e" - integrity sha512-g0a2HPqLguqAczs3dMECuA1RgoGFPyvDqcbaDEdCWY9g59kdUAz3YRmaJBNKXflrHNwB7Q12Gkf/0CZXfdHR7g== +socket.io-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" + integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== dependencies: component-emitter "1.2.1" debug "~3.1.0" - has-binary2 "~1.0.2" isarray "2.0.1" -socket.io@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014" - integrity sha1-waRZDO/4fs8TxyZS8Eb3FrKeYBQ= +socket.io@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" + integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== dependencies: - debug "~2.6.6" - engine.io "~3.1.0" + debug "~3.1.0" + engine.io "~3.2.0" + has-binary2 "~1.0.2" socket.io-adapter "~1.1.0" - socket.io-client "2.0.4" - socket.io-parser "~3.1.1" - -socks-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" - integrity sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw== - dependencies: - agent-base "~4.2.0" - socks "~2.2.0" - -socks@1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" - integrity sha1-Yo1+TQSRJDVEWsC25Fk3bLPm1pE= - dependencies: - ip "^1.1.2" - smart-buffer "^1.0.4" - -socks@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" - integrity sha512-0GabKw7n9mI46vcNrVfs0o6XzWzjVa3h6GaSo2UPxtWAROXUWavfJWh1M4PR5tnE0dcnQXZIDFP4yrAysLze/w== - dependencies: - ip "^1.1.5" - smart-buffer "^4.0.1" + socket.io-client "2.1.1" + socket.io-parser "~3.2.0" source-map-resolve@^0.5.0: version "0.5.2" @@ -3661,7 +2787,7 @@ source-map@^0.5.6: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -3755,11 +2881,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringstream@~0.0.4: - version "0.0.6" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" - integrity sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA== - stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3821,16 +2942,6 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -thunkify@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" - integrity sha1-+qDp0jDFGsyVyhOjYawFyn4EVT0= - -timespan@2.3.x: - version "2.3.0" - resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" - integrity sha1-SQLOBAvRPYRcj1myfp1ZutbzmSk= - tmp@0.0.24: version "0.0.24" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.24.tgz#d6a5e198d14a9835cc6f2d7c3d9e302428c8cf12" @@ -3880,13 +2991,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@~2.3.0: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - integrity sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA== - dependencies: - punycode "^1.4.1" - tough-cookie@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" @@ -3894,14 +2998,6 @@ tough-cookie@~2.3.3: dependencies: punycode "^1.4.1" -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - tree-kill@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" @@ -3931,11 +3027,6 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" integrity sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ== -tsscmp@~1.0.0: - version "1.0.6" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" - integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== - tsutils@2.27.2: version "2.27.2" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" @@ -3950,23 +3041,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - integrity sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us= - tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" 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" - type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" @@ -3990,11 +3069,6 @@ ultron@~1.1.0: resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== -underscore@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" - integrity sha1-a7rwh3UA02vjTsqlhODbn+8DUgk= - union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -4025,6 +3099,11 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +upath@^1.0.5: + version "1.1.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -4040,7 +3119,7 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -useragent@^2.1.12: +useragent@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== @@ -4063,16 +3142,6 @@ uuid@^3.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g== -uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -uws@~9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95" - integrity sha512-HNMztPP5A1sKuVFmdZ6BPVpBQd5bUjNC8EFMFiICK+oho/OQsAJy5hnIx4btMHiOk8j04f/DbIlqnEZ9d72dqg== - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -4112,11 +3181,6 @@ webdriver-manager@^12.0.6: semver "^5.3.0" xml2js "^0.4.17" -when@^3.7.7: - version "3.7.8" - resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82" - integrity sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I= - which@^1.2.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -4141,21 +3205,11 @@ window-size@^0.1.4: resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= -with-callback@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/with-callback/-/with-callback-1.0.2.tgz#a09629b9a920028d721404fb435bdcff5c91bc21" - integrity sha1-oJYpuakgAo1yFAT7Q1vc/1yRvCE= - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -4212,16 +3266,6 @@ xmlhttprequest-ssl@~1.5.4: resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - integrity sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM= - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= - y18n@^3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" From b4b57797e6e60a3f84a568bf57c5d2d45e21ff24 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 4 Feb 2019 14:55:11 -0800 Subject: [PATCH 078/316] fix regex for updating VERSION on release --- on-version.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/on-version.js b/on-version.js index 18dee817..87e3d8e7 100644 --- a/on-version.js +++ b/on-version.js @@ -29,7 +29,7 @@ const shell = require('shelljs'); const version = require('./package.json').version; shell.sed('-i', '\"@bazel/typescript\": \"[0-9\.]*\"', `"@bazel/typescript": "${version}"`, 'README.md'); shell.sed('-i', '\"@bazel/karma\": \"[0-9\.]*\"', `"@bazel/karma": "${version}"`, 'README.md'); -shell.sed('-i', 'VERSION \= \"[0-9\.]*\"', `VERSION = "${version}"`, 'version.bzl'); +shell.sed('-i', '^VERSION \= \"[0-9\.]*\"', `VERSION = "${version}"`, 'version.bzl'); shell.sed('-i', 'check_rules_typescript_version\\\(version_string \= \"[0-9\.]*\"', `check_rules_typescript_version(version_string = "${version}"`, 'WORKSPACE'); // Following instructions in version.bzl, we should update the minimal compatibility version whenever From 2c5e4a87b4b6b2def1c798f2932653976190ca5f Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 4 Feb 2019 14:57:29 -0800 Subject: [PATCH 079/316] rel: 0.23.1 --- README.md | 4 ++-- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e334a93b..09dbcf59 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.0", - "@bazel/karma": "0.23.0", + "@bazel/typescript": "0.23.1", + "@bazel/karma": "0.23.1", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 2b644566..9427127a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.23.0") +check_rules_typescript_version(version_string = "0.23.1") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index 15f4a391..e570a07f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.23.0", + "version": "0.23.1", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index ec462f96..3d4590cd 100644 --- a/version.bzl +++ b/version.bzl @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.23.0" +VERSION = "0.23.1" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for From f9b7c34d2e0b75e26af8ffd90e08c58960e9635b Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 4 Feb 2019 15:40:33 -0800 Subject: [PATCH 080/316] Fix @build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto target in npm @bazel/typescript generated bazel workspace Closes #404 PiperOrigin-RevId: 232380639 --- internal/e2e/npm_packages/typescript_2.7/BUILD.bazel | 4 ++++ internal/e2e/npm_packages/typescript_2.8/BUILD.bazel | 4 ++++ internal/e2e/npm_packages/typescript_2.9/BUILD.bazel | 4 ++++ internal/e2e/npm_packages/typescript_3.0/BUILD.bazel | 4 ++++ internal/e2e/npm_packages/typescript_3.1/BUILD.bazel | 4 ++++ .../bazelbuild/bazel/src/main/protobuf/BUILD.bazel | 7 +++++++ 6 files changed, 27 insertions(+) diff --git a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel index db3403d9..e7cccf46 100644 --- a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel @@ -34,6 +34,10 @@ ts_library( jasmine_node_test( name = "test", + data = [ + # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace + "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + ], deps = [ ":test_lib", "@npm//jasmine", diff --git a/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel index db3403d9..e7cccf46 100644 --- a/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel @@ -34,6 +34,10 @@ ts_library( jasmine_node_test( name = "test", + data = [ + # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace + "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + ], deps = [ ":test_lib", "@npm//jasmine", diff --git a/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel index db3403d9..e7cccf46 100644 --- a/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel @@ -34,6 +34,10 @@ ts_library( jasmine_node_test( name = "test", + data = [ + # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace + "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + ], deps = [ ":test_lib", "@npm//jasmine", diff --git a/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel index db3403d9..e7cccf46 100644 --- a/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel @@ -34,6 +34,10 @@ ts_library( jasmine_node_test( name = "test", + data = [ + # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace + "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + ], deps = [ ":test_lib", "@npm//jasmine", diff --git a/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel index db3403d9..e7cccf46 100644 --- a/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel @@ -34,6 +34,10 @@ ts_library( jasmine_node_test( name = "test", + data = [ + # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace + "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + ], deps = [ ":test_lib", "@npm//jasmine", diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel index 38af0d0a..24a43bf8 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel @@ -1,13 +1,18 @@ +# BEGIN-DEV-ONLY +# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. +# The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") package(default_visibility = ["//:__pkg__"]) licenses(["notice"]) # Apache 2.0 +# END-DEV-ONLY # Export the raw proto file so protobufjs can be used reflectively without codegen exports_files(["worker_protocol.proto"]) +# BEGIN-DEV-ONLY proto_library( name = "blaze_worker_proto", srcs = ["worker_protocol.proto"], @@ -31,6 +36,8 @@ go_library( filegroup( name = "npm_package_assets", srcs = [ + "BUILD.bazel", "worker_protocol.proto", ], ) +# END-DEV-ONLY From f2331b282d0861488ce20128491356edeb06bec3 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 4 Feb 2019 15:41:59 -0800 Subject: [PATCH 081/316] rel: 0.23.2 --- README.md | 4 ++-- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 09dbcf59..7ee8109c 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.1", - "@bazel/karma": "0.23.1", + "@bazel/typescript": "0.23.2", + "@bazel/karma": "0.23.2", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 9427127a..489d674e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.23.1") +check_rules_typescript_version(version_string = "0.23.2") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index e570a07f..fc1d4fb5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.23.1", + "version": "0.23.2", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 3d4590cd..d2bc5506 100644 --- a/version.bzl +++ b/version.bzl @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.23.1" +VERSION = "0.23.2" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for From f70e4df8ea498b17863371ff284ae31e83ed82a7 Mon Sep 17 00:00:00 2001 From: radokirov Date: Tue, 5 Feb 2019 15:08:58 -0800 Subject: [PATCH 082/316] Add a list of the current available rules at tsetse.info. PiperOrigin-RevId: 232566676 --- README.md | 4 ++-- WORKSPACE | 2 +- docs/index.md | 8 ++++++++ package.json | 2 +- version.bzl | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7ee8109c..09dbcf59 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.2", - "@bazel/karma": "0.23.2", + "@bazel/typescript": "0.23.1", + "@bazel/karma": "0.23.1", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 489d674e..9427127a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.23.2") +check_rules_typescript_version(version_string = "0.23.1") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/docs/index.md b/docs/index.md index ee00762d..ef521eb3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -41,3 +41,11 @@ $ bazel build :all mycode.ts(2,1): error TS21222: return value is unused. See http://tsetse.info/check-return-value ``` + +## Rules + +* [Ban expect truthy promise](./ban-expect-truthy-promise) +* [Ban promise as condition](./ban-promise-as-condition) +* [Check return value](./check-return-value) +* [Equals NaN](./equals-nan) +* [Must use promises](./must-use-promises) diff --git a/package.json b/package.json index fc1d4fb5..e570a07f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.23.2", + "version": "0.23.1", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index d2bc5506..3d4590cd 100644 --- a/version.bzl +++ b/version.bzl @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.23.2" +VERSION = "0.23.1" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for From 578ebf2126a78f44f29deb67f070eae21d2b5511 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Wed, 6 Feb 2019 08:42:12 -0800 Subject: [PATCH 083/316] Call ngtsc when registered as a tsc_wrapped plugin. PiperOrigin-RevId: 232681550 --- internal/build_defs.bzl | 3 + internal/common/tsconfig.bzl | 3 + internal/tsc_wrapped/tsc_wrapped.ts | 93 +++++++++++++++++++++++------ internal/tsc_wrapped/tsconfig.ts | 6 ++ 4 files changed, 88 insertions(+), 17 deletions(-) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index fbf93d4d..b300f906 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -341,6 +341,9 @@ ts_library = rule( """, default = Label("@npm//typescript:typescript__typings"), ), + "compile_angular_templates": attr.bool( + doc = """Run the Angular ngtsc compiler under ts_library""", + ), "supports_workers": attr.bool( doc = """Intended for internal use only. Allows you to disable the Bazel Worker strategy for this library. diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 0b1fcda6..349dc6f9 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -155,6 +155,9 @@ def create_tsconfig( "expectedDiagnostics": getattr(ctx.attr, "expected_diagnostics", []), } + if hasattr(ctx.attr, "compile_angular_templates") and ctx.attr.compile_angular_templates: + bazel_options["compileAngularTemplates"] = True + if disable_strict_deps: bazel_options["disableStrictDeps"] = disable_strict_deps bazel_options["allowedStrictDeps"] = [] diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 983ac788..9aa74738 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -10,6 +10,7 @@ import {CompilerHost} from './compiler_host'; import * as bazelDiagnostics from './diagnostics'; import {constructManifest} from './manifest'; import * as perfTrace from './perf_trace'; +import {PluginCompilerHost, TscPlugin} from './plugin_api'; import {PLUGIN as strictDepsPlugin} from './strict_deps'; import {BazelOptions, parseTsconfig, resolveNormalizedPath} from './tsconfig'; import {debug, log, runAsWorker, runWorkerLoop} from './worker'; @@ -47,7 +48,7 @@ function isCompilationTarget( */ export function gatherDiagnostics( options: ts.CompilerOptions, bazelOpts: BazelOptions, program: ts.Program, - disabledTsetseRules: string[]): ts.Diagnostic[] { + disabledTsetseRules: string[], angularPlugin?: TscPlugin): ts.Diagnostic[] { // Install extra diagnostic plugins if (!bazelOpts.disableStrictDeps) { const ignoredFilesPrefixes: string[] = []; @@ -73,8 +74,9 @@ export function gatherDiagnostics( let selectedTsetsePlugin = bazelConformancePlugin; program = selectedTsetsePlugin.wrap(program, disabledTsetseRules); } - - // TODO(alexeagle): support plugins registered by config + if (angularPlugin) { + program = angularPlugin.wrap(program); + } const diagnostics: ts.Diagnostic[] = []; perfTrace.wrap('type checking', () => { @@ -129,7 +131,13 @@ function runOneBuild( throw new Error( 'Impossible state: if parseTsconfig returns no errors, then parsed should be non-null'); } - const {options, bazelOpts, files, disabledTsetseRules} = parsed; + const { + options, + bazelOpts, + files, + disabledTsetseRules, + angularCompilerOptions + } = parsed; if (bazelOpts.maxCacheSizeMb !== undefined) { const maxCacheSizeBytes = bazelOpts.maxCacheSizeMb * (1 << 20); @@ -154,14 +162,16 @@ function runOneBuild( const perfTracePath = bazelOpts.perfTracePath; if (!perfTracePath) { return runFromOptions( - fileLoader, options, bazelOpts, files, disabledTsetseRules); + fileLoader, options, bazelOpts, files, disabledTsetseRules, + angularCompilerOptions); } log('Writing trace to', perfTracePath); const success = perfTrace.wrap( 'runOneBuild', () => runFromOptions( - fileLoader, options, bazelOpts, files, disabledTsetseRules)); + fileLoader, options, bazelOpts, files, disabledTsetseRules, + angularCompilerOptions)); if (!success) return false; // Force a garbage collection pass. This keeps our memory usage // consistent across multiple compilations, and allows the file @@ -182,20 +192,47 @@ const expectDiagnosticsWhitelist: string[] = [ function runFromOptions( fileLoader: FileLoader, options: ts.CompilerOptions, - bazelOpts: BazelOptions, files: string[], - disabledTsetseRules: string[]): boolean { + bazelOpts: BazelOptions, files: string[], disabledTsetseRules: string[], + angularCompilerOptions?: {[key: string]: unknown}): boolean { perfTrace.snapshotMemoryUsage(); cache.resetStats(); cache.traceStats(); + const compilerHostDelegate = ts.createCompilerHost({target: ts.ScriptTarget.ES5}); const moduleResolver = bazelOpts.isJsTranspilation ? makeJsModuleResolver(bazelOpts.workspaceName) : ts.resolveModuleName; - const compilerHost = new CompilerHost( + const tsickleCompilerHost: CompilerHost = new CompilerHost( files, options, bazelOpts, compilerHostDelegate, fileLoader, moduleResolver); + let compilerHost: PluginCompilerHost = tsickleCompilerHost; + + let angularPlugin: TscPlugin|undefined; + if (bazelOpts.compileAngularTemplates) { + try { + const ngOptions = angularCompilerOptions || {}; + // Add the rootDir setting to the options passed to NgTscPlugin. + // Required so that synthetic files added to the rootFiles in the program + // can be given absolute paths, just as we do in tsconfig.ts, matching + // the behavior in TypeScript's tsconfig parsing logic. + ngOptions['rootDir'] = options.rootDir; + + // Dynamically load the Angular compiler installed as a peerDep + const ngtsc = require('@angular/compiler-cli'); + angularPlugin = new ngtsc.NgTscPlugin(ngOptions); + } catch (e) { + console.error(e); + throw new Error( + 'when using `ts_library(compile_angular_templates=True)`, ' + + 'you must install @angular/compiler-cli'); + } + + // Wrap host only needed until after Ivy cleanup + // TODO(alexeagle): remove after ngsummary and ngfactory files eliminated + compilerHost = angularPlugin!.wrapHost!(files, compilerHost); + } const oldProgram = cache.getProgram(bazelOpts.target); @@ -209,8 +246,8 @@ function runFromOptions( // If there are any TypeScript type errors abort now, so the error // messages refer to the original source. After any subsequent passes // (decorator downleveling or tsickle) we do not type check. - let diagnostics = - gatherDiagnostics(options, bazelOpts, program, disabledTsetseRules); + let diagnostics = gatherDiagnostics( + options, bazelOpts, program, disabledTsetseRules, angularPlugin); if (!expectDiagnosticsWhitelist.length || expectDiagnosticsWhitelist.some(p => bazelOpts.target.startsWith(p))) { diagnostics = bazelDiagnostics.filterExpected( @@ -235,11 +272,22 @@ function runFromOptions( let diagnostics: ts.Diagnostic[] = []; let useTsickleEmit = bazelOpts.tsickle; + let transforms: ts.CustomTransformers = { + before: [], + after: [], + afterDeclarations: [], + }; + + if (angularPlugin) { + transforms = angularPlugin.createTransformers!(compilerHost); + } + if (useTsickleEmit) { diagnostics = emitWithTsickle( - program, compilerHost, compilationTargets, options, bazelOpts); + program, tsickleCompilerHost, compilationTargets, options, bazelOpts, + transforms); } else { - diagnostics = emitWithTypescript(program, compilationTargets); + diagnostics = emitWithTypescript(program, compilationTargets, transforms); } if (diagnostics.length > 0) { @@ -253,10 +301,14 @@ function runFromOptions( } function emitWithTypescript( - program: ts.Program, compilationTargets: ts.SourceFile[]): ts.Diagnostic[] { + program: ts.Program, compilationTargets: ts.SourceFile[], + transforms: ts.CustomTransformers): ts.Diagnostic[] { const diagnostics: ts.Diagnostic[] = []; for (const sf of compilationTargets) { - const result = program.emit(sf); + const result = program.emit( + sf, /*writeFile*/ undefined, + /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, + transforms); diagnostics.push(...result.diagnostics); } return diagnostics; @@ -272,7 +324,8 @@ function emitWithTypescript( export function emitWithTsickle( program: ts.Program, compilerHost: CompilerHost, compilationTargets: ts.SourceFile[], options: ts.CompilerOptions, - bazelOpts: BazelOptions): ts.Diagnostic[] { + bazelOpts: BazelOptions, + transforms: ts.CustomTransformers): ts.Diagnostic[] { const emitResults: tsickle.EmitResult[] = []; const diagnostics: ts.Diagnostic[] = []; // The 'tsickle' import above is only used in type positions, so it won't @@ -295,7 +348,13 @@ export function emitWithTsickle( for (const sf of compilationTargets) { perfTrace.wrap(`emit ${sf.fileName}`, () => { emitResults.push(optTsickle.emitWithTsickle( - program, compilerHost, compilerHost, options, sf)); + program, compilerHost, compilerHost, options, sf, + /*writeFile*/ undefined, + /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, { + beforeTs: transforms.before, + afterTs: transforms.after, + afterDeclarations: transforms.afterDeclarations, + })); }); } }); diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index 076439c0..060b5ff8 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -156,11 +156,17 @@ export interface BazelOptions { * compilation unit. */ hasImplementation?: boolean; + + /** + * Enable the Angular ngtsc plugin. + */ + compileAngularTemplates?: boolean; } export interface ParsedTsConfig { options: ts.CompilerOptions; bazelOpts: BazelOptions; + angularCompilerOptions?: {[k: string]: unknown}; files: string[]; disabledTsetseRules: string[]; config: {}; From 483bf906383355a4dfb1319bc81f9bf0388a1786 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 6 Feb 2019 10:18:16 -0800 Subject: [PATCH 084/316] Fix lint Closes #405 PiperOrigin-RevId: 232697351 --- internal/build_defs.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index b300f906..ef73fa2a 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -260,6 +260,9 @@ ts_library = rule( allow_files = [".ts", ".tsx"], mandatory = True, ), + "compile_angular_templates": attr.bool( + doc = """Run the Angular ngtsc compiler under ts_library""", + ), "compiler": attr.label( doc = """Sets a different TypeScript compiler binary to use for this library. For example, we use the vanilla TypeScript tsc.js for bootstrapping, @@ -341,9 +344,6 @@ ts_library = rule( """, default = Label("@npm//typescript:typescript__typings"), ), - "compile_angular_templates": attr.bool( - doc = """Run the Angular ngtsc compiler under ts_library""", - ), "supports_workers": attr.bool( doc = """Intended for internal use only. Allows you to disable the Bazel Worker strategy for this library. From ebf4db27ede9ec5d42f6fb3aebc50d49343c9f4b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 6 Feb 2019 10:26:00 -0800 Subject: [PATCH 085/316] rel: 0.23.3 --- README.md | 4 ++-- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 09dbcf59..93d21e94 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.1", - "@bazel/karma": "0.23.1", + "@bazel/typescript": "0.23.3", + "@bazel/karma": "0.23.3", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 9427127a..acb4497a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.23.1") +check_rules_typescript_version(version_string = "0.23.3") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index e570a07f..6fc1cd9c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.23.1", + "version": "0.23.3", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 3d4590cd..50cee429 100644 --- a/version.bzl +++ b/version.bzl @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.23.1" +VERSION = "0.23.3" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for From e922b3c66e95a6fd17eb0e469700f4f55b28f918 Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Wed, 6 Feb 2019 14:12:54 -0800 Subject: [PATCH 086/316] feat(ts_library): bump default target to es2015 Closes #406 PiperOrigin-RevId: 232743893 --- examples/devmode_consumer/BUILD.bazel | 15 +++++++++++++++ .../devmode_consumer.bzl} | 8 ++++---- .../devmode_consumer_test.sh} | 7 +++++++ examples/es5_output/BUILD.bazel | 15 --------------- examples/googmodule/BUILD.bazel | 8 ++++---- internal/build_defs.bzl | 4 ++++ 6 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 examples/devmode_consumer/BUILD.bazel rename examples/{es5_output/es5_consumer.bzl => devmode_consumer/devmode_consumer.bzl} (89%) rename examples/{es5_output/es5_output_test.sh => devmode_consumer/devmode_consumer_test.sh} (95%) delete mode 100644 examples/es5_output/BUILD.bazel diff --git a/examples/devmode_consumer/BUILD.bazel b/examples/devmode_consumer/BUILD.bazel new file mode 100644 index 00000000..78d6a463 --- /dev/null +++ b/examples/devmode_consumer/BUILD.bazel @@ -0,0 +1,15 @@ +load(":devmode_consumer.bzl", "devmode_consumer") + +devmode_consumer( + name = "devmode_consumer", + deps = ["//examples:bar_ts_library"], +) + +sh_test( + name = "devmode_consumer_test", + srcs = ["devmode_consumer_test.sh"], + data = [ + ":devmode_consumer", + "@bazel_tools//tools/bash/runfiles", + ], +) diff --git a/examples/es5_output/es5_consumer.bzl b/examples/devmode_consumer/devmode_consumer.bzl similarity index 89% rename from examples/es5_output/es5_consumer.bzl rename to examples/devmode_consumer/devmode_consumer.bzl index 05d406c7..0d29ca92 100644 --- a/examples/es5_output/es5_consumer.bzl +++ b/examples/devmode_consumer/devmode_consumer.bzl @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Example of a rule that requires ES5 (devmode) inputs. +"""Example of a rule that requires es2015 (devmode) inputs. """ load("@build_bazel_rules_nodejs//internal:node.bzl", "sources_aspect") -def _es5_consumer(ctx): +def _devmode_consumer(ctx): files = depset() # Since we apply the sources_aspect to our deps below, we can iterate through @@ -32,8 +32,8 @@ def _es5_consumer(ctx): runfiles = ctx.runfiles(files.to_list()), )] -es5_consumer = rule( - implementation = _es5_consumer, +devmode_consumer = rule( + implementation = _devmode_consumer, attrs = { "deps": attr.label_list(aspects = [sources_aspect]), }, diff --git a/examples/es5_output/es5_output_test.sh b/examples/devmode_consumer/devmode_consumer_test.sh similarity index 95% rename from examples/es5_output/es5_output_test.sh rename to examples/devmode_consumer/devmode_consumer_test.sh index ab58ce59..096f4d55 100755 --- a/examples/es5_output/es5_output_test.sh +++ b/examples/devmode_consumer/devmode_consumer_test.sh @@ -79,3 +79,10 @@ if [[ "$FOO_JS" != *"define(\"build_bazel_rules_typescript/examples/foo\""* ]]; echo "$FOO_JS" exit 1 fi + +# should produce es2015 classes +if [[ "$FOO_JS" != *"class Greeter"* ]]; then + echo "Expected foo.js produce a es2015, but was" + echo "$FOO_JS" + exit 1 +fi \ No newline at end of file diff --git a/examples/es5_output/BUILD.bazel b/examples/es5_output/BUILD.bazel deleted file mode 100644 index 5bc709f8..00000000 --- a/examples/es5_output/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load(":es5_consumer.bzl", "es5_consumer") - -es5_consumer( - name = "es5_output", - deps = ["//examples:bar_ts_library"], -) - -sh_test( - name = "es5_output_test", - srcs = ["es5_output_test.sh"], - data = [ - ":es5_output", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel index 6bc149c6..efaa52e7 100644 --- a/examples/googmodule/BUILD.bazel +++ b/examples/googmodule/BUILD.bazel @@ -1,5 +1,5 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("//examples/es5_output:es5_consumer.bzl", "es5_consumer") +load("//examples/devmode_consumer:devmode_consumer.bzl", "devmode_consumer") load("//internal:defaults.bzl", "ts_library") ts_library( @@ -8,8 +8,8 @@ ts_library( tsconfig = "tsconfig.json", ) -es5_consumer( - name = "es5_output", +devmode_consumer( + name = "devmode_output", deps = [":googmodule"], ) @@ -17,7 +17,7 @@ jasmine_node_test( name = "googmodule_output_test", srcs = ["googmodule_output_test.js"], data = [ - ":es5_output", + ":devmode_output", "@npm//jasmine", ], ) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index ef73fa2a..fb22d2a8 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -188,6 +188,10 @@ def tsc_wrapped_tsconfig( ) config["bazelOptions"]["nodeModulesPrefix"] = node_modules_root + # Override the target so we use es2015 for devmode + # Since g3 isn't ready to do this yet + config["compilerOptions"]["target"] = "es2015" + # If the user gives a tsconfig attribute, the generated file should extend # from the user's tsconfig. # See https://github.com/Microsoft/TypeScript/issues/9876 From 0ab3a13ab610ad033a3c1ebd8a2080f7f251b624 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 7 Feb 2019 10:19:49 -0800 Subject: [PATCH 087/316] Fix issue with module_root when building external repo Closes #242 Closes #249 PiperOrigin-RevId: 232897910 --- .bazelci/presubmit.yml | 3 +++ internal/common/module_mappings.bzl | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index fef67604..f587cc91 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -19,6 +19,9 @@ platforms: build_targets: - "..." - "@disable_tsetse_for_external_test//..." + # Run some targets again, but addressed as an external repo + # TODO(alexeagle): run all of them after fixing https://github.com/bazelbuild/rules_typescript/issues/243 + - "@build_bazel_rules_typescript//examples/some_library:lib" test_flags: # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1604 - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl index a28b3279..b74e5b80 100644 --- a/internal/common/module_mappings.bzl +++ b/internal/common/module_mappings.bzl @@ -90,9 +90,17 @@ def get_module_mappings(label, attrs, srcs = [], workspace_name = None, mappings else: for s in srcs: - if not s.short_path.startswith(mr): + short_path = s.short_path + + # Execroot paths for external repositories should start with external/ + # But the short_path property of file gives the relative path from our workspace + # instead. We must correct this to compare with the module_root which is an + # execroot path. + if short_path.startswith("../"): + short_path = "external/" + short_path[3:] + if not short_path.startswith(mr): fail(("all sources must be under module root: %s, but found: %s" % - (mr, s.short_path))) + (mr, short_path))) if mn in mappings and mappings[mn] != mr: fail(("duplicate module mapping at %s: %s maps to both %s and %s" % (label, mn, mappings[mn], mr)), "deps") From 83543bc83d215f6cf65db60706271ab584c7c25b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 7 Feb 2019 13:38:58 -0800 Subject: [PATCH 088/316] Prepare for next rules_nodejs release by updating usages of deprecated internal/node.bzl Closes #407 PiperOrigin-RevId: 232936088 --- examples/devmode_consumer/devmode_consumer.bzl | 2 +- examples/es6_output/es6_consumer.bzl | 2 +- internal/devserver/ts_devserver.bzl | 5 +---- internal/karma/karma_web_test.bzl | 7 ++----- internal/karma/web_test.bzl | 2 +- package.bzl | 2 ++ 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/devmode_consumer/devmode_consumer.bzl b/examples/devmode_consumer/devmode_consumer.bzl index 0d29ca92..b23a4b42 100644 --- a/examples/devmode_consumer/devmode_consumer.bzl +++ b/examples/devmode_consumer/devmode_consumer.bzl @@ -15,7 +15,7 @@ """Example of a rule that requires es2015 (devmode) inputs. """ -load("@build_bazel_rules_nodejs//internal:node.bzl", "sources_aspect") +load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") def _devmode_consumer(ctx): files = depset() diff --git a/examples/es6_output/es6_consumer.bzl b/examples/es6_output/es6_consumer.bzl index 2e4e824f..16726baf 100644 --- a/examples/es6_output/es6_consumer.bzl +++ b/examples/es6_output/es6_consumer.bzl @@ -15,7 +15,7 @@ """Example of a rule that requires ES6 inputs. """ -load("@build_bazel_rules_nodejs//internal:collect_es6_sources.bzl", "collect_es6_sources") +load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources") def _es6_consumer(ctx): es6_sources = collect_es6_sources(ctx) diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index 0667c98f..3fd9519e 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -14,6 +14,7 @@ "Simple development server" +load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") load( "@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim", @@ -22,10 +23,6 @@ load( "@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "html_asset_inject", ) -load( - "@build_bazel_rules_nodejs//internal:node.bzl", - "sources_aspect", -) def _ts_devserver(ctx): files = depset() diff --git a/internal/karma/karma_web_test.bzl b/internal/karma/karma_web_test.bzl index 28526d73..b1bab2d5 100644 --- a/internal/karma/karma_web_test.bzl +++ b/internal/karma/karma_web_test.bzl @@ -13,12 +13,9 @@ # limitations under the License. "Unit testing with Karma" +load("@build_bazel_rules_nodejs//internal/common:expand_into_runfiles.bzl", "expand_path_into_runfiles") +load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim") -load( - "@build_bazel_rules_nodejs//internal:node.bzl", - "expand_path_into_runfiles", - "sources_aspect", -) load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") load(":web_test.bzl", "COMMON_WEB_TEST_ATTRS") diff --git a/internal/karma/web_test.bzl b/internal/karma/web_test.bzl index b40d4e08..7ebb58b2 100644 --- a/internal/karma/web_test.bzl +++ b/internal/karma/web_test.bzl @@ -13,7 +13,7 @@ # limitations under the License. "Common web_test attributes" -load("@build_bazel_rules_nodejs//internal:node.bzl", "sources_aspect") +load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") # Attributes shared by any web_test rule (ts_web_test, karma_web_test, protractor_web_test) COMMON_WEB_TEST_ATTRS = { diff --git a/package.bzl b/package.bzl index ab74c671..a0746fe3 100644 --- a/package.bzl +++ b/package.bzl @@ -31,6 +31,8 @@ def rules_typescript_dev_dependencies(): These are in this file to keep version information in one place, and make the WORKSPACE shorter. + + Also this allows other repos to reference our sources with local_repository and install the needed deps. """ _maybe( From ff7e3ee4ae3ed98ee20b5cee609cbe6448b6a99c Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 7 Feb 2019 13:41:57 -0800 Subject: [PATCH 089/316] rel: 0.24.0 --- README.md | 4 ++-- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 93d21e94..3ee4c160 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.3", - "@bazel/karma": "0.23.3", + "@bazel/typescript": "0.24.0", + "@bazel/karma": "0.24.0", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index acb4497a..5f821778 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.23.3") +check_rules_typescript_version(version_string = "0.24.0") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index 6fc1cd9c..f416c522 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.23.3", + "version": "0.24.0", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 50cee429..2584db80 100644 --- a/version.bzl +++ b/version.bzl @@ -17,12 +17,12 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.23.3" +VERSION = "0.24.0" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for # releases with breaking changes and/or new features. -COMPAT_VERSION = "0.23.0" +COMPAT_VERSION = "0.24.0" def check_rules_typescript_version(version_string): """ From b1f3bdecddce3005d7b4cb23c03c32e08fe17549 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 8 Feb 2019 18:26:51 +0000 Subject: [PATCH 090/316] Check existing dependencies for ambient module declarations. PiperOrigin-RevId: 233083308 --- README.md | 4 +-- WORKSPACE | 2 +- package.json | 2 +- ts_auto_deps/analyze/analyze.go | 53 +++++++++++++++++++++++++++++---- version.bzl | 4 +-- 5 files changed, 53 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 3ee4c160..93d21e94 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.24.0", - "@bazel/karma": "0.24.0", + "@bazel/typescript": "0.23.3", + "@bazel/karma": "0.23.3", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 5f821778..acb4497a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.24.0") +check_rules_typescript_version(version_string = "0.23.3") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index f416c522..6fc1cd9c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.24.0", + "version": "0.23.3", "keywords": [ "typescript", "bazel" diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 644110a2..0960b579 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path/filepath" + "regexp" "strings" "github.com/bazelbuild/buildtools/edit" @@ -327,7 +328,7 @@ func (a *Analyzer) resolveImports(ctx context.Context, currentPkg, root string, continue handlingImports } } - d, err := a.findRuleProvidingImport(target.dependencies, imp) + d, err := a.findExistingDepProvidingImport(ctx, target.dependencies, imp) if err != nil { return err } @@ -368,22 +369,27 @@ func pathWithExtensions(basename string) []string { return paths } -// findRuleProvidingImport looks through a map of loaded rules for a rule -// which can provide the passed import. +var ambientModuleDeclRE = regexp.MustCompile("(?m)^\\s*declare\\s+module\\s+['\"]([^'\"]+)['\"]\\s+\\{") + +// findExistingDepProvidingImport looks through a map of the existing deps to +// see if any of them provide the import in a way that can't be queried +// for. E.g. if the build rule has a "module_name" attribute or if one +// of the .d.ts sources has an ambient module declaration. // // If the import already has a knownTarget, findRuleProvidingImport will // return the knownTarget. -func (a *Analyzer) findRuleProvidingImport(rules map[string]*appb.Rule, i *ts_auto_depsImport) (string, error) { +func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, rules map[string]*appb.Rule, i *ts_auto_depsImport) (string, error) { if i.knownTarget != "" { return i.knownTarget, nil } + + // check if any of the existing deps declare a module_name that matches the import for _, r := range rules { moduleName := stringAttribute(r, "module_name") if moduleName == "" { continue } - srcs := listAttribute(r, "srcs") - for _, src := range srcs { + for _, src := range listAttribute(r, "srcs") { _, _, file := edit.ParseLabel(src) moduleImportPath := moduleName + "/" + stripTSExtension(file) if i.importPath == moduleImportPath || i.importPath == strings.TrimSuffix(moduleImportPath, "/index") { @@ -391,6 +397,41 @@ func (a *Analyzer) findRuleProvidingImport(rules map[string]*appb.Rule, i *ts_au } } } + + // check if any of the existing deps have .d.ts sources which have ambient module + // declarations + for _, r := range rules { + for _, src := range listAttribute(r, "srcs") { + filepath := labelToPath(src) + if !strings.HasSuffix(filepath, ".d.ts") { + continue + } + + contents, err := platform.ReadFile(ctx, filepath) + if err != nil { + return "", fmt.Errorf("error reading file lookinf for ambient module decls: %s", err) + } + + matches := ambientModuleDeclRE.FindAllStringSubmatch(string(contents), -1) + + // put all the ambient modules into a set + declaredModules := make(map[string]bool) + for _, match := range matches { + declaredModules[match[1]] = true + } + + // remove all the modules that were imported (ie all the modules that + // were being augmented/re-opened) + for _, mi := range parseImports(filepath, contents) { + delete(declaredModules, mi.importPath) + } + + if declaredModules[i.importPath] { + debugf("found import %s in ambient module declaration in %s", i.importPath, r.GetName()) + return r.GetName(), nil + } + } + } return "", nil } diff --git a/version.bzl b/version.bzl index 2584db80..50cee429 100644 --- a/version.bzl +++ b/version.bzl @@ -17,12 +17,12 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.24.0" +VERSION = "0.23.3" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for # releases with breaking changes and/or new features. -COMPAT_VERSION = "0.24.0" +COMPAT_VERSION = "0.23.0" def check_rules_typescript_version(version_string): """ From 8899fc82dcfe167516c3af2fc3e6ad84fca44ca3 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 8 Feb 2019 18:28:37 +0000 Subject: [PATCH 091/316] Improve handling of import paths versus file paths. There isn't a one to one mapping of ts import paths to file paths. A import path of "google3/foo/bar" could be from "foo/bar.ts" or "foo/bar.d.ts" or foo/bar/index.ts" or several others. The query-based analyzer has to issue a query looking for all the possible files for an import, then match the files found to the import path. This cl improves the matching from found files back to import paths by consistently using a single function to generate all the possibilities, and matching against all of them, instead of trying to normalize a file path back into an import path. Fixes a bug where the query based analyzer couldn't find an import that was both named index and an ngsummary. PiperOrigin-RevId: 233083622 --- ts_auto_deps/analyze/loader.go | 51 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index ab82fcea..4b509caa 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -132,6 +132,25 @@ func labelCacheKey(currentPkg, label string) string { return currentPkg + "^" + label } +// possibleFilepaths generates the possible filepaths for the ts import path. +// e.g. google3/foo/bar could be foo/bar.ts or foo/bar.d.ts or foo/bar/index.ts, etc. +// Also handles special angular import paths (.ngfactory and .ngsummary). +func possibleFilepaths(importPath string) []string { + // If the path has a suffix of ".ngfactory" or ".ngsummary", it might + // be an Angular AOT generated file. We can infer the target as we + // infer its corresponding ngmodule target by simply stripping the + // ".ngfactory" / ".ngsummary" suffix + importPath = strings.TrimSuffix(strings.TrimSuffix(importPath, ".ngsummary"), ".ngfactory") + importPath = strings.TrimPrefix(importPath, workspace.Name()+"/") + + var possiblePaths []string + + possiblePaths = append(possiblePaths, pathWithExtensions(importPath)...) + possiblePaths = append(possiblePaths, pathWithExtensions(filepath.Join(importPath, "index"))...) + + return possiblePaths +} + // LoadImportPaths uses Bazel Query to load targets associated with import // paths from BUILD files. func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg, workspaceRoot string, paths []string) (map[string]*appb.Rule, error) { @@ -150,15 +169,9 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg if _, ok := addedPaths[path]; !ok { addedPaths[path] = true - // If the path has a suffix of ".ngfactory" or ".ngsummary", it might - // be an Angular AOT generated file. We can infer the target as we - // infer its corresponding ngmodule target by simply stripping the - // ".ngfactory" / ".ngsummary" suffix - path = strings.TrimSuffix(strings.TrimSuffix(path, ".ngsummary"), ".ngfactory") - path = strings.TrimPrefix(path, workspace.Name()+"/") - - possiblePaths = append(possiblePaths, pathWithExtensions(path)...) - possiblePaths = append(possiblePaths, pathWithExtensions(filepath.Join(path, "index"))...) + // there isn't a one to one mapping from ts import paths to file + // paths, so look for all the possible file paths + possiblePaths = append(possiblePaths, possibleFilepaths(path)...) } } } @@ -190,7 +203,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg } } - labelToRule := make(map[string]*appb.Rule) + filepathToRule := make(map[string]*appb.Rule) // load all the rules with file srcs (either literal or generated) sourceLabelToRule, err := q.loadRulesWithSources(workspaceRoot, fileLabels) @@ -198,7 +211,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg return nil, err } for label, rule := range sourceLabelToRule { - labelToRule[label] = rule + filepathToRule[labelToPath(label)] = rule } // load all the rules with generator rule srcs @@ -208,20 +221,14 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg } for label, rule := range generatorLabelToRule { for _, generated := range generatorsToFiles[label] { - labelToRule[generated.GetName()] = rule + filepathToRule[labelToPath(generated.GetName())] = rule } } - for label, rule := range labelToRule { - _, pkg, file := edit.ParseLabel(label) - // Trim "/index" suffixes that were added to path in the queries above. - pathWithoutExtension := strings.TrimSuffix(filepath.Join(pkg, stripTSExtension(file)), string(filepath.Separator)+"index") - for _, path := range paths { - if pathWithoutExtension == strings.TrimSuffix(path, string(filepath.Separator)+"index") { - results[path] = rule - } else if pathWithoutExtension == strings.TrimSuffix(path, ".ngsummary") { - results[path] = rule - } else if pathWithoutExtension == strings.TrimSuffix(path, ".ngfactory") { + for _, path := range paths { + // check all the possible file paths for the import path + for _, fp := range possibleFilepaths(path) { + if rule, ok := filepathToRule[fp]; ok { results[path] = rule } } From dffa7a22161a8917742940706a8936651a1a1f00 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 8 Feb 2019 19:53:07 +0000 Subject: [PATCH 092/316] fix: devserver not working on windows refactor: remove unnecessary runfile stat Closes #385 PiperOrigin-RevId: 233100030 --- .bazelci/presubmit.yml | 2 - devserver/devserver/devserver.go | 38 +++++----- devserver/main.go | 31 ++++++--- devserver/runfile-filesystem.go | 4 +- devserver/runfiles/runfiles.go | 4 +- internal/devserver/BUILD | 1 + internal/devserver/launcher_template.sh | 59 ++++++++++++++++ internal/devserver/ts_devserver.bzl | 93 +++++++++++++++---------- 8 files changed, 162 insertions(+), 70 deletions(-) create mode 100644 internal/devserver/launcher_template.sh diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index f587cc91..5b60a2c2 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -52,6 +52,4 @@ platforms: - "--action_env=PATH" - "--test_env=PATH" test_targets: - - "--" - "..." - - "-//devserver/devserver:go_default_test" diff --git a/devserver/devserver/devserver.go b/devserver/devserver/devserver.go index 47489080..9bd3a866 100644 --- a/devserver/devserver/devserver.go +++ b/devserver/devserver/devserver.go @@ -97,13 +97,7 @@ func (w *headerSuppressorResponseWriter) WriteHeader(code int) {} func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) http.HandlerFunc { // We want to add the root runfile path because by default developers should be able to request // runfiles through their absolute manifest path (e.g. "my_workspace_name/src/file.css") - // We use the empty string package because of the different algorithm for - // file resolution used internally and externally. - pkgPaths := dirHTTPFileSystem{[]string{"./"}, base} - for _, pkg := range pkgs { - pkgPaths.files = append(pkgPaths.files, pathReplacer.Replace(pkg)) - } - pkgPaths.files = append(pkgPaths.files, base) + pkgPaths := dirHTTPFileSystem{append(pkgs, "./"), base} fileHandler := http.FileServer(pkgPaths).ServeHTTP @@ -127,8 +121,8 @@ func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) userIndexFile, err := runfiles.Runfile(base, pathReplacer.Replace(filepath.Join(pkg, "index.html"))) // In case the potential user index file couldn't be found in the runfiles, - // just continue searching. - if _, statErr := os.Stat(userIndexFile); err != nil || statErr != nil { + // continue searching within other packages. + if err != nil { continue } @@ -175,34 +169,40 @@ func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) // dirHTTPFileSystem implements http.FileSystem by looking in the list of dirs one after each other. type dirHTTPFileSystem struct { - files []string + packageDirs []string base string } func (fs dirHTTPFileSystem) Open(name string) (http.File, error) { - for _, packageName := range fs.files { - filePackageName := filepath.Join(packageName, name) - realFilePath, err := runfiles.Runfile(fs.base, filePackageName) - stat, statErr := os.Stat(realFilePath) + for _, packageName := range fs.packageDirs { + manifestFilePath := filepath.Join(packageName, name) + realFilePath, err := runfiles.Runfile(fs.base, manifestFilePath) - if err != nil || statErr != nil { + if err != nil { // In case the runfile could not be found, we also need to check that the requested // path does not refer to a directory containing an "index.html" file. This can // happen if Bazel runs without runfile symlinks, where only files can be resolved // from the manifest. In that case we dirty check if there is a "index.html" file. - realFilePath, err = runfiles.Runfile(fs.base, filepath.Join(filePackageName, "index.html")) + realFilePath, err = runfiles.Runfile(fs.base, filepath.Join(manifestFilePath, "index.html")) - // Continue searching if the runfile couldn't be found for the request filed. - if _, statErr := os.Stat(realFilePath); err != nil || statErr != nil { + // Continue searching if the runfile couldn't be found for the requested file. + if err != nil { continue } } + stat, err := os.Stat(realFilePath) + if err != nil { + // This should actually never happen because runfiles resolved through the runfile helpers + // should always exist. Just in order to properly handle the error, we add this error handling. + return nil, fmt.Errorf("could not read runfile %s", manifestFilePath) + } + // In case the resolved file resolves to a directory. This can only happen if // Bazel runs with symlinked runfiles (e.g. on MacOS, linux). In that case, we // just look for a index.html in the directory. if stat.IsDir() { - realFilePath, err = runfiles.Runfile(fs.base, filepath.Join(filePackageName, "index.html")) + realFilePath, err = runfiles.Runfile(fs.base, filepath.Join(manifestFilePath, "index.html")) // In case the index.html file of the requested directory couldn't be found, // we just continue searching. diff --git a/devserver/main.go b/devserver/main.go index 29c224b7..7b0a2a0c 100644 --- a/devserver/main.go +++ b/devserver/main.go @@ -8,15 +8,17 @@ import ( "io/ioutil" "net/http" "os" - "path/filepath" "strings" "github.com/bazelbuild/rules_typescript/devserver/concatjs" "github.com/bazelbuild/rules_typescript/devserver/devserver" + "github.com/bazelbuild/rules_typescript/devserver/runfiles" ) var ( port = flag.Int("port", 5432, "server port to listen on") + // The "base" CLI flag is only kept because within Google3 because removing would be a breaking change due to + // ConcatJS and "devserver/devserver.go" still respecting the specified base flag. base = flag.String("base", "", "server base (required, runfiles of the binary)") pkgs = flag.String("packages", "", "root package(s) to serve, comma-separated") manifest = flag.String("manifest", "", "sources manifest (.MF)") @@ -28,23 +30,30 @@ var ( func main() { flag.Parse() - if *base == "" || len(*pkgs) == 0 || (*manifest == "") || (*scriptsManifest == "") { + if len(*pkgs) == 0 || (*manifest == "") || (*scriptsManifest == "") { fmt.Fprintf(os.Stderr, "Required argument not set\n") os.Exit(1) } - if _, err := os.Stat(*base); err != nil { - fmt.Fprintf(os.Stderr, "Cannot read server base %s: %v\n", *base, err) + manifestPath, err := runfiles.Runfile(*base, *scriptsManifest) + + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to find scripts_manifest in runfiles: %v\n", err) os.Exit(1) } - scriptsManifestPath := filepath.Join(*base, *scriptsManifest) - scriptFiles, err := manifestFiles(scriptsManifestPath) + scriptFiles, err := manifestFiles(manifestPath) if err != nil { fmt.Fprintf(os.Stderr, "Failed to read scripts_manifest: %v\n", err) os.Exit(1) } + if !strings.HasPrefix(*servingPath, "/") { + fmt.Fprintf(os.Stderr, "The specified serving_path does not start with a slash. "+ + "This causes the serving path to not have any effect.\n") + os.Exit(1) + } + preScripts := make([]string, 0, 100) postScripts := make([]string, 0, 1) @@ -76,7 +85,12 @@ func main() { // the requirejs script which is added to scriptFiles by the devserver // skylark rule. for _, v := range scriptFiles { - js, err := loadScript(filepath.Join(*base, v)) + runfile, err := runfiles.Runfile(*base, v) + if err != nil { + fmt.Fprintf(os.Stderr, "Could not find runfile %s, got error %s", v, err) + } + + js, err := loadScript(runfile) if err != nil { fmt.Fprintf(os.Stderr, "Failed to read script %s: %v\n", v, err) } else { @@ -90,7 +104,8 @@ func main() { postScripts = append(postScripts, fmt.Sprintf("require([\"%s\"]);", *entryModule)) } - http.Handle(*servingPath, concatjs.ServeConcatenatedJS(*manifest, *base, preScripts, postScripts, nil /* realFileSystem */)) + http.Handle(*servingPath, concatjs.ServeConcatenatedJS(*manifest, *base, preScripts, postScripts, + &RunfileFileSystem{})) pkgList := strings.Split(*pkgs, ",") http.HandleFunc("/", devserver.CreateFileHandler(*servingPath, *manifest, pkgList, *base)) diff --git a/devserver/runfile-filesystem.go b/devserver/runfile-filesystem.go index 3f99c2f3..090ded64 100644 --- a/devserver/runfile-filesystem.go +++ b/devserver/runfile-filesystem.go @@ -30,6 +30,6 @@ func (fs *RunfileFileSystem) ReadFile(filename string) ([]byte, error) { // ResolvePath resolves the specified path within a given root using Bazel's runfile resolution. // This is necessary because on Windows, runfiles are not symlinked and need to be // resolved using the runfile manifest file. -func (fs *RunfileFileSystem) ResolvePath(root string, file string) (string, error) { - return runfiles.Runfile(root, file) +func (fs *RunfileFileSystem) ResolvePath(root string, manifestFilePath string) (string, error) { + return runfiles.Runfile(root, manifestFilePath) } diff --git a/devserver/runfiles/runfiles.go b/devserver/runfiles/runfiles.go index 1d03448e..cff9accb 100644 --- a/devserver/runfiles/runfiles.go +++ b/devserver/runfiles/runfiles.go @@ -4,7 +4,7 @@ package runfiles import "github.com/bazelbuild/rules_go/go/tools/bazel" // Runfile returns the base directory to the bazel runfiles -func Runfile(_ string, path string) (string, error) { - return bazel.Runfile(path) +func Runfile(_base string, manifestPath string) (string, error) { + return bazel.Runfile(manifestPath) } diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD index d6e97331..2dfa86be 100644 --- a/internal/devserver/BUILD +++ b/internal/devserver/BUILD @@ -19,6 +19,7 @@ package(default_visibility = [ ]) exports_files([ + "launcher_template.sh", # Exported to be consumed for generating skydoc. "ts_devserver.bzl", ]) diff --git a/internal/devserver/launcher_template.sh b/internal/devserver/launcher_template.sh new file mode 100644 index 00000000..13722a99 --- /dev/null +++ b/internal/devserver/launcher_template.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +# --- begin runfiles.bash initialization --- +# Source the runfiles library: +# https://github.com/bazelbuild/bazel/blob/master/tools/bash/runfiles/runfiles.bash +# The runfiles library defines rlocation, which is a platform independent function +# used to lookup the runfiles locations. This code snippet is needed at the top +# of scripts that use rlocation to lookup the location of runfiles.bash and source it +if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then + if [[ -f "$0.runfiles_manifest" ]]; then + export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest" + elif [[ -f "$0.runfiles/MANIFEST" ]]; then + export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST" + elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then + export RUNFILES_DIR="$0.runfiles" + fi +fi +if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then + source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash" +elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then + source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \ + "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)" +else + echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash" + exit 1 +fi +# --- end runfiles.bash initialization --- + + +readonly main=$(rlocation "TEMPLATED_main") +readonly manifest=$(rlocation "TEMPLATED_manifest") +readonly scripts_manifest=$(rlocation "TEMPLATED_scripts_manifest") + +# Workaround for https://github.com/bazelbuild/bazel/issues/6764 +# If this issue is incorporated into Bazel, the workaround here should be removed. +MSYS2_ARG_CONV_EXCL="*" "${main}" \ + -packages=TEMPLATED_packages \ + -serving_path=TEMPLATED_serving_path \ + -entry_module=TEMPLATED_entry_module \ + -port=TEMPLATED_port \ + -manifest="${manifest}" \ + -scripts_manifest="${scripts_manifest}" \ + "$@" diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index 3fd9519e..fe377ecc 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -24,6 +24,14 @@ load( "html_asset_inject", ) +# Helper function to convert a short path to a path that is +# found in the MANIFEST file. +def _short_path_to_manifest_path(ctx, short_path): + if short_path.startswith("../"): + return short_path[3:] + else: + return ctx.workspace_name + "/" + short_path + def _ts_devserver(ctx): files = depset() for d in ctx.attr.deps: @@ -52,7 +60,7 @@ def _ts_devserver(ctx): amd_names_shim = ctx.actions.declare_file( "_%s.amd_names_shim.js" % ctx.label.name, - sibling = ctx.outputs.executable, + sibling = ctx.outputs.script, ) write_amd_names_shim(ctx.actions, amd_names_shim, ctx.attr.bootstrap) @@ -76,6 +84,7 @@ def _ts_devserver(ctx): ] devserver_runfiles += ctx.files.static_files devserver_runfiles += script_files + devserver_runfiles += ctx.files._bash_runfile_helpers if ctx.file.index_html: injected_index = ctx.actions.declare_file("index.html") @@ -96,37 +105,24 @@ def _ts_devserver(ctx): ) devserver_runfiles += [injected_index] - serving_arg = "" - if ctx.attr.serving_path: - serving_arg = "-serving_path=%s" % ctx.attr.serving_path - packages = depset(["/".join([workspace_name, ctx.label.package])] + ctx.attr.additional_root_paths) - # FIXME: more bash dependencies makes Windows support harder - ctx.actions.write( - output = ctx.outputs.executable, + ctx.actions.expand_template( + template = ctx.file._launcher_template, + output = ctx.outputs.script, + substitutions = { + "TEMPLATED_entry_module": ctx.attr.entry_module, + "TEMPLATED_main": _short_path_to_manifest_path(ctx, ctx.executable._devserver.short_path), + "TEMPLATED_manifest": _short_path_to_manifest_path(ctx, ctx.outputs.manifest.short_path), + "TEMPLATED_packages": ",".join(packages.to_list()), + "TEMPLATED_port": str(ctx.attr.port), + "TEMPLATED_scripts_manifest": _short_path_to_manifest_path(ctx, ctx.outputs.scripts_manifest.short_path), + "TEMPLATED_serving_path": ctx.attr.serving_path if ctx.attr.serving_path else "", + "TEMPLATED_workspace": workspace_name, + }, is_executable = True, - content = """#!/bin/sh -RUNFILES="$PWD/.." -{main} {serving_arg} \ - -base="$RUNFILES" \ - -packages={packages} \ - -manifest={workspace}/{manifest} \ - -scripts_manifest={workspace}/{scripts_manifest} \ - -entry_module={entry_module} \ - -port={port} \ - "$@" -""".format( - main = ctx.executable._devserver.short_path, - serving_arg = serving_arg, - workspace = workspace_name, - packages = ",".join(packages.to_list()), - manifest = ctx.outputs.manifest.short_path, - scripts_manifest = ctx.outputs.scripts_manifest.short_path, - entry_module = ctx.attr.entry_module, - port = str(ctx.attr.port), - ), ) + return [DefaultInfo( runfiles = ctx.runfiles( files = devserver_runfiles, @@ -191,6 +187,7 @@ ts_devserver = rule( allow_files = True, aspects = [sources_aspect], ), + "_bash_runfile_helpers": attr.label(default = Label("@bazel_tools//tools/bash/runfiles")), "_devserver": attr.label( # For local development in rules_typescript, we build the devserver from sources. # This requires that we have the go toolchain available. @@ -206,33 +203,52 @@ ts_devserver = rule( executable = True, cfg = "host", ), + "_launcher_template": attr.label(allow_single_file = True, default = Label("//internal/devserver:launcher_template.sh")), "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//node_modules/requirejs:require.js")), }, outputs = { "manifest": "%{name}.MF", + "script": "%{name}.sh", "scripts_manifest": "scripts_%{name}.MF", }, - executable = True, ) """ts_devserver is a simple development server intended for a quick "getting started" experience. Additional documentation at https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel """ -def ts_devserver_macro(tags = [], **kwargs): - """ibazel wrapper for `ts_devserver` - - This macro re-exposes the `ts_devserver` rule with some extra tags so that - it behaves correctly under ibazel. +def ts_devserver_macro(name, data = [], args = [], visibility = None, tags = [], testonly = 0, **kwargs): + """Macro for creating a `ts_devserver` + This macro re-exposes a `sh_binary` and `ts_devserver` target that can run the + actual devserver implementation. + The `ts_devserver` rule is just responsible for generating a launcher script + that runs the Go devserver implementation. The `sh_binary` is the primary + target that matches the specified "name" and executes the generated bash + launcher script. This is re-exported in `//:defs.bzl` as `ts_devserver` so if you load the rule from there, you actually get this macro. - Args: - tags: standard Bazel tags, this macro adds a couple for ibazel + name: Name of the devserver target + data: Runtime dependencies for the devserver + args: Command line arguments that will be passed to the devserver Go implementation + visibility: Visibility of the devserver targets + tags: Standard Bazel tags, this macro adds a couple for ibazel + testonly: Whether the devserver should only run in `bazel test` **kwargs: passed through to `ts_devserver` """ ts_devserver( + name = "%s_launcher" % name, + data = data + ["@bazel_tools//tools/bash/runfiles"], + testonly = testonly, + visibility = ["//visibility:private"], + tags = tags, + **kwargs + ) + + native.sh_binary( + name = name, + args = args, # Users don't need to know that these tags are required to run under ibazel tags = tags + [ # Tell ibazel not to restart the devserver when its deps change. @@ -241,5 +257,8 @@ def ts_devserver_macro(tags = [], **kwargs): # this program. "ibazel_live_reload", ], - **kwargs + srcs = ["%s_launcher.sh" % name], + data = [":%s_launcher" % name], + testonly = testonly, + visibility = visibility, ) From c691955e946e99fc19de7e14ffdb412e28fa4cb2 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Fri, 8 Feb 2019 12:48:59 -0800 Subject: [PATCH 093/316] Update to rules_nodejs 0.18.2 Closes #408 PiperOrigin-RevId: 233109259 --- README.md | 7 +++---- WORKSPACE | 2 +- internal/e2e/npm_packages/karma/WORKSPACE | 3 +-- internal/e2e/npm_packages/karma_stack_trace/WORKSPACE | 3 +-- internal/e2e/npm_packages/karma_typescript/WORKSPACE | 3 +-- internal/e2e/npm_packages/ts_auto_deps/WORKSPACE | 3 +-- internal/e2e/npm_packages/ts_devserver/WORKSPACE | 3 +-- internal/e2e/npm_packages/typescript_2.7/WORKSPACE | 3 +-- internal/e2e/npm_packages/typescript_2.8/WORKSPACE | 3 +-- internal/e2e/npm_packages/typescript_2.9/WORKSPACE | 3 +-- internal/e2e/npm_packages/typescript_3.0/WORKSPACE | 3 +-- internal/e2e/npm_packages/typescript_3.1/WORKSPACE | 3 +-- internal/karma/package.bzl | 3 +-- package.bzl | 4 ++-- package.json | 2 +- version.bzl | 4 ++-- 16 files changed, 20 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 93d21e94..76ca1e3a 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.23.3", - "@bazel/karma": "0.23.3", + "@bazel/typescript": "0.24.0", + "@bazel/karma": "0.24.0", ... }, ... @@ -49,8 +49,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch rules_nodejs http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], - strip_prefix = "rules_nodejs-0.16.8", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) # Setup the NodeJS toolchain diff --git a/WORKSPACE b/WORKSPACE index acb4497a..5f821778 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.23.3") +check_rules_typescript_version(version_string = "0.24.0") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE index 5a409ea8..56e31178 100644 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index 03bfe1ea..3b01b546 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index 83983637..ddbf4ca5 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE index a4662d5b..62145df9 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE +++ b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/ts_devserver/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE index dc13223b..09359802 100644 --- a/internal/e2e/npm_packages/ts_devserver/WORKSPACE +++ b/internal/e2e/npm_packages/ts_devserver/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE index d3abdb37..34d2587b 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE index 54038640..576c9e1b 100644 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE index 2ce03cdb..0a445c94 100644 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE index 1fb00c1d..2d7f5770 100644 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE index 1fb00c1d..2d7f5770 100644 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -18,8 +18,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/karma/package.bzl b/internal/karma/package.bzl index 564cb3c9..b99e1d1a 100644 --- a/internal/karma/package.bzl +++ b/internal/karma/package.bzl @@ -29,8 +29,7 @@ def rules_karma_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.bzl b/package.bzl index a0746fe3..dcdfde87 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.16.8", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.8.zip"], + strip_prefix = "rules_nodejs-0.18.2", + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.18.2.zip"], ) # For running skylint diff --git a/package.json b/package.json index 6fc1cd9c..f416c522 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.23.3", + "version": "0.24.0", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 50cee429..2584db80 100644 --- a/version.bzl +++ b/version.bzl @@ -17,12 +17,12 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.23.3" +VERSION = "0.24.0" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for # releases with breaking changes and/or new features. -COMPAT_VERSION = "0.23.0" +COMPAT_VERSION = "0.24.0" def check_rules_typescript_version(version_string): """ From a4a2b3aef8c4f8dfb677c316077e28f513a48942 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 8 Feb 2019 13:35:15 -0800 Subject: [PATCH 094/316] Update to latest rules_nodejs Closes #413 Closes #410 PiperOrigin-RevId: 233117208 --- README.md | 4 +++- internal/devserver/BUILD | 1 + internal/e2e/npm_packages/karma/WORKSPACE | 3 ++- internal/e2e/npm_packages/karma_stack_trace/WORKSPACE | 3 ++- internal/e2e/npm_packages/karma_typescript/WORKSPACE | 3 ++- internal/e2e/npm_packages/ts_auto_deps/WORKSPACE | 3 ++- internal/e2e/npm_packages/ts_devserver/WORKSPACE | 3 ++- internal/e2e/npm_packages/typescript_2.7/WORKSPACE | 3 ++- internal/e2e/npm_packages/typescript_2.8/WORKSPACE | 3 ++- internal/e2e/npm_packages/typescript_2.9/WORKSPACE | 3 ++- internal/e2e/npm_packages/typescript_3.0/WORKSPACE | 3 ++- internal/e2e/npm_packages/typescript_3.1/WORKSPACE | 3 ++- internal/karma/package.bzl | 3 ++- package.bzl | 4 ++-- 14 files changed, 28 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 76ca1e3a..1cbe6ab1 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,11 @@ containing: load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch rules_nodejs +# (you can check https://github.com/bazelbuild/rules_nodejs for a newer release than this) http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) # Setup the NodeJS toolchain diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD index 2dfa86be..25b03e15 100644 --- a/internal/devserver/BUILD +++ b/internal/devserver/BUILD @@ -33,6 +33,7 @@ filegroup( name = "npm_package_assets", srcs = [ "BUILD", + "launcher_template.sh", "package.json", "ts_devserver.bzl", "yarn.lock", diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE index 56e31178..7898a78f 100644 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index 3b01b546..538809e7 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index ddbf4ca5..96a736cf 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE index 62145df9..a73ab0f2 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE +++ b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/ts_devserver/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE index 09359802..b5524760 100644 --- a/internal/e2e/npm_packages/ts_devserver/WORKSPACE +++ b/internal/e2e/npm_packages/ts_devserver/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE index 34d2587b..0d7b73f4 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE index 576c9e1b..12eba137 100644 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE index 0a445c94..d0b4e905 100644 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE index 2d7f5770..b27f0767 100644 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE index 2d7f5770..b27f0767 100644 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -18,7 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/karma/package.bzl b/internal/karma/package.bzl index b99e1d1a..94a216c1 100644 --- a/internal/karma/package.bzl +++ b/internal/karma/package.bzl @@ -29,7 +29,8 @@ def rules_karma_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.2/rules_nodejs-0.18.2.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.bzl b/package.bzl index dcdfde87..2a28acb4 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - strip_prefix = "rules_nodejs-0.18.2", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.18.2.zip"], + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], + sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", ) # For running skylint From 95be3953e00ca94d466aab2bb60e5e4cccdcacbd Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 8 Feb 2019 13:38:33 -0800 Subject: [PATCH 095/316] rel: 0.24.1 --- README.md | 4 ++-- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1cbe6ab1..e228827d 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.24.0", - "@bazel/karma": "0.24.0", + "@bazel/typescript": "0.24.1", + "@bazel/karma": "0.24.1", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 5f821778..2f8b991a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.24.0") +check_rules_typescript_version(version_string = "0.24.1") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index f416c522..99086250 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.24.0", + "version": "0.24.1", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 2584db80..1f975616 100644 --- a/version.bzl +++ b/version.bzl @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.24.0" +VERSION = "0.24.1" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for From e5e66f0a14c51d000f18ede706f8836deef96f45 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 11 Feb 2019 09:37:25 -0800 Subject: [PATCH 096/316] Update to rules_nodejs 0.18.5 Closes #414 PiperOrigin-RevId: 233423330 --- README.md | 4 ++-- internal/e2e/npm_packages/karma/WORKSPACE | 4 ++-- internal/e2e/npm_packages/karma_stack_trace/WORKSPACE | 4 ++-- internal/e2e/npm_packages/karma_typescript/WORKSPACE | 4 ++-- internal/e2e/npm_packages/ts_auto_deps/WORKSPACE | 4 ++-- internal/e2e/npm_packages/ts_devserver/WORKSPACE | 4 ++-- internal/e2e/npm_packages/typescript_2.7/WORKSPACE | 4 ++-- internal/e2e/npm_packages/typescript_2.8/WORKSPACE | 4 ++-- internal/e2e/npm_packages/typescript_2.9/WORKSPACE | 4 ++-- internal/e2e/npm_packages/typescript_3.0/WORKSPACE | 4 ++-- internal/e2e/npm_packages/typescript_3.1/WORKSPACE | 4 ++-- internal/karma/package.bzl | 4 ++-- package.bzl | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index e228827d..c8082c36 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # (you can check https://github.com/bazelbuild/rules_nodejs for a newer release than this) http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", ) # Setup the NodeJS toolchain diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE index 7898a78f..6545390f 100644 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index 538809e7..20b5d217 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index 96a736cf..07b71008 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE index a73ab0f2..be2a4dbd 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE +++ b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/ts_devserver/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE index b5524760..703cac1a 100644 --- a/internal/e2e/npm_packages/ts_devserver/WORKSPACE +++ b/internal/e2e/npm_packages/ts_devserver/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE index 0d7b73f4..7cdc6949 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE index 12eba137..ca44e458 100644 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE index d0b4e905..5631a125 100644 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE index b27f0767..6a741b68 100644 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE index b27f0767..6a741b68 100644 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], ) load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") diff --git a/internal/karma/package.bzl b/internal/karma/package.bzl index 94a216c1..1d0832cc 100644 --- a/internal/karma/package.bzl +++ b/internal/karma/package.bzl @@ -29,8 +29,8 @@ def rules_karma_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", ) # ts_web_test depends on the web testing rules to provision browsers. diff --git a/package.bzl b/package.bzl index 2a28acb4..be88028c 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.4/rules_nodejs-0.18.4.tar.gz"], - sha256 = "23987a5cf549146742aa6a0d2536e4906906e63a608d5b9b32dd9fe5523ef51c", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", ) # For running skylint From 23d4eaf7c8546d04b00ef8acefd8fcd58f536496 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 11 Feb 2019 12:02:11 -0800 Subject: [PATCH 097/316] Define global.gc using v8 and vm modules if needed This allows us to tear down a bunch of complexity related to setting the --expose-gc flag when starting nodejs Closes #415 PiperOrigin-RevId: 233451681 --- BUILD.bazel | 17 +---------------- README.md | 2 -- internal/BUILD.bazel | 1 - internal/build_defs.bzl | 2 +- internal/e2e/default_tsconfig_test.js | 4 ++-- internal/tsc_wrapped/tsc_wrapped.ts | 8 ++++++++ internal/tsc_wrapped/worker.ts | 8 ++++++++ package.json | 3 ++- ts_auto_deps/updater/updater.go | 2 +- 9 files changed, 23 insertions(+), 24 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 09ee44b3..05517305 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -25,7 +25,7 @@ load("@bazel_gazelle//:def.bzl", "gazelle") # END-DEV-ONLY -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") # BEGIN-DEV-ONLY load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") @@ -108,18 +108,3 @@ npm_package( # ) # END-DEV-ONLY -# A nodejs_binary for @bazel/typescript/tsc_wrapped to use by default in -# ts_library that depends on @npm//@bazel/typescript instead of the -# output of the //internal/tsc_wrapped ts_library rule. This -# default is for downstream users that depend on the @bazel/typescript npm -# package. A generated @npm//@bazel/typescript/bin:tsc_wrapped target -# would not work because it does not have the node `--expose-gc` flag -# set which is required to support the call to `global.gc()`. -nodejs_binary( - name = "@bazel/typescript/tsc_wrapped", - data = ["@npm//@bazel/typescript"], - entry_point = "@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js", - install_source_map_support = False, - templated_args = ["--node_options=--expose-gc"], - visibility = ["//visibility:public"], -) diff --git a/README.md b/README.md index c8082c36..074475b8 100644 --- a/README.md +++ b/README.md @@ -140,8 +140,6 @@ filegroup( nodejs_binary( name = "@bazel/typescript/tsc_wrapped", entry_point = "@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js", - # The --expose-gc node option is required for tsc_wrapped - templated_args = ["--node_options=--expose-gc"], # Point bazel to your node_modules to find the entry point node_modules = ["//:node_modules"], ) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 5132aa88..64174550 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -86,7 +86,6 @@ nodejs_binary( "@npm//typescript", ], entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js", - templated_args = ["--node_options=--expose-gc"], visibility = ["//visibility:public"], ) diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl index fb22d2a8..16395468 100644 --- a/internal/build_defs.bzl +++ b/internal/build_defs.bzl @@ -22,7 +22,7 @@ load(":common/compilation.bzl", "COMMON_ATTRIBUTES", "DEPS_ASPECTS", "compile_ts load(":common/tsconfig.bzl", "create_tsconfig") load(":ts_config.bzl", "TsConfigInfo") -_DEFAULT_COMPILER = "@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped" +_DEFAULT_COMPILER = "@npm//@bazel/typescript/bin:tsc_wrapped" def _trim_package_node_modules(package_name): # trim a package name down to its path prior to a node_modules diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index 77115213..a71affd1 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -387,7 +387,7 @@ workspace(name = "a") ${WORKSPACE_BOILERPLATE}`); write('a/BUILD', ` # We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm -# package in this test. This changes the ts_library compiler from the default '@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped' +# package in this test. This changes the ts_library compiler from the default # which depends on @npm//@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") ts_library( @@ -410,7 +410,7 @@ local_repository(name="a", path="../a") ${WORKSPACE_BOILERPLATE}`); write('b/BUILD', ` # We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm -# package in this test. This changes the ts_library compiler from the default '@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped' +# package in this test. This changes the ts_library compiler from the default # which depends on @npm//@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") exports_files(["tsconfig.json"]) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 9aa74738..2062b735 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -15,6 +15,14 @@ import {PLUGIN as strictDepsPlugin} from './strict_deps'; import {BazelOptions, parseTsconfig, resolveNormalizedPath} from './tsconfig'; import {debug, log, runAsWorker, runWorkerLoop} from './worker'; +// Equivalent of running node with --expose-gc +// but easier to write tooling since we don't need to inject that arg to +// nodejs_binary +if (typeof global.gc !== 'function') { + require('v8').setFlagsFromString('--expose_gc'); + global.gc = require('vm').runInNewContext('gc'); +} + /** * Top-level entry point for tsc_wrapped. */ diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 4a102cc0..7e52ba8f 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -4,6 +4,14 @@ const protobufjs = require('protobufjs'); // tslint:disable-next-line:variable-name: ByteBuffer is instantiatable. const ByteBuffer = require('bytebuffer'); +// Equivalent of running node with --expose-gc +// but easier to write tooling since we don't need to inject that arg to +// nodejs_binary +if (typeof global.gc !== 'function') { + require('v8').setFlagsFromString('--expose_gc'); + global.gc = require('vm').runInNewContext('gc'); +} + export const DEBUG = false; export function debug(...args: Array<{}>) { diff --git a/package.json b/package.json index 99086250..8b9df619 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "main": "./internal/tsc_wrapped/index.js", "typings": "./internal/tsc_wrapped/index.d.ts", "bin": { - "ts_auto_deps": "./ts_auto_deps/ts_auto_deps.js" + "ts_auto_deps": "./ts_auto_deps/ts_auto_deps.js", + "tsc_wrapped": "./internal/tsc_wrapped/tsc_wrapped.js" }, "dependencies": { "protobufjs": "5.0.3", diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index f4f9a5e0..44e64929 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -867,7 +867,7 @@ func removeSourcesUsed(bld *build.File, ruleKind, attrName string, srcs srcSet) } const ( - tsSkylarkLabel = "@build_bazel_rules_typescript//:defs.bzl" + tsSkylarkLabel = "@npm_bazel_typescript//:defs.bzl" ngSkylarkLabel = "@angular//:index.bzl" ) From 3e92736af9d6bcae1991a6a6947a20f4bfd8f0de Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 11 Feb 2019 13:51:51 -0800 Subject: [PATCH 098/316] Renames `build_bazel_rules_typescript` and `build_bazel_rules_karma` to `npm_bazel_typescript` and `npm_bazel_karma` respectively BREAKING CHANGE: Users will need to rename `build_bazel_rules_typescript` to `npm_bazel_typescript` and `build_bazel_rules_karma` to `npm_bazel_karma` in their projects Closes #412 PiperOrigin-RevId: 233472013 --- .bazelci/presubmit.yml | 2 +- BUILD.bazel | 2 +- DEVELOPING.md | 8 ++++---- README.md | 10 +++++----- WORKSPACE | 8 ++++---- devserver/devserver/devserver_test.go | 4 ++-- docs/BUILD.bazel | 6 +++--- examples/bar.ts | 4 ++-- examples/devmode_consumer/devmode_consumer_test.sh | 14 +++++++------- examples/devserver/BUILD.bazel | 2 +- examples/es6_output/es6_output_test.sh | 6 +++--- examples/googmodule/googmodule_output_test.js | 4 ++-- examples/protocol_buffers/BUILD.bazel | 8 ++++---- examples/some_module/BUILD.bazel | 2 +- examples/some_module/module_load_test.sh | 2 +- examples/testing/BUILD.bazel | 2 +- examples/testing/static_script.spec.ts | 2 +- internal/BUILD.bazel | 2 +- internal/defaults.bzl | 4 ++-- .../e2e/disable_tsetse_for_external/BUILD.bazel | 2 +- internal/e2e/npm_packages/karma/BUILD.bazel | 2 +- internal/e2e/npm_packages/karma/WORKSPACE | 2 +- internal/e2e/npm_packages/karma/yarn.lock | 2 +- .../e2e/npm_packages/karma_stack_trace/BUILD.bazel | 4 ++-- .../e2e/npm_packages/karma_stack_trace/WORKSPACE | 4 ++-- .../karma_stack_trace/test_folder/BUILD.bazel | 2 +- .../e2e/npm_packages/karma_stack_trace/yarn.lock | 4 ++-- .../e2e/npm_packages/karma_typescript/BUILD.bazel | 4 ++-- .../e2e/npm_packages/karma_typescript/WORKSPACE | 4 ++-- .../e2e/npm_packages/karma_typescript/yarn.lock | 4 ++-- internal/e2e/npm_packages/ts_auto_deps/WORKSPACE | 2 +- internal/e2e/npm_packages/ts_auto_deps/yarn.lock | 2 +- internal/e2e/npm_packages/ts_devserver/BUILD.bazel | 2 +- internal/e2e/npm_packages/ts_devserver/WORKSPACE | 2 +- internal/e2e/npm_packages/ts_devserver/yarn.lock | 2 +- .../e2e/npm_packages/typescript_2.7/BUILD.bazel | 4 ++-- internal/e2e/npm_packages/typescript_2.7/WORKSPACE | 2 +- internal/e2e/npm_packages/typescript_2.7/yarn.lock | 2 +- .../e2e/npm_packages/typescript_2.8/BUILD.bazel | 4 ++-- internal/e2e/npm_packages/typescript_2.8/WORKSPACE | 2 +- internal/e2e/npm_packages/typescript_2.8/yarn.lock | 2 +- .../e2e/npm_packages/typescript_2.9/BUILD.bazel | 4 ++-- internal/e2e/npm_packages/typescript_2.9/WORKSPACE | 2 +- internal/e2e/npm_packages/typescript_2.9/yarn.lock | 2 +- .../e2e/npm_packages/typescript_3.0/BUILD.bazel | 4 ++-- internal/e2e/npm_packages/typescript_3.0/WORKSPACE | 2 +- internal/e2e/npm_packages/typescript_3.0/yarn.lock | 2 +- .../e2e/npm_packages/typescript_3.1/BUILD.bazel | 4 ++-- internal/e2e/npm_packages/typescript_3.1/WORKSPACE | 2 +- internal/e2e/npm_packages/typescript_3.1/yarn.lock | 2 +- internal/e2e/typescript_3.1/BUILD.bazel | 6 +++--- internal/e2e/typescript_3.1/WORKSPACE | 6 +++--- internal/karma/BUILD.bazel | 6 +++--- internal/karma/WORKSPACE | 10 +++++----- internal/karma/defaults.bzl | 4 ++-- internal/karma/karma_web_test.bzl | 4 ++-- internal/karma/package.bzl | 2 +- internal/karma/package.json | 2 +- internal/karma/ts_web_test.bzl | 2 +- internal/protobufjs/ts_proto_library.bzl | 8 ++++---- internal/ts_repositories.bzl | 12 ++++++------ package.bzl | 6 +++--- package.json | 2 +- version.bzl | 14 +++++++------- 64 files changed, 130 insertions(+), 130 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 5b60a2c2..5d8f34e7 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -21,7 +21,7 @@ platforms: - "@disable_tsetse_for_external_test//..." # Run some targets again, but addressed as an external repo # TODO(alexeagle): run all of them after fixing https://github.com/bazelbuild/rules_typescript/issues/243 - - "@build_bazel_rules_typescript//examples/some_library:lib" + - "@npm_bazel_typescript//examples/some_library:lib" test_flags: # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1604 - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" diff --git a/BUILD.bazel b/BUILD.bazel index 05517305..c47ed666 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -99,7 +99,7 @@ npm_package( ) # Produces the release we publish to GitHub. Users download this starlark package -# to get the @build_bazel_rules_typescript workspace. +# to get the @npm_bazel_typescript workspace. # FIXME(gregmagolan): strip the npm_package prefix from within the generated archive # pkg_tar( # name = "release", diff --git a/DEVELOPING.md b/DEVELOPING.md index 8428d019..f45639b5 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -4,13 +4,13 @@ We strongly encourage you to review the project's scope described in the `README ## Testing changing downstream -By default, downstream projects use both an `http_archive` of `build_bazel_rules_typescript` and the released `@bazel/typescript` and `@bazel/karma` npm packages. `postinstall` steps in these npm packages check that the version of the `build_bazel_rules_typescript` is compatible with the version of the npm package(s). +By default, downstream projects use both an `http_archive` of `npm_bazel_typescript` and the released `@bazel/typescript` and `@bazel/karma` npm packages. `postinstall` steps in these npm packages check that the version of the `npm_bazel_typescript` is compatible with the version of the npm package(s). For example, if a downstream `WORKSPACE` contain: ```python http_archive( - name = "build_bazel_rules_typescript", + name = "npm_bazel_typescript", url = "https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip", strip_prefix = "rules_typescript-0.21.0", ) @@ -38,7 +38,7 @@ to ```python "compiler": attr.label( - default = Label("@build_bazel_rules_typescript//internal:tsc_wrapped_bin"), + default = Label("@npm_bazel_typescript//internal:tsc_wrapped_bin"), ``` The correct defaults to use so that you are not depending on the npm package downstream are in `/internal/defaults.bzl`. Note, your downstream @@ -46,7 +46,7 @@ workspace will also need the correct `@npm` dependencies available to build thes In the case of the `angular` workspace, some `@npm` dependencies in this repository will also need to be changed to `@ngdeps` since `angular` does not have an `@npm` workspace with npm dependencies. -Note, with this workflow the downstream version of `@npm//typescript` will be used to compile the `ts_library` targets in `build_bazel_rules_typescript`. +Note, with this workflow the downstream version of `@npm//typescript` will be used to compile the `ts_library` targets in `npm_bazel_typescript`. An example of this can be found under `internal/e2e/typescript_3.1`. ## Releasing diff --git a/README.md b/README.md index 074475b8..d696a902 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,13 @@ yarn_install( load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -# Fetch transitive Bazel dependencies of build_bazel_rules_karma +# Fetch transitive Bazel dependencies of npm_bazel_karma # ONLY REQUIRED if you are using the @bazel/karma npm package -load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") +load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() # Setup TypeScript toolchain -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() # Setup web testing, choose browsers we can test on @@ -168,7 +168,7 @@ Create a `BUILD` file next to your sources: ```python package(default_visibility=["//visibility:public"]) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "my_code", @@ -250,7 +250,7 @@ To use `ts_devserver`, you simply `load` the rule, and call it with `deps` that point to your `ts_library` target(s): ```python -load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") ts_library( name = "app", diff --git a/WORKSPACE b/WORKSPACE index 2f8b991a..f7cfc7dc 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "build_bazel_rules_typescript") +workspace(name = "npm_bazel_typescript") -# Load nested build_bazel_rules_karma repository +# Load nested npm_bazel_karma repository local_repository( - name = "build_bazel_rules_karma", + name = "npm_bazel_karma", path = "internal/karma", ) @@ -26,7 +26,7 @@ load("//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() # Load rules_karma dependencies -load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") +load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() diff --git a/devserver/devserver/devserver_test.go b/devserver/devserver/devserver_test.go index 0c0ba56a..1fa91294 100644 --- a/devserver/devserver/devserver_test.go +++ b/devserver/devserver/devserver_test.go @@ -47,9 +47,9 @@ func TestDevserverFileHandling(t *testing.T) { handler := CreateFileHandler("/app.js", "manifest.MF", []string{ // This verifies that we can resolve relatively to the current package. Usually the // devserver Bazel rule adds the current package here. - "build_bazel_rules_typescript/devserver/devserver", + "npm_bazel_typescript/devserver/devserver", // Verifies that we can specify subfolders of workspaces - "build_bazel_rules_typescript/devserver/devserver/test", + "npm_bazel_typescript/devserver/devserver/test", // Verifies that we can specify external workspaces as root dirs. "devserver_test_workspace", // Verifies that we can specify subfolders from external workspaces. diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index c8c686b6..edd71438 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -8,9 +8,9 @@ skylark_doc( "//internal:ts_repositories.bzl", "//internal/devserver:ts_devserver.bzl", "//internal/protobufjs:ts_proto_library.bzl", - # TODO(gregmagolan): fix docs for build_bazel_rules_karma - # "@build_bazel_rules_karma//:karma_web_test.bzl", - # "@build_bazel_rules_karma//:ts_web_test.bzl", + # TODO(gregmagolan): fix docs for npm_bazel_karma + # "@npm_bazel_karma//:karma_web_test.bzl", + # "@npm_bazel_karma//:ts_web_test.bzl", ], format = "html", # The site is served at http://tsetse.info so the URL doesn't include a diff --git a/examples/bar.ts b/examples/bar.ts index ab6ce269..d363ae37 100644 --- a/examples/bar.ts +++ b/examples/bar.ts @@ -15,8 +15,8 @@ * limitations under the License. */ -import {Greeter} from 'build_bazel_rules_typescript/examples/foo'; -import {a} from 'build_bazel_rules_typescript/examples/generated_ts/foo'; +import {Greeter} from 'npm_bazel_typescript/examples/foo'; +import {a} from 'npm_bazel_typescript/examples/generated_ts/foo'; // Repro for #31, should automatically discover @types/node import * as fs from 'fs'; import {cool} from 'some-lib'; diff --git a/examples/devmode_consumer/devmode_consumer_test.sh b/examples/devmode_consumer/devmode_consumer_test.sh index 096f4d55..eb511803 100755 --- a/examples/devmode_consumer/devmode_consumer_test.sh +++ b/examples/devmode_consumer/devmode_consumer_test.sh @@ -27,9 +27,9 @@ else fi # --- end runfiles.bash initialization --- -readonly LIBRARY_JS=$(cat $(rlocation "build_bazel_rules_typescript/examples/some_library/library.js")) -readonly BAR_JS=$(cat $(rlocation "build_bazel_rules_typescript/examples/bar.js")) -readonly FOO_JS=$(cat $(rlocation "build_bazel_rules_typescript/examples/foo.js")) +readonly LIBRARY_JS=$(cat $(rlocation "npm_bazel_typescript/examples/some_library/library.js")) +readonly BAR_JS=$(cat $(rlocation "npm_bazel_typescript/examples/bar.js")) +readonly FOO_JS=$(cat $(rlocation "npm_bazel_typescript/examples/foo.js")) # should produce named UMD modules if [[ "$LIBRARY_JS" != *"define(\"some-lib\""* ]]; then @@ -39,14 +39,14 @@ if [[ "$LIBRARY_JS" != *"define(\"some-lib\""* ]]; then fi # should produce named UMD modules -if [[ "$BAR_JS" != *"define(\"build_bazel_rules_typescript/examples/bar\""* ]]; then +if [[ "$BAR_JS" != *"define(\"npm_bazel_typescript/examples/bar\""* ]]; then echo "Expected bar.js to declare named module, but was" echo "$BAR_JS" exit 1 fi # should give a name to required modules -if [[ "$BAR_JS" != *"require(\"build_bazel_rules_typescript/examples/foo\")"* ]]; then +if [[ "$BAR_JS" != *"require(\"npm_bazel_typescript/examples/foo\")"* ]]; then echo "Expected bar.js to require named module foo, but was" echo "$BAR_JS" exit 1 @@ -60,7 +60,7 @@ if [[ "$BAR_JS" != *"require(\"some-lib\")"* ]]; then fi # should give a name to required generated modules without bazel-bin -if [[ "$BAR_JS" != *"require(\"build_bazel_rules_typescript/examples/generated_ts/foo\")"* ]]; then +if [[ "$BAR_JS" != *"require(\"npm_bazel_typescript/examples/generated_ts/foo\")"* ]]; then echo "Expected bar.js to require generated named module foo, but was" echo "$BAR_JS" exit 1 @@ -74,7 +74,7 @@ if [[ "$BAR_JS" != *"require(\"typescript\")"* ]]; then fi # should produce named UMD modules -if [[ "$FOO_JS" != *"define(\"build_bazel_rules_typescript/examples/foo\""* ]]; then +if [[ "$FOO_JS" != *"define(\"npm_bazel_typescript/examples/foo\""* ]]; then echo "Expected foo.js to declare named module, but was" echo "$FOO_JS" exit 1 diff --git a/examples/devserver/BUILD.bazel b/examples/devserver/BUILD.bazel index efa1f628..249e7282 100644 --- a/examples/devserver/BUILD.bazel +++ b/examples/devserver/BUILD.bazel @@ -14,7 +14,7 @@ ts_devserver( name = "devserver", additional_root_paths = [ "npm/node_modules/tslib", - "build_bazel_rules_typescript/examples/devserver/", + "npm_bazel_typescript/examples/devserver/", ], port = 80, serving_path = "/bundle.js", diff --git a/examples/es6_output/es6_output_test.sh b/examples/es6_output/es6_output_test.sh index 81ba1f15..c6a0102f 100755 --- a/examples/es6_output/es6_output_test.sh +++ b/examples/es6_output/es6_output_test.sh @@ -27,9 +27,9 @@ else fi # --- end runfiles.bash initialization --- -readonly FOO_JS=$(cat $(rlocation "build_bazel_rules_typescript/examples/es6_output/es6_output.es6/examples/foo.js")) -readonly BAR_JS=$(cat $(rlocation "build_bazel_rules_typescript/examples/es6_output/es6_output.es6/examples/bar.js")) -readonly LIBRARY_JS=$(cat $(rlocation "build_bazel_rules_typescript/examples/es6_output/es6_output.es6/examples/some_library/library.js")) +readonly FOO_JS=$(cat $(rlocation "npm_bazel_typescript/examples/es6_output/es6_output.es6/examples/foo.js")) +readonly BAR_JS=$(cat $(rlocation "npm_bazel_typescript/examples/es6_output/es6_output.es6/examples/bar.js")) +readonly LIBRARY_JS=$(cat $(rlocation "npm_bazel_typescript/examples/es6_output/es6_output.es6/examples/some_library/library.js")) # should not down-level ES2015 syntax, eg. `class` if [[ "$FOO_JS" != *"class Greeter"* ]]; then diff --git a/examples/googmodule/googmodule_output_test.js b/examples/googmodule/googmodule_output_test.js index b3b4d403..82d9e209 100644 --- a/examples/googmodule/googmodule_output_test.js +++ b/examples/googmodule/googmodule_output_test.js @@ -4,13 +4,13 @@ describe('googmodule', () => { let output; beforeAll(() => { output = require.resolve( - 'build_bazel_rules_typescript/examples/googmodule/a.js'); + 'npm_bazel_typescript/examples/googmodule/a.js'); }); it('should have goog module syntax in devmode', () => { expect(fs.readFileSync(output, {encoding: 'utf-8'})) .toContain( - `goog.module('build_bazel_rules_typescript.examples.googmodule.a')`); + `goog.module('npm_bazel_typescript.examples.googmodule.a')`); }); it('should have tsickle type annotations', () => { expect(fs.readFileSync(output, { diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel index 16452de7..4594ffef 100644 --- a/examples/protocol_buffers/BUILD.bazel +++ b/examples/protocol_buffers/BUILD.bazel @@ -1,7 +1,7 @@ -load("@build_bazel_rules_karma//:defaults.bzl", "ts_web_test_suite") load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@npm_bazel_karma//:defaults.bzl", "ts_web_test_suite") load( "//:defs.bzl", "ts_devserver", @@ -44,7 +44,7 @@ ts_library( ts_web_test_suite( name = "test", - bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"], + bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"], browsers = [ "@io_bazel_rules_webtesting//browsers:chromium-local", "@io_bazel_rules_webtesting//browsers:firefox-local", @@ -60,8 +60,8 @@ ts_library( ts_devserver( name = "devserver", - bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"], - entry_module = "build_bazel_rules_typescript/examples/protocol_buffers/app", + bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"], + entry_module = "npm_bazel_typescript/examples/protocol_buffers/app", port = 8080, deps = [":bundle"], ) diff --git a/examples/some_module/BUILD.bazel b/examples/some_module/BUILD.bazel index a6ff1bf3..ecd8224a 100644 --- a/examples/some_module/BUILD.bazel +++ b/examples/some_module/BUILD.bazel @@ -39,7 +39,7 @@ nodejs_binary( ":main", ":some_module", ], - entry_point = "build_bazel_rules_typescript/examples/some_module/main.js", + entry_point = "npm_bazel_typescript/examples/some_module/main.js", ) sh_test( diff --git a/examples/some_module/module_load_test.sh b/examples/some_module/module_load_test.sh index 68cd2759..752979ae 100755 --- a/examples/some_module/module_load_test.sh +++ b/examples/some_module/module_load_test.sh @@ -27,7 +27,7 @@ else fi # --- end runfiles.bash initialization --- -readonly OUT=$($(rlocation "build_bazel_rules_typescript/examples/some_module/bin")) +readonly OUT=$($(rlocation "npm_bazel_typescript/examples/some_module/bin")) if [ "$OUT" != "hello world" ]; then echo "Expected output 'hello world' but was $OUT" diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel index 287a3b9d..133ee68e 100644 --- a/examples/testing/BUILD.bazel +++ b/examples/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_karma//:defaults.bzl", "karma_web_test_suite", "ts_web_test_suite") +load("@npm_bazel_karma//:defaults.bzl", "karma_web_test_suite", "ts_web_test_suite") load("//internal:defaults.bzl", "ts_library") ts_library( diff --git a/examples/testing/static_script.spec.ts b/examples/testing/static_script.spec.ts index ebc6cbc4..6651308f 100644 --- a/examples/testing/static_script.spec.ts +++ b/examples/testing/static_script.spec.ts @@ -1,6 +1,6 @@ const someGlobal = new Promise((resolve, reject) => { const script = document.createElement('script'); - script.src = `base/build_bazel_rules_typescript/examples/testing/static_script.js`; + script.src = `base/npm_bazel_typescript/examples/testing/static_script.js`; script.onerror = reject; script.onload = () => { document.body.removeChild(script); diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 64174550..e9baf8eb 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -85,7 +85,7 @@ nodejs_binary( "@npm//tsutils", "@npm//typescript", ], - entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js", + entry_point = "npm_bazel_typescript/internal/tsc_wrapped/tsc_wrapped.js", visibility = ["//visibility:public"], ) diff --git a/internal/defaults.bzl b/internal/defaults.bzl index 1823e308..9ef73e2f 100644 --- a/internal/defaults.bzl +++ b/internal/defaults.bzl @@ -15,14 +15,14 @@ "Defaults for rules_typescript repository not meant to be used downstream" load( - "@build_bazel_rules_typescript//:defs.bzl", + "@npm_bazel_typescript//:defs.bzl", _ts_library = "ts_library", ) # We can't use the defaults for ts_library compiler and ts_web_test_suite karma # internally because the defaults are .js dependencies on the npm packages that are # published and internally we are building the things themselves to publish to npm -INTERNAL_TS_LIBRARY_COMPILER = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin" +INTERNAL_TS_LIBRARY_COMPILER = "@npm_bazel_typescript//internal:tsc_wrapped_bin" def ts_library(compiler = INTERNAL_TS_LIBRARY_COMPILER, **kwargs): _ts_library(compiler = compiler, **kwargs) diff --git a/internal/e2e/disable_tsetse_for_external/BUILD.bazel b/internal/e2e/disable_tsetse_for_external/BUILD.bazel index b626aaa7..ccdb610d 100644 --- a/internal/e2e/disable_tsetse_for_external/BUILD.bazel +++ b/internal/e2e/disable_tsetse_for_external/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") +load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/internal/e2e/npm_packages/karma/BUILD.bazel b/internal/e2e/npm_packages/karma/BUILD.bazel index 85122f3d..e401902c 100644 --- a/internal/e2e/npm_packages/karma/BUILD.bazel +++ b/internal/e2e/npm_packages/karma/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") +load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") ts_web_test_suite( name = "testing", diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE index 6545390f..e86f3204 100644 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -36,7 +36,7 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") +load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() diff --git a/internal/e2e/npm_packages/karma/yarn.lock b/internal/e2e/npm_packages/karma/yarn.lock index 00bda136..392dea6c 100644 --- a/internal/e2e/npm_packages/karma/yarn.lock +++ b/internal/e2e/npm_packages/karma/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/build_bazel_rules_karma/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/npm_bazel_karma/bazel-out/darwin-fastbuild/bin/npm_package": version "0.0.0" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel index 6a0ed246..63535a46 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel +++ b/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index 20b5d217..2a3dcc99 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -36,7 +36,7 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") +load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() @@ -49,6 +49,6 @@ browser_repositories( firefox = True, ) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel index 6ffe7a79..100ddf29 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel +++ b/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/internal/e2e/npm_packages/karma_stack_trace/yarn.lock b/internal/e2e/npm_packages/karma_stack_trace/yarn.lock index 7436e473..c6588b22 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/yarn.lock +++ b/internal/e2e/npm_packages/karma_stack_trace/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/build_bazel_rules_karma/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/npm_bazel_karma/bazel-out/darwin-fastbuild/bin/npm_package": version "0.0.0" dependencies: jasmine-core "2.8.0" @@ -17,7 +17,7 @@ semver "5.6.0" tmp "0.0.33" -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/karma_typescript/BUILD.bazel b/internal/e2e/npm_packages/karma_typescript/BUILD.bazel index c42feee3..e2311f12 100644 --- a/internal/e2e/npm_packages/karma_typescript/BUILD.bazel +++ b/internal/e2e/npm_packages/karma_typescript/BUILD.bazel @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "lib", diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index 07b71008..cdf3cac4 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -36,7 +36,7 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_karma//:package.bzl", "rules_karma_dependencies") +load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() @@ -49,6 +49,6 @@ browser_repositories( firefox = True, ) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/karma_typescript/yarn.lock b/internal/e2e/npm_packages/karma_typescript/yarn.lock index d6c33442..e72c0ff2 100644 --- a/internal/e2e/npm_packages/karma_typescript/yarn.lock +++ b/internal/e2e/npm_packages/karma_typescript/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/build_bazel_rules_karma/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/npm_bazel_karma/bazel-out/darwin-fastbuild/bin/npm_package": version "0.0.0" dependencies: jasmine-core "2.8.0" @@ -17,7 +17,7 @@ semver "5.6.0" tmp "0.0.33" -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE index be2a4dbd..3dddfc8b 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE +++ b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/ts_auto_deps/yarn.lock b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock index cff6e8d9..6a6c9f2e 100644 --- a/internal/e2e/npm_packages/ts_auto_deps/yarn.lock +++ b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/ts_devserver/BUILD.bazel b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel index 0b4ec011..dd6eeef0 100644 --- a/internal/e2e/npm_packages/ts_devserver/BUILD.bazel +++ b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") ts_library( name = "app", diff --git a/internal/e2e/npm_packages/ts_devserver/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE index 703cac1a..95df7348 100644 --- a/internal/e2e/npm_packages/ts_devserver/WORKSPACE +++ b/internal/e2e/npm_packages/ts_devserver/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/ts_devserver/yarn.lock b/internal/e2e/npm_packages/ts_devserver/yarn.lock index 0f87dee2..64043372 100644 --- a/internal/e2e/npm_packages/ts_devserver/yarn.lock +++ b/internal/e2e/npm_packages/ts_devserver/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel index e7cccf46..0f08b301 100644 --- a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "main", @@ -36,7 +36,7 @@ jasmine_node_test( name = "test", data = [ # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], deps = [ ":test_lib", diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE index 7cdc6949..edbf7625 100644 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.7/yarn.lock b/internal/e2e/npm_packages/typescript_2.7/yarn.lock index 00b356bc..3ccf2bfc 100644 --- a/internal/e2e/npm_packages/typescript_2.7/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.7/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel index e7cccf46..0f08b301 100644 --- a/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "main", @@ -36,7 +36,7 @@ jasmine_node_test( name = "test", data = [ # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], deps = [ ":test_lib", diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE index ca44e458..55c47cc6 100644 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.8/yarn.lock b/internal/e2e/npm_packages/typescript_2.8/yarn.lock index 0f79fc4c..b5348dcf 100644 --- a/internal/e2e/npm_packages/typescript_2.8/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.8/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel index e7cccf46..0f08b301 100644 --- a/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "main", @@ -36,7 +36,7 @@ jasmine_node_test( name = "test", data = [ # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], deps = [ ":test_lib", diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE index 5631a125..a01a0f0c 100644 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.9/yarn.lock b/internal/e2e/npm_packages/typescript_2.9/yarn.lock index 36885d19..8ac413b1 100644 --- a/internal/e2e/npm_packages/typescript_2.9/yarn.lock +++ b/internal/e2e/npm_packages/typescript_2.9/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel index e7cccf46..0f08b301 100644 --- a/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "main", @@ -36,7 +36,7 @@ jasmine_node_test( name = "test", data = [ # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], deps = [ ":test_lib", diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE index 6a741b68..55c70816 100644 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.0/yarn.lock b/internal/e2e/npm_packages/typescript_3.0/yarn.lock index 88ed70c0..887715e8 100644 --- a/internal/e2e/npm_packages/typescript_3.0/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.0/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel index e7cccf46..0f08b301 100644 --- a/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel +++ b/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "main", @@ -36,7 +36,7 @@ jasmine_node_test( name = "test", data = [ # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], deps = [ ":test_lib", diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE index 6a741b68..55c70816 100644 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE @@ -36,6 +36,6 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.1/yarn.lock b/internal/e2e/npm_packages/typescript_3.1/yarn.lock index 2b156164..be3dbed1 100644 --- a/internal/e2e/npm_packages/typescript_3.1/yarn.lock +++ b/internal/e2e/npm_packages/typescript_3.1/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/build_bazel_rules_typescript/bazel-out/darwin-fastbuild/bin/npm_package": +"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": version "0.22.1-41-gc1f5737" dependencies: jasmine-core "2.8.0" diff --git a/internal/e2e/typescript_3.1/BUILD.bazel b/internal/e2e/typescript_3.1/BUILD.bazel index 042f5467..693fc5fa 100644 --- a/internal/e2e/typescript_3.1/BUILD.bazel +++ b/internal/e2e/typescript_3.1/BUILD.bazel @@ -13,19 +13,19 @@ # limitations under the License. load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") ts_library( name = "main", srcs = ["main.ts"], - compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", + compiler = "@npm_bazel_typescript//internal:tsc_wrapped_bin", ) ts_library( name = "test_lib", testonly = True, srcs = glob(["*.spec.ts"]), - compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", + compiler = "@npm_bazel_typescript//internal:tsc_wrapped_bin", deps = [ ":main", "@npm//@types/jasmine", diff --git a/internal/e2e/typescript_3.1/WORKSPACE b/internal/e2e/typescript_3.1/WORKSPACE index ab0e7c3d..d53e1b5b 100644 --- a/internal/e2e/typescript_3.1/WORKSPACE +++ b/internal/e2e/typescript_3.1/WORKSPACE @@ -15,11 +15,11 @@ workspace(name = "typescript_31") local_repository( - name = "build_bazel_rules_typescript", + name = "npm_bazel_typescript", path = "../../..", ) -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") +load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() @@ -33,6 +33,6 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 7fcc0b85..2c1cfc3e 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -16,8 +16,8 @@ # Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. # The generated `@bazel/karma` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") -load("@build_bazel_rules_typescript//:version.bzl", "COMPAT_VERSION") -load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") +load("@npm_bazel_typescript//:version.bzl", "COMPAT_VERSION") +load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) @@ -60,7 +60,7 @@ nodejs_binary( genrule( name = "license_copy", - srcs = ["@build_bazel_rules_typescript//:LICENSE"], + srcs = ["@npm_bazel_typescript//:LICENSE"], outs = ["LICENSE"], cmd = "cp $< $@", ) diff --git a/internal/karma/WORKSPACE b/internal/karma/WORKSPACE index 3e166d87..a2a34010 100644 --- a/internal/karma/WORKSPACE +++ b/internal/karma/WORKSPACE @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "build_bazel_rules_karma") +workspace(name = "npm_bazel_karma") -# Load nested build_bazel_rules_typescript repository +# Load nested npm_bazel_typescript repository local_repository( - name = "build_bazel_rules_typescript", + name = "npm_bazel_typescript", path = "../..", ) # Load our dependencies -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") +load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() @@ -49,6 +49,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") gazelle_dependencies() # Setup typescript toolchain -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() diff --git a/internal/karma/defaults.bzl b/internal/karma/defaults.bzl index 7e891dd7..954a9915 100644 --- a/internal/karma/defaults.bzl +++ b/internal/karma/defaults.bzl @@ -15,14 +15,14 @@ "Defaults for rules_karma repository not meant to be used downstream" load( - "@build_bazel_rules_karma//:defs.bzl", + "@npm_bazel_karma//:defs.bzl", _karma_web_test = "karma_web_test", _karma_web_test_suite = "karma_web_test_suite", _ts_web_test = "ts_web_test", _ts_web_test_suite = "ts_web_test_suite", ) -INTERNAL_KARMA_BIN = "@build_bazel_rules_karma//:karma_bin" +INTERNAL_KARMA_BIN = "@npm_bazel_karma//:karma_bin" def karma_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): _karma_web_test(karma = karma, **kwargs) diff --git a/internal/karma/karma_web_test.bzl b/internal/karma/karma_web_test.bzl index b1bab2d5..2002fd22 100644 --- a/internal/karma/karma_web_test.bzl +++ b/internal/karma/karma_web_test.bzl @@ -43,7 +43,7 @@ KARMA_GENERIC_WEB_TEST_ATTRS = dict(COMMON_WEB_TEST_ATTRS, **{ doc = """Arbitrary files which are available to be served on request. Files are served at: `/base//`, e.g. - `/base/build_bazel_rules_typescript/examples/testing/static_script.js`""", + `/base/npm_bazel_typescript/examples/testing/static_script.js`""", allow_files = True, ), "runtime_deps": attr.label_list( @@ -332,7 +332,7 @@ def karma_web_test( static_files: Arbitrary files which are available to be served on request. Files are served at: `/base//`, e.g. - `/base/build_bazel_rules_typescript/examples/testing/static_script.js` + `/base/npm_bazel_typescript/examples/testing/static_script.js` config_file: User supplied Karma configuration file. Bazel will override certain attributes of this configuration file. Attributes that are overridden will be outputted to the test log. diff --git a/internal/karma/package.bzl b/internal/karma/package.bzl index 1d0832cc..ed31fee8 100644 --- a/internal/karma/package.bzl +++ b/internal/karma/package.bzl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Package file which defines build_bazel_rules_karma dependencies +"""Package file which defines npm_bazel_karma dependencies """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") diff --git a/internal/karma/package.json b/internal/karma/package.json index 9f04bff1..5f71978d 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -38,7 +38,7 @@ "jasmine-core": "2.8.0" }, "bazelWorkspaces": { - "build_bazel_rules_karma": { + "npm_bazel_karma": { "version": "0.0.0-PLACEHOLDER", "compatVersion": "0.0.0-COMPAT_VERSION", "rootPath": "." diff --git a/internal/karma/ts_web_test.bzl b/internal/karma/ts_web_test.bzl index 9189076a..ab5329b2 100644 --- a/internal/karma/ts_web_test.bzl +++ b/internal/karma/ts_web_test.bzl @@ -86,7 +86,7 @@ def ts_web_test( static_files: Arbitrary files which are available to be served on request. Files are served at: `/base//`, e.g. - `/base/build_bazel_rules_typescript/examples/testing/static_script.js` + `/base/npm_bazel_typescript/examples/testing/static_script.js` tags: Standard Bazel tags, this macro adds tags for ibazel support as well as `browser:chromium-system` to allow for filtering on systems with no system Chrome. diff --git a/internal/protobufjs/ts_proto_library.bzl b/internal/protobufjs/ts_proto_library.bzl index 7c6e58e1..807dea0f 100644 --- a/internal/protobufjs/ts_proto_library.bzl +++ b/internal/protobufjs/ts_proto_library.bzl @@ -144,7 +144,7 @@ a `ts_library` can appear, such as in the `deps[]` of another `ts_library`. Example: ``` -load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_proto_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library", "ts_proto_library") proto_library( name = "car_proto", @@ -172,18 +172,18 @@ name the rule differently from the output file. The JavaScript produced by protobuf.js has a runtime dependency on a support library. Under devmode (e.g. `ts_devserver`, `ts_web_test_suite`) you'll need to include these scripts in the `bootstrap` phase (before Require.js loads). You can use the label -`@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts` to reference these scripts +`@npm_bazel_typescript//:protobufjs_bootstrap_scripts` to reference these scripts in the `bootstrap` attribute of `ts_web_test_suite` or `ts_devserver`. To complete the example above, you could write a `ts_web_test_suite`: ``` -load("@build_bazel_rules_karma//:defs.bzl", "ts_web_test_suite") +load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") ts_web_test_suite( name = "test", deps = ["test_lib"], - bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"], + bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"], browsers = [ "@io_bazel_rules_webtesting//browsers:chromium-local", "@io_bazel_rules_webtesting//browsers:firefox-local", diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index 2a90a70f..16c3e40c 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -40,20 +40,20 @@ def ts_setup_workspace(): # @build_bazel_rules_typescript_tsc_wrapped_deps is not used locally. yarn_install( name = "build_bazel_rules_typescript_tsc_wrapped_deps", - package_json = "@build_bazel_rules_typescript//internal:tsc_wrapped/package.json", - yarn_lock = "@build_bazel_rules_typescript//internal:tsc_wrapped/yarn.lock", + package_json = "@npm_bazel_typescript//internal:tsc_wrapped/package.json", + yarn_lock = "@npm_bazel_typescript//internal:tsc_wrapped/yarn.lock", ) yarn_install( name = "build_bazel_rules_typescript_devserver_deps", - package_json = "@build_bazel_rules_typescript//internal/devserver:package.json", - yarn_lock = "@build_bazel_rules_typescript//internal/devserver:yarn.lock", + package_json = "@npm_bazel_typescript//internal/devserver:package.json", + yarn_lock = "@npm_bazel_typescript//internal/devserver:yarn.lock", ) yarn_install( name = "build_bazel_rules_typescript_protobufs_compiletime_deps", - package_json = "@build_bazel_rules_typescript//internal/protobufjs:package.json", - yarn_lock = "@build_bazel_rules_typescript//internal/protobufjs:yarn.lock", + package_json = "@npm_bazel_typescript//internal/protobufjs:package.json", + yarn_lock = "@npm_bazel_typescript//internal/protobufjs:yarn.lock", ) # BEGIN-DEV-ONLY diff --git a/package.bzl b/package.bzl index be88028c..900d106c 100644 --- a/package.bzl +++ b/package.bzl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Package file which defines build_bazel_rules_typescript dependencies +"""Package file which defines npm_bazel_typescript dependencies """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") @@ -22,7 +22,7 @@ def rules_typescript_dependencies(): rules_typescript_dependencies is no longer needed, and will be removed in a future release. We assume you will fetch rules_nodejs in your WORKSPACE file, and no other dependencies remain here. Simply remove any calls to this function and the corresponding call to - load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") + load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dependencies") """) def rules_typescript_dev_dependencies(): @@ -83,7 +83,7 @@ def rules_typescript_dev_dependencies(): # io_bazel_rules_webtesting depends on bazel_skylib. It is installed by # web_test_repositories() but we depend on it here in case users don't call # web_test_repositories(). This will get cleaned up by https://github.com/bazelbuild/rules_typescript/pull/374 - # which introduces build_bazel_rules_karma with its own defs.bzl file + # which introduces npm_bazel_karma with its own defs.bzl file # that will allow this dep to be removed from rules_typescript_dependencies() _maybe( http_archive, diff --git a/package.json b/package.json index 8b9df619..ba5d33d2 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "which": "~1.0.5" }, "bazelWorkspaces": { - "build_bazel_rules_typescript": { + "npm_bazel_typescript": { "version": "0.0.0-PLACEHOLDER", "compatVersion": "0.0.0-COMPAT_VERSION", "rootPath": "." diff --git a/version.bzl b/version.bzl index 1f975616..42b13de7 100644 --- a/version.bzl +++ b/version.bzl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Package file which defines build_bazel_rules_typescript version in skylark +"""Package file which defines npm_bazel_typescript version in skylark """ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") @@ -26,9 +26,9 @@ COMPAT_VERSION = "0.24.0" def check_rules_typescript_version(version_string): """ - Verify that a compatible build_bazel_rules_typescript is loaded a WORKSPACE. + Verify that a compatible npm_bazel_typescript is loaded a WORKSPACE. - Where COMPAT_VERSION and VERSION come from the build_bazel_rules_typescript that + Where COMPAT_VERSION and VERSION come from the npm_bazel_typescript that is loaded in a WORKSPACE, this function will check: VERSION >= version_string >= COMPAT_VERSION @@ -38,18 +38,18 @@ def check_rules_typescript_version(version_string): ``` # in WORKSPACE: - load("@build_bazel_rules_typescript//:defs.bzl", "check_rules_typescript_version") + load("@npm_bazel_typescript//:defs.bzl", "check_rules_typescript_version") check_rules_typescript_version(version_string = "0.22.0") ``` Args: version_string: A version string to check for compatibility with the loaded version - of build_bazel_rules_typescript. The version check performed is + of npm_bazel_typescript. The version check performed is `VERSION >= version_string >= COMPAT_VERSION` where VERSION and COMPAT_VERSION - come from the loaded version of build_bazel_rules_typescript. + come from the loaded version of npm_bazel_typescript. """ if not check_version(VERSION, version_string) or not check_version(version_string, COMPAT_VERSION): - fail("\nLoaded build_bazel_rules_typescript version {} with mimimum compat version of {} is not compatible with checked version {}!\n\n".format( + fail("\nLoaded npm_bazel_typescript version {} with mimimum compat version of {} is not compatible with checked version {}!\n\n".format( VERSION, COMPAT_VERSION, version_string, From 5f01ea2ac74a401978f59db278d886397add9b63 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 11 Feb 2019 14:38:08 -0800 Subject: [PATCH 099/316] Fix broken CircleCI Missed a spot where build_bazel_rules_typescript needs renamed to npm_bazel_typescript PiperOrigin-RevId: 233481401 --- internal/e2e/default_tsconfig_test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js index a71affd1..dd909a47 100644 --- a/internal/e2e/default_tsconfig_test.js +++ b/internal/e2e/default_tsconfig_test.js @@ -23,11 +23,11 @@ const os = require('os'); const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'wksp')); const WORKSPACE_BOILERPLATE = ` local_repository( - name = "build_bazel_rules_typescript", + name = "npm_bazel_typescript", path = "${process.cwd()}", ) # Using rules_typescript_dev_dependencies for this test since we're not depending on the generated npm package -load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") +load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") node_repositories() @@ -37,7 +37,7 @@ yarn_install( yarn_lock = "//:yarn.lock", ) # Using ts_setup_dev_workspace for this test since we're not depending on the generated npm package -load("@build_bazel_rules_typescript//internal:ts_repositories.bzl", "ts_setup_dev_workspace") +load("@npm_bazel_typescript//internal:ts_repositories.bzl", "ts_setup_dev_workspace") ts_setup_dev_workspace() `; @@ -388,8 +388,8 @@ ${WORKSPACE_BOILERPLATE}`); write('a/BUILD', ` # We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm # package in this test. This changes the ts_library compiler from the default -# which depends on @npm//@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is -load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") +# which depends on @npm//@bazel/typescript which is not available in this test to '@npm_bazel_typescript//internal:tsc_wrapped_bin' which is +load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") ts_library( name = "a_lib", srcs=["has_implicit_any.ts"], @@ -411,8 +411,8 @@ ${WORKSPACE_BOILERPLATE}`); write('b/BUILD', ` # We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm # package in this test. This changes the ts_library compiler from the default -# which depends on @npm//@bazel/typescript which is not available in this test to '@build_bazel_rules_typescript//internal:tsc_wrapped_bin' which is -load("@build_bazel_rules_typescript//internal:defaults.bzl", "ts_library") +# which depends on @npm//@bazel/typescript which is not available in this test to '@npm_bazel_typescript//internal:tsc_wrapped_bin' which is +load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") exports_files(["tsconfig.json"]) ts_library( name = "b_lib", From 851857e485f89f44c45fef8238c1178ac6e446e8 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 11 Feb 2019 15:29:09 -0800 Subject: [PATCH 100/316] rel: 0.25.0 --- README.md | 4 ++-- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d696a902..736956d5 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Optionally add the `@bazel/karma` npm package if you would like to use the { ... "devDependencies": { - "@bazel/typescript": "0.24.1", - "@bazel/karma": "0.24.1", + "@bazel/typescript": "0.25.0", + "@bazel/karma": "0.25.0", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index f7cfc7dc..e58de6ad 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.24.1") +check_rules_typescript_version(version_string = "0.25.0") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index ba5d33d2..9dacadb2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.24.1", + "version": "0.25.0", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 42b13de7..570c649b 100644 --- a/version.bzl +++ b/version.bzl @@ -17,12 +17,12 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.24.1" +VERSION = "0.25.0" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for # releases with breaking changes and/or new features. -COMPAT_VERSION = "0.24.0" +COMPAT_VERSION = "0.25.0" def check_rules_typescript_version(version_string): """ From 219b7cd9d04f9d321e0135615bee45e29d584509 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 12 Feb 2019 19:09:52 -0800 Subject: [PATCH 101/316] Generate npm_packages in internal/e2e/npm_packages/test.sh for smoother local testing Closes #416 PiperOrigin-RevId: 233672246 --- internal/e2e/npm_packages/test.sh | 14 +++++++++----- package.json | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/e2e/npm_packages/test.sh b/internal/e2e/npm_packages/test.sh index 12be17e9..306b2f7e 100755 --- a/internal/e2e/npm_packages/test.sh +++ b/internal/e2e/npm_packages/test.sh @@ -2,8 +2,9 @@ set -u -e -o pipefail -cd $(dirname "$0") -TESTS_ROOT_DIR=$(pwd) +TESTS_ROOT_DIR=$(cd $(dirname "$0"); pwd) +TYPESCRIPT_ROOT_DIR=$(cd $TESTS_ROOT_DIR/../../..; pwd) +KARMA_ROOT_DIR=$(cd $TESTS_ROOT_DIR/../../../internal/karma; pwd) echo "" echo "#################################################################################" @@ -15,16 +16,19 @@ echo "" echo "Run this script with '--update-lock-files' to update yarn.lock files instead of running tests" echo "" -# Determine the absolute paths to the generated @bazel/typescript and @bazel/karma npm packages -cd $TESTS_ROOT_DIR/../../.. +# Generate the npm packages @bazel/typescript and @bazel/karma npm packages and +# determine their absolute paths in bazel-bin +cd $TYPESCRIPT_ROOT_DIR BAZEL=$(pwd)/node_modules/.bin/bazel if [[ ! -f $BAZEL ]] ; then echo "Bazel not found under $BAZEL" exit 1 fi +$BAZEL build //:npm_package BAZEL_BIN_TYPESCRIPT=$($BAZEL info bazel-bin) BAZEL_TYPESCRIPT_NPM_PACKAGE=$BAZEL_BIN_TYPESCRIPT/npm_package -cd $TESTS_ROOT_DIR/../../../internal/karma +cd $KARMA_ROOT_DIR +$BAZEL build //:npm_package BAZEL_BIN_KARMA=$($BAZEL info bazel-bin) BAZEL_KARMA_NPM_PACKAGE=$BAZEL_BIN_KARMA/npm_package echo "@bazel/typescript: $BAZEL_TYPESCRIPT_NPM_PACKAGE" diff --git a/package.json b/package.json index 9dacadb2..b416f5f4 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ } }, "scripts": { - "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e //:npm_package && cd internal/karma; bazel build //:npm_package", + "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e", "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-npm_packages && yarn e2e-typescript_3.1", "e2e-bazel-external": "jasmine internal/e2e/default_tsconfig_test.js", "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", From 916f7e23f8d1e6bfb2352a4548fe7de623daece4 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 12 Feb 2019 21:53:13 -0800 Subject: [PATCH 102/316] Add docs for karma rules Closes #417 PiperOrigin-RevId: 233688614 --- DEVELOPING.md | 6 +- README.md | 34 +-- docs/BUILD.bazel | 3 - internal/karma/.gitignore | 2 + internal/karma/WORKSPACE | 25 +- internal/karma/docs/BUILD.bazel | 10 + internal/karma/docs/index.md | 89 ++++++++ internal/karma/docs/install.md | 80 +++++++ internal/karma/docs/karma_web_test.md | 315 ++++++++++++++++++++++++++ internal/karma/docs/ts_web_test.md | 272 ++++++++++++++++++++++ internal/karma/package.json | 3 + 11 files changed, 798 insertions(+), 41 deletions(-) create mode 100644 internal/karma/.gitignore create mode 100644 internal/karma/docs/BUILD.bazel create mode 100644 internal/karma/docs/index.md create mode 100644 internal/karma/docs/install.md create mode 100644 internal/karma/docs/karma_web_test.md create mode 100644 internal/karma/docs/ts_web_test.md diff --git a/DEVELOPING.md b/DEVELOPING.md index f45639b5..81bc6e12 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -56,14 +56,14 @@ changes since the last tag - if so, this will be a minor, if not, it's a patch. (This may not sound like semver - but since our major version is a zero, the rule is that minors are breaking changes and patches are new features). -1. Re-generate the API docs: `yarn skydoc` +1. Re-generate the API docs: `yarn skydoc && (cd internal/karma; yarn skydoc)` 1. May be necessary if Go code has changed though probably it was already necessary to run this to keep CI green: `bazel run :gazelle` 1. If we depend on a newer rules_nodejs, update the `check_rules_nodejs_version` in `ts_repositories.bzl` 1. `git commit -a -m 'Update docs for release'` 1. `npm config set tag-version-prefix ''` 1. `npm version minor -m 'rel: %s'` (replace `minor` with `patch` if no breaking changes) -1. Build npm packages and publish them: `TMP=$(mktemp -d -t bazel-release.XXXXXXX); bazel --output_base=$TMP run //:npm_package.publish && cd internal/karma && bazel --output_base=$TMP run //:npm_package.publish` -1. `git push && git push --tags` +1. Build npm packages and publish them: `TMP=$(mktemp -d -t bazel-release.XXXXXXX); bazel --output_base=$TMP run //:npm_package.publish && ( cd internal/karma && bazel --output_base=$TMP run //:npm_package.publish )` +1. `git push upstream && git push upstream --tags` (assumes you named the bazelbuild fork as "upstream") 1. (Temporary): submit a google3 CL to update the versions in package.bzl and package.json [releases]: https://github.com/bazelbuild/rules_typescript/releases diff --git a/README.md b/README.md index 736956d5..b404de88 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ Circle CI | Bazel CI The TypeScript rules integrate the TypeScript compiler with Bazel. +This repo used to contain Karma rules `ts_web_test` and `karma_web_test`. +These are now documented in the README at http://npmjs.com/package/@bazel/karma + ## API Docs Generated documentation for using each rule is at: @@ -18,15 +21,12 @@ http://tsetse.info/api/ First, install a current Bazel distribution. Add the `@bazel/typescript` npm package to your `package.json` `devDependencies`. -Optionally add the `@bazel/karma` npm package if you would like to use the -`ts_web_test`, `ts_web_test_suite`, `karma_web_test` or `karma_web_test_suite` rules. ``` { ... "devDependencies": { "@bazel/typescript": "0.25.0", - "@bazel/karma": "0.25.0", ... }, ... @@ -59,7 +59,7 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install" node_repositories() # Setup Bazel managed npm dependencies with the `yarn_install` rule. -# The name of this rule should be set to `npm` so that `ts_library` and `ts_web_test_suite` +# The name of this rule should be set to `npm` so that `ts_library` # can find your npm dependencies by default in the `@npm` workspace. You may # also use the `npm_install` rule with a `package-lock.json` file if you prefer. # See https://github.com/bazelbuild/rules_nodejs#dependencies for more info. @@ -73,23 +73,9 @@ yarn_install( load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -# Fetch transitive Bazel dependencies of npm_bazel_karma -# ONLY REQUIRED if you are using the @bazel/karma npm package -load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") -rules_karma_dependencies() - # Setup TypeScript toolchain load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() - -# Setup web testing, choose browsers we can test on -# ONLY REQUIRED if you are using the @bazel/karma npm package -load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") - -web_test_repositories() -browser_repositories( - chromium = True, -) ``` # Self-managed npm dependencies @@ -143,15 +129,6 @@ nodejs_binary( # Point bazel to your node_modules to find the entry point node_modules = ["//:node_modules"], ) - -# Create a karma rule to use in ts_web_test_suite karma -# attribute when using self-managed dependencies -nodejs_binary( - name = "karma/karma", - entry_point = "karma/bin/karma", - # Point bazel to your node_modules to find the entry point - node_modules = ["//:node_modules"], -) ``` See https://github.com/bazelbuild/rules_nodejs#dependencies for more information on @@ -325,7 +302,4 @@ If you'd like a "watch mode", try https://github.com/bazelbuild/bazel-watcher At some point, we plan to release a tool similar to [gazelle] to generate the BUILD files from your source code. -In the meantime, we suggest associating the `.bazel` extension with Python in -your editor, so that you get useful syntax highlighting. - [gazelle]: https://github.com/bazelbuild/rules_go/tree/master/go/tools/gazelle diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index edd71438..019f3dcd 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -8,9 +8,6 @@ skylark_doc( "//internal:ts_repositories.bzl", "//internal/devserver:ts_devserver.bzl", "//internal/protobufjs:ts_proto_library.bzl", - # TODO(gregmagolan): fix docs for npm_bazel_karma - # "@npm_bazel_karma//:karma_web_test.bzl", - # "@npm_bazel_karma//:ts_web_test.bzl", ], format = "html", # The site is served at http://tsetse.info so the URL doesn't include a diff --git a/internal/karma/.gitignore b/internal/karma/.gitignore new file mode 100644 index 00000000..bae2b585 --- /dev/null +++ b/internal/karma/.gitignore @@ -0,0 +1,2 @@ +# This file is generated during the build +README.md diff --git a/internal/karma/WORKSPACE b/internal/karma/WORKSPACE index a2a34010..f584c273 100644 --- a/internal/karma/WORKSPACE +++ b/internal/karma/WORKSPACE @@ -43,12 +43,27 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -# Setup gazelle toolchain -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") - -gazelle_dependencies() - # Setup typescript toolchain load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() + +# Dependencies for generating documentation +load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") + +sass_repositories() + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "com_google_protobuf", + strip_prefix = "protobuf-3.6.1.3", + sha256 = "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2", + # v3.6.1.3 as of 2019-01-15 + urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.6.1.3.zip"], + type = "zip", +) + +load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories") + +skydoc_repositories() diff --git a/internal/karma/docs/BUILD.bazel b/internal/karma/docs/BUILD.bazel new file mode 100644 index 00000000..dc0a3bc9 --- /dev/null +++ b/internal/karma/docs/BUILD.bazel @@ -0,0 +1,10 @@ +load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc") + +skylark_doc( + name = "docs", + srcs = [ + "//:karma_web_test.bzl", + "//:ts_web_test.bzl", + ], + format = "markdown", +) diff --git a/internal/karma/docs/index.md b/internal/karma/docs/index.md new file mode 100644 index 00000000..697f82ff --- /dev/null +++ b/internal/karma/docs/index.md @@ -0,0 +1,89 @@ + +# Overview + + + + +

Unit testing with Karma

+ +

Macros

+ + + + + + + + + + + + + + + + + + + +
+ + run_karma_web_test + + +

Creates an action that can run karma.

+ +
+ + karma_web_test + + +

Runs unit tests in a browser with Karma.

+ +
+ + karma_web_test_suite + + +

Defines a test_suite of web_test targets that wrap a karma_web_test target.

+ +
+

Unit testing in a browser

+ +

Macros

+ + + + + + + + + + + + + + + +
+ + ts_web_test + + +

Runs unit tests in a browser.

+ +
+ + ts_web_test_suite + + +

Defines a test_suite of web_test targets that wrap a ts_web_test target.

+ +
diff --git a/internal/karma/docs/install.md b/internal/karma/docs/install.md new file mode 100644 index 00000000..e04b5584 --- /dev/null +++ b/internal/karma/docs/install.md @@ -0,0 +1,80 @@ +# Karma rules for Bazel + +**WARNING: this is beta-quality software. Breaking changes are likely. Not recommended for production use without expert support.** + +The Karma rules run karma tests with Bazel. + +## Installation + +Add the `@bazel/karma` npm package to your `devDependencies` in `package.json`. + +Your `WORKSPACE` should declare a `yarn_install` or `npm_install` rule named `npm`. +It should then install the rules found in the npm packages. + +This is copied from the README for rules_nodejs: + +```python +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# Fetch rules_nodejs +# (you can check https://github.com/bazelbuild/rules_nodejs/releases for a newer release than this) +http_archive( + name = "build_bazel_rules_nodejs", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], + sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", +) + +# Setup the NodeJS toolchain +load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") +node_repositories() + +yarn_install( + name = "npm", + package_json = "//:package.json", + yarn_lock = "//:yarn.lock", +) + +# Install all Bazel dependencies needed for npm packages that supply Bazel rules +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") +install_bazel_dependencies() +``` + +This causes the `@bazel/karma` package to be installed as a Bazel workspace named `npm_bazel_karma`. + +Now add this to your `WORKSPACE` to install the Karma dependencies: + +```python +# Fetch transitive Bazel dependencies of npm_bazel_karma +load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") +rules_karma_dependencies() +``` + +This installs the `io_bazel_rules_webtesting` repository, if you haven't installed it earlier. + +Finally, configure the rules_webtesting: + +```python +# Setup web testing, choose browsers we can test on +load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") + +web_test_repositories() +browser_repositories( + chromium = True, +) +``` + +## Installing with self-managed dependencies + +If you didn't use the `yarn_install` or `npm_install` rule to create an `npm` workspace, you'll have to declare a rule in your root `BUILD.bazel` file to execute karma: + +```python +# Create a karma rule to use in ts_web_test_suite karma +# attribute when using self-managed dependencies +nodejs_binary( + name = "karma/karma", + entry_point = "karma/bin/karma", + # Point bazel to your node_modules to find the entry point + node_modules = ["//:node_modules"], +) +``` + diff --git a/internal/karma/docs/karma_web_test.md b/internal/karma/docs/karma_web_test.md new file mode 100644 index 00000000..39c65434 --- /dev/null +++ b/internal/karma/docs/karma_web_test.md @@ -0,0 +1,315 @@ + + +

Unit testing with Karma

+ + + + +## run_karma_web_test + +
+run_karma_web_test(ctx)
+
+ +Creates an action that can run karma. + +This is also used by ts_web_test_rule. + +Returns: + The runfiles for the generated action. + + + +### Attributes + + + + + + + + + + + + + +
ctx +

Unknown; Required

+

Bazel rule execution context

+
+ +## karma_web_test + +
+karma_web_test(srcs, deps, data, configuration_env_vars, bootstrap, runtime_deps, static_files, config_file, tags, **kwargs)
+
+ +Runs unit tests in a browser with Karma. + +When executed under `bazel test`, this uses a headless browser for speed. +This is also because `bazel test` allows multiple targets to be tested together, +and we don't want to open a Chrome window on your machine for each one. Also, +under `bazel test` the test will execute and immediately terminate. + +Running under `ibazel test` gives you a "watch mode" for your tests. The rule is +optimized for this case - the test runner server will stay running and just +re-serve the up-to-date JavaScript source bundle. + +To debug a single test target, run it with `bazel run` instead. This will open a +browser window on your computer. Also you can use any other browser by opening +the URL printed when the test starts up. The test will remain running until you +cancel the `bazel run` command. + +This rule will use your system Chrome by default. In the default case, your +environment must specify CHROME_BIN so that the rule will know which Chrome binary to run. +Other `browsers` and `customLaunchers` may be set using the a base Karma configuration +specified in the `config_file` attribute. + + + +### Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
srcs +

List of strings; Optional

+

A list of JavaScript test files

+
deps +

List of strings; Optional

+

Other targets which produce JavaScript such as ts_library

+
data +

List of strings; Optional

+

Runtime dependencies

+
configuration_env_vars +

List of strings; Optional

+

Pass these configuration environment variables to the resulting binary. +Chooses a subset of the configuration environment variables (taken from ctx.var), which also +includes anything specified via the --define flag. +Note, this can lead to different outputs produced by this rule.

+
bootstrap +

List of strings; Optional

+

JavaScript files to include before the module loader (require.js). +For example, you can include Reflect,js for TypeScript decorator metadata reflection, +or UMD bundles for third-party libraries.

+
runtime_deps +

List of strings; Optional

+

Dependencies which should be loaded after the module loader but before the srcs and deps. +These should be a list of targets which produce JavaScript such as ts_library. +The files will be loaded in the same order they are declared by that rule.

+
static_files +

List of strings; Optional

+

Arbitrary files which are available to be served on request. +Files are served at: +/base/&lt;WORKSPACE_NAME&gt;/&lt;path-to-file&gt;, e.g. +/base/npm_bazel_typescript/examples/testing/static_script.js

+
config_file +

Unknown; Optional

+

User supplied Karma configuration file. Bazel will override +certain attributes of this configuration file. Attributes that are +overridden will be outputted to the test log.

+
tags +

List of strings; Optional

+

Standard Bazel tags, this macro adds tags for ibazel support

+
**kwargs +

Unknown; Optional

+

Passed through to karma_web_test

+
+ +## karma_web_test_suite + +
+karma_web_test_suite(name, browsers, args, browser_overrides, config, flaky, local, shard_count, size, tags, test_suite_tags, timeout, visibility, web_test_data, wrapped_test_tags, **remaining_keyword_args)
+
+ +Defines a test_suite of web_test targets that wrap a karma_web_test target. + +This macro also accepts all parameters in karma_web_test. See karma_web_test docs +for details. + + + +### Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
name +

Name; Required

+

The base name of the test

+
browsers +

List of strings; Optional

+

A sequence of labels specifying the browsers to use.

+
args +

Unknown; Optional

+

Args for web_test targets generated by this extension.

+
browser_overrides +

Unknown; Optional

+

Dictionary; optional; default is an empty dictionary. A +dictionary mapping from browser names to browser-specific web_test +attributes, such as shard_count, flakiness, timeout, etc. For example: +{'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} +'//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}.

+
config +

Unknown; Optional

+

Label; optional; Configuration of web test features.

+
flaky +

Unknown; Optional

+

A boolean specifying that the test is flaky. If set, the test will +be retried up to 3 times (default: 0)

+
local +

Unknown; Optional

+

boolean; optional.

+
shard_count +

Unknown; Optional

+

The number of test shards to use per browser. (default: 1)

+
size +

Unknown; Optional

+

A string specifying the test size. (default: 'large')

+
tags +

List of strings; Optional

+

A list of test tag strings to apply to each generated web_test target. +This macro adds a couple for ibazel.

+
test_suite_tags +

Unknown; Optional

+

A list of tag strings for the generated test_suite.

+
timeout +

Unknown; Optional

+

A string specifying the test timeout (default: computed from size)

+
visibility +

Unknown; Optional

+

List of labels; optional.

+
web_test_data +

List of strings; Optional

+

Data dependencies for the web_test.

+
wrapped_test_tags +

Unknown; Optional

+

A list of test tag strings to use for the wrapped test

+
**remaining_keyword_args +

Unknown; Optional

+

Arguments for the wrapped test target.

+
diff --git a/internal/karma/docs/ts_web_test.md b/internal/karma/docs/ts_web_test.md new file mode 100644 index 00000000..eca85355 --- /dev/null +++ b/internal/karma/docs/ts_web_test.md @@ -0,0 +1,272 @@ + + +

Unit testing in a browser

+ + + + +## ts_web_test + +
+ts_web_test(srcs, deps, data, configuration_env_vars, bootstrap, runtime_deps, static_files, tags, **kwargs)
+
+ +Runs unit tests in a browser. + +When executed under `bazel test`, this uses a headless browser for speed. +This is also because `bazel test` allows multiple targets to be tested together, +and we don't want to open a Chrome window on your machine for each one. Also, +under `bazel test` the test will execute and immediately terminate. + +Running under `ibazel test` gives you a "watch mode" for your tests. The rule is +optimized for this case - the test runner server will stay running and just +re-serve the up-to-date JavaScript source bundle. + +To debug a single test target, run it with `bazel run` instead. This will open a +browser window on your computer. Also you can use any other browser by opening +the URL printed when the test starts up. The test will remain running until you +cancel the `bazel run` command. + +This rule will use your system Chrome. Your environment must specify CHROME_BIN +so that the rule will know which Chrome binary to run. + +Currently this rule uses Karma as the test runner under the hood, but this is +an implementation detail. We might switch to another runner like Jest in the future. + + + +### Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
srcs +

List of strings; Optional

+

A list of JavaScript test files

+
deps +

List of strings; Optional

+

Other targets which produce JavaScript such as ts_library

+
data +

List of strings; Optional

+

Runtime dependencies

+
configuration_env_vars +

List of strings; Optional

+

Pass these configuration environment variables to the resulting binary. +Chooses a subset of the configuration environment variables (taken from ctx.var), which also +includes anything specified via the --define flag. +Note, this can lead to different outputs produced by this rule.

+
bootstrap +

List of strings; Optional

+

JavaScript files to include before the module loader (require.js). +For example, you can include Reflect,js for TypeScript decorator metadata reflection, +or UMD bundles for third-party libraries.

+
runtime_deps +

List of strings; Optional

+

Dependencies which should be loaded after the module loader but before the srcs and deps. +These should be a list of targets which produce JavaScript such as ts_library. +The files will be loaded in the same order they are declared by that rule.

+
static_files +

List of strings; Optional

+

Arbitrary files which are available to be served on request. +Files are served at: +/base/&lt;WORKSPACE_NAME&gt;/&lt;path-to-file&gt;, e.g. +/base/npm_bazel_typescript/examples/testing/static_script.js

+
tags +

List of strings; Optional

+

Standard Bazel tags, this macro adds tags for ibazel support as well as

+
**kwargs +

Unknown; Optional

+

Passed through to ts_web_test

+
+ +## ts_web_test_suite + +
+ts_web_test_suite(name, browsers, args, browser_overrides, config, flaky, local, shard_count, size, tags, test_suite_tags, timeout, visibility, web_test_data, wrapped_test_tags, **remaining_keyword_args)
+
+ +Defines a test_suite of web_test targets that wrap a ts_web_test target. + +This macro also accepts all parameters in ts_web_test. See ts_web_test docs for +details. + + + +### Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
name +

Name; Required

+

The base name of the test.

+
browsers +

List of strings; Optional

+

A sequence of labels specifying the browsers to use.

+
args +

Unknown; Optional

+

Args for web_test targets generated by this extension.

+
browser_overrides +

Unknown; Optional

+

Dictionary; optional; default is an empty dictionary. A +dictionary mapping from browser names to browser-specific web_test +attributes, such as shard_count, flakiness, timeout, etc. For example: +{'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} +'//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}.

+
config +

Unknown; Optional

+

Label; optional; Configuration of web test features.

+
flaky +

Unknown; Optional

+

A boolean specifying that the test is flaky. If set, the test will +be retried up to 3 times (default: 0)

+
local +

Unknown; Optional

+

boolean; optional.

+
shard_count +

Unknown; Optional

+

The number of test shards to use per browser. (default: 1)

+
size +

Unknown; Optional

+

A string specifying the test size. (default: 'large')

+
tags +

List of strings; Optional

+

A list of test tag strings to apply to each generated web_test_suite target. +This macro adds a couple for ibazel.

+
test_suite_tags +

Unknown; Optional

+

A list of tag strings for the generated test_suite.

+
timeout +

Unknown; Optional

+

A string specifying the test timeout (default: computed from size)

+
visibility +

Unknown; Optional

+

List of labels; optional.

+
web_test_data +

List of strings; Optional

+

Data dependencies for the web_test_suite.

+
wrapped_test_tags +

Unknown; Optional

+

A list of test tag strings to use for the wrapped test

+
**remaining_keyword_args +

Unknown; Optional

+

Arguments for the wrapped test target.

+
diff --git a/internal/karma/package.json b/internal/karma/package.json index 5f71978d..e714d267 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -43,5 +43,8 @@ "compatVersion": "0.0.0-COMPAT_VERSION", "rootPath": "." } + }, + "scripts": { + "skydoc": "bazel build --symlink_prefix=bazel- //docs && unzip -o -d docs bazel-bin/docs/docs-skydoc.zip && cat docs/install.md docs/*_web_test.md | sed 's/^##/\\\n##/' > README.md" } } From 94150121f7dfdc69c945a56672874c1c4a019d4d Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 13 Feb 2019 10:03:55 -0800 Subject: [PATCH 103/316] Pin rules_webtesting browser versions for CI and local testing Closes #418 PiperOrigin-RevId: 233775615 --- WORKSPACE | 78 +-------------- internal/e2e/npm_packages/karma/WORKSPACE | 9 +- .../npm_packages/karma_stack_trace/WORKSPACE | 9 +- .../npm_packages/karma_typescript/WORKSPACE | 9 +- internal/karma/BUILD.bazel | 1 + internal/karma/browser_repositories.bzl | 95 +++++++++++++++++++ 6 files changed, 111 insertions(+), 90 deletions(-) create mode 100644 internal/karma/browser_repositories.bzl diff --git a/WORKSPACE b/WORKSPACE index e58de6ad..27b20982 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -93,82 +93,10 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories" web_test_repositories() -# Load pinned browser versions for rules_webtesting. -load("@io_bazel_rules_webtesting//web/internal:platform_http_file.bzl", "platform_http_file") - -platform_http_file( - name = "org_chromium_chromium", - amd64_sha256 = - "6933d0afce6e17304b62029fbbd246cbe9e130eb0d90d7682d3765d3dbc8e1c8", - amd64_urls = [ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/561732/chrome-linux.zip", - ], - licenses = ["notice"], # BSD 3-clause (maybe more?) - macos_sha256 = - "084884e91841a923d7b6e81101f0105bbc3b0026f9f6f7a3477f5b313ee89e32", - macos_urls = [ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/561733/chrome-mac.zip", - ], - windows_sha256 = - "d1bb728118c12ea436d8ea07dba980789e7d860aa664dd1fad78bc20e8d9391c", - windows_urls = [ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/540270/chrome-win32.zip", - ], -) - -platform_http_file( - name = "org_chromium_chromedriver", - amd64_sha256 = - "71eafe087900dbca4bc0b354a1d172df48b31a4a502e21f7c7b156d7e76c95c7", - amd64_urls = [ - "https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip", - ], - licenses = ["reciprocal"], # BSD 3-clause, ICU, MPL 1.1, libpng (BSD/MIT-like), Academic Free License v. 2.0, BSD 2-clause, MIT - macos_sha256 = - "fd32a27148f44796a55f5ce3397015c89ebd9f600d9dda2bcaca54575e2497ae", - macos_urls = [ - "https://chromedriver.storage.googleapis.com/2.41/chromedriver_mac64.zip", - ], - windows_sha256 = - "a8fa028acebef7b931ef9cb093f02865f9f7495e49351f556e919f7be77f072e", - windows_urls = [ - "https://chromedriver.storage.googleapis.com/2.38/chromedriver_win32.zip", - ], -) +# Setup browser repositories +load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") -platform_http_file( - name = "org_mozilla_firefox", - amd64_sha256 = - "3a729ddcb1e0f5d63933177a35177ac6172f12edbf9fbbbf45305f49333608de", - amd64_urls = [ - "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", - "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", - ], - licenses = ["reciprocal"], # MPL 2.0 - macos_sha256 = - "bf23f659ae34832605dd0576affcca060d1077b7bf7395bc9874f62b84936dc5", - macos_urls = [ - "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg", - "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg", - ], -) - -platform_http_file( - name = "org_mozilla_geckodriver", - amd64_sha256 = - "c9ae92348cf00aa719be6337a608fae8304691a95668e8e338d92623ba9e0ec6", - amd64_urls = [ - "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", - "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", - ], - licenses = ["reciprocal"], # MPL 2.0 - macos_sha256 = - "ce4a3e9d706db94e8760988de1ad562630412fa8cf898819572522be584f01ce", - macos_urls = [ - "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-macos.tar.gz", - "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-macos.tar.gz", - ], -) +browser_repositories() # Tell Bazel where the nested local repositories are that are # used for tests diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE index e86f3204..fee3fa61 100644 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ b/internal/e2e/npm_packages/karma/WORKSPACE @@ -40,11 +40,10 @@ load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() -load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") +load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") web_test_repositories() -browser_repositories( - chromium = True, - firefox = True, -) +load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") + +browser_repositories() diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE index 2a3dcc99..969276f2 100644 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE @@ -40,14 +40,13 @@ load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() -load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") +load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") web_test_repositories() -browser_repositories( - chromium = True, - firefox = True, -) +load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") + +browser_repositories() load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE index cdf3cac4..41fde934 100644 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ b/internal/e2e/npm_packages/karma_typescript/WORKSPACE @@ -40,14 +40,13 @@ load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") rules_karma_dependencies() -load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") +load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") web_test_repositories() -browser_repositories( - chromium = True, - firefox = True, -) +load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") + +browser_repositories() load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index 2c1cfc3e..f00ec1b3 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -70,6 +70,7 @@ npm_package( srcs = [ "BUILD.bazel", "WORKSPACE", + "browser_repositories.bzl", "defaults.bzl", "defs.bzl", "karma.conf.js", diff --git a/internal/karma/browser_repositories.bzl b/internal/karma/browser_repositories.bzl new file mode 100644 index 00000000..68c36013 --- /dev/null +++ b/internal/karma/browser_repositories.bzl @@ -0,0 +1,95 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Pinned browser versions tested against in https://github.com/bazelbuild/rules_typescript CI. +""" + +load("@io_bazel_rules_webtesting//web/internal:platform_http_file.bzl", "platform_http_file") + +def browser_repositories(): + """Load pinned rules_webtesting browser versions.""" + + platform_http_file( + name = "org_chromium_chromium", + amd64_sha256 = + "6933d0afce6e17304b62029fbbd246cbe9e130eb0d90d7682d3765d3dbc8e1c8", + amd64_urls = [ + "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/561732/chrome-linux.zip", + ], + licenses = ["notice"], # BSD 3-clause (maybe more?) + macos_sha256 = + "084884e91841a923d7b6e81101f0105bbc3b0026f9f6f7a3477f5b313ee89e32", + macos_urls = [ + "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/561733/chrome-mac.zip", + ], + windows_sha256 = + "d1bb728118c12ea436d8ea07dba980789e7d860aa664dd1fad78bc20e8d9391c", + windows_urls = [ + "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/540270/chrome-win32.zip", + ], + ) + + platform_http_file( + name = "org_chromium_chromedriver", + amd64_sha256 = + "71eafe087900dbca4bc0b354a1d172df48b31a4a502e21f7c7b156d7e76c95c7", + amd64_urls = [ + "https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip", + ], + licenses = ["reciprocal"], # BSD 3-clause, ICU, MPL 1.1, libpng (BSD/MIT-like), Academic Free License v. 2.0, BSD 2-clause, MIT + macos_sha256 = + "fd32a27148f44796a55f5ce3397015c89ebd9f600d9dda2bcaca54575e2497ae", + macos_urls = [ + "https://chromedriver.storage.googleapis.com/2.41/chromedriver_mac64.zip", + ], + windows_sha256 = + "a8fa028acebef7b931ef9cb093f02865f9f7495e49351f556e919f7be77f072e", + windows_urls = [ + "https://chromedriver.storage.googleapis.com/2.38/chromedriver_win32.zip", + ], + ) + + platform_http_file( + name = "org_mozilla_firefox", + amd64_sha256 = + "3a729ddcb1e0f5d63933177a35177ac6172f12edbf9fbbbf45305f49333608de", + amd64_urls = [ + "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", + "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", + ], + licenses = ["reciprocal"], # MPL 2.0 + macos_sha256 = + "bf23f659ae34832605dd0576affcca060d1077b7bf7395bc9874f62b84936dc5", + macos_urls = [ + "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg", + ], + ) + + platform_http_file( + name = "org_mozilla_geckodriver", + amd64_sha256 = + "c9ae92348cf00aa719be6337a608fae8304691a95668e8e338d92623ba9e0ec6", + amd64_urls = [ + "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", + "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", + ], + licenses = ["reciprocal"], # MPL 2.0 + macos_sha256 = + "ce4a3e9d706db94e8760988de1ad562630412fa8cf898819572522be584f01ce", + macos_urls = [ + "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-macos.tar.gz", + "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-macos.tar.gz", + ], + ) From 593de7ff80cc044b755b5b2dd043cb84b77ec542 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 13 Feb 2019 11:34:42 -0800 Subject: [PATCH 104/316] fix(karma): do not show error message if unnamed amd module is loaded Currently unnamed AMD modules need to be manually configured through a `require.config` call. This then configures Require.JS to load the unnamed AMD module dynamically as a "static file". Meaning that the unnamed AMD module needs to be specified within the `ts_web_test_suite` `static_files` attribute. All static files will be proxied by default and can be loaded through `${location}/base/{workspace}/{path}` and therefore it's common to load static files that way. **The problem** here is that the "karma-requirejs" plugin by default shows an error message if something is loaded through a karma proxy. We need to disable this warning for such known & proxied requests so that the error output is clean and does not cause confusion what "no timestamp for XXX" means. Closes #371 PiperOrigin-RevId: 233796107 --- internal/e2e/npm_packages/karma/BUILD.bazel | 6 ++++ .../npm_packages/karma/amd-modules.spec.js | 32 +++++++++++++++++++ .../npm_packages/karma/requirejs-config.js | 8 +++++ .../npm_packages/karma/unnamed-amd-module.js | 5 +++ internal/karma/karma.conf.js | 15 ++++++++- 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 internal/e2e/npm_packages/karma/amd-modules.spec.js create mode 100644 internal/e2e/npm_packages/karma/requirejs-config.js create mode 100644 internal/e2e/npm_packages/karma/unnamed-amd-module.js diff --git a/internal/e2e/npm_packages/karma/BUILD.bazel b/internal/e2e/npm_packages/karma/BUILD.bazel index e401902c..d96a4050 100644 --- a/internal/e2e/npm_packages/karma/BUILD.bazel +++ b/internal/e2e/npm_packages/karma/BUILD.bazel @@ -21,4 +21,10 @@ ts_web_test_suite( "@io_bazel_rules_webtesting//browsers:chromium-local", "@io_bazel_rules_webtesting//browsers:firefox-local", ], + static_files = [ + ":unnamed-amd-module.js", + ], + deps = [ + ":requirejs-config.js", + ], ) diff --git a/internal/e2e/npm_packages/karma/amd-modules.spec.js b/internal/e2e/npm_packages/karma/amd-modules.spec.js new file mode 100644 index 00000000..c52e4040 --- /dev/null +++ b/internal/e2e/npm_packages/karma/amd-modules.spec.js @@ -0,0 +1,32 @@ +define('npm_packages_karma_e2e/amd-modules.spec', ['require'], (require) => { + + describe('AMD module loading', () => { + + describe('unnamed amd modules', () => { + + it('should not warn if module is configured as static file', doneFn => { + spyOn(console, 'error'); + + require(['unnamed-module'], () => { + // Loading such an anonymous AMD module should not cause any error messages about + // a missing timestamp. This is a limitation of the "karma-requirejs" plugin which + // by default always prints an error for requests through Karma's proxy. + // See: https://github.com/karma-runner/karma-requirejs/issues/6 + expect(console.error).toHaveBeenCalledTimes(0); + doneFn(); + }); + }); + + it('should warn if module is not specified as static file', doneFn => { + spyOn(console, 'error').and.callThrough(); + + require(['unnamed-module-invalid-file'], + /* loaded callback */ () => {}, + /* error callback */ () => { + expect(console.error).toHaveBeenCalledWith(jasmine.stringMatching(/no timestamp/)); + doneFn(); + }); + }); + }); + }) +}); diff --git a/internal/e2e/npm_packages/karma/requirejs-config.js b/internal/e2e/npm_packages/karma/requirejs-config.js new file mode 100644 index 00000000..5ad31a12 --- /dev/null +++ b/internal/e2e/npm_packages/karma/requirejs-config.js @@ -0,0 +1,8 @@ +require.config({ + paths: { + // Configure some fake AMD module that exists and should not cause a loading + // error message from the "karma-requirejs" plugin which is enabled by default. + 'unnamed-module': '/base/npm_packages_karma_e2e/unnamed-amd-module', + 'unnamed-module-invalid-file': '/some-invalid-file-path', + } +}); diff --git a/internal/e2e/npm_packages/karma/unnamed-amd-module.js b/internal/e2e/npm_packages/karma/unnamed-amd-module.js new file mode 100644 index 00000000..fd58f4e6 --- /dev/null +++ b/internal/e2e/npm_packages/karma/unnamed-amd-module.js @@ -0,0 +1,5 @@ +// Unnamed AMD module definition which needs to be manually configured through +// a "requirejs" configuration whenever this module should be loaded. +define(function() { + // Just an empty definition. Nothing to assert here. +}); diff --git a/internal/karma/karma.conf.js b/internal/karma/karma.conf.js index dae40a93..1d82ff1f 100644 --- a/internal/karma/karma.conf.js +++ b/internal/karma/karma.conf.js @@ -165,6 +165,19 @@ try // base path that will be used to resolve all patterns // (eg. files, exclude) overrideConfigValue(conf, 'basePath', 'TMPL_runfiles_path'); + + // Do not show "no timestamp" errors from "karma-requirejs" for proxied file + // requests. Files which are passed as "static_files" are proxied by default and + // therefore should not cause such an exception when loaded as expected. + // See: https://github.com/karma-runner/karma-requirejs/issues/6 + const requireJsShowNoTimestampsError = '^(?!/base/).*$'; + + if (conf.client) { + overrideConfigValue(conf.client, 'requireJsShowNoTimestampsError', + requireJsShowNoTimestampsError); + } else { + conf.client = {requireJsShowNoTimestampsError}; + } } /** @@ -388,7 +401,7 @@ try throw new Error('Invalid base karma configuration. Expected config function to be exported.'); } const originalSetConfig = config.set; - config.set = function(c) { conf = c; } + config.set = function(c) { conf = c; }; baseConf(config); config.set = originalSetConfig; if (DEBUG) console.info(`Base karma configuration: ${JSON.stringify(conf, null, 2)}`); From f2fc2146d8f9ed9f3a38349d11e0772a8de469b0 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 13 Feb 2019 13:18:14 -0800 Subject: [PATCH 105/316] Handle ts_libraries with both moduleNames and moduleRoots. PiperOrigin-RevId: 233815780 --- ts_auto_deps/analyze/analyze.go | 51 ++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 0960b579..e7f28511 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -371,6 +371,26 @@ func pathWithExtensions(basename string) []string { var ambientModuleDeclRE = regexp.MustCompile("(?m)^\\s*declare\\s+module\\s+['\"]([^'\"]+)['\"]\\s+\\{") +// pathStartsWith checks if path starts with prefix, checking each path segment, +// so that @angular/core starts with @angular/core, but @angular/core-bananas +// does not +func pathStartsWith(path, prefix string) bool { + pathParts := strings.Split(path, string(os.PathSeparator)) + prefixParts := strings.Split(prefix, string(os.PathSeparator)) + + if len(prefixParts) > len(pathParts) { + return false + } + + for i, prefixPart := range prefixParts { + if prefixPart != pathParts[i] { + return false + } + } + + return true +} + // findExistingDepProvidingImport looks through a map of the existing deps to // see if any of them provide the import in a way that can't be queried // for. E.g. if the build rule has a "module_name" attribute or if one @@ -389,11 +409,33 @@ func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, rules map if moduleName == "" { continue } + if !pathStartsWith(i.importPath, moduleName) { + continue + } + // fmt.Printf("checking if %s is provided by %s\n", i.importPath, moduleName) + // if module root is a file, remove the file extension, since it'll be added + // by possibleFilepaths below + moduleRoot := stripTSExtension(stringAttribute(r, "module_root")) + _, pkg, _ := edit.ParseLabel(r.GetName()) + + // resolve the import path against the module name and module root, ie if + // the import path is @foo/bar and there's a moduleName of @foo the resolved + // import path is location/of/foo/bar, or if there's also a moduleRoot of + // baz, the resolved import path is location/of/foo/baz/bar + // + // using strings.TrimPrefix for trimming the path is ok, since + // pathStartsWith already checked that moduleName is a proper prefix of + // i.importPath + resolvedImportPath := filepath.Join(pkg, moduleRoot, strings.TrimPrefix(i.importPath, moduleName)) + + // enumerate all the possible filepaths for the resolved import path, and + // compare against all the srcs + possibleImportPaths := possibleFilepaths(resolvedImportPath) for _, src := range listAttribute(r, "srcs") { - _, _, file := edit.ParseLabel(src) - moduleImportPath := moduleName + "/" + stripTSExtension(file) - if i.importPath == moduleImportPath || i.importPath == strings.TrimSuffix(moduleImportPath, "/index") { - return r.GetName(), nil + for _, mi := range possibleImportPaths { + if mi == labelToPath(src) { + return r.GetName(), nil + } } } } @@ -522,6 +564,7 @@ func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyRepor for _, dep := range target.deps() { if edit.LabelsEqual(dep, imp.knownTarget, "") { + // fmt.Printf("%s provides %s\n", dep, imp.importPath) usedDeps[dep] = true report.NecessaryDependency = append(report.NecessaryDependency, imp.knownTarget) continue handlingImports From a7aa8f24285639b7f399370f8decaef7f075c2d6 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 13 Feb 2019 13:52:26 -0800 Subject: [PATCH 106/316] Check for .d.ts files with ambient module declarations in the sources of the rule, not just in the sources of the deps. Also fixes an issue where the query-based analyzer failed when run outside of the workspace root. Fixed by prefixing the the root path to the file path when loading .d.ts files. PiperOrigin-RevId: 233822781 --- ts_auto_deps/analyze/analyze.go | 27 ++++++++++++++++----------- ts_auto_deps/analyze/analyze_test.go | 7 +++---- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index e7f28511..d1ca2d5a 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -328,7 +328,7 @@ func (a *Analyzer) resolveImports(ctx context.Context, currentPkg, root string, continue handlingImports } } - d, err := a.findExistingDepProvidingImport(ctx, target.dependencies, imp) + d, err := a.findExistingDepProvidingImport(ctx, root, target, imp) if err != nil { return err } @@ -398,13 +398,13 @@ func pathStartsWith(path, prefix string) bool { // // If the import already has a knownTarget, findRuleProvidingImport will // return the knownTarget. -func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, rules map[string]*appb.Rule, i *ts_auto_depsImport) (string, error) { +func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, root string, rt *resolvedTarget, i *ts_auto_depsImport) (string, error) { if i.knownTarget != "" { return i.knownTarget, nil } // check if any of the existing deps declare a module_name that matches the import - for _, r := range rules { + for _, r := range rt.dependencies { moduleName := stringAttribute(r, "module_name") if moduleName == "" { continue @@ -440,18 +440,23 @@ func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, rules map } } - // check if any of the existing deps have .d.ts sources which have ambient module - // declarations - for _, r := range rules { + // check if any of the other sources or the souces of any of the deps are .d.ts + // files which have ambient module declarations + var allRules []*appb.Rule + for _, r := range rt.dependencies { + allRules = append(allRules, r) + } + allRules = append(allRules, rt.rule) + for _, r := range allRules { for _, src := range listAttribute(r, "srcs") { - filepath := labelToPath(src) - if !strings.HasSuffix(filepath, ".d.ts") { + fp := filepath.Join(root, labelToPath(src)) + if !strings.HasSuffix(fp, ".d.ts") { continue } - contents, err := platform.ReadFile(ctx, filepath) + contents, err := platform.ReadFile(ctx, fp) if err != nil { - return "", fmt.Errorf("error reading file lookinf for ambient module decls: %s", err) + return "", fmt.Errorf("error reading file looking for ambient module decls: %s", err) } matches := ambientModuleDeclRE.FindAllStringSubmatch(string(contents), -1) @@ -464,7 +469,7 @@ func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, rules map // remove all the modules that were imported (ie all the modules that // were being augmented/re-opened) - for _, mi := range parseImports(filepath, contents) { + for _, mi := range parseImports(fp, contents) { delete(declaredModules, mi.importPath) } diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index 3e669ad3..9e97220a 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -156,14 +156,13 @@ func TestUnresolvedImports(t *testing.T) { } for _, test := range tests { r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` + {"a_lib", fmt.Sprintf(` rule_class: "ts_library" attribute: < name: "srcs" - string_list_value: "//a:b/importer.ts" - string_list_value: "//a:importer.d.ts" + string_list_value: "//a:%s" type: 5 - >`, nil}, + >`, test.filepath), nil}, }, []*file{{test.filepath, []string{test.fileContents}}}) if r == nil { continue From 2312a8507090182d6565a4b072eb7893b20bce0b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 18 Feb 2019 07:23:51 -0800 Subject: [PATCH 107/316] Support Angular plugin rollout: declare extra outs Angular ngtsc needs to emit two additional .js files for each .ts input to support legacy imports Closes #420 PiperOrigin-RevId: 234478540 --- internal/common/compilation.bzl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 44483cbf..8bb4732d 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -170,9 +170,22 @@ def _outputs(ctx, label, srcs_files = []): basename = basename[:-len(ext)] break closure_js_files += [ctx.actions.declare_file(basename + ".closure.js")] + + # Temporary until all imports of ngfactory/ngsummary files are removed + # TODO(alexeagle): clean up after Ivy launch + if getattr(ctx, "compile_angular_templates", False): + closure_js_files += [ctx.actions.declare_file(basename + ".ngfactory.closure.js")] + closure_js_files += [ctx.actions.declare_file(basename + ".ngsummary.closure.js")] + if not is_dts: devmode_js_files += [ctx.actions.declare_file(basename + ".js")] declaration_files += [ctx.actions.declare_file(basename + ".d.ts")] + + # Temporary until all imports of ngfactory/ngsummary files are removed + # TODO(alexeagle): clean up after Ivy launch + if getattr(ctx, "compile_angular_templates", False): + devmode_js_files += [ctx.actions.declare_file(basename + ".ngfactory.js")] + devmode_js_files += [ctx.actions.declare_file(basename + ".ngsummary.js")] return struct( closure_js = closure_js_files, devmode_js = devmode_js_files, From d08fb54ddc2fc05767d4619dc5e96838768ac231 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 19 Feb 2019 14:48:26 -0800 Subject: [PATCH 108/316] fix(devserver): static assets sometimes incorrectly injected Currently whenever the `ts_devserver` tries to inject static assets which are not part of the current Bazel package, but part of the current workspace (e.g. file in a parent package), incorrect asset URLs are injected. This is because the `ts_devserver` currently uses the `File#path` property which is relative to the execroot. So files which are not part of the current Bazel package, but part of the execroot sources, will be kept relative to the execroot. This is problematic because the execroot is not part of the devserver root directories and therfore the injected URLs are incorrect. Instead we should always explicitly pass the `ts_devserver` implementation-specific manifest paths to the asset injection function. To be clear: This currently only affects Windows because if Bazel symlinks the runfiles, the Go runfile helpers also look for the requested files in the `working dirctory` (which is always the the `devserver_runfiles/{workspace_name}` --> so runfiles within the current workspace can be always resolved even though they are not part of the root directory. This is something we need to make consistent in the future, but is not related to that specific bug (we should always precisely pass manifest paths) Fixes #409. Closes #423 PiperOrigin-RevId: 234678783 --- internal/devserver/ts_devserver.bzl | 2 +- .../e2e/npm_packages/ts_devserver/BUILD.bazel | 5 +++ .../ts_devserver/package-template.json | 4 ++- .../ts_devserver/protractor.conf.js | 2 +- .../ts_devserver/red-body-style.css | 3 ++ .../ts_devserver/subpackage/BUILD.bazel | 33 +++++++++++++++++++ .../ts_devserver/subpackage/index.html | 10 ++++++ .../subpackage/subpackage_e2e_test.ts | 17 ++++++++++ .../npm_packages/ts_devserver/tsconfig.json | 5 +++ 9 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 internal/e2e/npm_packages/ts_devserver/red-body-style.css create mode 100644 internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel create mode 100644 internal/e2e/npm_packages/ts_devserver/subpackage/index.html create mode 100644 internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl index fe377ecc..399bd4e3 100644 --- a/internal/devserver/ts_devserver.bzl +++ b/internal/devserver/ts_devserver.bzl @@ -100,7 +100,7 @@ def _ts_devserver(ctx): "/".join([ctx.bin_dir.path, ctx.label.package]), "/".join([ctx.genfiles_dir.path, ctx.label.package]), ], - [f.path for f in ctx.files.static_files] + [bundle_script], + [_short_path_to_manifest_path(ctx, f.short_path) for f in ctx.files.static_files] + [bundle_script], injected_index, ) devserver_runfiles += [injected_index] diff --git a/internal/e2e/npm_packages/ts_devserver/BUILD.bazel b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel index dd6eeef0..f7e2f11e 100644 --- a/internal/e2e/npm_packages/ts_devserver/BUILD.bazel +++ b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel @@ -14,6 +14,11 @@ load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") +exports_files([ + "red-body-style.css", + "tsconfig.json", +]) + ts_library( name = "app", srcs = ["app.ts"], diff --git a/internal/e2e/npm_packages/ts_devserver/package-template.json b/internal/e2e/npm_packages/ts_devserver/package-template.json index 7001bfac..5a9c82e0 100644 --- a/internal/e2e/npm_packages/ts_devserver/package-template.json +++ b/internal/e2e/npm_packages/ts_devserver/package-template.json @@ -10,6 +10,8 @@ }, "scripts": { "pretest": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG", - "test": "bazel build ... && concurrently \"bazel run //:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor\" --kill-others --success first" + "wait-for-servers": "while [[ ! nc -z 127.0.0.1 8080 ]] || [[ ! nc -z 127.0.0.1 8081 ]]; do sleep 1; done", + "run-e2e-tests": "concurrently \"bazel run //:devserver\" \"yarn wait-for-servers\" --kill-others --success first", + "test": "bazel build ... && yarn run-e2e-tests" } } diff --git a/internal/e2e/npm_packages/ts_devserver/protractor.conf.js b/internal/e2e/npm_packages/ts_devserver/protractor.conf.js index 9691a646..725b81e5 100644 --- a/internal/e2e/npm_packages/ts_devserver/protractor.conf.js +++ b/internal/e2e/npm_packages/ts_devserver/protractor.conf.js @@ -1,6 +1,6 @@ exports.config = { specs: [ - 'bazel-bin/*_e2e_test.js', + 'bazel-bin/**/*_e2e_test.js', ], capabilities: { browserName: 'chrome', diff --git a/internal/e2e/npm_packages/ts_devserver/red-body-style.css b/internal/e2e/npm_packages/ts_devserver/red-body-style.css new file mode 100644 index 00000000..5c5e887d --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/red-body-style.css @@ -0,0 +1,3 @@ +body { + background: red; +} diff --git a/internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel b/internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel new file mode 100644 index 00000000..b68ac440 --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel @@ -0,0 +1,33 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") + +ts_devserver( + name = "devserver", + index_html = "index.html", + port = 8081, + static_files = ["//:red-body-style.css"], +) + +ts_library( + name = "e2e", + testonly = 1, + srcs = ["subpackage_e2e_test.ts"], + deps = [ + "@npm//@types/jasmine", + "@npm//@types/node", + "@npm//protractor", + ], +) diff --git a/internal/e2e/npm_packages/ts_devserver/subpackage/index.html b/internal/e2e/npm_packages/ts_devserver/subpackage/index.html new file mode 100644 index 00000000..4ea2bf3c --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/subpackage/index.html @@ -0,0 +1,10 @@ + + + + + Subpackage Devserver + + + This is the devserver for a Bazel subpackage. + + diff --git a/internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts b/internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts new file mode 100644 index 00000000..281ea393 --- /dev/null +++ b/internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts @@ -0,0 +1,17 @@ +import {browser, by, element} from 'protractor'; + +describe('subpackage', () => { + + beforeAll(async () => { + await browser.waitForAngularEnabled(false); + await browser.get('http://127.0.0.1:8081/'); + }); + + // Ensures that the "ts_devserver" properly injects and loads static files which + // are in the current workspace, but not part of the current Bazel package. See + // related issue: https://github.com/bazelbuild/rules_typescript/issues/409 + it('should be able to properly load the injected CSS file', async () => { + const bodyElement = element(by.css('body')); + expect(await bodyElement.getCssValue('background')).toContain('rgb(255, 0, 0)'); + }); +}); diff --git a/internal/e2e/npm_packages/ts_devserver/tsconfig.json b/internal/e2e/npm_packages/ts_devserver/tsconfig.json index e69de29b..40dd2251 100644 --- a/internal/e2e/npm_packages/ts_devserver/tsconfig.json +++ b/internal/e2e/npm_packages/ts_devserver/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "lib": ["es2015", "dom"] + } +} From ba7325d5e8249c3be9b3831757d0a5e3a79e9352 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 20 Feb 2019 16:44:02 -0800 Subject: [PATCH 109/316] Add a tsconfig bazelOptions devmodeTargetOverride experimental setting Closes #426 PiperOrigin-RevId: 234895524 --- internal/tsc_wrapped/tsconfig.ts | 48 +++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index 060b5ff8..512b3146 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -36,7 +36,10 @@ export interface BazelOptions { /** If true, convert require()s into goog.module(). */ googmodule: boolean; - /** If true, emit ES5 into filename.es5.js. */ + /** + * If true, emit devmode output into filename.js. + * If false, emit prodmode output into filename.closure.js. + */ es5Mode: boolean; /** If true, convert TypeScript code into a Closure-compatible variant. */ @@ -161,6 +164,17 @@ export interface BazelOptions { * Enable the Angular ngtsc plugin. */ compileAngularTemplates?: boolean; + + /** + * Override for ECMAScript target language level to use for devmode. + * + * This setting can be set in a user's tsconfig to override the default + * devmode target. + * + * EXPERIMENTAL: This setting is experimental and may be removed in the + * future. + */ + devmodeTargetOverride?: string; } export interface ParsedTsConfig { @@ -299,6 +313,8 @@ export function parseTsconfig( bazelOpts.tsickle = bazelOpts.tsickle || userConfig.bazelOptions.tsickle; bazelOpts.googmodule = bazelOpts.googmodule || userConfig.bazelOptions.googmodule; + bazelOpts.devmodeTargetOverride = bazelOpts.devmodeTargetOverride || + userConfig.bazelOptions.devmodeTargetOverride; } if (!bazelOpts.suppressTsconfigOverrideWarnings) { warnOnOverriddenOptions(userConfig); @@ -311,6 +327,36 @@ export function parseTsconfig( return [null, errors, {target}]; } + // Override the devmode target if devmodeTargetOverride is set + if (bazelOpts.es5Mode && bazelOpts.devmodeTargetOverride) { + switch (bazelOpts.devmodeTargetOverride.toLowerCase()) { + case 'es3': + options.target = ts.ScriptTarget.ES3; + break; + case 'es5': + options.target = ts.ScriptTarget.ES5; + break; + case 'es2015': + options.target = ts.ScriptTarget.ES2015; + break; + case 'es2016': + options.target = ts.ScriptTarget.ES2016; + break; + case 'es2017': + options.target = ts.ScriptTarget.ES2017; + break; + case 'es2018': + options.target = ts.ScriptTarget.ES2018; + break; + case 'esnext': + options.target = ts.ScriptTarget.ESNext; + break; + default: + console.error( + 'WARNING: your tsconfig.json file specifies an invalid bazelOptions.devmodeTargetOverride value of: \'${bazelOpts.devmodeTargetOverride\''); + } + } + // Sort rootDirs with longest include directories first. // When canonicalizing paths, we always want to strip // `workspace/bazel-bin/file` to just `file`, not to `bazel-bin/file`. From 489acd07a9495da2f6b503cea87431a3af630004 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 20 Feb 2019 16:56:59 -0800 Subject: [PATCH 110/316] Properly support the -remove_unused_declarations flag. Typescript declarations can declare arbitrary global symbols, so a declaration might be required without an explicit import. Long term the plan is to require explicit taze comments for the such declarations, but until then the query based analyzer needs to report the same warnings that blaze analyze does. Also warn for possibly unused css_libraries. PiperOrigin-RevId: 234897666 --- ts_auto_deps/analyze/analyze.go | 16 +++++++++++++++- ts_auto_deps/analyze/loader.go | 15 --------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index d1ca2d5a..475ab3e3 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -593,7 +593,21 @@ func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyRepor return nil, err } for label, rule := range labelToRule { - if isTazeManagedRuleClass(rule.GetRuleClass()) || isGenerated(rule) { + switch class := rule.GetRuleClass(); class { + case "ts_declaration": + // TypeScript declarations might declare arbitrary global symbols, so it + // is impossible to detect reliably if the import is being used (without + // compiling, at least). Report that the rule has no explicit import as a + // warning, so that ts_auto_deps can decide to import remove or not based on a + // flag. + warning := fmt.Sprintf("WARNING: %s: keeping possibly used %s '%s'", rule.GetLocation(), class, label) + report.Feedback = append(report.Feedback, warning) + case "css_library": + // Similar to ts_declaration, ts_auto_deps can't reliably detect if css_library + // imports are being used, since ts_auto_deps can't currently parse @requirecss + // annotations. Unlike ts_declaration, there's no flag to remove them, so + // there's no need to report a warning. + default: report.UnnecessaryDependency = append(report.UnnecessaryDependency, label) } } diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 4b509caa..f70dbcb9 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -376,21 +376,6 @@ func dedupeLabels(labels []string) []string { return uniqueLabels } -// isTazeManagedRuleClass checks if a class is a ts_auto_deps-managed rule class. -func isTazeManagedRuleClass(class string) bool { - for _, c := range []string{ - "ts_library", - "ts_declaration", - "ng_module", - "js_library", - } { - if c == class { - return true - } - } - return false -} - // typeScriptRules returns all TypeScript rules in rules. func typeScriptRules(rules []*appb.Rule) []*appb.Rule { var tsRules []*appb.Rule From c09bc740230ce0fbf3ca92b6c8755da577ef1de2 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 20 Feb 2019 19:42:19 -0800 Subject: [PATCH 111/316] Update pinned chromium to 69.0.3497 and chrome-driver to 2.44 for OSX and Linux Closes #425 PiperOrigin-RevId: 234918540 --- internal/karma/browser_repositories.bzl | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/internal/karma/browser_repositories.bzl b/internal/karma/browser_repositories.bzl index 68c36013..cc58e5c6 100644 --- a/internal/karma/browser_repositories.bzl +++ b/internal/karma/browser_repositories.bzl @@ -23,19 +23,29 @@ def browser_repositories(): platform_http_file( name = "org_chromium_chromium", amd64_sha256 = - "6933d0afce6e17304b62029fbbd246cbe9e130eb0d90d7682d3765d3dbc8e1c8", + "941de83d78b27d43db07f427136ba159d661bb111db8d9ffe12499b863a003e1", amd64_urls = [ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/561732/chrome-linux.zip", + # Chromium 69.0.3497.0 (2018-07-19 snaphot 576668) + # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/576668/ + "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/576668/chrome-linux.zip", ], licenses = ["notice"], # BSD 3-clause (maybe more?) macos_sha256 = - "084884e91841a923d7b6e81101f0105bbc3b0026f9f6f7a3477f5b313ee89e32", + "bd01783e7d179e9f85d4b6f0c9df53118d13977cc7d365a1caa9d198c6afcfd8", macos_urls = [ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/561733/chrome-mac.zip", + # Chromium 69.0.3497.0 (2018-07-19 snaphot 576668) + # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/576668/ + # NOTE: There is an issue with ChromeHeadless on OSX chromium 70+ + "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/576668/chrome-mac.zip", ], windows_sha256 = "d1bb728118c12ea436d8ea07dba980789e7d860aa664dd1fad78bc20e8d9391c", windows_urls = [ + # Chromium 66.0.3359.0 (2018-03-01 snaphot 540270) + # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/612439/ + # NOTE: There is an issue with chromium 68-71 with Windows: https://bugs.chromium.org/p/chromium/issues/detail?id=540270 + # and pinning to 72 is not possible as the archive name has changed to chrome-win.zip which breaks + # as the executable path the hard-coded in rules_webtesting and includes the archive name. "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/540270/chrome-win32.zip", ], ) @@ -43,19 +53,25 @@ def browser_repositories(): platform_http_file( name = "org_chromium_chromedriver", amd64_sha256 = - "71eafe087900dbca4bc0b354a1d172df48b31a4a502e21f7c7b156d7e76c95c7", + "687d2e15c42908e2911344c08a949461b3f20a83017a7a682ef4d002e05b5d46", amd64_urls = [ - "https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip", + # ChromeDriver 2.44 supports Chrome v69-71 + # http://chromedriver.chromium.org/downloads + "https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip", ], licenses = ["reciprocal"], # BSD 3-clause, ICU, MPL 1.1, libpng (BSD/MIT-like), Academic Free License v. 2.0, BSD 2-clause, MIT macos_sha256 = - "fd32a27148f44796a55f5ce3397015c89ebd9f600d9dda2bcaca54575e2497ae", + "3fd49c2782a5f93cb48ff2dee021004d9a7fb393798e4c4807b391cedcd30ed9", macos_urls = [ - "https://chromedriver.storage.googleapis.com/2.41/chromedriver_mac64.zip", + # ChromeDriver 2.44 supports Chrome v69-71 + # http://chromedriver.chromium.org/downloads + "https://chromedriver.storage.googleapis.com/2.44/chromedriver_mac64.zip", ], windows_sha256 = "a8fa028acebef7b931ef9cb093f02865f9f7495e49351f556e919f7be77f072e", windows_urls = [ + # ChromeDriver 2.38 supports Chrome v65-67 + # http://chromedriver.chromium.org/downloads "https://chromedriver.storage.googleapis.com/2.38/chromedriver_win32.zip", ], ) From dbf0d6bce139e845e3c6ef34b769058e9a9d6b1d Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 20 Feb 2019 21:44:08 -0800 Subject: [PATCH 112/316] Update docs for release --- docs/api/build_defs.html | 21 +++---- docs/api/devserver/ts_devserver.html | 61 ++++++++++++++----- docs/api/index.html | 73 ++++------------------- docs/api/protobufjs/ts_proto_library.html | 18 ++---- docs/api/ts_config.html | 10 ---- docs/api/ts_repositories.html | 22 +++---- 6 files changed, 80 insertions(+), 125 deletions(-) diff --git a/docs/api/build_defs.html b/docs/api/build_defs.html index 0fe64259..4e9239a8 100644 --- a/docs/api/build_defs.html +++ b/docs/api/build_defs.html @@ -67,16 +67,6 @@ -
  • - Unit testing with Karma - -
  • Protocol Buffers
      @@ -209,7 +199,7 @@

      Attributes

      ts_library

      -
      ts_library(name, deps, srcs, compiler, internal_testing_type_check_dependencies, node_modules, supports_workers, tsconfig, tsickle_typed)
      +
      ts_library(name, deps, srcs, compile_angular_templates, compiler, internal_testing_type_check_dependencies, node_modules, supports_workers, tsconfig, tsickle_typed)

      ts_library type-checks and compiles a set of TypeScript sources to JavaScript.

      It produces declarations files (.d.ts) which are used for compiling downstream @@ -245,10 +235,17 @@

      Attributes

      The TypeScript source files to compile.

      + + compile_angular_templates + +

      Boolean; Optional; Default is False

      +

      Run the Angular ngtsc compiler under ts_library

      + + compiler -

      Label; Optional; Default is @build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped

      +

      Label; Optional; Default is @npm//@bazel/typescript/bin:tsc_wrapped

      Sets a different TypeScript compiler binary to use for this library. For example, we use the vanilla TypeScript tsc.js for bootstrapping, and Angular compilations can replace this with ngc.

      diff --git a/docs/api/devserver/ts_devserver.html b/docs/api/devserver/ts_devserver.html index 9c4febb2..22d1d37d 100644 --- a/docs/api/devserver/ts_devserver.html +++ b/docs/api/devserver/ts_devserver.html @@ -67,16 +67,6 @@
  • -
  • - Unit testing with Karma - -
  • Protocol Buffers
      @@ -110,12 +100,16 @@

      Macros

      ts_devserver_macro

      -
      ts_devserver_macro(tags, **kwargs)
      +
      ts_devserver_macro(name, data, args, visibility, tags, testonly, **kwargs)
      -

      ibazel wrapper for ts_devserver

      -

      This macro re-exposes the ts_devserver rule with some extra tags so that -it behaves correctly under ibazel.

      -

      This is re-exported in //:defs.bzl as ts_devserver so if you load the rule +

      Macro for creating a ts_devserver

      +

      This macro re-exposes a sh_binary and ts_devserver target that can run the +actual devserver implementation. +The ts_devserver rule is just responsible for generating a launcher script +that runs the Go devserver implementation. The sh_binary is the primary +target that matches the specified "name" and executes the generated bash +launcher script. +This is re-exported in //:defs.bzl as ts_devserver so if you load the rule from there, you actually get this macro.

      @@ -127,11 +121,46 @@

      Attributes

      + + name + +

      Name; Required

      +

      Name of the devserver target

      + + + + data + +

      List of strings; Optional

      +

      Runtime dependencies for the devserver

      + + + + args + +

      List of strings; Optional

      +

      Command line arguments that will be passed to the devserver Go implementation

      + + + + visibility + +

      Unknown; Optional

      +

      Visibility of the devserver targets

      + + tags

      List of strings; Optional

      -

      standard Bazel tags, this macro adds a couple for ibazel

      +

      Standard Bazel tags, this macro adds a couple for ibazel

      + + + + testonly + +

      Integer; Optional

      +

      Whether the devserver should only run in bazel test

      diff --git a/docs/api/index.html b/docs/api/index.html index b00ec920..76bd7941 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -67,16 +67,6 @@
  • -
  • - Unit testing with Karma - -
  • Protocol Buffers @@ -204,51 +193,20 @@

    Macros

    - - -

    Simple development server

    - -

    Rules

    - - - - - - - - - - - -
    - - ts_devserver - - -

    ts_devserver is a simple development server intended for a quick "getting started" experience.

    - -
    -

    Macros

    - - - - - -
    - - ts_devserver_macro + + ts_setup_dev_workspace -

    ibazel wrapper for ts_devserver

    +

    Setup the toolchain needed for local development, but not needed by users.

    -

    Unit testing with Karma

    +

    Simple development server

    Rules

    @@ -259,12 +217,12 @@

    Rules

    @@ -279,23 +237,12 @@

    Macros

    - - - - diff --git a/docs/api/protobufjs/ts_proto_library.html b/docs/api/protobufjs/ts_proto_library.html index b1db1ea3..c19d9db1 100644 --- a/docs/api/protobufjs/ts_proto_library.html +++ b/docs/api/protobufjs/ts_proto_library.html @@ -67,16 +67,6 @@ -
  • - Unit testing with Karma - -
  • Protocol Buffers
      @@ -111,7 +101,7 @@

      ts_proto_library

      Wraps https://github.com/dcodeIO/protobuf.js for use in Bazel.

      ts_proto_library has identical outputs to ts_library, so it can be used anywhere a ts_library can appear, such as in the deps[] of another ts_library.

      -
      load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_proto_library")
      +
      load("@npm_bazel_typescript//:defs.bzl", "ts_library", "ts_proto_library")
       
       proto_library(
           name = "car_proto",
      @@ -137,15 +127,15 @@ 

      ts_proto_library

      The JavaScript produced by protobuf.js has a runtime dependency on a support library. Under devmode (e.g. ts_devserver, ts_web_test_suite) you'll need to include these scripts in the bootstrap phase (before Require.js loads). You can use the label -@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts to reference these scripts +@npm_bazel_typescript//:protobufjs_bootstrap_scripts to reference these scripts in the bootstrap attribute of ts_web_test_suite or ts_devserver.

      To complete the example above, you could write a ts_web_test_suite:

      -
      load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test_suite")
      +
      load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite")
       
       ts_web_test_suite(
           name = "test",
           deps = ["test_lib"],
      -    bootstrap = ["@build_bazel_rules_typescript//:protobufjs_bootstrap_scripts"],
      +    bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"],
           browsers = [
             "@io_bazel_rules_webtesting//browsers:chromium-local",
             "@io_bazel_rules_webtesting//browsers:firefox-local",
      diff --git a/docs/api/ts_config.html b/docs/api/ts_config.html
      index 4dae48f5..c5dcbcb9 100644
      --- a/docs/api/ts_config.html
      +++ b/docs/api/ts_config.html
      @@ -67,16 +67,6 @@
           
         
  • -
  • - Unit testing with Karma - -
  • Protocol Buffers
      diff --git a/docs/api/ts_repositories.html b/docs/api/ts_repositories.html index 93135a78..1b27aaf4 100644 --- a/docs/api/ts_repositories.html +++ b/docs/api/ts_repositories.html @@ -67,16 +67,6 @@
  • -
  • - Unit testing with Karma - -
  • Protocol Buffers
      @@ -100,6 +90,7 @@

      Install toolchain dependencies

      Macros


      @@ -113,6 +104,17 @@

      ts_setup_workspace

      by the TypeScript rules.

      +
      + +

      ts_setup_dev_workspace

      + +
      ts_setup_dev_workspace()
      + +

      Setup the toolchain needed for local development, but not needed by users.

      +

      These needs to be in a separate file from ts_setup_workspace() so as not +to leak load statements.

      + + From 87de17128df91b5d901d497ead42bda9d45a9a34 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 20 Feb 2019 21:44:22 -0800 Subject: [PATCH 113/316] rel: 0.25.1 --- README.md | 2 +- WORKSPACE | 2 +- package.json | 2 +- version.bzl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b404de88..3819e0a8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Add the `@bazel/typescript` npm package to your `package.json` `devDependencies` { ... "devDependencies": { - "@bazel/typescript": "0.25.0", + "@bazel/typescript": "0.25.1", ... }, ... diff --git a/WORKSPACE b/WORKSPACE index 27b20982..b2e86ba8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -77,7 +77,7 @@ ts_setup_dev_workspace() # Test that check_rules_typescript_version works as expected load("//:defs.bzl", "check_rules_typescript_version") -check_rules_typescript_version(version_string = "0.25.0") +check_rules_typescript_version(version_string = "0.25.1") # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/package.json b/package.json index b416f5f4..d82e3f20 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "TypeScript rules for Bazel", "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.25.0", + "version": "0.25.1", "keywords": [ "typescript", "bazel" diff --git a/version.bzl b/version.bzl index 570c649b..f2953325 100644 --- a/version.bzl +++ b/version.bzl @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") -VERSION = "0.25.0" +VERSION = "0.25.1" # This version is the minimum version that is API compatible with this version # of rules_typescript. This version should be updated to equal VERSION for From 644e4c1c608383603c805827a172b8ad947a4620 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 21 Feb 2019 10:35:30 -0800 Subject: [PATCH 114/316] Include README in @bazel/karma package This way the docs are visibile on npmjs.com Closes #427 PiperOrigin-RevId: 235021720 --- DEVELOPING.md | 2 +- internal/karma/.gitignore | 2 -- internal/karma/BUILD.bazel | 11 +++++++++++ internal/karma/docs/BUILD.bazel | 3 ++- internal/karma/package.json | 3 --- 5 files changed, 14 insertions(+), 7 deletions(-) delete mode 100644 internal/karma/.gitignore diff --git a/DEVELOPING.md b/DEVELOPING.md index 81bc6e12..c5b36dd0 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -56,7 +56,7 @@ changes since the last tag - if so, this will be a minor, if not, it's a patch. (This may not sound like semver - but since our major version is a zero, the rule is that minors are breaking changes and patches are new features). -1. Re-generate the API docs: `yarn skydoc && (cd internal/karma; yarn skydoc)` +1. Re-generate the API docs: `yarn skydoc` 1. May be necessary if Go code has changed though probably it was already necessary to run this to keep CI green: `bazel run :gazelle` 1. If we depend on a newer rules_nodejs, update the `check_rules_nodejs_version` in `ts_repositories.bzl` 1. `git commit -a -m 'Update docs for release'` diff --git a/internal/karma/.gitignore b/internal/karma/.gitignore deleted file mode 100644 index bae2b585..00000000 --- a/internal/karma/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# This file is generated during the build -README.md diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel index f00ec1b3..54f69edf 100644 --- a/internal/karma/BUILD.bazel +++ b/internal/karma/BUILD.bazel @@ -65,6 +65,16 @@ genrule( cmd = "cp $< $@", ) +# Ugly genrule depending on local linux environment to build the README out of skylark doc generation. +# Only referenced when we do a release. +# TODO: This ought to be possible with stardoc alone. Need to coordinate with Chris Parsons. +genrule( + name = "generate_README", + srcs = ["//docs", "//docs:install.md"], + outs = ["README.md"], + cmd = "unzip -o -d docs $(location //docs:docs) && cat docs/install.md docs/*_web_test.md | sed 's/^##/\\\n##/' > $@", +) + npm_package( name = "npm_package", srcs = [ @@ -88,6 +98,7 @@ npm_package( deps = [ ":bazel_karma", ":license_copy", + ":generate_README" ], ) diff --git a/internal/karma/docs/BUILD.bazel b/internal/karma/docs/BUILD.bazel index dc0a3bc9..ff0476c2 100644 --- a/internal/karma/docs/BUILD.bazel +++ b/internal/karma/docs/BUILD.bazel @@ -1,5 +1,5 @@ load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc") - +exports_files(["install.md"]) skylark_doc( name = "docs", srcs = [ @@ -7,4 +7,5 @@ skylark_doc( "//:ts_web_test.bzl", ], format = "markdown", + visibility = ["//:__subpackages__"], ) diff --git a/internal/karma/package.json b/internal/karma/package.json index e714d267..5f71978d 100644 --- a/internal/karma/package.json +++ b/internal/karma/package.json @@ -43,8 +43,5 @@ "compatVersion": "0.0.0-COMPAT_VERSION", "rootPath": "." } - }, - "scripts": { - "skydoc": "bazel build --symlink_prefix=bazel- //docs && unzip -o -d docs bazel-bin/docs/docs-skydoc.zip && cat docs/install.md docs/*_web_test.md | sed 's/^##/\\\n##/' > README.md" } } From 57c8d4d02d28b95ca12a145538fa87e3ecc6b74b Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 21 Feb 2019 12:34:29 -0800 Subject: [PATCH 115/316] Cleanups for moving @bazel/typescript to rules_nodejs - add a missing third-party license - make a cleaner root build file, don't need fencing - introduce a new npm_package that fetches just the first-party google3 stuff we need in the other repo Closes #428 PiperOrigin-RevId: 235047429 --- BUILD.bazel | 51 +++-- .../bazel/src/main/protobuf/BUILD.bazel | 6 +- .../bazel/src/main/protobuf/LICENSE | 202 ++++++++++++++++++ 3 files changed, 235 insertions(+), 24 deletions(-) create mode 100644 third_party/github.com/bazelbuild/bazel/src/main/protobuf/LICENSE diff --git a/BUILD.bazel b/BUILD.bazel index c47ed666..b2b79b65 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -12,10 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# BEGIN-DEV-ONLY -# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. -# The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. -# # To update BUILD.bazel files after changing Go code, run # bazel run //:gazelle # @@ -23,11 +19,7 @@ # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") - -# END-DEV-ONLY load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") - -# BEGIN-DEV-ONLY load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") load("//:version.bzl", "COMPAT_VERSION") @@ -63,13 +55,18 @@ js_library( visibility = ["//visibility:public"], ) +genrule( + name = "generate_BUILD", + srcs = [], + outs = ["BUILD"], + cmd = "echo \"#marker that this is a bazel package\" > $@", +) + npm_package( name = "npm_package", srcs = [ - "BUILD.bazel", "LICENSE", "README.md", - "WORKSPACE", "defs.bzl", "package.bzl", "package.json", @@ -87,6 +84,7 @@ npm_package( "0.0.0-COMPAT_VERSION": COMPAT_VERSION, }, deps = [ + ":generate_BUILD", "//devserver:devserver-darwin", "//devserver:devserver-linux", "//devserver:devserver-windows", @@ -98,13 +96,26 @@ npm_package( ], ) -# Produces the release we publish to GitHub. Users download this starlark package -# to get the @npm_bazel_typescript workspace. -# FIXME(gregmagolan): strip the npm_package prefix from within the generated archive -# pkg_tar( -# name = "release", -# srcs = ["//:npm_package"], -# extension = "tgz", -# ) - -# END-DEV-ONLY +# This package is included in the npm_bazel_typescript package in rules_nodejs/packages/typescript +npm_package( + name = "npm_bazel_typescript_package", + srcs = [ + "//devserver:npm_package_assets", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", + "//internal:common/compilation.bzl", + "//internal:common/json_marshal.bzl", + "//internal:common/module_mappings.bzl", + "//internal:common/tsconfig.bzl", + ], + deps = [ + "//internal:generated_BUILD", + "//internal:tsc_wrapped", + "//devserver:devserver-darwin", + "//devserver:devserver-linux", + "//devserver:devserver-windows", + "//ts_auto_deps:ts_auto_deps-darwin", + "//ts_auto_deps:ts_auto_deps-linux", + "//ts_auto_deps:ts_auto_deps-windows", + ], + visibility = ["//visibility:public"], +) diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel index 24a43bf8..3b326019 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel @@ -35,9 +35,7 @@ go_library( filegroup( name = "npm_package_assets", - srcs = [ - "BUILD.bazel", - "worker_protocol.proto", - ], + srcs = glob(["*"]), + visibility = ["//visibility:public"], ) # END-DEV-ONLY diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/LICENSE b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/LICENSE new file mode 100644 index 00000000..7a4a3ea2 --- /dev/null +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file From a69aa2c226fbab420eeb8e54bf6897a3c1072f49 Mon Sep 17 00:00:00 2001 From: Lynn Chyi Date: Fri, 22 Feb 2019 08:51:20 -0800 Subject: [PATCH 116/316] Update README.md (#330) I ran into an error using self-managed deps because a `.proto` (I think it was worker_protocol) file was not included in my `@bazel/typescript` node_modules. It turns out that it was not included in the filegroup in my root `BUILD`. Hopefully this makes the getting started process a lot smoother for folks that need self-managed deps for some reason still. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3819e0a8..044cb389 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ filegroup( name = "node_modules", srcs = glob( include = [ + # Must include .proto files since the tsc_wrapped compiler utilizes them + "node_modules/**/*.proto", "node_modules/**/*.js", "node_modules/**/*.d.ts", "node_modules/**/*.json", From 84f9af9415bcb856df8a2bcfd4c81e3083352a3b Mon Sep 17 00:00:00 2001 From: radokirov Date: Fri, 22 Feb 2019 15:05:50 -0800 Subject: [PATCH 117/316] \nRemove e2e\n PiperOrigin-RevId: 235266333 --- README.md | 2 - .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 .../{tsconfig.json => tsconfig.json.oss} | 0 internal/e2e/strict_deps/BUILD | 39 ------------------- .../{tsconfig.json => tsconfig.json.oss} | 0 internal/tsc_wrapped/test_support.ts | 2 +- 16 files changed, 1 insertion(+), 42 deletions(-) rename internal/e2e/disable_tsetse_for_external/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/karma/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/karma_stack_trace/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/karma_typescript/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/ts_auto_deps/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/ts_devserver/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/typescript_2.7/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/typescript_2.8/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/typescript_2.9/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/typescript_3.0/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/npm_packages/typescript_3.1/{tsconfig.json => tsconfig.json.oss} (100%) rename internal/e2e/reference_types_directive/{tsconfig.json => tsconfig.json.oss} (100%) delete mode 100644 internal/e2e/strict_deps/BUILD rename internal/e2e/typescript_3.1/{tsconfig.json => tsconfig.json.oss} (100%) diff --git a/README.md b/README.md index 044cb389..3819e0a8 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,6 @@ filegroup( name = "node_modules", srcs = glob( include = [ - # Must include .proto files since the tsc_wrapped compiler utilizes them - "node_modules/**/*.proto", "node_modules/**/*.js", "node_modules/**/*.d.ts", "node_modules/**/*.json", diff --git a/internal/e2e/disable_tsetse_for_external/tsconfig.json b/internal/e2e/disable_tsetse_for_external/tsconfig.json.oss similarity index 100% rename from internal/e2e/disable_tsetse_for_external/tsconfig.json rename to internal/e2e/disable_tsetse_for_external/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/karma/tsconfig.json b/internal/e2e/npm_packages/karma/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/karma/tsconfig.json rename to internal/e2e/npm_packages/karma/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/karma_stack_trace/tsconfig.json b/internal/e2e/npm_packages/karma_stack_trace/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/karma_stack_trace/tsconfig.json rename to internal/e2e/npm_packages/karma_stack_trace/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/karma_typescript/tsconfig.json b/internal/e2e/npm_packages/karma_typescript/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/karma_typescript/tsconfig.json rename to internal/e2e/npm_packages/karma_typescript/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/ts_auto_deps/tsconfig.json b/internal/e2e/npm_packages/ts_auto_deps/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/ts_auto_deps/tsconfig.json rename to internal/e2e/npm_packages/ts_auto_deps/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/ts_devserver/tsconfig.json b/internal/e2e/npm_packages/ts_devserver/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/ts_devserver/tsconfig.json rename to internal/e2e/npm_packages/ts_devserver/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/typescript_2.7/tsconfig.json b/internal/e2e/npm_packages/typescript_2.7/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/typescript_2.7/tsconfig.json rename to internal/e2e/npm_packages/typescript_2.7/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/typescript_2.8/tsconfig.json b/internal/e2e/npm_packages/typescript_2.8/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/typescript_2.8/tsconfig.json rename to internal/e2e/npm_packages/typescript_2.8/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/typescript_2.9/tsconfig.json b/internal/e2e/npm_packages/typescript_2.9/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/typescript_2.9/tsconfig.json rename to internal/e2e/npm_packages/typescript_2.9/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/typescript_3.0/tsconfig.json b/internal/e2e/npm_packages/typescript_3.0/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/typescript_3.0/tsconfig.json rename to internal/e2e/npm_packages/typescript_3.0/tsconfig.json.oss diff --git a/internal/e2e/npm_packages/typescript_3.1/tsconfig.json b/internal/e2e/npm_packages/typescript_3.1/tsconfig.json.oss similarity index 100% rename from internal/e2e/npm_packages/typescript_3.1/tsconfig.json rename to internal/e2e/npm_packages/typescript_3.1/tsconfig.json.oss diff --git a/internal/e2e/reference_types_directive/tsconfig.json b/internal/e2e/reference_types_directive/tsconfig.json.oss similarity index 100% rename from internal/e2e/reference_types_directive/tsconfig.json rename to internal/e2e/reference_types_directive/tsconfig.json.oss diff --git a/internal/e2e/strict_deps/BUILD b/internal/e2e/strict_deps/BUILD deleted file mode 100644 index e2387a16..00000000 --- a/internal/e2e/strict_deps/BUILD +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//internal:defaults.bzl", "ts_library") - -licenses(["notice"]) # Apache 2.0 - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "grandparent", - srcs = ["grandparent.ts"], -) - -ts_library( - name = "parent", - srcs = ["parent.ts"], - deps = [":grandparent"], -) - -ts_library( - name = "strict_deps", - srcs = ["child.ts"], - expected_diagnostics = [ - "TS2307:child\.ts\(2,.*transitive dependency.*not allowed", - ], - deps = [":parent"], -) diff --git a/internal/e2e/typescript_3.1/tsconfig.json b/internal/e2e/typescript_3.1/tsconfig.json.oss similarity index 100% rename from internal/e2e/typescript_3.1/tsconfig.json rename to internal/e2e/typescript_3.1/tsconfig.json.oss diff --git a/internal/tsc_wrapped/test_support.ts b/internal/tsc_wrapped/test_support.ts index 6c99a3ea..5f592e69 100644 --- a/internal/tsc_wrapped/test_support.ts +++ b/internal/tsc_wrapped/test_support.ts @@ -23,7 +23,7 @@ import {FileCache} from './cache'; export function writeTempFile(name: string, contents: string): string { // TEST_TMPDIR is set by bazel. - const fn = (process.env.TEST_TMPDIR || '/tmp') + '/tmp.' + + const fn = (process.env['TEST_TMPDIR'] || '/tmp') + '/tmp.' + (Math.random() * 1000000).toFixed(0) + '.' + name; fs.writeFileSync(fn, contents); return fn; From fa655f64fbdb19d60c6eb9eacec5ee0f087a583a Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 22 Feb 2019 15:10:15 -0800 Subject: [PATCH 118/316] \nRemove e2e\n PiperOrigin-RevId: 235267098 --- .bazelci/presubmit.yml | 4 - .bazelignore | 3 - .ci/rules_typescript.json | 21 - .circleci/bazel.rc | 38 - .circleci/config.yml | 131 - .circleci/setup_cache.sh | 7 - .gitignore | 4 - README.md | 2 + WORKSPACE | 14 - internal/e2e/absolute_imports/BUILD.bazel | 25 - internal/e2e/absolute_imports/foo.ts | 2 - internal/e2e/absolute_imports/importer.ts | 1 - internal/e2e/default_tsconfig_test.js | 436 ---- .../disable_tsetse_for_external/BUILD.bazel | 23 - .../e2e/disable_tsetse_for_external/WORKSPACE | 15 - .../e2e/disable_tsetse_for_external/main.ts | 19 - .../tsconfig.json.oss | 0 internal/e2e/errorchecks/BUILD.bazel | 26 - internal/e2e/errorchecks/erroneous.ts | 1 - internal/e2e/errorchecks/erroneous_decl.d.ts | 2 - internal/e2e/npm_packages/README.md | 19 - internal/e2e/npm_packages/karma/.bazelrc | 6 - internal/e2e/npm_packages/karma/BUILD.bazel | 30 - internal/e2e/npm_packages/karma/README.md | 5 - internal/e2e/npm_packages/karma/WORKSPACE | 49 - .../npm_packages/karma/amd-modules.spec.js | 32 - internal/e2e/npm_packages/karma/decrement.js | 15 - .../e2e/npm_packages/karma/decrement.spec.js | 19 - .../npm_packages/karma/package-template.json | 9 - .../npm_packages/karma/requirejs-config.js | 8 - .../e2e/npm_packages/karma/tsconfig.json.oss | 0 .../npm_packages/karma/unnamed-amd-module.js | 5 - internal/e2e/npm_packages/karma/yarn.lock | 2199 ---------------- .../npm_packages/karma_stack_trace/.bazelrc | 6 - .../karma_stack_trace/BUILD.bazel | 53 - .../npm_packages/karma_stack_trace/WORKSPACE | 53 - .../karma_stack_trace/failing.spec.ts | 9 - .../karma_stack_trace/package-template.json | 11 - .../karma_stack_trace/test_folder/BUILD.bazel | 35 - .../karma_stack_trace/test_folder/hello.ts | 7 - .../test_folder/test.spec.ts | 11 - .../karma_stack_trace/test_sourcemap.sh | 25 - .../karma_stack_trace/tsconfig.json.oss | 0 .../npm_packages/karma_stack_trace/yarn.lock | 2306 ----------------- .../npm_packages/karma_typescript/.bazelrc | 6 - .../npm_packages/karma_typescript/BUILD.bazel | 42 - .../npm_packages/karma_typescript/WORKSPACE | 53 - .../karma_typescript/decrement.spec.ts | 7 - .../karma_typescript/decrement.ts | 3 - .../karma_typescript/package-template.json | 11 - .../karma_typescript/tsconfig.json.oss | 0 .../npm_packages/karma_typescript/yarn.lock | 2020 --------------- internal/e2e/npm_packages/test.sh | 72 - .../e2e/npm_packages/ts_auto_deps/.bazelrc | 6 - .../e2e/npm_packages/ts_auto_deps/BUILD.bazel | 15 - .../e2e/npm_packages/ts_auto_deps/WORKSPACE | 41 - .../ts_auto_deps/package-template.json | 9 - .../npm_packages/ts_auto_deps/simple/file.ts | 2 - .../ts_auto_deps/tsconfig.json.oss | 0 .../e2e/npm_packages/ts_auto_deps/yarn.lock | 242 -- .../e2e/npm_packages/ts_devserver/BUILD.bazel | 47 - .../e2e/npm_packages/ts_devserver/WORKSPACE | 41 - internal/e2e/npm_packages/ts_devserver/app.ts | 4 - .../npm_packages/ts_devserver/app_e2e_test.ts | 25 - .../e2e/npm_packages/ts_devserver/index.html | 21 - .../ts_devserver/package-template.json | 17 - .../ts_devserver/protractor.conf.js | 12 - .../ts_devserver/red-body-style.css | 3 - .../ts_devserver/subpackage/BUILD.bazel | 33 - .../ts_devserver/subpackage/index.html | 10 - .../subpackage/subpackage_e2e_test.ts | 17 - .../ts_devserver/tsconfig.json.oss | 5 - .../e2e/npm_packages/ts_devserver/yarn.lock | 1261 --------- .../e2e/npm_packages/typescript_2.7/.bazelrc | 6 - .../npm_packages/typescript_2.7/BUILD.bazel | 45 - .../e2e/npm_packages/typescript_2.7/WORKSPACE | 41 - .../npm_packages/typescript_2.7/main.spec.ts | 31 - .../e2e/npm_packages/typescript_2.7/main.ts | 3 - .../typescript_2.7/package-template.json | 12 - .../typescript_2.7/tsconfig.json.oss | 0 .../e2e/npm_packages/typescript_2.7/yarn.lock | 300 --- .../e2e/npm_packages/typescript_2.8/.bazelrc | 6 - .../npm_packages/typescript_2.8/BUILD.bazel | 45 - .../e2e/npm_packages/typescript_2.8/WORKSPACE | 41 - .../npm_packages/typescript_2.8/main.spec.ts | 31 - .../e2e/npm_packages/typescript_2.8/main.ts | 3 - .../typescript_2.8/package-template.json | 12 - .../typescript_2.8/tsconfig.json.oss | 0 .../e2e/npm_packages/typescript_2.8/yarn.lock | 300 --- .../e2e/npm_packages/typescript_2.9/.bazelrc | 6 - .../npm_packages/typescript_2.9/BUILD.bazel | 45 - .../e2e/npm_packages/typescript_2.9/WORKSPACE | 41 - .../npm_packages/typescript_2.9/main.spec.ts | 31 - .../e2e/npm_packages/typescript_2.9/main.ts | 3 - .../typescript_2.9/package-template.json | 12 - .../typescript_2.9/tsconfig.json.oss | 0 .../e2e/npm_packages/typescript_2.9/yarn.lock | 300 --- .../e2e/npm_packages/typescript_3.0/.bazelrc | 6 - .../npm_packages/typescript_3.0/BUILD.bazel | 45 - .../e2e/npm_packages/typescript_3.0/WORKSPACE | 41 - .../npm_packages/typescript_3.0/main.spec.ts | 31 - .../e2e/npm_packages/typescript_3.0/main.ts | 3 - .../typescript_3.0/package-template.json | 12 - .../typescript_3.0/tsconfig.json.oss | 0 .../e2e/npm_packages/typescript_3.0/yarn.lock | 300 --- .../e2e/npm_packages/typescript_3.1/.bazelrc | 6 - .../npm_packages/typescript_3.1/BUILD.bazel | 45 - .../e2e/npm_packages/typescript_3.1/WORKSPACE | 41 - .../npm_packages/typescript_3.1/main.spec.ts | 31 - .../e2e/npm_packages/typescript_3.1/main.ts | 3 - .../typescript_3.1/package-template.json | 12 - .../typescript_3.1/tsconfig.json.oss | 0 .../e2e/npm_packages/typescript_3.1/yarn.lock | 300 --- .../e2e/reference_types_directive/BUILD.bazel | 28 - .../reference_types_directive/package.json | 11 - .../reference_types.spec.ts | 21 - .../tsconfig.json.oss | 5 - .../tsconfig_types.ts | 3 - .../e2e/reference_types_directive/yarn.lock | 19 - internal/e2e/strict_deps/child.ts | 4 - internal/e2e/strict_deps/grandparent.ts | 1 - internal/e2e/strict_deps/parent.ts | 4 - internal/e2e/typescript_3.1/.bazelrc | 6 - internal/e2e/typescript_3.1/BUILD.bazel | 44 - internal/e2e/typescript_3.1/WORKSPACE | 38 - internal/e2e/typescript_3.1/main.spec.ts | 22 - internal/e2e/typescript_3.1/main.ts | 3 - internal/e2e/typescript_3.1/package.json | 15 - internal/e2e/typescript_3.1/tsconfig.json.oss | 0 internal/e2e/typescript_3.1/yarn.lock | 301 --- package.json | 5 +- 131 files changed, 3 insertions(+), 12428 deletions(-) delete mode 100644 .ci/rules_typescript.json delete mode 100644 .circleci/bazel.rc delete mode 100644 .circleci/config.yml delete mode 100755 .circleci/setup_cache.sh delete mode 100644 internal/e2e/absolute_imports/BUILD.bazel delete mode 100644 internal/e2e/absolute_imports/foo.ts delete mode 100644 internal/e2e/absolute_imports/importer.ts delete mode 100644 internal/e2e/default_tsconfig_test.js delete mode 100644 internal/e2e/disable_tsetse_for_external/BUILD.bazel delete mode 100644 internal/e2e/disable_tsetse_for_external/WORKSPACE delete mode 100644 internal/e2e/disable_tsetse_for_external/main.ts delete mode 100644 internal/e2e/disable_tsetse_for_external/tsconfig.json.oss delete mode 100644 internal/e2e/errorchecks/BUILD.bazel delete mode 100644 internal/e2e/errorchecks/erroneous.ts delete mode 100644 internal/e2e/errorchecks/erroneous_decl.d.ts delete mode 100644 internal/e2e/npm_packages/README.md delete mode 100644 internal/e2e/npm_packages/karma/.bazelrc delete mode 100644 internal/e2e/npm_packages/karma/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/karma/README.md delete mode 100644 internal/e2e/npm_packages/karma/WORKSPACE delete mode 100644 internal/e2e/npm_packages/karma/amd-modules.spec.js delete mode 100644 internal/e2e/npm_packages/karma/decrement.js delete mode 100644 internal/e2e/npm_packages/karma/decrement.spec.js delete mode 100644 internal/e2e/npm_packages/karma/package-template.json delete mode 100644 internal/e2e/npm_packages/karma/requirejs-config.js delete mode 100644 internal/e2e/npm_packages/karma/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/karma/unnamed-amd-module.js delete mode 100644 internal/e2e/npm_packages/karma/yarn.lock delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/.bazelrc delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/WORKSPACE delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/failing.spec.ts delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/package-template.json delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/test_folder/hello.ts delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/test_folder/test.spec.ts delete mode 100755 internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/karma_stack_trace/yarn.lock delete mode 100644 internal/e2e/npm_packages/karma_typescript/.bazelrc delete mode 100644 internal/e2e/npm_packages/karma_typescript/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/karma_typescript/WORKSPACE delete mode 100644 internal/e2e/npm_packages/karma_typescript/decrement.spec.ts delete mode 100644 internal/e2e/npm_packages/karma_typescript/decrement.ts delete mode 100644 internal/e2e/npm_packages/karma_typescript/package-template.json delete mode 100644 internal/e2e/npm_packages/karma_typescript/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/karma_typescript/yarn.lock delete mode 100755 internal/e2e/npm_packages/test.sh delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/.bazelrc delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/WORKSPACE delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/package-template.json delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/simple/file.ts delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/ts_auto_deps/yarn.lock delete mode 100644 internal/e2e/npm_packages/ts_devserver/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/ts_devserver/WORKSPACE delete mode 100644 internal/e2e/npm_packages/ts_devserver/app.ts delete mode 100644 internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts delete mode 100644 internal/e2e/npm_packages/ts_devserver/index.html delete mode 100644 internal/e2e/npm_packages/ts_devserver/package-template.json delete mode 100644 internal/e2e/npm_packages/ts_devserver/protractor.conf.js delete mode 100644 internal/e2e/npm_packages/ts_devserver/red-body-style.css delete mode 100644 internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/ts_devserver/subpackage/index.html delete mode 100644 internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts delete mode 100644 internal/e2e/npm_packages/ts_devserver/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/ts_devserver/yarn.lock delete mode 100644 internal/e2e/npm_packages/typescript_2.7/.bazelrc delete mode 100644 internal/e2e/npm_packages/typescript_2.7/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/typescript_2.7/WORKSPACE delete mode 100644 internal/e2e/npm_packages/typescript_2.7/main.spec.ts delete mode 100644 internal/e2e/npm_packages/typescript_2.7/main.ts delete mode 100644 internal/e2e/npm_packages/typescript_2.7/package-template.json delete mode 100644 internal/e2e/npm_packages/typescript_2.7/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/typescript_2.7/yarn.lock delete mode 100644 internal/e2e/npm_packages/typescript_2.8/.bazelrc delete mode 100644 internal/e2e/npm_packages/typescript_2.8/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/typescript_2.8/WORKSPACE delete mode 100644 internal/e2e/npm_packages/typescript_2.8/main.spec.ts delete mode 100644 internal/e2e/npm_packages/typescript_2.8/main.ts delete mode 100644 internal/e2e/npm_packages/typescript_2.8/package-template.json delete mode 100644 internal/e2e/npm_packages/typescript_2.8/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/typescript_2.8/yarn.lock delete mode 100644 internal/e2e/npm_packages/typescript_2.9/.bazelrc delete mode 100644 internal/e2e/npm_packages/typescript_2.9/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/typescript_2.9/WORKSPACE delete mode 100644 internal/e2e/npm_packages/typescript_2.9/main.spec.ts delete mode 100644 internal/e2e/npm_packages/typescript_2.9/main.ts delete mode 100644 internal/e2e/npm_packages/typescript_2.9/package-template.json delete mode 100644 internal/e2e/npm_packages/typescript_2.9/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/typescript_2.9/yarn.lock delete mode 100644 internal/e2e/npm_packages/typescript_3.0/.bazelrc delete mode 100644 internal/e2e/npm_packages/typescript_3.0/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/typescript_3.0/WORKSPACE delete mode 100644 internal/e2e/npm_packages/typescript_3.0/main.spec.ts delete mode 100644 internal/e2e/npm_packages/typescript_3.0/main.ts delete mode 100644 internal/e2e/npm_packages/typescript_3.0/package-template.json delete mode 100644 internal/e2e/npm_packages/typescript_3.0/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/typescript_3.0/yarn.lock delete mode 100644 internal/e2e/npm_packages/typescript_3.1/.bazelrc delete mode 100644 internal/e2e/npm_packages/typescript_3.1/BUILD.bazel delete mode 100644 internal/e2e/npm_packages/typescript_3.1/WORKSPACE delete mode 100644 internal/e2e/npm_packages/typescript_3.1/main.spec.ts delete mode 100644 internal/e2e/npm_packages/typescript_3.1/main.ts delete mode 100644 internal/e2e/npm_packages/typescript_3.1/package-template.json delete mode 100644 internal/e2e/npm_packages/typescript_3.1/tsconfig.json.oss delete mode 100644 internal/e2e/npm_packages/typescript_3.1/yarn.lock delete mode 100644 internal/e2e/reference_types_directive/BUILD.bazel delete mode 100644 internal/e2e/reference_types_directive/package.json delete mode 100644 internal/e2e/reference_types_directive/reference_types.spec.ts delete mode 100644 internal/e2e/reference_types_directive/tsconfig.json.oss delete mode 100644 internal/e2e/reference_types_directive/tsconfig_types.ts delete mode 100644 internal/e2e/reference_types_directive/yarn.lock delete mode 100644 internal/e2e/strict_deps/child.ts delete mode 100644 internal/e2e/strict_deps/grandparent.ts delete mode 100644 internal/e2e/strict_deps/parent.ts delete mode 100644 internal/e2e/typescript_3.1/.bazelrc delete mode 100644 internal/e2e/typescript_3.1/BUILD.bazel delete mode 100644 internal/e2e/typescript_3.1/WORKSPACE delete mode 100644 internal/e2e/typescript_3.1/main.spec.ts delete mode 100644 internal/e2e/typescript_3.1/main.ts delete mode 100644 internal/e2e/typescript_3.1/package.json delete mode 100644 internal/e2e/typescript_3.1/tsconfig.json.oss delete mode 100644 internal/e2e/typescript_3.1/yarn.lock diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 5d8f34e7..92b8746f 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -6,7 +6,6 @@ platforms: - "@nodejs//:yarn" build_targets: - "..." - - "@disable_tsetse_for_external_test//..." test_flags: # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1404 - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" @@ -18,7 +17,6 @@ platforms: - "@nodejs//:yarn" build_targets: - "..." - - "@disable_tsetse_for_external_test//..." # Run some targets again, but addressed as an external repo # TODO(alexeagle): run all of them after fixing https://github.com/bazelbuild/rules_typescript/issues/243 - "@npm_bazel_typescript//examples/some_library:lib" @@ -33,7 +31,6 @@ platforms: - "@nodejs//:yarn" build_targets: - "..." - - "@disable_tsetse_for_external_test//..." test_flags: # TODO(gregmagolan): chrome & firefox unknown breakage on macos target here; does work locally on mac - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" @@ -47,7 +44,6 @@ platforms: - "--action_env=PATH" build_targets: - "..." - - "@disable_tsetse_for_external_test//..." test_flags: - "--action_env=PATH" - "--test_env=PATH" diff --git a/.bazelignore b/.bazelignore index 8f1d7b0f..cf89afe1 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,5 +1,2 @@ node_modules devserver/devserver/test/test-workspace -internal/e2e/disable_tsetse_for_external -internal/e2e/npm_packages -internal/e2e/typescript_3.1 diff --git a/.ci/rules_typescript.json b/.ci/rules_typescript.json deleted file mode 100644 index 01a62edb..00000000 --- a/.ci/rules_typescript.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "configurations": [ - {"node": "linux-x86_64"}, - {"node": "ubuntu_16.04-x86_64"} - ], - "parameters": { - "configure": ["$BAZEL run @nodejs//:yarn"], - "test_tag_filters": ["-browser:chromium-local"] - } - }, - { - "configurations": [ - {"node": "darwin-x86_64"} - ], - "parameters": { - "configure": ["$BAZEL run @nodejs//:yarn"], - "test_tag_filters": ["-browser:chromium-local"] - } - } -] diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc deleted file mode 100644 index 595b37d6..00000000 --- a/.circleci/bazel.rc +++ /dev/null @@ -1,38 +0,0 @@ -# These options are enabled when running on CI -# We do this by copying this file to /etc/bazel.bazelrc at the start of the build. - -# Don't be spammy in the logs -build --noshow_progress - -# Don't run manual tests -test --test_tag_filters=-manual - -# Print all the options that apply to the build. -# This helps us diagnose which options override others -# (e.g. /etc/bazel.bazelrc vs. /.bazelrc) -build --announce_rc - -# Enable experimental CircleCI bazel remote cache proxy -build --experimental_remote_spawn_cache --remote_rest_cache=http://localhost:7643 - -# Prevent unstable environment variables from tainting cache keys -build --experimental_strict_action_env - -# Save downloaded repositories such as the go toolchain -# This directory can then be included in the CircleCI cache -# It should save time running the first build -build --experimental_repository_cache=/home/circleci/bazel_repository_cache - -# Workaround https://github.com/bazelbuild/bazel/issues/3645 -# Bazel doesn't calculate the memory ceiling correctly when running under Docker. -# Limit Bazel to consuming 2360K of RAM -build --local_resources=2360,1.0,1.0 -# Also limit Bazel's own JVM heap to stay within our 4G container limit -startup --host_jvm_args=-Xmx3g -# Since the default CircleCI container has only 4G, limiting the memory -# is required to keep Bazel from exhausting the memory. These values -# are determined experimentally. If the Bazel process crashes without -# any error messages then the --local_resources and --host_jvm_args -# memory should be reduced. If the Bazel process errors out within -# a "JVM out of memory" error then the --host_jvm_args memory should -# be increased. \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 883705f0..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,131 +0,0 @@ -# Configuration file for https://circleci.com/gh/bazelbuild/rules_typescript - -# Note: YAML anchors allow an object to be re-used, reducing duplication. -# The ampersand declares an alias for an object, then later the `<<: *name` -# syntax dereferences it. -# See http://blog.daemonl.com/2016/02/yaml.html -# To validate changes, use an online parser, eg. -# http://yaml-online-parser.appspot.com/ - -## IMPORTANT -# If you change the `docker_image` version, also change the `cache_key` suffix -var_1: &docker_image circleci/node:10.12-browsers -var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-internal/karma:node:{{ checksum "internal/karma/yarn.lock" }}-10.12-browsers -var_3: &setup-bazel-remote-cache - run: - name: Start up bazel remote cache proxy - command: ~/bazel-remote-proxy -backend circleci:// - background: true - -# Settings common to each job -anchor_1: &job_defaults - working_directory: ~/ts - # Use a docker image with bazel already installed - docker: - - image: *docker_image - -# After checkout, rebase on top of master. -# Similar to travis behavior, but not quite the same. -# See https://discuss.circleci.com/t/1662 -anchor_2: &post_checkout - post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge" - -version: 2 -jobs: - build: - <<: *job_defaults - steps: - - checkout: - <<: *post_checkout - - run: .circleci/setup_cache.sh - - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - *setup-bazel-remote-cache - - restore_cache: - key: *cache_key - - - run: yarn install - - run: yarn bazel info release - - run: yarn bazel build ... - - run: yarn bazel test ... - - run: 'cd internal/karma && - yarn install && - yarn bazel build ...' - - run: yarn bazel build @disable_tsetse_for_external_test//... - - # This job tests the same stuff, but without the .bazelrc file. - # It disables worker mode, for example. - build_no_bazelrc: - <<: *job_defaults - steps: - - checkout: - <<: *post_checkout - - run: .circleci/setup_cache.sh - - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - *setup-bazel-remote-cache - - restore_cache: - key: *cache_key - - - run: yarn install - - run: yarn bazel --bazelrc=/dev/null info release - # We cherry pick the memory utilization options from .circleci/bazel.rc here. - # Since the default CircleCI container has only 4G, limiting the memory - # is required to keep Bazel from exhausting the memory. - - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0 - - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0 - - run: 'cd internal/karma && - yarn install && - yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0' - - run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build @disable_tsetse_for_external_test//... --local_resources=2560,1.0,1.0 - - - save_cache: - key: *cache_key - paths: - - "node_modules" - - "internal/karma/node_modules" - - # Runs end-to-end browser tests. - test: - <<: *job_defaults - resource_class: xlarge - environment: - CHROMEDRIVER_VERSION_ARG: --versions.chrome 2.41 - steps: - - checkout: - <<: *post_checkout - - run: .circleci/setup_cache.sh - - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - *setup-bazel-remote-cache - - restore_cache: - key: *cache_key - - - run: yarn install - - run: xvfb-run -a yarn e2e - - lint: - <<: *job_defaults - steps: - - checkout: - <<: *post_checkout - - - run: yarn install - - # Run the skylark linter to check our Bazel rules - # Note, this is not yet enforced, because - # - buildifier doesn't exit non-zero in the presence of lint warnings: https://github.com/bazelbuild/buildtools/issues/470 - # - false positive for rule docstrings: https://github.com/bazelbuild/buildtools/issues/471 - - run: 'yarn bazel:lint || - (echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)' - - # Enforce that BUILD files are formatted. - - run: 'yarn bazel:format -mode=check || - (echo "BUILD files not formatted. Please run ''yarn bazel:format''" ; exit 1)' - -workflows: - version: 2 - # Run the two builds in parallel, reporting separate status to github PRs. - default_workflow: - jobs: - - build - - build_no_bazelrc - - test - - lint diff --git a/.circleci/setup_cache.sh b/.circleci/setup_cache.sh deleted file mode 100755 index 53462a20..00000000 --- a/.circleci/setup_cache.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -set -u -e - -readonly DOWNLOAD_URL="https://6-116431813-gh.circle-artifacts.com/0/pkg/bazel-remote-proxy-$(uname -s)_$(uname -m)" - -curl --fail -o ~/bazel-remote-proxy "$DOWNLOAD_URL" -chmod +x ~/bazel-remote-proxy diff --git a/.gitignore b/.gitignore index eea1acf5..ba9bf88d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,4 @@ .idea node_modules /bazel-* -/internal/e2e/npm_packages/*/bazel-* -/internal/e2e/npm_packages/*/package.json -/internal/e2e/npm_packages/ts_auto_deps/simple/BUILD -/internal/e2e/npm_packages/ts_auto_deps/simple/BUILD.bazel /internal/karma/bazel-* diff --git a/README.md b/README.md index 3819e0a8..044cb389 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ filegroup( name = "node_modules", srcs = glob( include = [ + # Must include .proto files since the tsc_wrapped compiler utilizes them + "node_modules/**/*.proto", "node_modules/**/*.js", "node_modules/**/*.d.ts", "node_modules/**/*.json", diff --git a/WORKSPACE b/WORKSPACE index b2e86ba8..9ee5c208 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -40,13 +40,6 @@ yarn_install( yarn_lock = "//examples/bazel_managed_deps:yarn.lock", ) -# Deps for the //internal/e2e/reference_types_directive test -yarn_install( - name = "build_bazel_rules_typescript_internal_reference_types_directive_deps", - package_json = "//internal/e2e/reference_types_directive:package.json", - yarn_lock = "//internal/e2e/reference_types_directive:yarn.lock", -) - # Install a hermetic version of node. node_repositories() @@ -98,13 +91,6 @@ load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") browser_repositories() -# Tell Bazel where the nested local repositories are that are -# used for tests -local_repository( - name = "disable_tsetse_for_external_test", - path = "internal/e2e/disable_tsetse_for_external", -) - local_repository( name = "devserver_test_workspace", path = "devserver/devserver/test/test-workspace", diff --git a/internal/e2e/absolute_imports/BUILD.bazel b/internal/e2e/absolute_imports/BUILD.bazel deleted file mode 100644 index a9f216c8..00000000 --- a/internal/e2e/absolute_imports/BUILD.bazel +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "absolute_imports", - srcs = glob(["*.ts"]), - expected_diagnostics = [ - "TS2307: Cannot find module 'internal/e2e/absolute_imports/foo'", - ], -) diff --git a/internal/e2e/absolute_imports/foo.ts b/internal/e2e/absolute_imports/foo.ts deleted file mode 100644 index ea26727c..00000000 --- a/internal/e2e/absolute_imports/foo.ts +++ /dev/null @@ -1,2 +0,0 @@ -const a = 1; -export default a; diff --git a/internal/e2e/absolute_imports/importer.ts b/internal/e2e/absolute_imports/importer.ts deleted file mode 100644 index 472d9e40..00000000 --- a/internal/e2e/absolute_imports/importer.ts +++ /dev/null @@ -1 +0,0 @@ -import foo from 'internal/e2e/absolute_imports/foo'; diff --git a/internal/e2e/default_tsconfig_test.js b/internal/e2e/default_tsconfig_test.js deleted file mode 100644 index dd909a47..00000000 --- a/internal/e2e/default_tsconfig_test.js +++ /dev/null @@ -1,436 +0,0 @@ -/** - * @fileoverview - * This tests interactions between multiple Bazel workspaces. - * - * We have learned from experience in the rules_nodejs repo that it's not - * practical to simply check in the nested WORKSPACE files and try to build - * them, because - * - it's hard to exclude them from the parent WORKSPACE - each nested workspace - * must be registered there with a matching name - * - testing a child workspace requires `cd` into the directory, which doesn't - * fit the CI model of `bazel test ...` - * - * The test is written in JavaScript simply to make it more portable, so we can - * run it on Windows for example. We don't use TypeScript here since we are - * running outside the build system. - */ - -const fs = require('fs'); -const path = require('path'); -const child_process = require('child_process'); -const os = require('os'); - -const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'wksp')); -const WORKSPACE_BOILERPLATE = ` -local_repository( - name = "npm_bazel_typescript", - path = "${process.cwd()}", -) -# Using rules_typescript_dev_dependencies for this test since we're not depending on the generated npm package -load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dev_dependencies") -rules_typescript_dev_dependencies() -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories() -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) -# Using ts_setup_dev_workspace for this test since we're not depending on the generated npm package -load("@npm_bazel_typescript//internal:ts_repositories.bzl", "ts_setup_dev_workspace") -ts_setup_dev_workspace() -`; - -const PACKAGE_JSON = `{ - "devDependencies": { - "@types/node": "7.0.18", - "protobufjs": "5.0.3", - "source-map-support": "0.5.9", - "tsickle": "0.33.1", - "tsutils": "2.27.2", - "typescript": "~3.1.3" - } -} -`; - -const YARN_LOCK = - `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -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" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tsickle@0.33.1: - version "0.33.1" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" - integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.7.3" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@~3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" -`; - -/** - * Create a file at path filename, creating parent directories as needed, under - * this test's temp directory. Write the content into that file. - */ -function write(filename, content) { - var parents = path.dirname(path.join(tmpdir, filename)); - while (path.dirname(parents) !== parents) { - if (!fs.existsSync(path.join(parents))) { - fs.mkdirSync(path.join(parents)); - } - parents = path.dirname(parents); - } - fs.writeFileSync(path.join(tmpdir, filename), content); -} - -function bazel(workspace, args) { - const result = child_process.spawnSync('bazel', args, { - cwd: path.join(tmpdir, workspace), - stdio: 'inherit', - }); - expect(result.status).toBe(0, 'bazel exited with non-zero exit code'); -} - -describe('default tsconfig', () => { - it(`uses the tsconfig in the workspace defining the rule, - not the workspace where the rule is defined (rules_typescript), nor - the workspace where the build is occurring`, - () => { - // Workspace 'a' can't compile with --noImplicitAny. - // When workspace 'b' has a dep here, we make sure not to use the - // tsconfig from workspace 'b' - write('a/package.json', PACKAGE_JSON); - write('a/yarn.lock', YARN_LOCK); - write('a/WORKSPACE', ` -workspace(name = "a") -${WORKSPACE_BOILERPLATE}`); - write('a/BUILD', ` -# We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm -# package in this test. This changes the ts_library compiler from the default -# which depends on @npm//@bazel/typescript which is not available in this test to '@npm_bazel_typescript//internal:tsc_wrapped_bin' which is -load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") -ts_library( - name = "a_lib", - srcs=["has_implicit_any.ts"], - visibility = ["//visibility:public"], -) - `); - write('a/tsconfig.json', `{}`); - write('a/has_implicit_any.ts', `function f(a) { - console.error(a); - }`); - - // Workspace 'b' has a default tsconfig that sets --noImplicitAny. - write('b/package.json', PACKAGE_JSON); - write('b/yarn.lock', YARN_LOCK); - write('b/WORKSPACE', ` -workspace(name="b") -local_repository(name="a", path="../a") -${WORKSPACE_BOILERPLATE}`); - write('b/BUILD', ` -# We use ts_library from internal/defaults.bzl since we don't have a @bazel/typescript npm -# package in this test. This changes the ts_library compiler from the default -# which depends on @npm//@bazel/typescript which is not available in this test to '@npm_bazel_typescript//internal:tsc_wrapped_bin' which is -load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") -exports_files(["tsconfig.json"]) -ts_library( - name = "b_lib", - srcs = ["file.ts"], - deps = ["@a//:a_lib"], -) - `); - write('b/file.ts', ` - f('thing'); - `); - write('b/tsconfig.json', `{ - "compilerOptions": { - "noImplicitAny": true - } - }`); - - // Now build from workspace 'b' and verify that the dep in workspace 'a' - // was able to compile. - bazel('b', ['build', ':all']); - }); -}); diff --git a/internal/e2e/disable_tsetse_for_external/BUILD.bazel b/internal/e2e/disable_tsetse_for_external/BUILD.bazel deleted file mode 100644 index ccdb610d..00000000 --- a/internal/e2e/disable_tsetse_for_external/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "main", - srcs = glob(["*.ts"]), - deps = ["@npm//@types"], -) diff --git a/internal/e2e/disable_tsetse_for_external/WORKSPACE b/internal/e2e/disable_tsetse_for_external/WORKSPACE deleted file mode 100644 index 96c1bacf..00000000 --- a/internal/e2e/disable_tsetse_for_external/WORKSPACE +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "disable_tsetse_for_external_test") diff --git a/internal/e2e/disable_tsetse_for_external/main.ts b/internal/e2e/disable_tsetse_for_external/main.ts deleted file mode 100644 index 691f11af..00000000 --- a/internal/e2e/disable_tsetse_for_external/main.ts +++ /dev/null @@ -1,19 +0,0 @@ -export {}; - -// string.trim() result is unused -let stringUnused; -stringUnused = 'hello'; -stringUnused.trim(); -const stringLiteralUnused = 'hello'; -stringLiteralUnused.trim(); - -// Array.concat() result is unused. -const arrayOfStringsUnused = ['hello']; -arrayOfStringsUnused.concat(arrayOfStringsUnused); - -// Object.create() result is unused -const objectUnused = {}; -Object.create(objectUnused); - -// string.replace() with a substring -stringUnused.replace('o', 'O'); diff --git a/internal/e2e/disable_tsetse_for_external/tsconfig.json.oss b/internal/e2e/disable_tsetse_for_external/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/errorchecks/BUILD.bazel b/internal/e2e/errorchecks/BUILD.bazel deleted file mode 100644 index 874aeb7a..00000000 --- a/internal/e2e/errorchecks/BUILD.bazel +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "erroneous", - srcs = glob(["*.ts"]), - expected_diagnostics = [ - "TS2322: Type '\"not a number\"' is not assignable to type 'number'", - "TS2304: Cannot find name 'TypeThatDoesNotExist'", - ], -) diff --git a/internal/e2e/errorchecks/erroneous.ts b/internal/e2e/errorchecks/erroneous.ts deleted file mode 100644 index b0a583ca..00000000 --- a/internal/e2e/errorchecks/erroneous.ts +++ /dev/null @@ -1 +0,0 @@ -export const x: number = 'not a number'; diff --git a/internal/e2e/errorchecks/erroneous_decl.d.ts b/internal/e2e/errorchecks/erroneous_decl.d.ts deleted file mode 100644 index c1a3b97d..00000000 --- a/internal/e2e/errorchecks/erroneous_decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ - -export declare class Foo { field: TypeThatDoesNotExist; } diff --git a/internal/e2e/npm_packages/README.md b/internal/e2e/npm_packages/README.md deleted file mode 100644 index 240a6229..00000000 --- a/internal/e2e/npm_packages/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# End-to-end tests for generated npm packages - -All tests that depend on the generated npm packages such as `@bazel/typescript` and `@bazel/karma` should -go in this folder. - -## Running - -These tests are run using `test.sh` which generates the `package.json` files in each directory before calling `yarn test`. -The `package.json` files are generated from template `package-template.json` files. The absolute locations of -the generated npm packages are substituted in when generating the `package.json` files. - -### Running an individual test - -To run a specific test run `yarn e2e-npm_packages --test ` where `` -is the name of the test folder to run. - -### Updating yarn.lock file - -To update the `yarn.lock` files for these tests run `yarn e2e-npm_packages --update-lock-files`. diff --git a/internal/e2e/npm_packages/karma/.bazelrc b/internal/e2e/npm_packages/karma/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/karma/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/karma/BUILD.bazel b/internal/e2e/npm_packages/karma/BUILD.bazel deleted file mode 100644 index d96a4050..00000000 --- a/internal/e2e/npm_packages/karma/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") - -ts_web_test_suite( - name = "testing", - srcs = glob(["*.js"]), - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - "@io_bazel_rules_webtesting//browsers:firefox-local", - ], - static_files = [ - ":unnamed-amd-module.js", - ], - deps = [ - ":requirejs-config.js", - ], -) diff --git a/internal/e2e/npm_packages/karma/README.md b/internal/e2e/npm_packages/karma/README.md deleted file mode 100644 index a9c02549..00000000 --- a/internal/e2e/npm_packages/karma/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Testing karma dependency - -A karma 3.0.0 dependency is here to verify that a user's karma dependency doesn't interfere with -the ts_web_test_suite rule which depends on a transitive dependency in @bazel/karma on a different -version of karma. diff --git a/internal/e2e/npm_packages/karma/WORKSPACE b/internal/e2e/npm_packages/karma/WORKSPACE deleted file mode 100644 index fee3fa61..00000000 --- a/internal/e2e/npm_packages/karma/WORKSPACE +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_karma_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") - -rules_karma_dependencies() - -load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") - -web_test_repositories() - -load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") - -browser_repositories() diff --git a/internal/e2e/npm_packages/karma/amd-modules.spec.js b/internal/e2e/npm_packages/karma/amd-modules.spec.js deleted file mode 100644 index c52e4040..00000000 --- a/internal/e2e/npm_packages/karma/amd-modules.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -define('npm_packages_karma_e2e/amd-modules.spec', ['require'], (require) => { - - describe('AMD module loading', () => { - - describe('unnamed amd modules', () => { - - it('should not warn if module is configured as static file', doneFn => { - spyOn(console, 'error'); - - require(['unnamed-module'], () => { - // Loading such an anonymous AMD module should not cause any error messages about - // a missing timestamp. This is a limitation of the "karma-requirejs" plugin which - // by default always prints an error for requests through Karma's proxy. - // See: https://github.com/karma-runner/karma-requirejs/issues/6 - expect(console.error).toHaveBeenCalledTimes(0); - doneFn(); - }); - }); - - it('should warn if module is not specified as static file', doneFn => { - spyOn(console, 'error').and.callThrough(); - - require(['unnamed-module-invalid-file'], - /* loaded callback */ () => {}, - /* error callback */ () => { - expect(console.error).toHaveBeenCalledWith(jasmine.stringMatching(/no timestamp/)); - doneFn(); - }); - }); - }); - }) -}); diff --git a/internal/e2e/npm_packages/karma/decrement.js b/internal/e2e/npm_packages/karma/decrement.js deleted file mode 100644 index 9743a400..00000000 --- a/internal/e2e/npm_packages/karma/decrement.js +++ /dev/null @@ -1,15 +0,0 @@ -(function(factory) { -if (typeof module === 'object' && typeof module.exports === 'object') { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; -} else if (typeof define === 'function' && define.amd) { - define('npm_packages_karma_e2e/decrement', ['require', 'exports'], factory); -} -})(function(require, exports) { -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); -function decrement(n) { - return n - 1; -} -exports.decrement = decrement; -}); diff --git a/internal/e2e/npm_packages/karma/decrement.spec.js b/internal/e2e/npm_packages/karma/decrement.spec.js deleted file mode 100644 index 6485d22b..00000000 --- a/internal/e2e/npm_packages/karma/decrement.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -(function(factory) { -if (typeof module === 'object' && typeof module.exports === 'object') { - var v = factory(require, exports); - if (v !== undefined) module.exports = v; -} else if (typeof define === 'function' && define.amd) { - define( - 'npm_packages_karma_e2e/decrement.spec', - ['require', 'exports', 'npm_packages_karma_e2e/decrement'], factory); -} -})(function(require, exports) { -'use strict'; -Object.defineProperty(exports, '__esModule', {value: true}); -var decrement_1 = require('npm_packages_karma_e2e/decrement'); -describe('decrementing', function() { - it('should do that', function() { - expect(decrement_1.decrement(1)).toBe(0); - }); -}); -}); diff --git a/internal/e2e/npm_packages/karma/package-template.json b/internal/e2e/npm_packages/karma/package-template.json deleted file mode 100644 index 9f22599a..00000000 --- a/internal/e2e/npm_packages/karma/package-template.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dependencies": { - "@bazel/karma": "file:${BAZEL_KARMA_NPM_PACKAGE}", - "karma": "3.0.0" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/karma/requirejs-config.js b/internal/e2e/npm_packages/karma/requirejs-config.js deleted file mode 100644 index 5ad31a12..00000000 --- a/internal/e2e/npm_packages/karma/requirejs-config.js +++ /dev/null @@ -1,8 +0,0 @@ -require.config({ - paths: { - // Configure some fake AMD module that exists and should not cause a loading - // error message from the "karma-requirejs" plugin which is enabled by default. - 'unnamed-module': '/base/npm_packages_karma_e2e/unnamed-amd-module', - 'unnamed-module-invalid-file': '/some-invalid-file-path', - } -}); diff --git a/internal/e2e/npm_packages/karma/tsconfig.json.oss b/internal/e2e/npm_packages/karma/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/karma/unnamed-amd-module.js b/internal/e2e/npm_packages/karma/unnamed-amd-module.js deleted file mode 100644 index fd58f4e6..00000000 --- a/internal/e2e/npm_packages/karma/unnamed-amd-module.js +++ /dev/null @@ -1,5 +0,0 @@ -// Unnamed AMD module definition which needs to be manually configured through -// a "requirejs" configuration whenever this module should be loaded. -define(function() { - // Just an empty definition. Nothing to assert here. -}); diff --git a/internal/e2e/npm_packages/karma/yarn.lock b/internal/e2e/npm_packages/karma/yarn.lock deleted file mode 100644 index 392dea6c..00000000 --- a/internal/e2e/npm_packages/karma/yarn.lock +++ /dev/null @@ -1,2199 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/npm_bazel_karma/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.0.0" - dependencies: - jasmine-core "2.8.0" - karma "^4.0.0" - karma-chrome-launcher "2.2.0" - karma-firefox-launcher "1.1.0" - karma-jasmine "1.1.1" - karma-requirejs "1.1.0" - karma-sauce-launcher "2.0.2" - karma-sourcemap-loader "0.3.7" - requirejs "2.3.5" - semver "5.6.0" - tmp "0.0.33" - -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== - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -adm-zip@~0.4.3: - version "0.4.13" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" - integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - integrity sha1-GdOGodntxufByF04iu28xW0zYC0= - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -async@^2.1.2: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== - dependencies: - lodash "^4.17.10" - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== - -blob@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" - integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== - -bluebird@^3.3.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" - integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== - -body-parser@^1.16.1: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - integrity sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY= - dependencies: - expand-range "^0.1.0" - -braces@^2.3.0, braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= - -chokidar@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.0" - braces "^2.3.0" - glob-parent "^3.1.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - lodash.debounce "^4.0.8" - normalize-path "^2.1.1" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - upath "^1.0.5" - optionalDependencies: - fsevents "^1.2.2" - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== - -circular-json@^0.5.5: - version "0.5.9" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" - integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -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= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -colors@^1.1.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" - integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - integrity sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y= - dependencies: - lodash "^4.5.0" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= - -component-emitter@1.2.1, component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js@^2.2.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" - integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== - -core-js@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" - integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= - -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@=3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" - integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.5" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" - integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - -es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" - integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== - -es6-promise@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" - integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - integrity sha1-SIsdHSRRyz06axks/AMPRMWFX+o= - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - integrity sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ= - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== - -follow-redirects@^1.0.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" - integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== - dependencies: - debug "=3.1.0" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= - dependencies: - null-check "^1.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.2.2: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" - integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@^7.1.1, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= - -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= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -http-errors@1.6.3, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.4.4: - 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-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= - dependencies: - is-extglob "^2.1.1" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= - -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== - dependencies: - buffer-alloc "^1.2.0" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jszip@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" - integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== - dependencies: - core-js "~2.3.0" - es6-promise "~3.0.2" - lie "~3.1.0" - pako "~1.0.2" - readable-stream "~2.0.6" - -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== - -karma-jasmine@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" - integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= - -karma-requirejs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" - integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= - -karma-sauce-launcher@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" - integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== - dependencies: - sauce-connect-launcher "^1.2.4" - saucelabs "^1.5.0" - selenium-webdriver "^4.0.0-alpha.1" - -karma-sourcemap-loader@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" - integrity sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg= - dependencies: - graceful-fs "^4.1.2" - -karma@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-3.0.0.tgz#6da83461a8a28d8224575c3b5b874e271b4730c3" - integrity sha512-ZTjyuDXVXhXsvJ1E4CnZzbCjSxD6sEdzEsFYogLuZM0yqvg/mgz+O+R1jb0J7uAQeuzdY8kJgx6hSNXLwFuHIQ== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.2.1" - -karma@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" - integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.5" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.3.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -lie@~3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= - -lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.5.0: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -log4js@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" - integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== - dependencies: - circular-json "^0.5.5" - date-format "^1.2.0" - debug "^3.1.0" - rfdc "^1.1.2" - streamroller "0.7.0" - -lru-cache@2.2.x: - version "2.2.4" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d" - integrity sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0= - -lru-cache@4.1.x: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@~2.1.18: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -mime@^2.3.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" - integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -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== - -nan@^2.9.2: - version "2.12.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" - integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== - -npm-packlist@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" - integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -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= - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -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.1, 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= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -pako@~1.0.2: - version "1.0.8" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" - integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -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= - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= - -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== - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" - integrity sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rfdc@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" - integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== - -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: - 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" - -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== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sauce-connect-launcher@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" - integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^2.2.1" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -sax@>=0.6.0, sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -selenium-webdriver@^4.0.0-alpha.1: - version "4.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" - integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== - dependencies: - jszip "^3.1.3" - rimraf "^2.5.4" - tmp "0.0.30" - xml2js "^0.4.17" - -semver@5.6.0, semver@^5.3.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - integrity sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ== - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-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= - -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tmp@0.0.33, tmp@0.0.x: - 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" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -useragent@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.2.1.tgz#cf593ef4f2d175875e8bb658ea92e18a4fd06d8e" - integrity sha1-z1k+9PLRdYdei7ZY6pLhik/QbY4= - dependencies: - lru-cache "2.2.x" - tmp "0.0.x" - -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - -which@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xml2js@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= diff --git a/internal/e2e/npm_packages/karma_stack_trace/.bazelrc b/internal/e2e/npm_packages/karma_stack_trace/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel deleted file mode 100644 index 63535a46..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/BUILD.bazel +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2019 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -exports_files(["tsconfig.json"]) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - "@npm//@types/jasmine", - ], -) - -# This is a test with failing test. This test is not directly run by CI. -# The sh_test below invokes this test and checks the source mapped lines in the -# stack trace. -ts_web_test_suite( - name = "karma_test", - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - ], - tags = ["manual"], # not run by CI - deps = [ - ":test_lib", - "//test_folder:test_lib", - ], -) - -sh_test( - name = "test_sourcemap", - srcs = ["test_sourcemap.sh"], - data = [ - ":karma_test", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE b/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE deleted file mode 100644 index 969276f2..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/WORKSPACE +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2019 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_karma_stack_trace") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") - -rules_karma_dependencies() - -load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") - -web_test_repositories() - -load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") - -browser_repositories() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/karma_stack_trace/failing.spec.ts b/internal/e2e/npm_packages/karma_stack_trace/failing.spec.ts deleted file mode 100644 index 5b77ed5b..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/failing.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This dummy export ensures that this file is compiled as a module instead -// of a script. -export {}; - -describe('stack trace', () => { - it('failing test', () => { - expect(true).toBe(false); - }); -}); diff --git a/internal/e2e/npm_packages/karma_stack_trace/package-template.json b/internal/e2e/npm_packages/karma_stack_trace/package-template.json deleted file mode 100644 index 4e167d87..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/package-template.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dependencies": { - "@bazel/karma": "file:${BAZEL_KARMA_NPM_PACKAGE}", - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "typescript": "3.1.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel b/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel deleted file mode 100644 index 100ddf29..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/test_folder/BUILD.bazel +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2019 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "hello", - srcs = glob( - ["*.ts"], - exclude = ["*.spec.ts"], - ), -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - ":hello", - "@npm//@types/jasmine", - ], -) diff --git a/internal/e2e/npm_packages/karma_stack_trace/test_folder/hello.ts b/internal/e2e/npm_packages/karma_stack_trace/test_folder/hello.ts deleted file mode 100644 index 72c2d1f9..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/test_folder/hello.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function sayHello() { - return 'Hello'; -} - -export function error() { - throw new Error('Error here'); -} \ No newline at end of file diff --git a/internal/e2e/npm_packages/karma_stack_trace/test_folder/test.spec.ts b/internal/e2e/npm_packages/karma_stack_trace/test_folder/test.spec.ts deleted file mode 100644 index 5ff40341..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/test_folder/test.spec.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { sayHello, error } from "./hello"; - -describe('multiple stack frames', () => { - it('failing test', () => { - expect(sayHello()).toBe('World'); - }); - - it('another failing test', () => { - expect(error()).toBe(null); - }); -}); diff --git a/internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh b/internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh deleted file mode 100755 index 1f733f8e..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/test_sourcemap.sh +++ /dev/null @@ -1,25 +0,0 @@ -# Execute first test. -OUTPUT=$(${RUNFILES_DIR}/npm_packages_karma_stack_trace/karma_test_chromium-local) - -# Test whether the package relative TS path is printed in stack trace. -echo ${OUTPUT} | grep -q "(failing.spec.ts:7:17" -if [[ "$?" != "0" ]]; then - echo "Did not find 'failing.spec.ts:7:17' in Karma stack trace" - exit 1 -fi - -# Test whether the package relative path inside a subdirectory is printed. -echo ${OUTPUT} | grep -q "(test_folder/test.spec.ts:5:23" -if [[ "$?" != "0" ]]; then - echo "Did not find 'test_folder/test.spec.ts:5:23' in Karma stack trace" - exit 1 -fi - -# Test whether stack trace with multiple stack frames mapped get printed. -echo ${OUTPUT} | grep -q "(test_folder/hello.ts:6:8" -if [[ "$?" != "0" ]]; then - echo "Did not find 'test_folder/hello.ts:6:8' in Karma stack trace" - exit 1 -fi - -exit 0 diff --git a/internal/e2e/npm_packages/karma_stack_trace/tsconfig.json.oss b/internal/e2e/npm_packages/karma_stack_trace/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/karma_stack_trace/yarn.lock b/internal/e2e/npm_packages/karma_stack_trace/yarn.lock deleted file mode 100644 index c6588b22..00000000 --- a/internal/e2e/npm_packages/karma_stack_trace/yarn.lock +++ /dev/null @@ -1,2306 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/npm_bazel_karma/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.0.0" - dependencies: - jasmine-core "2.8.0" - karma "^4.0.0" - karma-chrome-launcher "2.2.0" - karma-firefox-launcher "1.1.0" - karma-jasmine "1.1.1" - karma-requirejs "1.1.0" - karma-sauce-launcher "2.0.2" - karma-sourcemap-loader "0.3.7" - requirejs "2.3.5" - semver "5.6.0" - tmp "0.0.33" - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -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== - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -adm-zip@~0.4.3: - version "0.4.13" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" - integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - integrity sha1-GdOGodntxufByF04iu28xW0zYC0= - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -async@^2.1.2: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== - dependencies: - lodash "^4.17.10" - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== - -blob@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" - integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== - -bluebird@^3.3.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" - integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== - -body-parser@^1.16.1: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - integrity sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY= - dependencies: - expand-range "^0.1.0" - -braces@^2.3.0, braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -chokidar@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.0" - braces "^2.3.0" - glob-parent "^3.1.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - lodash.debounce "^4.0.8" - normalize-path "^2.1.1" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - upath "^1.0.5" - optionalDependencies: - fsevents "^1.2.2" - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== - -circular-json@^0.5.5: - version "0.5.9" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" - integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -colors@^1.1.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" - integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - integrity sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y= - dependencies: - lodash "^4.5.0" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= - -component-emitter@1.2.1, component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js@^2.2.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" - integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== - -core-js@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" - integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= - -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@=3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" - integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.5" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" - integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - -es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" - integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== - -es6-promise@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" - integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - integrity sha1-SIsdHSRRyz06axks/AMPRMWFX+o= - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - integrity sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ= - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== - -follow-redirects@^1.0.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" - integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== - dependencies: - debug "=3.1.0" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= - dependencies: - null-check "^1.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.2.2: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" - integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@^7.0.5, glob@^7.1.1, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= - -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= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -http-errors@1.6.3, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.4.4: - 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-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= - dependencies: - is-extglob "^2.1.1" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= - -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== - dependencies: - buffer-alloc "^1.2.0" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jszip@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" - integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== - dependencies: - core-js "~2.3.0" - es6-promise "~3.0.2" - lie "~3.1.0" - pako "~1.0.2" - readable-stream "~2.0.6" - -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== - -karma-jasmine@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" - integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= - -karma-requirejs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" - integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= - -karma-sauce-launcher@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" - integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== - dependencies: - sauce-connect-launcher "^1.2.4" - saucelabs "^1.5.0" - selenium-webdriver "^4.0.0-alpha.1" - -karma-sourcemap-loader@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" - integrity sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg= - dependencies: - graceful-fs "^4.1.2" - -karma@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" - integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.5" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.3.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lie@~3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= - -lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -log4js@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" - integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== - dependencies: - circular-json "^0.5.5" - date-format "^1.2.0" - debug "^3.1.0" - rfdc "^1.1.2" - streamroller "0.7.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -lru-cache@4.1.x: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@~2.1.18: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -mime@^2.3.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" - integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -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== - -nan@^2.9.2: - version "2.12.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" - integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== - -npm-packlist@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" - integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -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= - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -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-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, 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= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -pako@~1.0.2: - version "1.0.8" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" - integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -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= - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= - -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== - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" - integrity sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rfdc@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" - integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== - -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: - 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" - -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== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sauce-connect-launcher@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" - integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^2.2.1" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -sax@>=0.6.0, sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -selenium-webdriver@^4.0.0-alpha.1: - version "4.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" - integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== - dependencies: - jszip "^3.1.3" - rimraf "^2.5.4" - tmp "0.0.30" - xml2js "^0.4.17" - -semver@5.6.0, semver@^5.3.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - integrity sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ== - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-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= - -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tmp@0.0.33, tmp@0.0.x: - 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" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -typescript@3.1.x: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - -which@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xml2js@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= diff --git a/internal/e2e/npm_packages/karma_typescript/.bazelrc b/internal/e2e/npm_packages/karma_typescript/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/karma_typescript/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/karma_typescript/BUILD.bazel b/internal/e2e/npm_packages/karma_typescript/BUILD.bazel deleted file mode 100644 index e2311f12..00000000 --- a/internal/e2e/npm_packages/karma_typescript/BUILD.bazel +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "lib", - srcs = ["decrement.ts"], -) - -ts_library( - name = "tests", - testonly = 1, - srcs = glob(["*.spec.ts"]), - deps = [ - ":lib", - "@npm//@types/jasmine", - ], -) - -ts_web_test_suite( - name = "testing", - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - "@io_bazel_rules_webtesting//browsers:firefox-local", - ], - deps = [ - ":tests", - ], -) diff --git a/internal/e2e/npm_packages/karma_typescript/WORKSPACE b/internal/e2e/npm_packages/karma_typescript/WORKSPACE deleted file mode 100644 index 41fde934..00000000 --- a/internal/e2e/npm_packages/karma_typescript/WORKSPACE +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_package_karma_typescript_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") - -rules_karma_dependencies() - -load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") - -web_test_repositories() - -load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") - -browser_repositories() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/karma_typescript/decrement.spec.ts b/internal/e2e/npm_packages/karma_typescript/decrement.spec.ts deleted file mode 100644 index bf1bd91d..00000000 --- a/internal/e2e/npm_packages/karma_typescript/decrement.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {decrement} from './decrement'; - -describe('decrementing', () => { - it('should do that', () => { - expect(decrement(1)).toBe(0); - }); -}); diff --git a/internal/e2e/npm_packages/karma_typescript/decrement.ts b/internal/e2e/npm_packages/karma_typescript/decrement.ts deleted file mode 100644 index 7173ecc4..00000000 --- a/internal/e2e/npm_packages/karma_typescript/decrement.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function decrement(n: number) { - return n - 1; -} diff --git a/internal/e2e/npm_packages/karma_typescript/package-template.json b/internal/e2e/npm_packages/karma_typescript/package-template.json deleted file mode 100644 index a2d01b35..00000000 --- a/internal/e2e/npm_packages/karma_typescript/package-template.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dependencies": { - "@bazel/karma": "file:${BAZEL_KARMA_NPM_PACKAGE}", - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "typescript": "2.9.2" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/karma_typescript/tsconfig.json.oss b/internal/e2e/npm_packages/karma_typescript/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/karma_typescript/yarn.lock b/internal/e2e/npm_packages/karma_typescript/yarn.lock deleted file mode 100644 index e72c0ff2..00000000 --- a/internal/e2e/npm_packages/karma_typescript/yarn.lock +++ /dev/null @@ -1,2020 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/karma@file:../../../../../../../../../private/var/tmp/_bazel_greg/8018d2bc8e133e0b44c274b6423215ba/execroot/npm_bazel_karma/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.0.0" - dependencies: - jasmine-core "2.8.0" - karma "^4.0.0" - karma-chrome-launcher "2.2.0" - karma-firefox-launcher "1.1.0" - karma-jasmine "1.1.1" - karma-requirejs "1.1.0" - karma-sauce-launcher "2.0.2" - karma-sourcemap-loader "0.3.7" - requirejs "2.3.5" - semver "5.6.0" - tmp "0.0.33" - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -adm-zip@~0.4.3: - version "0.4.11" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a" - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - dependencies: - es6-promisify "^5.0.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - -async@^2.1.2: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - dependencies: - lodash "^4.17.10" - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - -blob@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" - -bluebird@^3.3.0: - version "3.5.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" - -body-parser@^1.16.1: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - dependencies: - expand-range "^0.1.0" - -braces@^2.3.0, braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -chokidar@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.0" - braces "^2.3.0" - glob-parent "^3.1.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - lodash.debounce "^4.0.8" - normalize-path "^2.1.1" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - upath "^1.0.5" - optionalDependencies: - fsevents "^1.2.2" - -chownr@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - -circular-json@^0.5.5: - version "0.5.9" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" - integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -colors@^1.1.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - dependencies: - lodash "^4.5.0" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - -component-emitter@1.2.1, component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - -core-js@^2.2.0: - version "2.5.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - -core-js@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" - integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -debug@=3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407" - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196" - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.4" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" - integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - -es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" - -es6-promise@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" - integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== - -follow-redirects@^1.0.0: - version "1.5.8" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.8.tgz#1dbfe13e45ad969f813e86c00e5296f525c885a1" - dependencies: - debug "=3.1.0" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - dependencies: - map-cache "^0.2.2" - -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - dependencies: - null-check "^1.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -fsevents@^1.2.2: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" - integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@^7.0.5, glob@^7.1.1: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -http-errors@1.6.3, http-errors@~1.6.3: - version "1.6.3" - resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - dependencies: - minimatch "^3.0.4" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -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" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= - dependencies: - is-extglob "^2.1.1" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - dependencies: - kind-of "^3.0.2" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - dependencies: - isobject "^3.0.1" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - dependencies: - buffer-alloc "^1.2.0" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jszip@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" - integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== - dependencies: - core-js "~2.3.0" - es6-promise "~3.0.2" - lie "~3.1.0" - pako "~1.0.2" - readable-stream "~2.0.6" - -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - -karma-jasmine@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" - -karma-requirejs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" - -karma-sauce-launcher@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" - integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== - dependencies: - sauce-connect-launcher "^1.2.4" - saucelabs "^1.5.0" - selenium-webdriver "^4.0.0-alpha.1" - -karma-sourcemap-loader@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" - dependencies: - graceful-fs "^4.1.2" - -karma@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" - integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.5" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.3.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -lie@~3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= - -lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - -log4js@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" - integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== - dependencies: - circular-json "^0.5.5" - date-format "^1.2.0" - debug "^3.1.0" - rfdc "^1.1.2" - streamroller "0.7.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -lru-cache@4.1.x: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - dependencies: - object-visit "^1.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@~1.36.0: - version "1.36.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" - -mime-types@~2.1.18: - version "2.1.20" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" - dependencies: - mime-db "~1.36.0" - -mime@^2.3.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" - integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minimist@~0.0.1: - version "0.0.10" - resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - -minipass@^2.2.1, minipass@^2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - -nan@^2.9.2: - version "2.11.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -needle@^2.2.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.3.tgz#c1b04da378cd634d8befe2de965dc2cfb0fd65ca" - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - -npm-packlist@^1.1.6: - version "1.1.11" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - dependencies: - isobject "^3.0.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -pako@~1.0.2: - version "1.0.8" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" - integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -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" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: - version "2.3.6" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - -rfdc@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" - integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== - -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -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" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - -sauce-connect-launcher@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" - integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^2.2.1" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -sax@>=0.6.0, sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - -selenium-webdriver@^4.0.0-alpha.1: - version "4.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" - integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== - dependencies: - jszip "^3.1.3" - rimraf "^2.5.4" - tmp "0.0.30" - xml2js "^0.4.17" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -semver@^5.3.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - dependencies: - extend-shallow "^3.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -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" - -tar@^4: - version "4.4.6" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" - dependencies: - chownr "^1.0.1" - fs-minipass "^1.2.5" - minipass "^2.3.3" - minizlib "^1.1.0" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tmp@0.0.33, tmp@0.0.x: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - dependencies: - tslib "^1.8.1" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -typescript@2.9.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - -which@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - dependencies: - string-width "^1.0.2 || 2" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xml2js@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" diff --git a/internal/e2e/npm_packages/test.sh b/internal/e2e/npm_packages/test.sh deleted file mode 100755 index 306b2f7e..00000000 --- a/internal/e2e/npm_packages/test.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash - -set -u -e -o pipefail - -TESTS_ROOT_DIR=$(cd $(dirname "$0"); pwd) -TYPESCRIPT_ROOT_DIR=$(cd $TESTS_ROOT_DIR/../../..; pwd) -KARMA_ROOT_DIR=$(cd $TESTS_ROOT_DIR/../../../internal/karma; pwd) - -echo "" -echo "#################################################################################" -echo "Running all npm package e2e tests under $TESTS_ROOT_DIR" -echo "" -echo "To run a specific test run this script with '--test ' where " -echo "is the name of the test folder to run" -echo "" -echo "Run this script with '--update-lock-files' to update yarn.lock files instead of running tests" -echo "" - -# Generate the npm packages @bazel/typescript and @bazel/karma npm packages and -# determine their absolute paths in bazel-bin -cd $TYPESCRIPT_ROOT_DIR -BAZEL=$(pwd)/node_modules/.bin/bazel -if [[ ! -f $BAZEL ]] ; then - echo "Bazel not found under $BAZEL" - exit 1 -fi -$BAZEL build //:npm_package -BAZEL_BIN_TYPESCRIPT=$($BAZEL info bazel-bin) -BAZEL_TYPESCRIPT_NPM_PACKAGE=$BAZEL_BIN_TYPESCRIPT/npm_package -cd $KARMA_ROOT_DIR -$BAZEL build //:npm_package -BAZEL_BIN_KARMA=$($BAZEL info bazel-bin) -BAZEL_KARMA_NPM_PACKAGE=$BAZEL_BIN_KARMA/npm_package -echo "@bazel/typescript: $BAZEL_TYPESCRIPT_NPM_PACKAGE" -echo "@bazel/karma: $BAZEL_KARMA_NPM_PACKAGE" - -# Now run all e2e tests -cd $TESTS_ROOT_DIR -for testDir in $(ls) ; do - [[ -d "$testDir" ]] || continue - ( - cd $testDir - echo "" - echo "#################################################################################" - echo "Running npm package e2e test $(pwd)" - echo "" - if [[ ! -f "package-template.json" ]] ; then - echo "No package-template.json file found in $testDir" - exit 1 - fi - # Generate package.json subsituting variables - # BAZEL_TYPESCRIPT_NPM_PACKAGE and BAZEL_KARMA_NPM_PACKAGE - ESCAPED_TYPESCRIPT=$(echo $BAZEL_TYPESCRIPT_NPM_PACKAGE | sed 's/\//\\\//g') - ESCAPED_KARMA=$(echo $BAZEL_KARMA_NPM_PACKAGE | sed 's/\//\\\//g') - sed -e "s/\${BAZEL_TYPESCRIPT_NPM_PACKAGE}/$ESCAPED_TYPESCRIPT/" -e "s/\${BAZEL_KARMA_NPM_PACKAGE}/$ESCAPED_KARMA/" package-template.json > package.json - if [[ $# -ge 1 && $1 = "--update-lock-files" ]] ; then - # Update yarn.lock files - echo "Running yarn install to update lock file" - yarn install - else - if [[ $# -ge 2 && $1 = "--test" && $2 != $testDir ]] ; then - # Skip this test - echo "Skipping test that was not specified in --test argument" - else - # Some tests like ts_auto_deps depend on node_modules - yarn install - # Run tests - yarn test - fi - fi - ) -done diff --git a/internal/e2e/npm_packages/ts_auto_deps/.bazelrc b/internal/e2e/npm_packages/ts_auto_deps/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/ts_auto_deps/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/ts_auto_deps/BUILD.bazel b/internal/e2e/npm_packages/ts_auto_deps/BUILD.bazel deleted file mode 100644 index abd01150..00000000 --- a/internal/e2e/npm_packages/ts_auto_deps/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -exports_files(["tsconfig.json"]) diff --git a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE b/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE deleted file mode 100644 index 3dddfc8b..00000000 --- a/internal/e2e/npm_packages/ts_auto_deps/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_ts_auto_deps_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/ts_auto_deps/package-template.json b/internal/e2e/npm_packages/ts_auto_deps/package-template.json deleted file mode 100644 index 44bcfa3b..00000000 --- a/internal/e2e/npm_packages/ts_auto_deps/package-template.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "typescript": "2.9.2" - }, - "scripts": { - "test": "cd simple && ts_auto_deps && bazel build simple" - } -} diff --git a/internal/e2e/npm_packages/ts_auto_deps/simple/file.ts b/internal/e2e/npm_packages/ts_auto_deps/simple/file.ts deleted file mode 100644 index bb2056c5..00000000 --- a/internal/e2e/npm_packages/ts_auto_deps/simple/file.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Test that a BUILD file is generated in this directory -export const a = 1; \ No newline at end of file diff --git a/internal/e2e/npm_packages/ts_auto_deps/tsconfig.json.oss b/internal/e2e/npm_packages/ts_auto_deps/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/ts_auto_deps/yarn.lock b/internal/e2e/npm_packages/ts_auto_deps/yarn.lock deleted file mode 100644 index 6a6c9f2e..00000000 --- a/internal/e2e/npm_packages/ts_auto_deps/yarn.lock +++ /dev/null @@ -1,242 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -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" - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@2.9.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs@^3.10.0: - version "3.32.0" - resolved "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/ts_devserver/BUILD.bazel b/internal/e2e/npm_packages/ts_devserver/BUILD.bazel deleted file mode 100644 index f7e2f11e..00000000 --- a/internal/e2e/npm_packages/ts_devserver/BUILD.bazel +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") - -exports_files([ - "red-body-style.css", - "tsconfig.json", -]) - -ts_library( - name = "app", - srcs = ["app.ts"], -) - -ts_devserver( - name = "devserver", - port = 8080, - # This is the path we'll request from the browser, see index.html - serving_path = "/bundle.min.js", - # The devserver can serve our static files too - static_files = ["index.html"], - # We'll collect all the devmode JS sources from these TypeScript libraries - deps = [":app"], -) - -ts_library( - name = "e2e", - testonly = 1, - srcs = ["app_e2e_test.ts"], - deps = [ - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//protractor", - ], -) diff --git a/internal/e2e/npm_packages/ts_devserver/WORKSPACE b/internal/e2e/npm_packages/ts_devserver/WORKSPACE deleted file mode 100644 index 95df7348..00000000 --- a/internal/e2e/npm_packages/ts_devserver/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_ts_devserver") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/ts_devserver/app.ts b/internal/e2e/npm_packages/ts_devserver/app.ts deleted file mode 100644 index 6c1c6e9d..00000000 --- a/internal/e2e/npm_packages/ts_devserver/app.ts +++ /dev/null @@ -1,4 +0,0 @@ -const el: HTMLDivElement = document.createElement('div'); -el.innerText = 'Hello, TypeScript'; -el.className = 'ts1'; -document.body.appendChild(el); diff --git a/internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts b/internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts deleted file mode 100644 index 1ce56fbc..00000000 --- a/internal/e2e/npm_packages/ts_devserver/app_e2e_test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {browser, by, element, ExpectedConditions} from 'protractor'; - -// This test uses Protractor without Angular, so disable Angular features -browser.waitForAngularEnabled(false); - -// Since we don't have a protractor bazel rule yet, the test is brought up in -// parallel with building the service under test. So the timeout must include -// compiling the application as well as starting the server. -const timeoutMs = 90 * 1000; - -describe('app', () => { - beforeAll(() => { - browser.get(''); - // Don't run any specs until we see a
      on the page. - browser.wait( - ExpectedConditions.presenceOf(element(by.css('div.ts1'))), - timeoutMs); - }, timeoutMs); - - it('should display: Hello, TypeScript', (done) => { - const div = element(by.css('div.ts1')); - div.getText().then(t => expect(t).toEqual(`Hello, TypeScript`)); - done(); - }); -}); diff --git a/internal/e2e/npm_packages/ts_devserver/index.html b/internal/e2e/npm_packages/ts_devserver/index.html deleted file mode 100644 index 8af1e7f6..00000000 --- a/internal/e2e/npm_packages/ts_devserver/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - ts_devserver example - - - - - - diff --git a/internal/e2e/npm_packages/ts_devserver/package-template.json b/internal/e2e/npm_packages/ts_devserver/package-template.json deleted file mode 100644 index 5a9c82e0..00000000 --- a/internal/e2e/npm_packages/ts_devserver/package-template.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "concurrently": "^3.5.1", - "jasmine": "2.8.0", - "protractor": "^5.2.0", - "typescript": "2.7.x" - }, - "scripts": { - "pretest": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG", - "wait-for-servers": "while [[ ! nc -z 127.0.0.1 8080 ]] || [[ ! nc -z 127.0.0.1 8081 ]]; do sleep 1; done", - "run-e2e-tests": "concurrently \"bazel run //:devserver\" \"yarn wait-for-servers\" --kill-others --success first", - "test": "bazel build ... && yarn run-e2e-tests" - } -} diff --git a/internal/e2e/npm_packages/ts_devserver/protractor.conf.js b/internal/e2e/npm_packages/ts_devserver/protractor.conf.js deleted file mode 100644 index 725b81e5..00000000 --- a/internal/e2e/npm_packages/ts_devserver/protractor.conf.js +++ /dev/null @@ -1,12 +0,0 @@ -exports.config = { - specs: [ - 'bazel-bin/**/*_e2e_test.js', - ], - capabilities: { - browserName: 'chrome', - chromeOptions: {args: ['--no-sandbox']} - }, - directConnect: true, - baseUrl: 'http://localhost:8080/', - framework: 'jasmine', -}; diff --git a/internal/e2e/npm_packages/ts_devserver/red-body-style.css b/internal/e2e/npm_packages/ts_devserver/red-body-style.css deleted file mode 100644 index 5c5e887d..00000000 --- a/internal/e2e/npm_packages/ts_devserver/red-body-style.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - background: red; -} diff --git a/internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel b/internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel deleted file mode 100644 index b68ac440..00000000 --- a/internal/e2e/npm_packages/ts_devserver/subpackage/BUILD.bazel +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") - -ts_devserver( - name = "devserver", - index_html = "index.html", - port = 8081, - static_files = ["//:red-body-style.css"], -) - -ts_library( - name = "e2e", - testonly = 1, - srcs = ["subpackage_e2e_test.ts"], - deps = [ - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//protractor", - ], -) diff --git a/internal/e2e/npm_packages/ts_devserver/subpackage/index.html b/internal/e2e/npm_packages/ts_devserver/subpackage/index.html deleted file mode 100644 index 4ea2bf3c..00000000 --- a/internal/e2e/npm_packages/ts_devserver/subpackage/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Subpackage Devserver - - - This is the devserver for a Bazel subpackage. - - diff --git a/internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts b/internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts deleted file mode 100644 index 281ea393..00000000 --- a/internal/e2e/npm_packages/ts_devserver/subpackage/subpackage_e2e_test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {browser, by, element} from 'protractor'; - -describe('subpackage', () => { - - beforeAll(async () => { - await browser.waitForAngularEnabled(false); - await browser.get('http://127.0.0.1:8081/'); - }); - - // Ensures that the "ts_devserver" properly injects and loads static files which - // are in the current workspace, but not part of the current Bazel package. See - // related issue: https://github.com/bazelbuild/rules_typescript/issues/409 - it('should be able to properly load the injected CSS file', async () => { - const bodyElement = element(by.css('body')); - expect(await bodyElement.getCssValue('background')).toContain('rgb(255, 0, 0)'); - }); -}); diff --git a/internal/e2e/npm_packages/ts_devserver/tsconfig.json.oss b/internal/e2e/npm_packages/ts_devserver/tsconfig.json.oss deleted file mode 100644 index 40dd2251..00000000 --- a/internal/e2e/npm_packages/ts_devserver/tsconfig.json.oss +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "lib": ["es2015", "dom"] - } -} diff --git a/internal/e2e/npm_packages/ts_devserver/yarn.lock b/internal/e2e/npm_packages/ts_devserver/yarn.lock deleted file mode 100644 index 64043372..00000000 --- a/internal/e2e/npm_packages/ts_devserver/yarn.lock +++ /dev/null @@ -1,1261 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -"@types/q@^0.0.32": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@types/q/-/q-0.0.32.tgz#bd284e57c84f1325da702babfc82a5328190c0c5" - integrity sha1-vShOV8hPEyXacCur/IKlMoGQwMU= - -"@types/selenium-webdriver@^3.0.0": - version "3.0.14" - resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz#0b20a2370e6b1b8322c9c3dfcaa409e6c7c0c0a9" - integrity sha512-4GbNCDs98uHCT/OMv40qQC/OpoPbYn9XdXeTiFwHBBFO6eJhYEPUu2zDKirXSbHlvDV8oZ9l8EQ+HrEx/YS9DQ== - -adm-zip@^0.4.9: - version "0.4.13" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" - integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - -ajv@^6.5.5: - version "6.7.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.7.0.tgz#e3ce7bb372d6577bb1839f1dfdfcbf5ad2948d96" - integrity sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg== - 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-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -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" - -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= - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -blocking-proxy@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/blocking-proxy/-/blocking-proxy-1.0.1.tgz#81d6fd1fe13a4c0d6957df7f91b75e98dac40cb2" - integrity sha512-KE8NFMZr3mN2E0HcvCgRtX7DjhiIQrwle+nSVJVC/yqFb9+xznHl2ZcoBp2L9qzkI4t4cBFJ1efXF8Dwi132RA== - dependencies: - minimist "^1.2.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browserstack@^1.5.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/browserstack/-/browserstack-1.5.2.tgz#17d8bb76127a1cc0ea416424df80d218f803673f" - integrity sha512-+6AFt9HzhKykcPF79W6yjEUJcdvZOV0lIXdkORXMJftGrDl0OKWqRF4GHqpDNkxiceDT/uB7Fb/aDwktvXX7dg== - dependencies: - https-proxy-agent "^2.2.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - 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@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.4.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -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" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== - dependencies: - delayed-stream "~1.0.0" - -commander@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" - integrity sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concurrently@^3.5.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.6.1.tgz#2f95baec5c4051294dfbb55b57a3b98a3e2b45ec" - integrity sha512-/+ugz+gwFSEfTGUxn0KHkY+19XPRTXR8+7oUK/HxgiN1n7FjeJmkrbSiXAJfyQ0zORgJYPaenmymwon51YXH9Q== - dependencies: - chalk "^2.4.1" - commander "2.6.0" - date-fns "^1.23.0" - lodash "^4.5.1" - read-pkg "^3.0.0" - rx "2.3.24" - spawn-command "^0.0.2-1" - supports-color "^3.2.3" - tree-kill "^1.1.0" - -core-js@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" - integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -date-fns@^1.23.0: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -del@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" - integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== - -es6-promise@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" - integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-string-regexp@^1.0.2, 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= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -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== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^2.0.1: - version "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-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= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - 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" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -hosted-git-info@^2.1.4: - version "2.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" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@~2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -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-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= - dependencies: - builtin-modules "^1.0.0" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= - -is-path-in-cwd@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= - dependencies: - path-is-inside "^1.0.1" - -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= - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -jasmine-core@2.8.0, jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -jasminewd2@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-2.2.0.tgz#e37cf0b17f199cce23bea71b2039395246b4ec4e" - integrity sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4= - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -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" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -jszip@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" - integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== - dependencies: - core-js "~2.3.0" - es6-promise "~3.0.2" - lie "~3.1.0" - pako "~1.0.2" - readable-stream "~2.0.6" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lie@~3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -lodash@^4.5.1: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -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== - -normalize-package-data@^2.3.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.2.tgz#6b2abd85774e51f7936f1395e45acb905dc849b2" - integrity sha512-YcMnjqeoUckXTPKZSAsPjUPLxH85XotbpqK3w4RyCwdFQSU5FxxBys8buehkSfg0j9fKvV1hn7O0+8reEgkAiw== - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optimist@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-tmpdir@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -pako@~1.0.2: - version "1.0.8" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" - integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -path-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.1: - 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-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.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= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - 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= - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -protractor@^5.2.0: - version "5.4.2" - resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.4.2.tgz#329efe37f48b2141ab9467799be2d4d12eb48c13" - integrity sha512-zlIj64Cr6IOWP7RwxVeD8O4UskLYPoyIcg0HboWJL9T79F1F0VWtKkGTr/9GN6BKL+/Q/GmM7C9kFVCfDbP5sA== - dependencies: - "@types/q" "^0.0.32" - "@types/selenium-webdriver" "^3.0.0" - blocking-proxy "^1.0.0" - browserstack "^1.5.1" - chalk "^1.1.3" - glob "^7.0.3" - jasmine "2.8.0" - jasminewd2 "^2.1.0" - optimist "~0.6.0" - q "1.4.1" - saucelabs "^1.5.0" - selenium-webdriver "3.6.0" - source-map-support "~0.4.0" - webdriver-js-extender "2.1.0" - webdriver-manager "^12.0.6" - -psl@^1.1.24: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -q@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" - integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4= - -q@^1.4.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - -qs@~6.5.2: - version "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@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -readable-stream@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -request@^2.87.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4: - 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" - -rx@2.3.24: - version "2.3.24" - resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" - integrity sha1-FPlQpCF9fjXapxu8vljv9o6ksrc= - -safe-buffer@^5.0.1, safe-buffer@^5.1.2: - 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: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -sax@>=0.6.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -selenium-webdriver@3.6.0, selenium-webdriver@^3.0.1: - version "3.6.0" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz#2ba87a1662c020b8988c981ae62cb2a01298eafc" - integrity sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q== - dependencies: - jszip "^3.1.3" - rimraf "^2.5.4" - tmp "0.0.30" - xml2js "^0.4.17" - -"semver@2 || 3 || 4 || 5", semver@5.6.0, semver@^5.3.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@~0.4.0: - version "0.4.18" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" - integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== - dependencies: - source-map "^0.5.6" - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= - -spdx-correct@^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== - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tree-kill@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.1.tgz#5398f374e2f292b9dcc7b2e71e30a5c3bb6c743a" - integrity sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q== - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - 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" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -typescript@2.7.x: - version "2.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@^3.3.2: - version "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" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -webdriver-js-extender@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz#57d7a93c00db4cc8d556e4d3db4b5db0a80c3bb7" - integrity sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ== - dependencies: - "@types/selenium-webdriver" "^3.0.0" - selenium-webdriver "^3.0.1" - -webdriver-manager@^12.0.6: - version "12.1.1" - resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.1.tgz#66c3271f69cefdaa9fdfca617ae95afae41c3c62" - integrity sha512-L9TEQmZs6JbMMRQI1w60mfps265/NCr0toYJl7p/R2OAk6oXAfwI6jqYP7EWae+d7Ad2S2Aj4+rzxoSjqk3ZuA== - dependencies: - adm-zip "^0.4.9" - chalk "^1.1.1" - del "^2.2.0" - glob "^7.0.3" - ini "^1.3.4" - minimist "^1.2.0" - q "^1.4.1" - request "^2.87.0" - rimraf "^2.5.2" - semver "^5.3.0" - xml2js "^0.4.17" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -xml2js@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.7/.bazelrc b/internal/e2e/npm_packages/typescript_2.7/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel deleted file mode 100644 index 0f08b301..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "main", - srcs = ["main.ts"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - ":main", - "@npm//@bazel/typescript", - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -jasmine_node_test( - name = "test", - data = [ - # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", - ], - deps = [ - ":test_lib", - "@npm//jasmine", - ], -) diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE deleted file mode 100644 index edbf7625..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_typescript_27_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.7/main.spec.ts b/internal/e2e/npm_packages/typescript_2.7/main.spec.ts deleted file mode 100644 index bef817ea..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/main.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as main from './main'; -import * as ts from 'typescript'; - -describe('main', () => { - it('should compile and run with @bazel/typescript npm package', () => { - expect(main.test()).toEqual('test'); - }); - - it('should successfully require @bazel/typescript', () => { - try { - const {debug} = require('@bazel/typescript'); - debug('test'); - } catch (e) { - fail(e.toString()) - } - }); - - it('runtime version of typescript should be correct', () => { - expect(ts.version).toEqual('2.7.2'); - }); - - it('should successfully require built-in node module \'os\'', () => { - try { - const os = require('os'); - console.log('Platform: ' + os.platform()); - console.log('Architecture: ' + os.arch()); - } catch (e) { - fail(e.toString()) - } - }); -}); diff --git a/internal/e2e/npm_packages/typescript_2.7/main.ts b/internal/e2e/npm_packages/typescript_2.7/main.ts deleted file mode 100644 index 36f3fab5..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function test() { - return 'test'; -} \ No newline at end of file diff --git a/internal/e2e/npm_packages/typescript_2.7/package-template.json b/internal/e2e/npm_packages/typescript_2.7/package-template.json deleted file mode 100644 index dd80dfa7..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/package-template.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "jasmine": "2.8.0", - "typescript": "2.7.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/typescript_2.7/tsconfig.json.oss b/internal/e2e/npm_packages/typescript_2.7/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/typescript_2.7/yarn.lock b/internal/e2e/npm_packages/typescript_2.7/yarn.lock deleted file mode 100644 index 3ccf2bfc..00000000 --- a/internal/e2e/npm_packages/typescript_2.7/yarn.lock +++ /dev/null @@ -1,300 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@2.8.0, jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@2.7.x: - version "2.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.8/.bazelrc b/internal/e2e/npm_packages/typescript_2.8/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel deleted file mode 100644 index 0f08b301..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "main", - srcs = ["main.ts"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - ":main", - "@npm//@bazel/typescript", - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -jasmine_node_test( - name = "test", - data = [ - # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", - ], - deps = [ - ":test_lib", - "@npm//jasmine", - ], -) diff --git a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE b/internal/e2e/npm_packages/typescript_2.8/WORKSPACE deleted file mode 100644 index 55c47cc6..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_typescript_28_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.8/main.spec.ts b/internal/e2e/npm_packages/typescript_2.8/main.spec.ts deleted file mode 100644 index 99e2d47b..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/main.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as main from './main'; -import * as ts from 'typescript'; - -describe('main', () => { - it('should compile and run with @bazel/typescript npm package', () => { - expect(main.test()).toEqual('test'); - }); - - it('should successfully require @bazel/typescript', () => { - try { - const {debug} = require('@bazel/typescript'); - debug('test'); - } catch (e) { - fail(e.toString()) - } - }); - - it('runtime version of typescript should be correct', () => { - expect(ts.version).toEqual('2.8.4'); - }); - - it('should successfully require built-in node module \'os\'', () => { - try { - const os = require('os'); - console.log('Platform: ' + os.platform()); - console.log('Architecture: ' + os.arch()); - } catch (e) { - fail(e.toString()) - } - }); -}); diff --git a/internal/e2e/npm_packages/typescript_2.8/main.ts b/internal/e2e/npm_packages/typescript_2.8/main.ts deleted file mode 100644 index 36f3fab5..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function test() { - return 'test'; -} \ No newline at end of file diff --git a/internal/e2e/npm_packages/typescript_2.8/package-template.json b/internal/e2e/npm_packages/typescript_2.8/package-template.json deleted file mode 100644 index b0fb4851..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/package-template.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "jasmine": "2.8.0", - "typescript": "2.8.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/typescript_2.8/tsconfig.json.oss b/internal/e2e/npm_packages/typescript_2.8/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/typescript_2.8/yarn.lock b/internal/e2e/npm_packages/typescript_2.8/yarn.lock deleted file mode 100644 index b5348dcf..00000000 --- a/internal/e2e/npm_packages/typescript_2.8/yarn.lock +++ /dev/null @@ -1,300 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@2.8.0, jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@2.8.x: - version "2.8.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.4.tgz#0b1db68e6bdfb0b767fa2ab642136a35b059b199" - integrity sha512-IIU5cN1mR5J3z9jjdESJbnxikTrEz3lzAw/D0Tf45jHpBp55nY31UkUvmVHoffCfKHTqJs3fCLPDxknQTTFegQ== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_2.9/.bazelrc b/internal/e2e/npm_packages/typescript_2.9/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel deleted file mode 100644 index 0f08b301..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "main", - srcs = ["main.ts"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - ":main", - "@npm//@bazel/typescript", - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -jasmine_node_test( - name = "test", - data = [ - # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", - ], - deps = [ - ":test_lib", - "@npm//jasmine", - ], -) diff --git a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE b/internal/e2e/npm_packages/typescript_2.9/WORKSPACE deleted file mode 100644 index a01a0f0c..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_typescript_29_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_2.9/main.spec.ts b/internal/e2e/npm_packages/typescript_2.9/main.spec.ts deleted file mode 100644 index 1c4a0b24..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/main.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as main from './main'; -import * as ts from 'typescript'; - -describe('main', () => { - it('should compile and run with @bazel/typescript npm package', () => { - expect(main.test()).toEqual('test'); - }); - - it('should successfully require @bazel/typescript', () => { - try { - const {debug} = require('@bazel/typescript'); - debug('test'); - } catch (e) { - fail(e.toString()) - } - }); - - it('runtime version of typescript should be correct', () => { - expect(ts.version).toEqual('2.9.2'); - }); - - it('should successfully require built-in node module \'os\'', () => { - try { - const os = require('os'); - console.log('Platform: ' + os.platform()); - console.log('Architecture: ' + os.arch()); - } catch (e) { - fail(e.toString()) - } - }); -}); diff --git a/internal/e2e/npm_packages/typescript_2.9/main.ts b/internal/e2e/npm_packages/typescript_2.9/main.ts deleted file mode 100644 index 36f3fab5..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function test() { - return 'test'; -} \ No newline at end of file diff --git a/internal/e2e/npm_packages/typescript_2.9/package-template.json b/internal/e2e/npm_packages/typescript_2.9/package-template.json deleted file mode 100644 index 31480f03..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/package-template.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "jasmine": "2.8.0", - "typescript": "2.9.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/typescript_2.9/tsconfig.json.oss b/internal/e2e/npm_packages/typescript_2.9/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/typescript_2.9/yarn.lock b/internal/e2e/npm_packages/typescript_2.9/yarn.lock deleted file mode 100644 index 8ac413b1..00000000 --- a/internal/e2e/npm_packages/typescript_2.9/yarn.lock +++ /dev/null @@ -1,300 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@2.8.0, jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@2.9.x: - version "2.9.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" - integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_3.0/.bazelrc b/internal/e2e/npm_packages/typescript_3.0/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel deleted file mode 100644 index 0f08b301..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "main", - srcs = ["main.ts"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - ":main", - "@npm//@bazel/typescript", - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -jasmine_node_test( - name = "test", - data = [ - # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", - ], - deps = [ - ":test_lib", - "@npm//jasmine", - ], -) diff --git a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE b/internal/e2e/npm_packages/typescript_3.0/WORKSPACE deleted file mode 100644 index 55c70816..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_typescript_30_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.0/main.spec.ts b/internal/e2e/npm_packages/typescript_3.0/main.spec.ts deleted file mode 100644 index 05923c3c..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/main.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as main from './main'; -import * as ts from 'typescript'; - -describe('main', () => { - it('should compile and run with @bazel/typescript npm package', () => { - expect(main.test()).toEqual('test'); - }); - - it('should successfully require @bazel/typescript', () => { - try { - const {debug} = require('@bazel/typescript'); - debug('test'); - } catch (e) { - fail(e.toString()) - } - }); - - it('runtime version of typescript should be correct', () => { - expect(ts.version).toEqual('3.0.3'); - }); - - it('should successfully require built-in node module \'os\'', () => { - try { - const os = require('os'); - console.log('Platform: ' + os.platform()); - console.log('Architecture: ' + os.arch()); - } catch (e) { - fail(e.toString()) - } - }); -}); diff --git a/internal/e2e/npm_packages/typescript_3.0/main.ts b/internal/e2e/npm_packages/typescript_3.0/main.ts deleted file mode 100644 index 36f3fab5..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function test() { - return 'test'; -} \ No newline at end of file diff --git a/internal/e2e/npm_packages/typescript_3.0/package-template.json b/internal/e2e/npm_packages/typescript_3.0/package-template.json deleted file mode 100644 index 23f78b62..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/package-template.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "jasmine": "2.8.0", - "typescript": "3.0.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/typescript_3.0/tsconfig.json.oss b/internal/e2e/npm_packages/typescript_3.0/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/typescript_3.0/yarn.lock b/internal/e2e/npm_packages/typescript_3.0/yarn.lock deleted file mode 100644 index 887715e8..00000000 --- a/internal/e2e/npm_packages/typescript_3.0/yarn.lock +++ /dev/null @@ -1,300 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@2.8.0, jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@3.0.x: - version "3.0.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.3.tgz#4853b3e275ecdaa27f78fda46dc273a7eb7fc1c8" - integrity sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/npm_packages/typescript_3.1/.bazelrc b/internal/e2e/npm_packages/typescript_3.1/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel b/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel deleted file mode 100644 index 0f08b301..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "main", - srcs = ["main.ts"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - deps = [ - ":main", - "@npm//@bazel/typescript", - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -jasmine_node_test( - name = "test", - data = [ - # Verify that worker_protocol.proto can be referenced as a target in the generated npm bazel workspace - "@npm_bazel_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", - ], - deps = [ - ":test_lib", - "@npm//jasmine", - ], -) diff --git a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE b/internal/e2e/npm_packages/typescript_3.1/WORKSPACE deleted file mode 100644 index 55c70816..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/WORKSPACE +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_packages_typescript_30_e2e") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "build_bazel_rules_nodejs", - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], -) - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/npm_packages/typescript_3.1/main.spec.ts b/internal/e2e/npm_packages/typescript_3.1/main.spec.ts deleted file mode 100644 index c164e66a..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/main.spec.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as main from './main'; -import * as ts from 'typescript'; - -describe('main', () => { - it('should compile and run with @bazel/typescript npm package', () => { - expect(main.test()).toEqual('test'); - }); - - it('should successfully require @bazel/typescript', () => { - try { - const {debug} = require('@bazel/typescript'); - debug('test'); - } catch (e) { - fail(e.toString()) - } - }); - - it('runtime version of typescript should be correct', () => { - expect(ts.version).toEqual('3.1.6'); - }); - - it('should successfully require built-in node module \'os\'', () => { - try { - const os = require('os'); - console.log('Platform: ' + os.platform()); - console.log('Architecture: ' + os.arch()); - } catch (e) { - fail(e.toString()) - } - }); -}); diff --git a/internal/e2e/npm_packages/typescript_3.1/main.ts b/internal/e2e/npm_packages/typescript_3.1/main.ts deleted file mode 100644 index 36f3fab5..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function test() { - return 'test'; -} \ No newline at end of file diff --git a/internal/e2e/npm_packages/typescript_3.1/package-template.json b/internal/e2e/npm_packages/typescript_3.1/package-template.json deleted file mode 100644 index b53c57a7..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/package-template.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "dependencies": { - "@bazel/typescript": "file:${BAZEL_TYPESCRIPT_NPM_PACKAGE}", - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "jasmine": "2.8.0", - "typescript": "3.1.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/npm_packages/typescript_3.1/tsconfig.json.oss b/internal/e2e/npm_packages/typescript_3.1/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/npm_packages/typescript_3.1/yarn.lock b/internal/e2e/npm_packages/typescript_3.1/yarn.lock deleted file mode 100644 index be3dbed1..00000000 --- a/internal/e2e/npm_packages/typescript_3.1/yarn.lock +++ /dev/null @@ -1,300 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/typescript@file:../../../../../../../../../private/var/tmp/_bazel_greg/837d12dda6835e241d9d3083438c6bb6/execroot/npm_bazel_typescript/bazel-out/darwin-fastbuild/bin/npm_package": - version "0.22.1-41-gc1f5737" - dependencies: - jasmine-core "2.8.0" - protobufjs "5.0.3" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "2.27.2" - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - integrity sha512-RabEJPjYMpjWqW1qYj4k0rlgP5uzyguoc0yxedJdq7t5h19MYvqhjCR1evM3raZ/peHRxp1Qfl24iawvkibSug== - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@2.8.0, jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - integrity sha1-awicChFXax8W3xG4AUbZHU6Lij4= - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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= - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@3.1.x: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/internal/e2e/reference_types_directive/BUILD.bazel b/internal/e2e/reference_types_directive/BUILD.bazel deleted file mode 100644 index 44a396e2..00000000 --- a/internal/e2e/reference_types_directive/BUILD.bazel +++ /dev/null @@ -1,28 +0,0 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("//internal:defaults.bzl", "ts_library") - -ts_library( - name = "tsconfig_types", - srcs = ["tsconfig_types.ts"], - expected_diagnostics = [ - "TS2304: Cannot find name 'Hammer'", - ], - node_modules = "@build_bazel_rules_typescript_internal_reference_types_directive_deps//:node_modules", - tsconfig = ":tsconfig.json", -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - node_modules = "@build_bazel_rules_typescript_internal_reference_types_directive_deps//:node_modules", - tsconfig = ":tsconfig.json", -) - -jasmine_node_test( - name = "test", - deps = [ - ":test_lib", - "@npm//jasmine", - ], -) diff --git a/internal/e2e/reference_types_directive/package.json b/internal/e2e/reference_types_directive/package.json deleted file mode 100644 index ea93a4fa..00000000 --- a/internal/e2e/reference_types_directive/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "description": "test deps", - "dependencies": { - "zone.js": "0.8.26" - }, - "devDependencies": { - "@types/hammerjs": "2.0.35", - "@types/jasmine": "^2.8.2", - "typescript": "2.7.2" - } -} diff --git a/internal/e2e/reference_types_directive/reference_types.spec.ts b/internal/e2e/reference_types_directive/reference_types.spec.ts deleted file mode 100644 index 8d52416e..00000000 --- a/internal/e2e/reference_types_directive/reference_types.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// -/// - -// The jasmine types are resolved because the tsconfig.json -// for this compilation includes "types": ["jasmine"]. -// This file will fail to compile if that mechanism of including types -// is broken - -describe('reference types directive resolution', () => { - it('should resolve zone.js types from node_modules/zone.js/dist/zone.js.d.ts', () => { - // The type of Zone should resolve above or this will fail to compile - let zone: Zone; - expect(1).toEqual(1); - }); - - it('should resolve hammerjs types from node_modules/@types/hammerjs/index.d.ts', () => { - // The type of HammerStatic should resolve above or this will fail to compile - let hammer: HammerStatic; - expect(1).toEqual(1); - }); -}); diff --git a/internal/e2e/reference_types_directive/tsconfig.json.oss b/internal/e2e/reference_types_directive/tsconfig.json.oss deleted file mode 100644 index 5b841a73..00000000 --- a/internal/e2e/reference_types_directive/tsconfig.json.oss +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "types": ["jasmine"] - } -} diff --git a/internal/e2e/reference_types_directive/tsconfig_types.ts b/internal/e2e/reference_types_directive/tsconfig_types.ts deleted file mode 100644 index 657fce4f..00000000 --- a/internal/e2e/reference_types_directive/tsconfig_types.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Since "hammerjs" is not included in the types=[] array in -// tsconfig, this should result in a compile error: TS2304: Cannot find name 'Hammer' -console.log(typeof Hammer); diff --git a/internal/e2e/reference_types_directive/yarn.lock b/internal/e2e/reference_types_directive/yarn.lock deleted file mode 100644 index 9a296117..00000000 --- a/internal/e2e/reference_types_directive/yarn.lock +++ /dev/null @@ -1,19 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/hammerjs@2.0.35": - version "2.0.35" - resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.35.tgz#7b7c950c7d54593e23bffc8d2b4feba9866a7277" - -"@types/jasmine@^2.8.2": - version "2.8.8" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.8.tgz#bf53a7d193ea8b03867a38bfdb4fbb0e0bf066c9" - -typescript@2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - -zone.js@0.8.26: - version "0.8.26" - resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.26.tgz#7bdd72f7668c5a7ad6b118148b4ea39c59d08d2d" diff --git a/internal/e2e/strict_deps/child.ts b/internal/e2e/strict_deps/child.ts deleted file mode 100644 index f7bca137..00000000 --- a/internal/e2e/strict_deps/child.ts +++ /dev/null @@ -1,4 +0,0 @@ -// The line below is a strict deps violation: -import {Symbol} from './grandparent'; - -console.log(Symbol); diff --git a/internal/e2e/strict_deps/grandparent.ts b/internal/e2e/strict_deps/grandparent.ts deleted file mode 100644 index d352bd65..00000000 --- a/internal/e2e/strict_deps/grandparent.ts +++ /dev/null @@ -1 +0,0 @@ -export class Symbol {} diff --git a/internal/e2e/strict_deps/parent.ts b/internal/e2e/strict_deps/parent.ts deleted file mode 100644 index 6df32877..00000000 --- a/internal/e2e/strict_deps/parent.ts +++ /dev/null @@ -1,4 +0,0 @@ -import {Symbol} from './grandparent'; -export const x = 1; - -console.log(Symbol); diff --git a/internal/e2e/typescript_3.1/.bazelrc b/internal/e2e/typescript_3.1/.bazelrc deleted file mode 100644 index 178af0a3..00000000 --- a/internal/e2e/typescript_3.1/.bazelrc +++ /dev/null @@ -1,6 +0,0 @@ -# Don't create symlinks like bazel-out in the project. -# These cause VSCode to traverse a massive tree, opening file handles and -# eventually a surprising failure with auto-discovery of the C++ toolchain in -# MacOS High Sierra. -# See https://github.com/bazelbuild/bazel/issues/4603 -build --symlink_prefix=/ diff --git a/internal/e2e/typescript_3.1/BUILD.bazel b/internal/e2e/typescript_3.1/BUILD.bazel deleted file mode 100644 index 693fc5fa..00000000 --- a/internal/e2e/typescript_3.1/BUILD.bazel +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "main", - srcs = ["main.ts"], - compiler = "@npm_bazel_typescript//internal:tsc_wrapped_bin", -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = glob(["*.spec.ts"]), - compiler = "@npm_bazel_typescript//internal:tsc_wrapped_bin", - deps = [ - ":main", - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//typescript", - ], -) - -jasmine_node_test( - name = "test", - deps = [ - ":test_lib", - "@npm//jasmine", - "@npm//typescript", - ], -) diff --git a/internal/e2e/typescript_3.1/WORKSPACE b/internal/e2e/typescript_3.1/WORKSPACE deleted file mode 100644 index d53e1b5b..00000000 --- a/internal/e2e/typescript_3.1/WORKSPACE +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "typescript_31") - -local_repository( - name = "npm_bazel_typescript", - path = "../../..", -) - -load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dev_dependencies") - -rules_typescript_dev_dependencies() - -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() diff --git a/internal/e2e/typescript_3.1/main.spec.ts b/internal/e2e/typescript_3.1/main.spec.ts deleted file mode 100644 index 5ad3f758..00000000 --- a/internal/e2e/typescript_3.1/main.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as main from './main'; -import * as ts from 'typescript'; - -describe('main', () => { - it('should compile and run without npm package', () => { - expect(main.test()).toEqual('test'); - }); - - it('runtime version of typescript should be correct', () => { - expect(ts.version).toEqual('3.1.6'); - }); - - it('should successfully require built-in node module \'os\'', () => { - try { - const os = require('os'); - console.log('Platform: ' + os.platform()); - console.log('Architecture: ' + os.arch()); - } catch (e) { - fail(e.toString()) - } - }); -}); diff --git a/internal/e2e/typescript_3.1/main.ts b/internal/e2e/typescript_3.1/main.ts deleted file mode 100644 index 36f3fab5..00000000 --- a/internal/e2e/typescript_3.1/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function test() { - return 'test'; -} \ No newline at end of file diff --git a/internal/e2e/typescript_3.1/package.json b/internal/e2e/typescript_3.1/package.json deleted file mode 100644 index 37929100..00000000 --- a/internal/e2e/typescript_3.1/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "dependencies": { - "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", - "jasmine": "2.8.0", - "protobufjs": "5.0.3", - "source-map-support": "0.5.9", - "tsickle": "0.33.1", - "tsutils": "2.27.2", - "typescript": "3.1.x" - }, - "scripts": { - "test": "bazel test ..." - } -} diff --git a/internal/e2e/typescript_3.1/tsconfig.json.oss b/internal/e2e/typescript_3.1/tsconfig.json.oss deleted file mode 100644 index e69de29b..00000000 diff --git a/internal/e2e/typescript_3.1/yarn.lock b/internal/e2e/typescript_3.1/yarn.lock deleted file mode 100644 index 90e09d9c..00000000 --- a/internal/e2e/typescript_3.1/yarn.lock +++ /dev/null @@ -1,301 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/jasmine@2.8.2": - version "2.8.2" - resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.0.5, glob@^7.0.6: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -jasmine-core@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - -jasmine@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" - dependencies: - exit "^0.1.2" - glob "^7.0.6" - jasmine-core "~2.8.0" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -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" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.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" - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -tsickle@0.33.1: - version "0.33.1" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" - integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.7.3" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -typescript@3.1.x: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" diff --git a/package.json b/package.json index d82e3f20..5240c5f2 100644 --- a/package.json +++ b/package.json @@ -59,14 +59,11 @@ }, "scripts": { "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e", - "e2e": "yarn e2e-bazel-external && yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver && yarn e2e-npm_packages && yarn e2e-typescript_3.1", - "e2e-bazel-external": "jasmine internal/e2e/default_tsconfig_test.js", + "e2e": "yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver", "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-app-prodserver": "concurrently \"bazel run //examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-protobuf-devserver": "concurrently \"bazel run //examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", "e2e-examples-protobuf-prodserver": "concurrently \"bazel run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", - "e2e-npm_packages": "./internal/e2e/npm_packages/test.sh", - "e2e-typescript_3.1": "cd internal/e2e/typescript_3.1; yarn test", "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", From 51cc371710f9eef6b20c46beecac2ab63f38f697 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Mon, 25 Feb 2019 10:22:33 -0800 Subject: [PATCH 119/316] Support recursive extended tsconfigs Closes #265 PiperOrigin-RevId: 235554123 --- internal/tsc_wrapped/tsconfig.ts | 96 ++++++++++++++++++--------- internal/tsc_wrapped/tsconfig_test.ts | 56 ++++++++++++++++ 2 files changed, 121 insertions(+), 31 deletions(-) diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index 512b3146..f8460c34 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -278,12 +278,76 @@ export function parseTsconfig( // TypeScript expects an absolute path for the tsconfig.json file tsconfigFile = resolveNormalizedPath(tsconfigFile); - const {config, error} = ts.readConfigFile(tsconfigFile, host.readFile); + const isUndefined = (value: any): value is undefined => value === undefined; + + // Handle bazel specific options, but make sure not to crash when reading a + // vanilla tsconfig.json. + + const readExtendedConfigFile = + (configFile: string, existingConfig?: any): {config?: any, error?: ts.Diagnostic} => { + const {config, error} = ts.readConfigFile(configFile, host.readFile); + + if (error) { + return {error}; + } + + // Allow Bazel users to control some of the bazel options. + // Since TypeScript's "extends" mechanism applies only to "compilerOptions" + // we have to repeat some of their logic to get the user's bazelOptions. + const mergedConfig = existingConfig || config; + + if (existingConfig) { + const existingBazelOpts: BazelOptions = existingConfig.bazelOptions || {}; + const newBazelBazelOpts: BazelOptions = config.bazelOptions || {}; + + mergedConfig.bazelOptions = { + ...existingBazelOpts, + + disableStrictDeps: isUndefined(existingBazelOpts.disableStrictDeps) + ? newBazelBazelOpts.disableStrictDeps + : existingBazelOpts.disableStrictDeps, + + suppressTsconfigOverrideWarnings: isUndefined(existingBazelOpts.suppressTsconfigOverrideWarnings) + ? newBazelBazelOpts.suppressTsconfigOverrideWarnings + : existingBazelOpts.suppressTsconfigOverrideWarnings, + + tsickle: isUndefined(existingBazelOpts.tsickle) + ? newBazelBazelOpts.tsickle + : existingBazelOpts.tsickle, + + googmodule: isUndefined(existingBazelOpts.googmodule) + ? newBazelBazelOpts.googmodule + : existingBazelOpts.googmodule, + + devmodeTargetOverride: isUndefined(existingBazelOpts.devmodeTargetOverride) + ? newBazelBazelOpts.devmodeTargetOverride + : existingBazelOpts.devmodeTargetOverride, + } + + if (!mergedConfig.bazelOptions.suppressTsconfigOverrideWarnings) { + warnOnOverriddenOptions(config); + } + } + + if (config.extends) { + let extendedConfigPath = resolveNormalizedPath(path.dirname(configFile), config.extends); + if (!extendedConfigPath.endsWith('.json')) extendedConfigPath += '.json'; + + return readExtendedConfigFile(extendedConfigPath, mergedConfig); + } + + return {config: mergedConfig}; + }; + + const {config, error} = readExtendedConfigFile(tsconfigFile); if (error) { // target is in the config file we failed to load... return [null, [error], {target: ''}]; } + const {options, errors, fileNames} = + ts.parseJsonConfigFileContent(config, host, path.dirname(tsconfigFile)); + // Handle bazel specific options, but make sure not to crash when reading a // vanilla tsconfig.json. const bazelOpts: BazelOptions = config.bazelOptions || {}; @@ -292,37 +356,7 @@ export function parseTsconfig( bazelOpts.typeBlackListPaths = bazelOpts.typeBlackListPaths || []; bazelOpts.compilationTargetSrc = bazelOpts.compilationTargetSrc || []; - // Allow Bazel users to control some of the bazel options. - // Since TypeScript's "extends" mechanism applies only to "compilerOptions" - // we have to repeat some of their logic to get the user's bazelOptions. - if (config.extends) { - let userConfigFile = - resolveNormalizedPath(path.dirname(tsconfigFile), config.extends); - if (!userConfigFile.endsWith('.json')) userConfigFile += '.json'; - const {config: userConfig, error} = - ts.readConfigFile(userConfigFile, host.readFile); - if (error) { - return [null, [error], {target}]; - } - if (userConfig.bazelOptions) { - bazelOpts.disableStrictDeps = bazelOpts.disableStrictDeps || - userConfig.bazelOptions.disableStrictDeps; - bazelOpts.suppressTsconfigOverrideWarnings = - bazelOpts.suppressTsconfigOverrideWarnings || - userConfig.bazelOptions.suppressTsconfigOverrideWarnings; - bazelOpts.tsickle = bazelOpts.tsickle || userConfig.bazelOptions.tsickle; - bazelOpts.googmodule = - bazelOpts.googmodule || userConfig.bazelOptions.googmodule; - bazelOpts.devmodeTargetOverride = bazelOpts.devmodeTargetOverride || - userConfig.bazelOptions.devmodeTargetOverride; - } - if (!bazelOpts.suppressTsconfigOverrideWarnings) { - warnOnOverriddenOptions(userConfig); - } - } - const {options, errors, fileNames} = - ts.parseJsonConfigFileContent(config, host, path.dirname(tsconfigFile)); if (errors && errors.length) { return [null, errors, {target}]; } diff --git a/internal/tsc_wrapped/tsconfig_test.ts b/internal/tsc_wrapped/tsconfig_test.ts index 63d3e7b5..eac3ffe2 100644 --- a/internal/tsc_wrapped/tsconfig_test.ts +++ b/internal/tsc_wrapped/tsconfig_test.ts @@ -57,4 +57,60 @@ describe('tsconfig', () => { expect(bazelOpts.disableStrictDeps).toBeTruthy(); } }); + + it('honors bazelOptions in recursive extends', ()=> { + const tsconfigOne = { + extends: './tsconfig-level-b.json', + files: ['a.ts'], + bazelOptions: { + disableStrictDeps: false + } + }; + + const tsconfigTwo = { + extends: './tsconfig-level-c.json', + bazelOptions: { + suppressTsconfigOverrideWarnings: true + } + }; + + const tsconfigThree = { + bazelOptions: { + tsickle: true, + suppressTsconfigOverrideWarnings: false, + disableStrictDeps: true + } + }; + + const files = { + [resolveNormalizedPath('path/to/tsconfig-level-a.json')]: JSON.stringify(tsconfigOne), + [resolveNormalizedPath('path/to/tsconfig-level-b.json')]: JSON.stringify(tsconfigTwo), + [resolveNormalizedPath('path/to/tsconfig-level-c.json')]: JSON.stringify(tsconfigThree), + }; + + const host: ts.ParseConfigHost = { + useCaseSensitiveFileNames: true, + fileExists: (path: string) => !!files[path], + readFile: (path: string) => files[path], + readDirectory( + rootDir: string, extensions: ReadonlyArray, + excludes: ReadonlyArray, includes: ReadonlyArray, + depth: number): string[] { + return []; + }, + }; + + const [parsed, diagnostics] = + parseTsconfig('path/to/tsconfig-level-a.json', host); + expect(diagnostics).toBeNull(); + + if (!parsed) { + fail('Expected parsed'); + } else { + const {bazelOpts} = parsed; + expect(bazelOpts.tsickle).toBeTruthy(); + expect(bazelOpts.suppressTsconfigOverrideWarnings).toBeTruthy(); + expect(bazelOpts.disableStrictDeps).toBeFalsy(); + } + }) }); From c1b74928e24e6339d1b502cf8cc0207cb11bb5e5 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 25 Feb 2019 14:03:40 -0800 Subject: [PATCH 120/316] Remove publishing-related bits from rules_typescript We only publish @bazel/typescript from the rules_nodejs repo now Closes #431 PiperOrigin-RevId: 235598697 --- .bazelrc | 2 -- BUILD.bazel | 41 --------------------------------------- DEVELOPING.md | 20 ------------------- internal/BUILD.bazel | 8 -------- on-version.js | 39 ------------------------------------- package.json | 3 +-- tools/bazel_stamp_vars.sh | 2 -- 7 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 on-version.js delete mode 100755 tools/bazel_stamp_vars.sh diff --git a/.bazelrc b/.bazelrc index 41e47faf..adf60bc7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -4,8 +4,6 @@ test --test_output=errors # Enable debugging tests with --config=debug test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results -build --workspace_status_command=./tools/bazel_stamp_vars.sh - # Turn off legacy external runfiles run --nolegacy_external_runfiles test --nolegacy_external_runfiles diff --git a/BUILD.bazel b/BUILD.bazel index b2b79b65..ace9f178 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -21,7 +21,6 @@ load("@bazel_gazelle//:def.bzl", "gazelle") load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") -load("//:version.bzl", "COMPAT_VERSION") # ts_library defaults to this label in the top-level package. # Point to where the file actually lives. @@ -55,46 +54,6 @@ js_library( visibility = ["//visibility:public"], ) -genrule( - name = "generate_BUILD", - srcs = [], - outs = ["BUILD"], - cmd = "echo \"#marker that this is a bazel package\" > $@", -) - -npm_package( - name = "npm_package", - srcs = [ - "LICENSE", - "README.md", - "defs.bzl", - "package.bzl", - "package.json", - "version.bzl", - "//devserver:npm_package_assets", - "//internal:npm_package_assets", - "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", - "//ts_auto_deps:npm_package_assets", - ], - replacements = { - "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", - # Do a simple replacement needed to make the local development differ - # from how our release is used. - "//devserver:devserver_bin": "//devserver", - "0.0.0-COMPAT_VERSION": COMPAT_VERSION, - }, - deps = [ - ":generate_BUILD", - "//devserver:devserver-darwin", - "//devserver:devserver-linux", - "//devserver:devserver-windows", - "//internal:generated_BUILD", - "//internal:tsc_wrapped", - "//ts_auto_deps:ts_auto_deps-darwin", - "//ts_auto_deps:ts_auto_deps-linux", - "//ts_auto_deps:ts_auto_deps-windows", - ], -) # This package is included in the npm_bazel_typescript package in rules_nodejs/packages/typescript npm_package( diff --git a/DEVELOPING.md b/DEVELOPING.md index c5b36dd0..fcfbee87 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -48,23 +48,3 @@ an `@npm` workspace with npm dependencies. Note, with this workflow the downstream version of `@npm//typescript` will be used to compile the `ts_library` targets in `npm_bazel_typescript`. An example of this can be found under `internal/e2e/typescript_3.1`. - -## Releasing - -Start from a clean checkout at master/HEAD. Check if there are any breaking -changes since the last tag - if so, this will be a minor, if not, it's a patch. -(This may not sound like semver - but since our major version is a zero, the -rule is that minors are breaking changes and patches are new features). - -1. Re-generate the API docs: `yarn skydoc` -1. May be necessary if Go code has changed though probably it was already necessary to run this to keep CI green: `bazel run :gazelle` -1. If we depend on a newer rules_nodejs, update the `check_rules_nodejs_version` in `ts_repositories.bzl` -1. `git commit -a -m 'Update docs for release'` -1. `npm config set tag-version-prefix ''` -1. `npm version minor -m 'rel: %s'` (replace `minor` with `patch` if no breaking changes) -1. Build npm packages and publish them: `TMP=$(mktemp -d -t bazel-release.XXXXXXX); bazel --output_base=$TMP run //:npm_package.publish && ( cd internal/karma && bazel --output_base=$TMP run //:npm_package.publish )` -1. `git push upstream && git push upstream --tags` (assumes you named the bazelbuild fork as "upstream") -1. (Temporary): submit a google3 CL to update the versions in package.bzl and package.json - -[releases]: https://github.com/bazelbuild/rules_typescript/releases - diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index e9baf8eb..698cef01 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -128,17 +128,9 @@ genrule( filegroup( name = "npm_package_assets", srcs = [ - "build_defs.bzl", "common/compilation.bzl", "common/json_marshal.bzl", "common/module_mappings.bzl", "common/tsconfig.bzl", - "defaults.bzl", - "ts_config.bzl", - "ts_repositories.bzl", - "tsc_wrapped/package.json", - "tsc_wrapped/yarn.lock", - "//internal/devserver:npm_package_assets", - "//internal/protobufjs:npm_package_assets", ], ) diff --git a/on-version.js b/on-version.js deleted file mode 100644 index 87e3d8e7..00000000 --- a/on-version.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2017 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @fileoverview This script updates the version in package.bzl to match - * the version in package.json. It is automatically called during the - * `npm version` step of the release process (see Releasing in README.me) - * by the "version" script in package.json. - */ -'use strict'; - -// Called from "version" npm script when running `npm version` -// during release process. This script updates the version -// in package.bzl to match that of package.json. -const shell = require('shelljs'); -const version = require('./package.json').version; -shell.sed('-i', '\"@bazel/typescript\": \"[0-9\.]*\"', `"@bazel/typescript": "${version}"`, 'README.md'); -shell.sed('-i', '\"@bazel/karma\": \"[0-9\.]*\"', `"@bazel/karma": "${version}"`, 'README.md'); -shell.sed('-i', '^VERSION \= \"[0-9\.]*\"', `VERSION = "${version}"`, 'version.bzl'); -shell.sed('-i', 'check_rules_typescript_version\\\(version_string \= \"[0-9\.]*\"', `check_rules_typescript_version(version_string = "${version}"`, 'WORKSPACE'); - -// Following instructions in version.bzl, we should update the minimal compatibility version whenever -// we have new features or breaking changes. So we assume that a patch number of 0 implies this. -if (version.endsWith('.0')) { - shell.sed('-i', 'COMPAT_VERSION \= \"[0-9\.]*\"', `COMPAT_VERSION = "${version}"`, 'version.bzl') -} diff --git a/package.json b/package.json index 5240c5f2..b4834d14 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", "bazel:lint": "yarn bazel:format --lint=warn", - "bazel:lint-fix": "yarn bazel:format --lint=fix", - "version": "node ./on-version.js && git stage README.md version.bzl WORKSPACE" + "bazel:lint-fix": "yarn bazel:format --lint=fix" } } diff --git a/tools/bazel_stamp_vars.sh b/tools/bazel_stamp_vars.sh deleted file mode 100755 index 1540d2d0..00000000 --- a/tools/bazel_stamp_vars.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -echo BUILD_SCM_VERSION $(git describe --abbrev=7 --tags HEAD) From 20dda477b5ff91cbef069f602222cdca30657837 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 27 Feb 2019 11:28:20 -0800 Subject: [PATCH 121/316] Support herb as a backend for taze. PiperOrigin-RevId: 235958571 --- ts_auto_deps/analyze/loader.go | 5 ++++- ts_auto_deps/updater/updater.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index f70dbcb9..ca5f73f0 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -349,7 +349,10 @@ func (q *QueryBasedTargetLoader) query(args ...string) (*appb.QueryResult, error // queries not returning a result while running with the '--keep_going' // flag. Since one query failing to return a result does not hinder the // other queries from returning a result, ignore these errors. - if err.Error() != "exit status 3" { + // + // Herb prints "printing partial results" to indicate the same as bazel's + // exit status 3 + if err.Error() != "exit status 3" && !strings.Contains(stderr.String(), "printing partial results") { // The error provided as a result is less useful than the contents of // stderr for debugging. return nil, fmt.Errorf(stderr.String()) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 44e64929..8c156eda 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -77,7 +77,7 @@ func attrTruthy(r *build.Rule, attr string) bool { // Matches the warning TypeScriptRuleChecker prints for unused ts_declarations. // TODO(martinprobst): in the long term, this should become the default and TypeScriptRuleChecker should no longer special case ts_declaration. var unusedDeclarationRE = regexp.MustCompile( - `WARNING: [^:]+:\d+:\d+: keeping possibly used ts_declaration '([^']+)'`) + `WARNING: [^:]+:\d+:(?:\d+:)? keeping possibly used ts_declaration '([^']+)'`) // GarbledBazelResponseError signals to callers that the proto returned by bazel // analyze was garbled, and couldn't be unmarshalled. From 6163b08a8be8852e5ab29ef2088e4199fc28af66 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 28 Feb 2019 11:38:25 -0800 Subject: [PATCH 122/316] Modify the query-based analyzer to handle cases where a source file is included in the srcs attribute of more than one rule. Add a heuristic that if more that one rule supplies a source file, favor ts_library rules. PiperOrigin-RevId: 236163673 --- ts_auto_deps/analyze/loader.go | 54 ++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index ca5f73f0..d5220171 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -203,32 +203,37 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg } } - filepathToRule := make(map[string]*appb.Rule) + filepathToRules := make(map[string][]*appb.Rule) // load all the rules with file srcs (either literal or generated) - sourceLabelToRule, err := q.loadRulesWithSources(workspaceRoot, fileLabels) + sourceLabelToRules, err := q.loadRulesWithSources(workspaceRoot, fileLabels) if err != nil { return nil, err } - for label, rule := range sourceLabelToRule { - filepathToRule[labelToPath(label)] = rule + for label, rules := range sourceLabelToRules { + for _, rule := range rules { + filepathToRules[labelToPath(label)] = append(filepathToRules[labelToPath(label)], rule) + } } // load all the rules with generator rule srcs - generatorLabelToRule, err := q.loadRulesWithSources(workspaceRoot, generators) + generatorLabelToRules, err := q.loadRulesWithSources(workspaceRoot, generators) if err != nil { return nil, err } - for label, rule := range generatorLabelToRule { - for _, generated := range generatorsToFiles[label] { - filepathToRule[labelToPath(generated.GetName())] = rule + for label, rules := range generatorLabelToRules { + for _, rule := range rules { + for _, generated := range generatorsToFiles[label] { + filepathToRules[labelToPath(generated.GetName())] = append(filepathToRules[labelToPath(generated.GetName())], rule) + } } } for _, path := range paths { // check all the possible file paths for the import path for _, fp := range possibleFilepaths(path) { - if rule, ok := filepathToRule[fp]; ok { + if rules, ok := filepathToRules[fp]; ok { + rule := chooseCanonicalRule(rules) results[path] = rule } } @@ -237,6 +242,23 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg return results, nil } +// chooseCanonicalRule chooses between rules which includes the imported file as +// a source. It applies heuristics, such as prefering ts_library to other rule +// types to narrow down the choices. After narrowing, it chooses the first +// rule. If no rules are left after narrowing, it returns the first rule from +// the original list. +func chooseCanonicalRule(rules []*appb.Rule) *appb.Rule { + // filter down to only ts_library rules + for _, r := range rules { + if r.GetRuleClass() == "ts_library" { + return r + } + } + + // if no rules matched the filter, just return the first rule + return rules[0] +} + // ruleLabel returns the label for a target which is a rule. Returns an error if // target is not a rule. func (q *QueryBasedTargetLoader) ruleLabel(target *appb.Target) (string, error) { @@ -279,10 +301,10 @@ func (q *QueryBasedTargetLoader) targetLabel(target *appb.Target) (string, error } // loadRulesWithSources loads all rules which include the labels in sources as -// srcs attributes. Returns a map from source label to the rule which includes -// it. A source label can be the label of a source file or a generated file or -// a generating rule. -func (q *QueryBasedTargetLoader) loadRulesWithSources(workspaceRoot string, sources []string) (map[string]*appb.Rule, error) { +// srcs attributes. Returns a map from source label to a list of rules which +// include it. A source label can be the label of a source file or a generated +// file or a generating rule. +func (q *QueryBasedTargetLoader) loadRulesWithSources(workspaceRoot string, sources []string) (map[string][]*appb.Rule, error) { pkgToLabels := make(map[string][]string) queries := make([]string, 0, len(sources)) for _, label := range sources { @@ -295,7 +317,7 @@ func (q *QueryBasedTargetLoader) loadRulesWithSources(workspaceRoot string, sour if err != nil { return nil, err } - labelToRule := make(map[string]*appb.Rule) + labelToRules := make(map[string][]*appb.Rule) for _, target := range r.GetTarget() { label, err := q.ruleLabel(target) if err != nil { @@ -307,13 +329,13 @@ func (q *QueryBasedTargetLoader) loadRulesWithSources(workspaceRoot string, sour for _, src := range listAttribute(rule, "srcs") { for _, l := range labels { if src == l { - labelToRule[l] = rule + labelToRules[l] = append(labelToRules[l], rule) break } } } } - return labelToRule, nil + return labelToRules, nil } // batchQuery runs a set of queries with a single call to Bazel query and the From 94cfb6dc4d9695d0eac4d9ea30795410200f4eb7 Mon Sep 17 00:00:00 2001 From: radokirov Date: Thu, 28 Feb 2019 16:24:34 -0800 Subject: [PATCH 123/316] Move the tsickle auto-quoting logic into a tsetse check. This check is only useful for code that would be opmitized through a property renaming optimizer (like Closure, and experiemental uglifyJS option, AFAIK). It is intentionally, exposed but not turned on by default for rules_typescript. PiperOrigin-RevId: 236218830 --- docs/property-renaming-safe.md | 43 +++++++++++++ internal/tsetse/error_code.ts | 8 +++ .../tsetse/rules/property_renaming_safe.ts | 54 ++++++++++++++++ .../tests/property_renaming_safe/errors.ts | 64 +++++++++++++++++++ 4 files changed, 169 insertions(+) create mode 100644 docs/property-renaming-safe.md create mode 100644 internal/tsetse/rules/property_renaming_safe.ts create mode 100644 internal/tsetse/tests/property_renaming_safe/errors.ts diff --git a/docs/property-renaming-safe.md b/docs/property-renaming-safe.md new file mode 100644 index 00000000..716b0d95 --- /dev/null +++ b/docs/property-renaming-safe.md @@ -0,0 +1,43 @@ + + +# Property renaming safe + +This check will reject code patterns that are likely to not be safe for an +optimization known as "property renaming". Closure compiler is currently one of +the main JS optimizer that performs that optimization and anecdotally it results +in 5-10% smaller bundles (see [more +info](http://closuretools.blogspot.com/2011/01/property-by-any-other-name-part-1.html)). + +Property renaming is the optimization where writes and accesses to object +properties like `x.userName` are rewritten to a shorter name like `x.a`. It +works great until other code expects the property to be the specific string +'userName'. This check will help catch bad optimization errors like this earlier +(during TS compilation). + +The check will reject a property access on an object through an index signature +in its type. For example, if you write this: + + interface IdxSig { + [key: string]: string; + } + + function propAccess(x: IdxSig) { + x.prop; // new error + x['prop']; // ok + } + + +the compiler will start erring like this: + + .../errors.ts:6:5 - error TS21227: Property prop is not declared on Type IdxSig. + The type has a string index signature, but it is being accessed using a dotted + property access. + + 6 x.prop; // new error + + +The presence of an index signature in the type most often means that the +properties of the object that carries that type are created outside the static +property renaming scope - for example JSON.parse, or dynamic for-in loop. Thus +accessing them without a quoted index signature will result in an incorrect +optimization. diff --git a/internal/tsetse/error_code.ts b/internal/tsetse/error_code.ts index 22da857a..1e0ea3a1 100644 --- a/internal/tsetse/error_code.ts +++ b/internal/tsetse/error_code.ts @@ -1,7 +1,15 @@ +/** + * Error codes for tsetse checks. + * + * Start with 21222 and increase linearly. + * The intent is for these codes to be fixed, so that tsetse users can + * search for them in user forums and other media. + */ export enum ErrorCode { CHECK_RETURN_VALUE = 21222, EQUALS_NAN = 21223, BAN_EXPECT_TRUTHY_PROMISE = 21224, MUST_USE_PROMISES = 21225, BAN_PROMISE_AS_CONDITION = 21226, + PROPERTY_RENAMING_SAFE = 21227, } diff --git a/internal/tsetse/rules/property_renaming_safe.ts b/internal/tsetse/rules/property_renaming_safe.ts new file mode 100644 index 00000000..7b842442 --- /dev/null +++ b/internal/tsetse/rules/property_renaming_safe.ts @@ -0,0 +1,54 @@ + +import * as ts from 'typescript'; + +import {Checker} from '../checker'; +import {ErrorCode} from '../error_code'; +import {AbstractRule} from '../rule'; + +/** + * A Tsetse rule that checks for some potential unsafe property renaming + * patterns. + * + * Note: This rule can have false positives. + */ +export class Rule extends AbstractRule { + readonly ruleName = 'property-renaming-safe'; + readonly code = ErrorCode.PROPERTY_RENAMING_SAFE; + + register(checker: Checker) { + checker.on( + ts.SyntaxKind.PropertyAccessExpression, + checkIndexSignAccessedWithPropAccess, this.code); + } +} + +// Copied from tsickle/src/quoting_transformer.ts, with the intention of +// removing it from there and only keeping a tsetse rule about this. +function checkIndexSignAccessedWithPropAccess( + checker: Checker, pae: ts.PropertyAccessExpression) { + // Reject dotted accesses to types that have an index type declared to quoted + // accesses, to avoid Closure renaming one access but not the other. This can + // happen because TS allows dotted access to string index types. + const typeChecker = checker.typeChecker; + const t = typeChecker.getTypeAtLocation(pae.expression); + if (!t.getStringIndexType()) return; + // Types can have string index signatures and declared properties (of the + // matching type). These properties have a symbol, as opposed to pure string + // index types. + const propSym = typeChecker.getSymbolAtLocation(pae.name); + // The decision to return below is a judgement call. Presumably, in most + // situations, dotted access to a property is correct, and should not be + // turned into quoted access even if there is a string index on the type. + // However it is possible to construct programs where this is incorrect, e.g. + // where user code assigns into a property through the index access in another + // location. + if (propSym) return; + + checker.addFailureAtNode( + pae.name, + `Property ${pae.name.text} is not declared on Type ` + + `${typeChecker.typeToString(t)}. The type has a string index ` + + `signature, but it is being accessed using a dotted property ` + + `access. +See http://tsetse.info/property-renaming-safe.`); +} diff --git a/internal/tsetse/tests/property_renaming_safe/errors.ts b/internal/tsetse/tests/property_renaming_safe/errors.ts new file mode 100644 index 00000000..b4ed844d --- /dev/null +++ b/internal/tsetse/tests/property_renaming_safe/errors.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +interface IdxSig { + [key: string]: string; +} + +function propAccess(x: IdxSig) { + x.prop; // error + x['prop']; // ok +} + +function descructuring(x: IdxSig) { + const {prop} = x; // ok, but should be an error. +} + +interface MixedIdxSig extends IdxSig { + namedProp: string; +} + +function mixedPropAccess(x: MixedIdxSig) { + x.namedProp; // ok + x['namedProp']; // ok + x.prop; // error + x['prop']; // ok +} + +function genericAccess(x: T) { + x.prop; // error + x['prop']; // ok +} + +interface MixedIndexSigUsedInUnion { + [key: string]: string; + namedProp2: string; +} + +function unionType(x: MixedIdxSig|MixedIndexSigUsedInUnion) { + x.prop; // error + x['prop']; // ok +} + +/** + * Curiously Record is treated like an index signature. + */ +function recordStringType(x: Record) { + x.prop; // error + x['prop']; // ok +} + +/** + * But narrowing the generic parameter to a string literal union exempts it. + */ +function recordNarrowType(x: Record<'prop'|'other', number>) { + x.prop; // ok + x['prop']; // ok +} + +/** + * Similary, to Records mapped types of of 'in string' are threated like a + * string index signature. + */ +function mappedType(x: {[x in string]: boolean}) { + x.prop; // error + x['prop']; // ok +} From 023eb7b1db1eff0231d37352ea80c01d380952d7 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Wed, 6 Mar 2019 09:30:48 -0800 Subject: [PATCH 124/316] Add a bzl_library rule for internal .bzl files This allows them to be referenced by stardoc generation in downstream repositories. PiperOrigin-RevId: 237062318 --- internal/BUILD.bazel | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 698cef01..a8c65c2d 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -15,18 +15,26 @@ # gazelle:exclude worker_protocol.proto load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("//internal:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) exports_files([ # Exported to be consumed for generating skydoc. + # TODO(alexeagle): remove this after migration to stardoc "build_defs.bzl", "ts_config.bzl", "ts_repositories.bzl", "tsetse/tsconfig.json", ]) +bzl_library( + name = "bzl", + srcs = glob(["common/*.bzl"]), + visibility = ["//visibility:public"], +) + # Vanilla typescript compiler: run the tsc.js binary distributed by TypeScript nodejs_binary( name = "tsc", From 45cf49b8ef12453302655b757ec7c7de39932e54 Mon Sep 17 00:00:00 2001 From: radokirov Date: Thu, 7 Mar 2019 16:27:37 -0800 Subject: [PATCH 125/316] Upgrade to compile with TS 3.3.3333 ts.compilerHost.getDirectories is now an optional field, so wrap access in a nullablity check. PiperOrigin-RevId: 237350326 --- internal/tsc_wrapped/compiler_host.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 04c35fd0..911b82e3 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -582,7 +582,8 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { } getDirectories(path: string) { - return this.delegate.getDirectories(path); + return this.delegate.getDirectories ? this.delegate.getDirectories(path) : + []; } readFile(fileName: string): string|undefined { From b53100f0d615d56fbc192b764987c53d317e3e60 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 11 Mar 2019 15:17:25 -0700 Subject: [PATCH 126/316] Tear out publishing-related bits These are now in rules_nodejs. We no longer publish releases from rules_typescript repo. Closes #435 PiperOrigin-RevId: 237893800 --- DEVELOPING.md | 50 ----- README.md | 313 ++------------------------------ WORKSPACE | 9 - defs.bzl | 2 - devserver/BUILD.bazel | 52 +----- docs/BUILD.bazel | 18 -- internal/BUILD.bazel | 9 +- internal/protobufjs/BUILD.bazel | 10 - package.bzl | 7 - package.json | 33 +--- ts_auto_deps/BUILD.bazel | 8 - version.bzl | 55 ------ 12 files changed, 23 insertions(+), 543 deletions(-) delete mode 100644 DEVELOPING.md delete mode 100644 docs/BUILD.bazel diff --git a/DEVELOPING.md b/DEVELOPING.md deleted file mode 100644 index fcfbee87..00000000 --- a/DEVELOPING.md +++ /dev/null @@ -1,50 +0,0 @@ -# For Developers - -We strongly encourage you to review the project's scope described in the `README.md` file before working on new features. For large changes, consider writing a design document using [this template](https://goo.gl/YCQttR). - -## Testing changing downstream - -By default, downstream projects use both an `http_archive` of `npm_bazel_typescript` and the released `@bazel/typescript` and `@bazel/karma` npm packages. `postinstall` steps in these npm packages check that the version of the `npm_bazel_typescript` is compatible with the version of the npm package(s). - -For example, if a downstream `WORKSPACE` contain: - -```python -http_archive( - name = "npm_bazel_typescript", - url = "https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip", - strip_prefix = "rules_typescript-0.21.0", -) -``` - -that that project's `package.json` would contain the matching: - -```json -"@bazel/typescript": "0.21.0", -"@bazel/karma": "0.21.0", -``` - -When authoring changes and testing downstream, depending on the `@bazel/typescript` and `@bazel/karma` npm packages makes the workflow confusing and difficult. -To make authoring and testing changes downstream easier, it is recommended that you override the default `compiler` attribute of `ts_library` if making changes -to `ts_library` and the default `karma` attribute of `ts_web_test_suite`/`ts_web_test` if making changes to those rules. - -For example, in `/internal/build_defs.bzl`, change - -```python -"compiler": attr.label( - default = Label(_DEFAULT_COMPILER), -``` - -to - -```python -"compiler": attr.label( - default = Label("@npm_bazel_typescript//internal:tsc_wrapped_bin"), -``` - -The correct defaults to use so that you are not depending on the npm package downstream are in `/internal/defaults.bzl`. Note, your downstream -workspace will also need the correct `@npm` dependencies available to build these targets (see `internal/e2e/typescript_3.1/package.json`). -In the case of the `angular` workspace, some `@npm` dependencies in this repository will also need to be changed to `@ngdeps` since `angular` does not have -an `@npm` workspace with npm dependencies. - -Note, with this workflow the downstream version of `@npm//typescript` will be used to compile the `ts_library` targets in `npm_bazel_typescript`. -An example of this can be found under `internal/e2e/typescript_3.1`. diff --git a/README.md b/README.md index 044cb389..8c999b34 100644 --- a/README.md +++ b/README.md @@ -1,307 +1,18 @@ -# TypeScript rules for Bazel +# build_bazel_rules_typescript -Circle CI | Bazel CI -:---: | :---: -[![CircleCI](https://circleci.com/gh/bazelbuild/rules_typescript.svg?style=svg)](https://circleci.com/gh/bazelbuild/rules_typescript) | [![Build status](https://badge.buildkite.com/7f98e137cd86baa5a4040a7e750bef87ef5fd293092fdaf878.svg)](https://buildkite.com/bazel/typescript-rules-typescript-postsubmit) +> Looking for documentation for TypeScript bazel rules that used to be here? +> See https://npmjs.com/package/@bazel/typescript -**WARNING: this is beta-quality software. Breaking changes are likely. Not recommended for production use without expert support.** +This repo contains a mirror of some Google-internal bits that support TypeScript development under Bazel. -The TypeScript rules integrate the TypeScript compiler with Bazel. +It contains these utilities: -This repo used to contain Karma rules `ts_web_test` and `karma_web_test`. -These are now documented in the README at http://npmjs.com/package/@bazel/karma +- `ts_devserver`: a Go library and binary that runs a fast local web server which concatenates JavaScript on-the-fly. It requires inputs in a named module format (module ids must be contained in the file, not inferred from the file's path). +- `ts_auto_deps`: a Go library and binary which generates `BUILD.bazel` files from TypeScript sources. +- `tsc_wrapped`: a TypeScript program which wraps the TypeScript compiler, hosting it under a Bazel worker. +- `tsetse`: a collection of third-party "strictness" checks which we add to the TypeScript compiler. +- `internal/common/*.bzl`: some Starlark utility code for running the `ts_library` rule. -## API Docs +There are no user-facing bits in this repo. These utilities are consumed in https://github.com/bazelbuild/rules_nodejs/tree/master/packages/typescript -Generated documentation for using each rule is at: -http://tsetse.info/api/ - -## Installation - -First, install a current Bazel distribution. - -Add the `@bazel/typescript` npm package to your `package.json` `devDependencies`. - -``` -{ - ... - "devDependencies": { - "@bazel/typescript": "0.25.1", - ... - }, - ... -} -``` - -Create a `BUILD.bazel` file in your project root: - -```python -package(default_visibility = ["//visibility:public"]) -exports_files(["tsconfig.json"]) -``` - -Next create a `WORKSPACE` file in your project root (or edit the existing one) -containing: - -```python -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# Fetch rules_nodejs -# (you can check https://github.com/bazelbuild/rules_nodejs for a newer release than this) -http_archive( - name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", -) - -# Setup the NodeJS toolchain -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories() - -# Setup Bazel managed npm dependencies with the `yarn_install` rule. -# The name of this rule should be set to `npm` so that `ts_library` -# can find your npm dependencies by default in the `@npm` workspace. You may -# also use the `npm_install` rule with a `package-lock.json` file if you prefer. -# See https://github.com/bazelbuild/rules_nodejs#dependencies for more info. -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -# Install all Bazel dependencies needed for npm packages that supply Bazel rules -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") -install_bazel_dependencies() - -# Setup TypeScript toolchain -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") -ts_setup_workspace() -``` - -# Self-managed npm dependencies - -We recommend you use Bazel managed dependencies but if you would like -Bazel to also install a `node_modules` in your workspace you can also -point the `node_repositories` repository rule in your WORKSPACE file to -your `package.json`. - -```python -node_repositories(package_json = ["//:package.json"]) -``` - -You can then run `yarn` in your workspace with: - -```sh -$ bazel run @nodejs//:yarn -``` - -To use your workspace `node_modules` folder as a dependency in `ts_library` and -other rules, add the following to your root `BUILD.bazel` file: - -```python -filegroup( - name = "node_modules", - srcs = glob( - include = [ - # Must include .proto files since the tsc_wrapped compiler utilizes them - "node_modules/**/*.proto", - "node_modules/**/*.js", - "node_modules/**/*.d.ts", - "node_modules/**/*.json", - "node_modules/.bin/*", - ], - exclude = [ - # Files under test & docs may contain file names that - # are not legal Bazel labels (e.g., - # node_modules/ecstatic/test/public/中文/檔案.html) - "node_modules/**/test/**", - "node_modules/**/docs/**", - # Files with spaces in the name are not legal Bazel labels - "node_modules/**/* */**", - "node_modules/**/* *", - ], - ), -) - -# Create a tsc_wrapped compiler rule to use in the ts_library -# compiler attribute when using self-managed dependencies -nodejs_binary( - name = "@bazel/typescript/tsc_wrapped", - entry_point = "@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js", - # Point bazel to your node_modules to find the entry point - node_modules = ["//:node_modules"], -) -``` - -See https://github.com/bazelbuild/rules_nodejs#dependencies for more information on -managing npm dependencies with Bazel. - -## Usage - -### Compiling TypeScript: `ts_library` - -The `ts_library` rule invokes the TypeScript compiler on one compilation unit, -or "library" (generally one directory of source files). - -Create a `BUILD` file next to your sources: - -```python -package(default_visibility=["//visibility:public"]) -load("@npm_bazel_typescript//:defs.bzl", "ts_library") - -ts_library( - name = "my_code", - srcs = glob(["*.ts"]), - deps = ["//path/to/other:library"], -) -``` - -If your ts_library target has npm dependencies you can specify these -with fine grained npm dependency targets created by the `yarn_install` or -`npm_install` rules: - -```python -ts_library( - name = "my_code", - srcs = glob(["*.ts"]), - deps = [ - "@npm//@types/node", - "@npm//@types/foo", - "@npm//foo", - "//path/to/other:library", - ], -) -``` - -You can also you the `@npm//@types` target which will include all -packages in the `@types` scope as dependencies. - -If you are using self-managed npm dependencies, you can use the -`node_modules` attribute in `ts_library` and point it to the -`//:node_modules` filegroup defined in your root `BUILD.bazel` file. -You'll also need to override the `compiler` attribute if you do this -as the Bazel-managed deps and self-managed cannot be used together -in the same rule. - -```python -ts_library( - name = "my_code", - srcs = glob(["*.ts"]), - deps = ["//path/to/other:library"], - node_modules = "//:node_modules", - compiler = "//:@bazel/typescript/tsc_wrapped", -) -``` - -To build a `ts_library` target run: - -`bazel build //path/to/package:target` - -The resulting `.d.ts` file paths will be printed. Additionally, the `.js` -outputs from TypeScript will be written to disk, next to the `.d.ts` files 1. - -Note that the `tsconfig.json` file used for compilation should be the same one -your editor references, to keep consistent settings for the TypeScript compiler. -By default, `ts_library` uses the `tsconfig.json` file in the workspace root -directory. See the notes about the `tsconfig` attribute in the [ts_library API docs]. - -> 1 The -> [declarationDir](https://www.typescriptlang.org/docs/handbook/compiler-options.html) -> compiler option will be silently overwritten if present. - -[ts_library API docs]: http://tsetse.info/api/build_defs.html#ts_library - -### Serving TypeScript for development - -There are two choices for development mode: - -1. Use the `ts_devserver` rule to bring up our simple, fast development server. - This is intentionally very simple, to help you get started quickly. However, - since there are many development servers available, we do not want to mirror - their features in yet another server we maintain. -1. Teach your real frontend server to serve files from Bazel's output directory. - This is not yet documented. Choose this option if you have an existing server - used in development mode, or if your requirements exceed what the - `ts_devserver` supports. Be careful that your development round-trip stays - fast (should be under two seconds). - -To use `ts_devserver`, you simply `load` the rule, and call it with `deps` that -point to your `ts_library` target(s): - -```python -load("@npm_bazel_typescript//:defs.bzl", "ts_devserver", "ts_library") - -ts_library( - name = "app", - srcs = ["app.ts"], -) - -ts_devserver( - name = "devserver", - # We'll collect all the devmode JS sources from these TypeScript libraries - deps = [":app"], - # This is the path we'll request from the browser, see index.html - serving_path = "/bundle.js", - # The devserver can serve our static files too - static_files = ["index.html"], -) -``` - -The `index.html` should be the same one you use for production, and it should -load the JavaScript bundle from the path indicated in `serving_path`. - -If you don't have an index.html file, a simple one will be generated by the -`ts_devserver`. - -See `examples/app` in this repository for a working example. To run the -devserver, we recommend you use [ibazel]: - -```sh -$ ibazel run examples/app:devserver -``` - -`ibazel` will keep the devserver program running, and provides a LiveReload -server so the browser refreshes the application automatically when each build -finishes. - -[ibazel]: https://github.com/bazelbuild/bazel-watcher - -## Writing TypeScript code for Bazel - -Bazel's TypeScript compiler has your workspace path mapped, so you can import -from an absolute path starting from your workspace. - -`/WORKSPACE`: -```python -workspace(name = "myworkspace") -``` - -`/some/long/path/to/deeply/nested/subdirectory.ts`: -```javascript -import {thing} from 'myworkspace/place'; -``` - -will import from `/place.ts`. - - -Since this is an extension to the vanillia TypeScript compiler, editors which use the TypeScript language services to provide code completion and inline type checking will not be able to resolve the modules. In the above example, adding -```json -"paths": { - "myworkspace/*": ["*"] -} -``` -to `tsconfig.json` will fix the imports for the common case of using absolute paths. -See https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping for more details on the paths syntax. - -Similarly, you can use path mapping to teach the editor how to resolve imports -from `ts_library` rules which set the `module_name` attribute. - -## Notes - -If you'd like a "watch mode", try https://github.com/bazelbuild/bazel-watcher -(note, it's also quite new). - -At some point, we plan to release a tool similar to [gazelle] to generate the -BUILD files from your source code. - -[gazelle]: https://github.com/bazelbuild/rules_go/tree/master/go/tools/gazelle +Please file issues for `ts_library` rule and other Bazel rules in that repo. diff --git a/WORKSPACE b/WORKSPACE index 9ee5c208..e6fc9e84 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -67,20 +67,11 @@ load("//internal:ts_repositories.bzl", "ts_setup_dev_workspace") ts_setup_dev_workspace() -# Test that check_rules_typescript_version works as expected -load("//:defs.bzl", "check_rules_typescript_version") - -check_rules_typescript_version(version_string = "0.25.1") - # Dependencies for generating documentation load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") sass_repositories() -load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories") - -skydoc_repositories() - # Setup rules_webtesting toolchain load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") diff --git a/defs.bzl b/defs.bzl index 7ae01391..2e223e82 100644 --- a/defs.bzl +++ b/defs.bzl @@ -17,14 +17,12 @@ Users should not load files under "/internal" """ -load("//:version.bzl", _check_rules_typescript_version = "check_rules_typescript_version") load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") load("//internal:ts_config.bzl", _ts_config = "ts_config") load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") -check_rules_typescript_version = _check_rules_typescript_version ts_setup_workspace = _ts_setup_workspace ts_library = _ts_library ts_config = _ts_config diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel index a04d169b..cd02979f 100644 --- a/devserver/BUILD.bazel +++ b/devserver/BUILD.bazel @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# BEGIN-DEV-ONLY -# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. -# The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") go_library( @@ -68,47 +65,10 @@ go_binary( visibility = ["//visibility:public"], ) -filegroup( - name = "npm_package_assets", - srcs = [ - "BUILD.bazel", - ], - visibility = ["//visibility:public"], -) - -# END-DEV-ONLY -config_setting( - name = "darwin_x64", - constraint_values = [ - "@bazel_tools//platforms:osx", - "@bazel_tools//platforms:x86_64", - ], -) - -config_setting( - name = "linux_x64", - constraint_values = [ - "@bazel_tools//platforms:linux", - "@bazel_tools//platforms:x86_64", - ], -) - -config_setting( - name = "windows_x64", - constraint_values = [ - "@bazel_tools//platforms:windows", - "@bazel_tools//platforms:x86_64", - ], -) - -filegroup( - name = "devserver", - srcs = select({ - ":darwin_x64": ["devserver-darwin_x64"], - ":linux_x64": ["devserver-linux_x64"], - ":windows_x64": ["devserver-windows_x64.exe"], - }), - # Don't build on CI - tags = ["manual"], - visibility = ["//visibility:public"], +filegroup( + name = "npm_package_assets", + srcs = [ + "BUILD.bazel", + ], + visibility = ["//visibility:public"], ) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel deleted file mode 100644 index 019f3dcd..00000000 --- a/docs/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc") - -skylark_doc( - name = "docs", - srcs = [ - "//internal:build_defs.bzl", - "//internal:ts_config.bzl", - "//internal:ts_repositories.bzl", - "//internal/devserver:ts_devserver.bzl", - "//internal/protobufjs:ts_proto_library.bzl", - ], - format = "html", - # The site is served at http://tsetse.info so the URL doesn't include a - # /rules_typescript segment. - # TODO(alexeagle): separate Tsetse docs from the rest of rules_typescript - site_root = "/api", - strip_prefix = "internal/", -) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index a8c65c2d..8b42aa89 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -20,14 +20,7 @@ load("//internal:defaults.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) -exports_files([ - # Exported to be consumed for generating skydoc. - # TODO(alexeagle): remove this after migration to stardoc - "build_defs.bzl", - "ts_config.bzl", - "ts_repositories.bzl", - "tsetse/tsconfig.json", -]) +exports_files(["tsetse/tsconfig.json"]) bzl_library( name = "bzl", diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel index b9ce1610..ae06e171 100644 --- a/internal/protobufjs/BUILD.bazel +++ b/internal/protobufjs/BUILD.bazel @@ -67,13 +67,3 @@ nodejs_binary( entry_point = "protobufjs/bin/pbts", install_source_map_support = False, ) - -filegroup( - name = "npm_package_assets", - srcs = [ - "BUILD.bazel", - "package.json", - "ts_proto_library.bzl", - "yarn.lock", - ], -) diff --git a/package.bzl b/package.bzl index 900d106c..e19ba502 100644 --- a/package.bzl +++ b/package.bzl @@ -103,13 +103,6 @@ def rules_typescript_dev_dependencies(): sha256 = "894d7928df8da85e263d743c8434d4c10ab0a3f0708fed0d53394e688e3faf70", ) - http_archive( - name = "io_bazel_skydoc", - url = "https://github.com/bazelbuild/skydoc/archive/82fdbfe797c6591d8732df0c0389a2b1c3e50992.zip", # 2018-12-12 - strip_prefix = "skydoc-82fdbfe797c6591d8732df0c0389a2b1c3e50992", - sha256 = "75fd965a71ca1f0d0406d0d0fb0964d24090146a853f58b432761a1a6c6b47b9", - ) - def _maybe(repo_rule, name, **kwargs): if name not in native.existing_rules(): repo_rule(name = name, **kwargs) diff --git a/package.json b/package.json index b4834d14..dd1a0292 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,12 @@ { - "name": "@bazel/typescript", - "description": "TypeScript rules for Bazel", + "private": true, "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", - "version": "0.25.1", - "keywords": [ - "typescript", - "bazel" - ], - "main": "./internal/tsc_wrapped/index.js", - "typings": "./internal/tsc_wrapped/index.d.ts", - "bin": { - "ts_auto_deps": "./ts_auto_deps/ts_auto_deps.js", - "tsc_wrapped": "./internal/tsc_wrapped/tsc_wrapped.js" - }, - "dependencies": { + "devDependencies": { "protobufjs": "5.0.3", "semver": "5.6.0", "source-map-support": "0.5.9", "tsutils": "2.27.2", - "jasmine-core": "2.8.0" - }, - "devDependencies": { "@bazel/bazel": "~0.22.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", @@ -34,6 +19,7 @@ "clang-format": "1.0.49", "concurrently": "^3.5.1", "http-server": "^0.11.1", + "jasmine-core": "2.8.0", "karma": "^4.0.0", "karma-chrome-launcher": "2.2.0", "karma-firefox-launcher": "1.1.0", @@ -50,23 +36,12 @@ "typescript": "~3.1.6", "which": "~1.0.5" }, - "bazelWorkspaces": { - "npm_bazel_typescript": { - "version": "0.0.0-PLACEHOLDER", - "compatVersion": "0.0.0-COMPAT_VERSION", - "rootPath": "." - } - }, "scripts": { "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e", "e2e": "yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver", "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-app-prodserver": "concurrently \"bazel run //examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", "e2e-examples-protobuf-devserver": "concurrently \"bazel run //examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", - "e2e-examples-protobuf-prodserver": "concurrently \"bazel run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", - "skydoc": "bazel build //docs && unzip -o -d docs/api bazel-bin/docs/docs-skydoc.zip", - "bazel:format": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=args-order,attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unsorted-dict-items,unused-variable", - "bazel:lint": "yarn bazel:format --lint=warn", - "bazel:lint-fix": "yarn bazel:format --lint=fix" + "e2e-examples-protobuf-prodserver": "concurrently \"bazel run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first" } } diff --git a/ts_auto_deps/BUILD.bazel b/ts_auto_deps/BUILD.bazel index a1e0f2df..b71e8a14 100644 --- a/ts_auto_deps/BUILD.bazel +++ b/ts_auto_deps/BUILD.bazel @@ -46,11 +46,3 @@ go_binary( pure = "on", visibility = ["//visibility:public"], ) - -filegroup( - name = "npm_package_assets", - srcs = [ - "ts_auto_deps.js", - ], - visibility = ["//visibility:public"], -) diff --git a/version.bzl b/version.bzl index f2953325..35f5df82 100644 --- a/version.bzl +++ b/version.bzl @@ -1,56 +1 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Package file which defines npm_bazel_typescript version in skylark -""" - -load("@build_bazel_rules_nodejs//internal/common:check_version.bzl", "check_version") - -VERSION = "0.25.1" - -# This version is the minimum version that is API compatible with this version -# of rules_typescript. This version should be updated to equal VERSION for -# releases with breaking changes and/or new features. COMPAT_VERSION = "0.25.0" - -def check_rules_typescript_version(version_string): - """ - Verify that a compatible npm_bazel_typescript is loaded a WORKSPACE. - - Where COMPAT_VERSION and VERSION come from the npm_bazel_typescript that - is loaded in a WORKSPACE, this function will check: - - VERSION >= version_string >= COMPAT_VERSION - - This should be called from the `WORKSPACE` file so that the build fails as - early as possible. For example: - - ``` - # in WORKSPACE: - load("@npm_bazel_typescript//:defs.bzl", "check_rules_typescript_version") - check_rules_typescript_version(version_string = "0.22.0") - ``` - - Args: - version_string: A version string to check for compatibility with the loaded version - of npm_bazel_typescript. The version check performed is - `VERSION >= version_string >= COMPAT_VERSION` where VERSION and COMPAT_VERSION - come from the loaded version of npm_bazel_typescript. - """ - if not check_version(VERSION, version_string) or not check_version(version_string, COMPAT_VERSION): - fail("\nLoaded npm_bazel_typescript version {} with mimimum compat version of {} is not compatible with checked version {}!\n\n".format( - VERSION, - COMPAT_VERSION, - version_string, - )) From 329ecca2d4a5fad2e36c49dba5c701a3a7daf7b3 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 12 Mar 2019 11:02:07 -0700 Subject: [PATCH 127/316] Fix downstream @bazel/typescript package It was picking up a build file containing a rules_go dependency. This was caught by our new Renovate setup which sent a red PR: https://circleci.com/gh/bazelbuild/rules_nodejs/5625#tests/containers/3 Closes #437 PiperOrigin-RevId: 238052911 --- BUILD.bazel | 1 - devserver/BUILD.bazel | 8 -------- 2 files changed, 9 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index ace9f178..74d8f248 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -59,7 +59,6 @@ js_library( npm_package( name = "npm_bazel_typescript_package", srcs = [ - "//devserver:npm_package_assets", "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", "//internal:common/compilation.bzl", "//internal:common/json_marshal.bzl", diff --git a/devserver/BUILD.bazel b/devserver/BUILD.bazel index cd02979f..b822549e 100644 --- a/devserver/BUILD.bazel +++ b/devserver/BUILD.bazel @@ -64,11 +64,3 @@ go_binary( pure = "on", visibility = ["//visibility:public"], ) - -filegroup( - name = "npm_package_assets", - srcs = [ - "BUILD.bazel", - ], - visibility = ["//visibility:public"], -) From 4c65ddb8f54bf38ba4224b8019cba9b2a8d1701d Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 15 Mar 2019 14:17:06 -0700 Subject: [PATCH 128/316] Support aliases and reexporting ts_libraries for ordinary imports. Instead of querying directly for rules with a given source file in their srcs, load all the rules in the package, and check for aliases and reexporting ts_libraries. PiperOrigin-RevId: 238708950 --- ts_auto_deps/analyze/analyze.go | 42 +--- ts_auto_deps/analyze/loader.go | 372 +++++++++++++++++++++------- ts_auto_deps/analyze/loader_test.go | 62 ++++- 3 files changed, 338 insertions(+), 138 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 475ab3e3..a80a5543 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -371,26 +371,6 @@ func pathWithExtensions(basename string) []string { var ambientModuleDeclRE = regexp.MustCompile("(?m)^\\s*declare\\s+module\\s+['\"]([^'\"]+)['\"]\\s+\\{") -// pathStartsWith checks if path starts with prefix, checking each path segment, -// so that @angular/core starts with @angular/core, but @angular/core-bananas -// does not -func pathStartsWith(path, prefix string) bool { - pathParts := strings.Split(path, string(os.PathSeparator)) - prefixParts := strings.Split(prefix, string(os.PathSeparator)) - - if len(prefixParts) > len(pathParts) { - return false - } - - for i, prefixPart := range prefixParts { - if prefixPart != pathParts[i] { - return false - } - } - - return true -} - // findExistingDepProvidingImport looks through a map of the existing deps to // see if any of them provide the import in a way that can't be queried // for. E.g. if the build rule has a "module_name" attribute or if one @@ -405,28 +385,10 @@ func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, root stri // check if any of the existing deps declare a module_name that matches the import for _, r := range rt.dependencies { - moduleName := stringAttribute(r, "module_name") - if moduleName == "" { - continue - } - if !pathStartsWith(i.importPath, moduleName) { + resolvedImportPath := resolveAgainstModuleRoot(r, i.importPath) + if resolvedImportPath == i.importPath { continue } - // fmt.Printf("checking if %s is provided by %s\n", i.importPath, moduleName) - // if module root is a file, remove the file extension, since it'll be added - // by possibleFilepaths below - moduleRoot := stripTSExtension(stringAttribute(r, "module_root")) - _, pkg, _ := edit.ParseLabel(r.GetName()) - - // resolve the import path against the module name and module root, ie if - // the import path is @foo/bar and there's a moduleName of @foo the resolved - // import path is location/of/foo/bar, or if there's also a moduleRoot of - // baz, the resolved import path is location/of/foo/baz/bar - // - // using strings.TrimPrefix for trimming the path is ok, since - // pathStartsWith already checked that moduleName is a proper prefix of - // i.importPath - resolvedImportPath := filepath.Join(pkg, moduleRoot, strings.TrimPrefix(i.importPath, moduleName)) // enumerate all the possible filepaths for the resolved import path, and // compare against all the srcs diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index d5220171..ff9e9eb1 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -158,30 +158,42 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg results := make(map[string]*appb.Rule) addedPaths := make(map[string]bool) - var possiblePaths []string + var possibleFilePaths []string + possiblePathToPath := make(map[string]string) + // for all the normalized typescript import paths, generate all the possible + // corresponding file paths for _, path := range paths { if strings.HasPrefix(path, "goog:") { // 'goog:' imports are resolved using an sstable. results[path] = nil continue } - if !strings.HasPrefix(path, "@") { - if _, ok := addedPaths[path]; !ok { - addedPaths[path] = true + if strings.HasPrefix(path, "@") { + continue + } + + if _, ok := addedPaths[path]; !ok { + addedPaths[path] = true - // there isn't a one to one mapping from ts import paths to file - // paths, so look for all the possible file paths - possiblePaths = append(possiblePaths, possibleFilepaths(path)...) + // there isn't a one to one mapping from ts import paths to file + // paths, so look for all the possible file paths + pfs := possibleFilepaths(path) + possibleFilePaths = append(possibleFilePaths, pfs...) + for _, pf := range pfs { + possiblePathToPath[pf] = path } } } - r, err := q.batchQuery(possiblePaths) + // query for all the possible filepaths, to determine which ones are real + r, err := q.batchQuery(possibleFilePaths) if err != nil { return nil, err } - var fileLabels, generators []string - generatorsToFiles := make(map[string][]*appb.GeneratedFile) + var fileLabels, packages []string + fileToGeneratorLabel := make(map[string]string) + pathToLabels := make(map[string][]string) + // get the labels for all the files which exist for _, target := range r.GetTarget() { label, err := q.fileLabel(target) if err != nil { @@ -191,50 +203,64 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg case appb.Target_GENERATED_FILE: file := target.GetGeneratedFile() generator := file.GetGeneratingRule() + label = file.GetName() + fileLabels = append(fileLabels, label) + _, pkg, _ := edit.ParseLabel(label) + packages = append(packages, pkg) // a generated file can be included as a source by referencing the label // of the generated file, or the label of the generating rule, so check // for both - fileLabels = append(fileLabels, file.GetName()) - generators = append(generators, generator) - generatorsToFiles[generator] = append(generatorsToFiles[generator], file) + fileToGeneratorLabel[labelToPath(label)] = labelToPath(generator) + pathToLabels[possiblePathToPath[labelToPath(label)]] = append(pathToLabels[possiblePathToPath[labelToPath(label)]], label) case appb.Target_SOURCE_FILE: fileLabels = append(fileLabels, label) + _, pkg, _ := edit.ParseLabel(label) + packages = append(packages, pkg) + pathToLabels[possiblePathToPath[labelToPath(label)]] = append(pathToLabels[possiblePathToPath[labelToPath(label)]], label) } } - filepathToRules := make(map[string][]*appb.Rule) - - // load all the rules with file srcs (either literal or generated) - sourceLabelToRules, err := q.loadRulesWithSources(workspaceRoot, fileLabels) + // load all the rules in all the packages files were found in, so we can look + // for aliases and reexporting libraries in the same package + pkgToAllRules, pkgToActualToAlias, err := q.loadAllRulesInPackages("", packages) if err != nil { return nil, err } - for label, rules := range sourceLabelToRules { - for _, rule := range rules { - filepathToRules[labelToPath(label)] = append(filepathToRules[labelToPath(label)], rule) - } - } - - // load all the rules with generator rule srcs - generatorLabelToRules, err := q.loadRulesWithSources(workspaceRoot, generators) - if err != nil { - return nil, err - } - for label, rules := range generatorLabelToRules { - for _, rule := range rules { - for _, generated := range generatorsToFiles[label] { - filepathToRules[labelToPath(generated.GetName())] = append(filepathToRules[labelToPath(generated.GetName())], rule) - } - } - } for _, path := range paths { - // check all the possible file paths for the import path - for _, fp := range possibleFilepaths(path) { - if rules, ok := filepathToRules[fp]; ok { - rule := chooseCanonicalRule(rules) - results[path] = rule + // look up the corresponding file label(s) for the normalized typescript + // import path + for _, label := range pathToLabels[path] { + _, pkg, _ := edit.ParseLabel(label) + // get the file path that corresponds to the normalized typescript import + // path + filePath := labelToPath(label) + var matchingDeps []*appb.Rule + allRules := pkgToAllRules[pkg] + actualToAlias := pkgToActualToAlias[pkg] + for _, candidate := range typeScriptRules(allRules) { + // check if the rule has the file or the generator of the file in its + // srcs + possibleSources := []string{filePath} + if gl, ok := fileToGeneratorLabel[filePath]; ok { + possibleSources = append(possibleSources, gl) + } + provides, err := q.ruleProvidesImports(candidate, srcsContainsAnyFilePath(possibleSources)) + if err != nil { + return nil, err + } + if !provides { + continue + } + + if alias, ok := actualToAlias[candidate.GetName()]; ok { + candidate = alias + } + matchingDeps = append(matchingDeps, candidate) + } + if len(matchingDeps) > 0 { + results[path] = chooseCanonicalRule(matchingDeps) } } } @@ -243,14 +269,12 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg } // chooseCanonicalRule chooses between rules which includes the imported file as -// a source. It applies heuristics, such as prefering ts_library to other rule -// types to narrow down the choices. After narrowing, it chooses the first -// rule. If no rules are left after narrowing, it returns the first rule from -// the original list. +// a source. func chooseCanonicalRule(rules []*appb.Rule) *appb.Rule { - // filter down to only ts_library rules + // if any of the rules is a reexporting lib assume that the reexport was + // created for a reason for _, r := range rules { - if r.GetRuleClass() == "ts_library" { + if isReexportingLib(r) { return r } } @@ -300,44 +324,6 @@ func (q *QueryBasedTargetLoader) targetLabel(target *appb.Target) (string, error } } -// loadRulesWithSources loads all rules which include the labels in sources as -// srcs attributes. Returns a map from source label to a list of rules which -// include it. A source label can be the label of a source file or a generated -// file or a generating rule. -func (q *QueryBasedTargetLoader) loadRulesWithSources(workspaceRoot string, sources []string) (map[string][]*appb.Rule, error) { - pkgToLabels := make(map[string][]string) - queries := make([]string, 0, len(sources)) - for _, label := range sources { - _, pkg, file := edit.ParseLabel(label) - pkgToLabels[pkg] = append(pkgToLabels[pkg], label) - // Query for all targets in the package which use file. - queries = append(queries, fmt.Sprintf("attr('srcs', %s, //%s:*)", file, pkg)) - } - r, err := q.batchQuery(queries) - if err != nil { - return nil, err - } - labelToRules := make(map[string][]*appb.Rule) - for _, target := range r.GetTarget() { - label, err := q.ruleLabel(target) - if err != nil { - return nil, err - } - rule := target.GetRule() - _, pkg, _ := edit.ParseLabel(label) - labels := pkgToLabels[pkg] - for _, src := range listAttribute(rule, "srcs") { - for _, l := range labels { - if src == l { - labelToRules[l] = append(labelToRules[l], rule) - break - } - } - } - } - return labelToRules, nil -} - // batchQuery runs a set of queries with a single call to Bazel query and the // '--keep_going' flag. func (q *QueryBasedTargetLoader) batchQuery(queries []string) (*appb.QueryResult, error) { @@ -388,6 +374,180 @@ func (q *QueryBasedTargetLoader) query(args ...string) (*appb.QueryResult, error return &result, nil } +// ruleProvidesImports checks if the rule directly provides the import, or if +// it's a reexporting lib, if one of its deps does. +func (q *QueryBasedTargetLoader) ruleProvidesImports(rule *appb.Rule, srcMatcher func(rule *appb.Rule) bool) (bool, error) { + if srcMatcher(rule) { + return true, nil + } + + if !isReexportingLib(rule) { + return false, nil + } + + // if the rule is a reexporting library, load all the rules that the rule + // reexports, and check if they provide the imported paths. This only handles + // one level of reexport. + _, pkg, _ := edit.ParseLabel(rule.GetName()) + // TODO(alexeagle): Batch calls to LoadLabels. Batching calls to ruleProvidesImport + // would also be required. + exportedRules, err := q.LoadRules(pkg, exportedLabels(rule)) + if err != nil { + return false, err + } + for _, exportedRule := range exportedRules { + if srcMatcher(exportedRule) { + return true, nil + } + } + + return false, nil +} + +// exportedLabels returns the labels exported by rule. Exported labels are the +// deps of a rule if the rule is an alias. +func exportedLabels(rule *appb.Rule) []string { + var exported []string + if isReexportingLib(rule) { + exported = append(exported, listAttribute(rule, "deps")...) + } + return exported +} + +// isReexportingLib checks if a library has no sources, which the TS rules use a +// way to mark a library as an alias. +func isReexportingLib(rule *appb.Rule) bool { + return len(listAttribute(rule, "srcs")) == 0 +} + +// srcsContainsPath returns a function, which takes a rule, which returns true +// if the rule has a src which matches one of the possible filepaths for the +// provided typescript import path. +func srcsContainsPath(path string) func(rule *appb.Rule) bool { + return func(rule *appb.Rule) bool { + resolvedImportPath := resolveAgainstModuleRoot(rule, path) + + // enumerate all the possible filepaths for the resolved import path, and + // compare against all the srcs + possibleImportPaths := possibleFilepaths(resolvedImportPath) + for _, src := range listAttribute(rule, "srcs") { + for _, mi := range possibleImportPaths { + if mi == labelToPath(src) { + return true + } + } + } + + return false + } +} + +// srcsContainsFilePath returns a function which takes a rule, which returns +// true if the rule has a src which, if pathified, equals one of the filePaths. +func srcsContainsAnyFilePath(filePaths []string) func(rule *appb.Rule) bool { + return func(rule *appb.Rule) bool { + for _, filePath := range filePaths { + for _, src := range listAttribute(rule, "srcs") { + if filePath == labelToPath(src) { + return true + } + } + } + + return false + } +} + +// loadAllRulesInPackages loads all rules in all packages. +// +// If an alias or aliases are present in the package, the rules for each alias' +// 'actual' attribute are loaded and a map from each 'actual' rule to its alias +// rule is constructed. +// +// loadAllRulesInPackages returns two maps. The first map is a map from a package +// label to all of the rules in the package. The second map is a map from a +// package to the map of 'actual' rules to alias rules for that package. +func (q *QueryBasedTargetLoader) loadAllRulesInPackages(currentPkg string, packages []string) (map[string][]*appb.Rule, map[string]map[string]*appb.Rule, error) { + var missingPackages []string + for _, pkg := range packages { + if _, ok := q.pkgCache[pkgCacheKey(currentPkg, pkg)]; !ok { + missingPackages = append(missingPackages, pkg) + } + } + if len(missingPackages) > 0 { + // Load any packages not already available in the cache. + var queries []string + pkgToRules := make(map[string][]*appb.Rule) + pkgToAliasToRule := make(map[string]map[string]*appb.Rule) + for _, pkg := range missingPackages { + if currentPkg != "" { + queries = append(queries, fmt.Sprintf("visible(%s:*, %s:*)", currentPkg, pkg)) + } else { + queries = append(queries, fmt.Sprintf("%s:*", pkg)) + } + pkgToAliasToRule[pkg] = make(map[string]*appb.Rule) + } + r, err := q.batchQuery(queries) + if err != nil { + return nil, nil, err + } + actualToAlias := make(map[string]*appb.Rule) + pkgToActuals := make(map[string][]string) + for _, target := range r.GetTarget() { + if target.GetType() == appb.Target_RULE { + rule := target.GetRule() + _, pkg, _ := edit.ParseLabel(rule.GetName()) + if rule.GetRuleClass() == "alias" { + // if the package contains an alias, derefence it (but only one layer + // of aliases) + actual := stringAttribute(rule, "actual") + if actual == "" { + return nil, nil, fmt.Errorf(`alias %q missing "actual" attribute`, rule.GetName()) + } + actualToAlias[actual] = rule + pkgToActuals[pkg] = append(pkgToActuals[pkg], actual) + } else { + pkgToRules[pkg] = append(pkgToRules[pkg], rule) + } + } + } + for pkg, actuals := range pkgToActuals { + // Load all the aliased rules, checking if they're visible from the + // package where they're aliased from + resolvedActuals, err := q.LoadRules(pkg, actuals) + if err != nil { + return nil, nil, err + } + for actual, rule := range resolvedActuals { + alias := actualToAlias[actual] + _, pkg, _ := edit.ParseLabel(alias.GetName()) + pkgToAliasToRule[pkg][rule.GetName()] = alias + pkgToRules[pkg] = append(pkgToRules[pkg], rule) + } + } + for _, pkg := range missingPackages { + q.pkgCache[pkgCacheKey(currentPkg, pkg)] = &pkgCacheEntry{ + rules: pkgToRules[pkg], + aliases: pkgToAliasToRule[pkg], + } + } + } + + pkgToRules := make(map[string][]*appb.Rule) + pkgToRuleToAlias := make(map[string]map[string]*appb.Rule) + for _, pkg := range packages { + cacheEntry := q.pkgCache[pkgCacheKey(currentPkg, pkg)] + pkgToRules[pkg] = cacheEntry.rules + pkgToRuleToAlias[pkg] = cacheEntry.aliases + } + + return pkgToRules, pkgToRuleToAlias, nil +} + +func pkgCacheKey(currentPkg, pkg string) string { + return currentPkg + "|" + pkg +} + // dedupeLabels returns a new set of labels with no duplicates. func dedupeLabels(labels []string) []string { addedLabels := make(map[string]bool) @@ -420,16 +580,48 @@ func typeScriptRules(rules []*appb.Rule) []*appb.Rule { } // resolveAgainstModuleRoot resolves imported against moduleRoot and moduleName. -func resolveAgainstModuleRoot(label, moduleRoot, moduleName, imported string) string { - if moduleRoot == "" && moduleName == "" { +func resolveAgainstModuleRoot(rule *appb.Rule, imported string) string { + moduleName := stringAttribute(rule, "module_name") + if moduleName == "" { return imported } - trim := strings.TrimPrefix(imported, moduleName) - if trim == imported { + if !pathStartsWith(imported, moduleName) { return imported } - _, pkg, _ := edit.ParseLabel(label) - return platform.Normalize(filepath.Join(pkg, moduleRoot, trim)) + // if module root is a file, remove the file extension, since it'll be added + // by possibleFilepaths below + moduleRoot := stripTSExtension(stringAttribute(rule, "module_root")) + _, pkg, _ := edit.ParseLabel(rule.GetName()) + + // resolve the import path against the module name and module root, ie if + // the import path is @foo/bar and there's a moduleName of @foo the resolved + // import path is location/of/foo/bar, or if there's also a moduleRoot of + // baz, the resolved import path is location/of/foo/baz/bar + // + // using strings.TrimPrefix for trimming the path is ok, since + // pathStartsWith already checked that moduleName is a proper prefix of + // i.importPath + return platform.Normalize(filepath.Join(pkg, moduleRoot, strings.TrimPrefix(imported, moduleName))) +} + +// pathStartsWith checks if path starts with prefix, checking each path segment, +// so that @angular/core starts with @angular/core, but @angular/core-bananas +// does not +func pathStartsWith(path, prefix string) bool { + pathParts := strings.Split(path, "/") + prefixParts := strings.Split(prefix, "/") + + if len(prefixParts) > len(pathParts) { + return false + } + + for i, prefixPart := range prefixParts { + if prefixPart != pathParts[i] { + return false + } + } + + return true } // parsePackageName parses and returns the scope and package of imported. For diff --git a/ts_auto_deps/analyze/loader_test.go b/ts_auto_deps/analyze/loader_test.go index ddb460cb..57651290 100644 --- a/ts_auto_deps/analyze/loader_test.go +++ b/ts_auto_deps/analyze/loader_test.go @@ -10,17 +10,63 @@ import ( func TestResolveAgainstModuleRoot(t *testing.T) { tests := []struct { - label, moduleRoot, moduleName, imported string - expectedResolution string + ruleLiteral string + imported string + expected string }{ - {"//a", "", "", "foo", "foo"}, - {"//b", "", "foo", "bar", "bar"}, - {"//c", "", "foo", "foo/bar", "c/bar"}, - {"//actual/loc:target", "mod/root", "foo/bar", "foo/bar/baz/bam", "actual/loc/mod/root/baz/bam"}, + { + ruleLiteral: `name: "//a" + rule_class: "ts_library"`, + imported: "foo", + expected: "foo", + }, + { + ruleLiteral: `name: "//b" + rule_class: "ts_library" + attribute: < + type: 4 + name: "module_name" + string_value: "foo" + >`, + imported: "bar", + expected: "bar", + }, + { + ruleLiteral: `name: "//c" + rule_class: "ts_library" + attribute: < + type: 4 + name: "module_name" + string_value: "foo" + >`, + imported: "foo/bar", + expected: "c/bar", + }, + { + ruleLiteral: `name: "//actual/loc:target" + rule_class: "ts_library" + attribute: < + type: 4 + name: "module_name" + string_value: "foo/bar" + > + attribute: < + type: 4 + name: "module_root" + string_value: "mod/root" + >`, + imported: "foo/bar/baz/bam", + expected: "actual/loc/mod/root/baz/bam", + }, } for _, test := range tests { - if resolution := resolveAgainstModuleRoot(test.label, test.moduleRoot, test.moduleName, test.imported); resolution != test.expectedResolution { - t.Errorf("resolveAgainstModuleRoot(%q): got %q, want %q", test.label, resolution, test.expectedResolution) + rule, err := parseRuleLiteral(test.ruleLiteral) + if err != nil { + t.Errorf("isRuleAnAlias(%q): failed to parse literal: %s", test.ruleLiteral, err) + continue + } + if actual := resolveAgainstModuleRoot(rule, test.imported); actual != test.expected { + t.Errorf("resolveAgainstModuleRoot(%q): got %q, want %q", rule.GetName(), actual, test.expected) } } } From 3a85a90c259e9c49f652142ce439044baad0f24e Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 19 Mar 2019 09:36:31 -0700 Subject: [PATCH 129/316] Use the canonical name for JS modules in node_modules Closes #438 PiperOrigin-RevId: 239207994 --- internal/tsc_wrapped/compiler_host.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 911b82e3..e0b2d031 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -340,6 +340,10 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { } } + if (fileName.startsWith('node_modules/')) { + return fileName.substring('node_modules/'.length); + } + // path/to/file -> // myWorkspace/path/to/file return path.posix.join(workspace, fileName); From 5a35750527f4ec89d12b4ce35caf96cb42e82c08 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 22 Mar 2019 11:08:20 -0700 Subject: [PATCH 130/316] Check for visibiliy, don't just assume reexports should be used. To save a query, I used a heuristic to choose between rules if more than one provided a given path. Global taze revealed some cases where the heuristic was wrong. PiperOrigin-RevId: 239827591 --- ts_auto_deps/analyze/loader.go | 56 ++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index ff9e9eb1..99a6877e 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -260,7 +260,11 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg matchingDeps = append(matchingDeps, candidate) } if len(matchingDeps) > 0 { - results[path] = chooseCanonicalRule(matchingDeps) + canonicalRule, err := q.chooseCanonicalRule(currentPkg, matchingDeps) + if err != nil { + return nil, err + } + results[path] = canonicalRule } } } @@ -268,19 +272,53 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg return results, nil } -// chooseCanonicalRule chooses between rules which includes the imported file as -// a source. -func chooseCanonicalRule(rules []*appb.Rule) *appb.Rule { - // if any of the rules is a reexporting lib assume that the reexport was - // created for a reason +// chooseCanonicalRule chooses between rules which include the imported file as +// a source (ie the rule that includes the file as a src, and any reexporting +// libraries). +// +// It filters the rules in a 2 stage process: +// +// 1. If only one of the rules is visible, choose that one, since the rule +// creator intended it to be imported. +// +// 2. If all or none of the rules are visible, choose the rule that directly +// includes the file as a src, since that reduces the chance of introducing +// circular dependencies. +func (q *QueryBasedTargetLoader) chooseCanonicalRule(currentPkg string, rules []*appb.Rule) (*appb.Rule, error) { + // check for visibility + var labels []string + for _, r := range rules { + labels = append(labels, r.GetName()) + } + visibleRulesMap, err := q.LoadRules(currentPkg, labels) + if err != nil { + return nil, err + } + + var visibleRules []*appb.Rule + for _, r := range visibleRulesMap { + if r != nil { + visibleRules = append(visibleRules, r) + } + } + + if len(visibleRules) == 1 { + return visibleRules[0], nil + } else if len(visibleRules) > 0 { + rules = visibleRules + } + + // if there's a visible reexporting lib and a visible lib with the src, favor + // the lib with the src, to reduce the chance of introducing a circular + // dependency for _, r := range rules { - if isReexportingLib(r) { - return r + if !isReexportingLib(r) { + return r, nil } } // if no rules matched the filter, just return the first rule - return rules[0] + return rules[0], nil } // ruleLabel returns the label for a target which is a rule. Returns an error if From bea5573522f3aa8730ee121448d952a489e8a638 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 22 Mar 2019 11:19:59 -0700 Subject: [PATCH 131/316] Fix a bug where taze couldn't handle the import of a file and its ngsummary. PiperOrigin-RevId: 239829941 --- ts_auto_deps/analyze/loader.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 99a6877e..2dd6d3a6 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -159,7 +159,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg addedPaths := make(map[string]bool) var possibleFilePaths []string - possiblePathToPath := make(map[string]string) + possiblePathToPaths := make(map[string][]string) // for all the normalized typescript import paths, generate all the possible // corresponding file paths for _, path := range paths { @@ -179,8 +179,10 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg // paths, so look for all the possible file paths pfs := possibleFilepaths(path) possibleFilePaths = append(possibleFilePaths, pfs...) + // map the file paths back to the import paths so we can map the file + // labels back to the import paths for _, pf := range pfs { - possiblePathToPath[pf] = path + possiblePathToPaths[pf] = append(possiblePathToPaths[pf], path) } } } @@ -212,12 +214,20 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg // of the generated file, or the label of the generating rule, so check // for both fileToGeneratorLabel[labelToPath(label)] = labelToPath(generator) - pathToLabels[possiblePathToPath[labelToPath(label)]] = append(pathToLabels[possiblePathToPath[labelToPath(label)]], label) + // map file label back to the import paths so that they can be looked for + // in the srcs of the rules + for _, path := range possiblePathToPaths[labelToPath(label)] { + pathToLabels[path] = append(pathToLabels[path], label) + } case appb.Target_SOURCE_FILE: fileLabels = append(fileLabels, label) _, pkg, _ := edit.ParseLabel(label) packages = append(packages, pkg) - pathToLabels[possiblePathToPath[labelToPath(label)]] = append(pathToLabels[possiblePathToPath[labelToPath(label)]], label) + // map file label back to the import paths so that they can be looked for + // in the srcs of the rules + for _, path := range possiblePathToPaths[labelToPath(label)] { + pathToLabels[path] = append(pathToLabels[path], label) + } } } From f8ed972dcd17f093dd1e339b284c05f4b1eaef33 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 22 Mar 2019 13:45:20 -0700 Subject: [PATCH 132/316] Fix bug where taze was using LoadRules() on the actuals of alaises. Aliases can alias things other than rules, and LoadRules() errors if asked to load a non-rule. Instead, use LoadTargets() and manually filter down to the rules. PiperOrigin-RevId: 239856549 --- ts_auto_deps/analyze/loader.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 2dd6d3a6..a7be545f 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -75,7 +75,7 @@ func (q *QueryBasedTargetLoader) LoadRules(pkg string, labels []string) (map[str if target.GetType() == appb.Target_RULE { labelToRule[label] = target.GetRule() } else { - return nil, fmt.Errorf("target contains object of type %q instead of type %q", target.GetType(), appb.Target_RULE) + return nil, fmt.Errorf("target %s contains object of type %q instead of type %q", label, target.GetType(), appb.Target_RULE) } } return labelToRule, nil @@ -560,13 +560,20 @@ func (q *QueryBasedTargetLoader) loadAllRulesInPackages(currentPkg string, packa } } for pkg, actuals := range pkgToActuals { - // Load all the aliased rules, checking if they're visible from the + // Load all the aliased targets, checking if they're visible from the // package where they're aliased from - resolvedActuals, err := q.LoadRules(pkg, actuals) + resolvedActuals, err := q.LoadTargets(pkg, actuals) if err != nil { return nil, nil, err } - for actual, rule := range resolvedActuals { + for actual, target := range resolvedActuals { + // aliases can be for anything, but deps can only be rules, so ignore + // other aliased targets + if target.GetType() != appb.Target_RULE { + continue + } + + rule := target.GetRule() alias := actualToAlias[actual] _, pkg, _ := edit.ParseLabel(alias.GetName()) pkgToAliasToRule[pkg][rule.GetName()] = alias From fab91f92e8663176b6224da6ab10941a25a89fb3 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 26 Mar 2019 12:41:50 -0700 Subject: [PATCH 133/316] Don't treat aliases with non-string "actual" attributes as errors. The "actual" value could be a select statement, in which case just ignore it, it's probably an alias for a rule in a different language, where blaze invocation flags are a thing. PiperOrigin-RevId: 240406142 --- ts_auto_deps/analyze/loader.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index a7be545f..c42ddb8a 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -550,7 +550,10 @@ func (q *QueryBasedTargetLoader) loadAllRulesInPackages(currentPkg string, packa // of aliases) actual := stringAttribute(rule, "actual") if actual == "" { - return nil, nil, fmt.Errorf(`alias %q missing "actual" attribute`, rule.GetName()) + // probably an alias with a select statement as the value for + // 'actual' - just ignore + platform.Infof(`alias %q has non-string "actual" attribute`, rule.GetName()) + continue } actualToAlias[actual] = rule pkgToActuals[pkg] = append(pkgToActuals[pkg], actual) From d6fe9d41fdba46f401e76ac656475e9e98cacf03 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Wed, 27 Mar 2019 10:17:59 -0700 Subject: [PATCH 134/316] Print a working hostname when running ts_devserver on crostini Fixes https://github.com/angular/angular-bazel-example/issues/287 PiperOrigin-RevId: 240588105 --- devserver/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devserver/main.go b/devserver/main.go index 7b0a2a0c..a41b8991 100644 --- a/devserver/main.go +++ b/devserver/main.go @@ -16,7 +16,7 @@ import ( ) var ( - port = flag.Int("port", 5432, "server port to listen on") + port = flag.Int("port", 5432, "server port to listen on") // The "base" CLI flag is only kept because within Google3 because removing would be a breaking change due to // ConcatJS and "devserver/devserver.go" still respecting the specified base flag. base = flag.String("base", "", "server base (required, runfiles of the binary)") @@ -113,6 +113,12 @@ func main() { if err != nil { h = "localhost" } + // Detect if we are running in a linux container inside ChromeOS + // If so, we assume you want to use the native browser (outside the container) + // so you'll need to modify the hostname to access the server + if _, err := os.Stat("/etc/apt/sources.list.d/cros.list"); err == nil { + h = h + ".linux.test" + } fmt.Printf("Server listening on http://%s:%d/\n", h, *port) fmt.Fprintln(os.Stderr, http.ListenAndServe(fmt.Sprintf(":%d", *port), nil).Error()) From 26d9c2d6e21887ac5a2d88e4e2150db69d1b11ac Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 1 Apr 2019 14:24:23 -0700 Subject: [PATCH 135/316] Point docs to up-to-date copy (#440) --- docs/api/build_defs.html | 381 +------------------- docs/api/devserver/ts_devserver.html | 289 +-------------- docs/api/index.html | 285 +-------------- docs/api/karma/ts_web_test.html | 412 +--------------------- docs/api/karma/ts_web_test_suite.html | 253 +------------ docs/api/main.css | 1 - docs/api/protobufjs/ts_proto_library.html | 191 +--------- docs/api/ts_config.html | 151 +------- docs/api/ts_repositories.html | 134 ------- 9 files changed, 7 insertions(+), 2090 deletions(-) delete mode 100755 docs/api/main.css delete mode 100644 docs/api/ts_repositories.html diff --git a/docs/api/build_defs.html b/docs/api/build_defs.html index 4e9239a8..304b2ad8 100644 --- a/docs/api/build_defs.html +++ b/docs/api/build_defs.html @@ -1,385 +1,6 @@ - - - - - - - - TypeScript compilation - - - - - - + - -
      -
      -
      - TypeScript compilation -
      -
      - - -
      -
      -

      TypeScript compilation

      - - -
      - -

      tsc_wrapped_tsconfig

      - -
      tsc_wrapped_tsconfig(ctx, files, srcs, devmode_manifest, jsx_factory, **kwargs)
      - -

      Produce a tsconfig.json that sets options required under Bazel.

      - - -

      Attributes

      - -
  • - - ts_web_test + + ts_devserver -

    Runs unit tests in a browser.

    +

    ts_devserver is a simple development server intended for a quick "getting started" experience.

    - - ts_web_test_macro - - -

    ibazel wrapper for ts_web_test

    - -
    - - ts_web_test_suite + + ts_devserver_macro -

    Defines a test_suite of web_test targets that wrap a ts_web_test target.

    +

    Macro for creating a ts_devserver

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ctx -

    Unknown; Required

    - -
    files -

    Unknown; Required

    - -
    srcs -

    Unknown; Required

    - -
    devmode_manifest -

    Unknown; Optional

    - -
    jsx_factory -

    Unknown; Optional

    - -
    **kwargs -

    Unknown; Optional

    - -
    -
    - -

    ts_library_macro

    - -
    ts_library_macro(tsconfig, **kwargs)
    - -

    Wraps ts_library to set the default for the tsconfig attribute.

    -

    This must be a macro so that the string is converted to a label in the context of the -workspace that declares the ts_library target, rather than the workspace that defines -ts_library, or the workspace where the build is taking place.

    -

    This macro is re-exported as ts_library in the public API.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - -
    tsconfig -

    Unknown; Optional

    -

    the label pointing to a tsconfig.json file

    -
    **kwargs -

    Unknown; Optional

    -

    remaining args to pass to the ts_library rule

    -
    -
    - -

    ts_library

    - -
    ts_library(name, deps, srcs, compile_angular_templates, compiler, internal_testing_type_check_dependencies, node_modules, supports_workers, tsconfig, tsickle_typed)
    - -

    ts_library type-checks and compiles a set of TypeScript sources to JavaScript.

    -

    It produces declarations files (.d.ts) which are used for compiling downstream -TypeScript targets and JavaScript for the browser and Closure compiler.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    A unique name for this rule.

    -
    deps -

    List of labels; Optional; Default is []

    - -
    srcs -

    List of labels; Required

    -

    The TypeScript source files to compile.

    -
    compile_angular_templates -

    Boolean; Optional; Default is False

    -

    Run the Angular ngtsc compiler under ts_library

    -
    compiler -

    Label; Optional; Default is @npm//@bazel/typescript/bin:tsc_wrapped

    -

    Sets a different TypeScript compiler binary to use for this library. - For example, we use the vanilla TypeScript tsc.js for bootstrapping, - and Angular compilations can replace this with ngc.

    -
            The default ts_library compiler depends on the `@npm//@bazel/typescript`
    -        target which is setup for projects that use bazel managed npm deps that
    -        fetch the @bazel/typescript npm package. It is recommended that you use
    -        the workspace name `@npm` for bazel managed deps so the default
    -        compiler works out of the box. Otherwise, you'll have to override
    -        the compiler attribute manually.
    -
    -
    internal_testing_type_check_dependencies -

    Boolean; Optional; Default is False

    -

    Testing only, whether to type check inputs that aren't srcs.

    -
    node_modules -

    Label; Optional; Default is @npm//typescript:typescript__typings

    -

    The npm packages which should be available during the compile.

    -
            The default value is `@npm//typescript:typescript__typings` is setup
    -        for projects that use bazel managed npm deps that. It is recommended
    -        that you use the workspace name `@npm` for bazel managed deps so the
    -        default node_modules works out of the box. Otherwise, you'll have to
    -        override the node_modules attribute manually. This default is in place
    -        since ts_library will always depend on at least the typescript
    -        default libs which are provided by `@npm//typescript:typescript__typings`.
    -
    -        This attribute is DEPRECATED. As of version 0.18.0 the recommended
    -        approach to npm dependencies is to use fine grained npm dependencies
    -        which are setup with the `yarn_install` or `npm_install` rules.
    -
    -        For example, in targets that used a `//:node_modules` filegroup,
    -
    -        ```
    -        ts_library(
    -          name = "my_lib",
    -          ...
    -          node_modules = "//:node_modules",
    -        )
    -        ```
    -
    -        which specifies all files within the `//:node_modules` filegroup
    -        to be inputs to the `my_lib`. Using fine grained npm dependencies,
    -        `my_lib` is defined with only the npm dependencies that are
    -        needed:
    -
    -        ```
    -        ts_library(
    -          name = "my_lib",
    -          ...
    -          deps = [
    -              "@npm//@types/foo",
    -              "@npm//@types/bar",
    -              "@npm//foo",
    -              "@npm//bar",
    -              ...
    -          ],
    -        )
    -        ```
    -
    -        In this case, only the listed npm packages and their
    -        transitive deps are includes as inputs to the `my_lib` target
    -        which reduces the time required to setup the runfiles for this
    -        target (see https://github.com/bazelbuild/bazel/issues/5153).
    -        The default typescript libs are also available via the node_modules
    -        default in this case.
    -
    -        The @npm external repository and the fine grained npm package
    -        targets are setup using the `yarn_install` or `npm_install` rule
    -        in your WORKSPACE file:
    -
    -        yarn_install(
    -          name = "npm",
    -          package_json = "//:package.json",
    -          yarn_lock = "//:yarn.lock",
    -        )
    -
    -
    supports_workers -

    Boolean; Optional; Default is True

    -

    Intended for internal use only. - Allows you to disable the Bazel Worker strategy for this library. - Typically used together with the "compiler" setting when using a - non-worker aware compiler binary.

    -
    tsconfig -

    Label; Optional

    -

    A tsconfig.json file containing settings for TypeScript compilation. - Note that some properties in the tsconfig are governed by Bazel and will be - overridden, such as target and module.

    -
            The default value is set to `//:tsconfig.json` by a macro. This means you must
    -        either:
    -
    -        - Have your `tsconfig.json` file in the workspace root directory
    -        - Use an alias in the root BUILD.bazel file to point to the location of tsconfig:
    -          `alias(name="tsconfig.json", actual="//path/to:tsconfig-something.json")`
    -        - Give an explicit `tsconfig` attribute to all `ts_library` targets
    -
    -
    tsickle_typed -

    Boolean; Optional; Default is True

    - -
    - - -
  • - - - - - diff --git a/docs/api/devserver/ts_devserver.html b/docs/api/devserver/ts_devserver.html index 22d1d37d..f2c41e11 100644 --- a/docs/api/devserver/ts_devserver.html +++ b/docs/api/devserver/ts_devserver.html @@ -1,293 +1,6 @@ - - - - - - - - Simple development server - - - - - - + - -
    -
    -
    - Simple development server -
    -
    - - -
    -
    -

    Simple development server

    - - -
    - -

    ts_devserver_macro

    - -
    ts_devserver_macro(name, data, args, visibility, tags, testonly, **kwargs)
    - -

    Macro for creating a ts_devserver

    -

    This macro re-exposes a sh_binary and ts_devserver target that can run the -actual devserver implementation. -The ts_devserver rule is just responsible for generating a launcher script -that runs the Go devserver implementation. The sh_binary is the primary -target that matches the specified "name" and executes the generated bash -launcher script. -This is re-exported in //:defs.bzl as ts_devserver so if you load the rule -from there, you actually get this macro.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    Name of the devserver target

    -
    data -

    List of strings; Optional

    -

    Runtime dependencies for the devserver

    -
    args -

    List of strings; Optional

    -

    Command line arguments that will be passed to the devserver Go implementation

    -
    visibility -

    Unknown; Optional

    -

    Visibility of the devserver targets

    -
    tags -

    List of strings; Optional

    -

    Standard Bazel tags, this macro adds a couple for ibazel

    -
    testonly -

    Integer; Optional

    -

    Whether the devserver should only run in bazel test

    -
    **kwargs -

    Unknown; Optional

    -

    passed through to ts_devserver

    -
    -
    - -

    ts_devserver

    - -
    ts_devserver(name, deps, data, additional_root_paths, bootstrap, entry_module, index_html, port, scripts, serving_path, static_files)
    - -

    ts_devserver is a simple development server intended for a quick "getting started" experience.

    -

    Additional documentation at https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    A unique name for this rule.

    -
    deps -

    List of labels; Optional; Default is []

    -

    Targets that produce JavaScript, such as ts_library

    -
    data -

    List of labels; Optional; Default is []

    -

    Dependencies that can be require'd while the server is running

    -
    additional_root_paths -

    List of strings; Optional; Default is []

    -

    Additional root paths to serve staticfiles from. - Paths should include the workspace name such as ["_main/resources"]

    -
    bootstrap -

    List of labels; Optional; Default is []

    -

    Scripts to include in the JS bundle before the module loader (require.js)

    -
    entry_module -

    String; Optional; Default is ''

    -

    The entrymodule should be the AMD module name of the entry module such as `"_main/src/index"ts_devserver concats the following snippet after the bundle to load the application:require(["entry_module"]);`

    -
    index_html -

    Label; Optional

    -

    An index.html file, we'll inject the script tag for the bundle, - as well as script tags for .js static_files and link tags for .css - static_files

    -
    port -

    Integer; Optional; Default is 5432

    -

    The port that the devserver will listen on.

    -
    scripts -

    List of labels; Optional; Default is []

    -

    User scripts to include in the JS bundle before the application sources

    -
    serving_path -

    String; Optional; Default is '/_/ts_scripts.js'

    -

    The path you can request from the client HTML which serves the JavaScript bundle. - If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js

    -
    static_files -

    List of labels; Optional; Default is []

    -

    Arbitrary files which to be served, such as index.html. - They are served relative to the package where this rule is declared.

    -
    - - -
    - - -
    -
    - diff --git a/docs/api/index.html b/docs/api/index.html index 76bd7941..c01557c4 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -1,289 +1,6 @@ - - - - - - - - Overview - - - - - - + - -
    -
    -
    - Overview -
    -
    - - -
    -
    -

    Overview

    - - - - -

    TypeScript compilation

    - -

    Rules

    - - - - - - - - - - - -
    - - ts_library - - -

    ts_library type-checks and compiles a set of TypeScript sources to JavaScript.

    - -
    -

    Macros

    - - - - - - - - - - - - - - - -
    - - tsc_wrapped_tsconfig - - -

    Produce a tsconfig.json that sets options required under Bazel.

    - -
    - - ts_library_macro - - -

    Wraps ts_library to set the default for the tsconfig attribute.

    - -
    -

    tsconfig.json files using extends

    - -

    Rules

    - - - - - - - - - - - -
    - - ts_config - - -

    Allows a tsconfig.json file to extend another file.

    - -
    -

    Install toolchain dependencies

    - -

    Macros

    - - - - - - - - - - - - - - - -
    - - ts_setup_workspace - - -

    This repository rule should be called from your WORKSPACE file.

    - -
    - - ts_setup_dev_workspace - - -

    Setup the toolchain needed for local development, but not needed by users.

    - -
    -

    Simple development server

    - -

    Rules

    - - - - - - - - - - - -
    - - ts_devserver - - -

    ts_devserver is a simple development server intended for a quick "getting started" experience.

    - -
    -

    Macros

    - - - - - - - - - - - -
    - - ts_devserver_macro - - -

    Macro for creating a ts_devserver

    - -
    -

    Protocol Buffers

    - -

    Rules

    - - - - - - - - - - - -
    - - ts_proto_library - - -

    Wraps https://github.com/dcodeIO/protobuf.js for use in Bazel.

    - -
    - - -
    - - -
    -
    - diff --git a/docs/api/karma/ts_web_test.html b/docs/api/karma/ts_web_test.html index b7d597f3..1f8916ad 100644 --- a/docs/api/karma/ts_web_test.html +++ b/docs/api/karma/ts_web_test.html @@ -1,416 +1,6 @@ - - - - - - - - Unit testing with Karma - - - - - - + - -
    -
    -
    - Unit testing with Karma -
    -
    - - -
    -
    -

    Unit testing with Karma

    - - -
    - -

    ts_web_test_macro

    - -
    ts_web_test_macro(karma, tags, data, **kwargs)
    - -

    ibazel wrapper for ts_web_test

    -

    This macro re-exposes the ts_web_test rule with some extra tags so that -it behaves correctly under ibazel.

    -

    This is re-exported in //:defs.bzl as ts_web_test so if you load the rule -from there, you actually get this macro.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - -
    karma -

    Unknown; Optional

    -

    karma binary label

    -
    tags -

    List of strings; Optional

    -

    standard Bazel tags, this macro adds a couple for ibazel

    -
    data -

    List of strings; Optional

    -

    runtime dependencies

    -
    **kwargs -

    Unknown; Optional

    -

    passed through to ts_web_test

    -
    -
    - -

    ts_web_test_suite

    - -
    ts_web_test_suite(name, browsers, karma, args, browser_overrides, config, flaky, local, shard_count, size, tags, test_suite_tags, timeout, visibility, web_test_data, wrapped_test_tags, **remaining_keyword_args)
    - -

    Defines a test_suite of web_test targets that wrap a ts_web_test target.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    The base name of the test.

    -
    browsers -

    List of strings; Optional

    -

    A sequence of labels specifying the browsers to use.

    -
    karma -

    Unknown; Optional

    -

    karma binary label

    -
    args -

    Unknown; Optional

    -

    Args for web_test targets generated by this extension.

    -
    browser_overrides -

    Unknown; Optional

    -

    Dictionary; optional; default is an empty dictionary. A -dictionary mapping from browser names to browser-specific web_test -attributes, such as shard_count, flakiness, timeout, etc. For example: -{'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} -'//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}.

    -
    config -

    Unknown; Optional

    -

    Label; optional; Configuration of web test features.

    -
    flaky -

    Unknown; Optional

    -

    A boolean specifying that the test is flaky. If set, the test will -be retried up to 3 times (default: 0)

    -
    local -

    Unknown; Optional

    -

    boolean; optional.

    -
    shard_count -

    Unknown; Optional

    -

    The number of test shards to use per browser. (default: 1)

    -
    size -

    Unknown; Optional

    -

    A string specifying the test size. (default: 'large')

    -
    tags -

    List of strings; Optional

    -

    A list of test tag strings to apply to each generated web_test target. -This macro adds a couple for ibazel.

    -
    test_suite_tags -

    Unknown; Optional

    -

    A list of tag strings for the generated test_suite.

    -
    timeout -

    Unknown; Optional

    -

    A string specifying the test timeout (default: computed from size)

    -
    visibility -

    Unknown; Optional

    -

    List of labels; optional.

    -
    web_test_data -

    List of strings; Optional

    -

    Data dependencies for the web_test.

    -
    wrapped_test_tags -

    Unknown; Optional

    -

    A list of test tag strings to use for the wrapped test

    -
    **remaining_keyword_args -

    Unknown; Optional

    -

    Arguments for the wrapped test target.

    -
    -
    - -

    ts_web_test

    - -
    ts_web_test(name, deps, data, srcs, bootstrap, karma, runtime_deps, static_files)
    - -

    Runs unit tests in a browser.

    -

    When executed under bazel test, this uses a headless browser for speed. -This is also because bazel test allows multiple targets to be tested together, -and we don't want to open a Chrome window on your machine for each one. Also, -under bazel test the test will execute and immediately terminate.

    -

    Running under ibazel test gives you a "watch mode" for your tests. The rule is -optimized for this case - the test runner server will stay running and just -re-serve the up-to-date JavaScript source bundle.

    -

    To debug a single test target, run it with bazel run instead. This will open a -browser window on your computer. Also you can use any other browser by opening -the URL printed when the test starts up. The test will remain running until you -cancel the bazel run command.

    -

    Currently this rule uses Karma as the test runner, but this is an implementation -detail. We might switch to another runner like Jest in the future.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    A unique name for this rule.

    -
    deps -

    List of labels; Optional; Default is []

    -

    Other targets which produce JavaScript such as ts_library

    -
    data -

    List of labels; Optional; Default is []

    -

    Runtime dependencies

    -
    srcs -

    List of labels; Optional; Default is []

    -

    JavaScript source files

    -
    bootstrap -

    List of labels; Optional; Default is []

    -

    JavaScript files to include before the module loader (require.js). - For example, you can include Reflect,js for TypeScript decorator metadata reflection, - or UMD bundles for third-party libraries.

    -
    karma -

    Label; Optional; Default is @npm//@bazel/karma/bin:karma

    - -
    runtime_deps -

    List of labels; Optional; Default is []

    -

    Dependencies which should be loaded after the module loader but before the srcs and deps. - These should be a list of targets which produce JavaScript such as ts_library. - The files will be loaded in the same order they are declared by that rule.

    -
    static_files -

    List of labels; Optional; Default is []

    -

    Arbitrary files which are available to be served on request. - Files are served at: - /base/<WORKSPACE_NAME>/<path-to-file>, e.g. - /base/build_bazel_rules_typescript/examples/testing/static_script.js

    -
    - - -
    - - -
    -
    - diff --git a/docs/api/karma/ts_web_test_suite.html b/docs/api/karma/ts_web_test_suite.html index 2ec11a38..8415331e 100644 --- a/docs/api/karma/ts_web_test_suite.html +++ b/docs/api/karma/ts_web_test_suite.html @@ -1,257 +1,6 @@ - - - - - - - - Web Test rules for Typescript. - - - - - - + - -
    -
    -
    - Web Test rules for Typescript. -
    -
    - - -
    -
    -

    Web Test rules for Typescript.

    - - -
    - -

    ts_web_test_suite

    - -
    ts_web_test_suite(name, browsers, args, browser_overrides, config, flaky, local, shard_count, size, tags, test_suite_tags, timeout, visibility, web_test_data, wrapped_test_tags)
    - -

    Defines a test_suite of web_test targets that wrap a ts_web_test target.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    The base name of the test.

    -
    browsers -

    List of strings; Optional

    -

    A sequence of labels specifying the browsers to use.

    -
    args -

    Unknown; Optional

    -

    Args for web_test targets generated by this extension.

    -
    browser_overrides -

    Unknown; Optional

    -

    Dictionary; optional; default is an empty dictionary. A -dictionary mapping from browser names to browser-specific web_test -attributes, such as shard_count, flakiness, timeout, etc. For example: -{'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} -'//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}.

    -
    config -

    Unknown; Optional

    -

    Label; optional; Configuration of web test features.

    -
    flaky -

    Unknown; Optional

    -

    A boolean specifying that the test is flaky. If set, the test will -be retried up to 3 times (default: 0)

    -
    local -

    Unknown; Optional

    -

    boolean; optional.

    -
    shard_count -

    Unknown; Optional

    -

    The number of test shards to use per browser. (default: 1)

    -
    size -

    Unknown; Optional

    -

    A string specifying the test size. (default: 'large')

    -
    tags -

    List of strings; Optional

    -

    A list of test tag strings to apply to each generated web_test target. -This macro adds a couple for ibazel.

    -
    test_suite_tags -

    Unknown; Optional

    -

    A list of tag strings for the generated test_suite.

    -
    timeout -

    Unknown; Optional

    -

    A string specifying the test timeout (default: computed from size)

    -
    visibility -

    Unknown; Optional

    -

    List of labels; optional.

    -
    web_test_data -

    List of strings; Optional

    -

    Data dependencies for the web_test.

    -
    wrapped_test_tags -

    Unknown; Optional

    -

    A list of test tag strings to use for the wrapped test -**remaining_keyword_args: Arguments for the wrapped test target.

    -
    - - -
    - - -
    -
    - diff --git a/docs/api/main.css b/docs/api/main.css deleted file mode 100755 index 89f66fe7..00000000 --- a/docs/api/main.css +++ /dev/null @@ -1 +0,0 @@ -body{background-color:#fafafa}pre,code{font-family:"Liberation Mono",Consolas,Monaco,"Andale Mono",monospace}pre{background-color:#eee;padding:20px;overflow-x:auto;word-wrap:normal}pre code{overflow-wrap:normal;white-space:pre}code{display:inline-block;font-size:90%;white-space:pre-wrap}.mdl-layout__drawer{background-color:#fff}.mdl-layout__drawer .mdl-layout-title{border-bottom:1px solid #e0e0e0;padding-left:24px}.drawer-nav ul{list-style:none;padding-left:0}.drawer-nav ul li{display:block;padding:0}.drawer-nav ul li ul li a{padding-left:44px;font-weight:400}.drawer-nav ul li a{display:block;flex-shrink:0;padding:15px 0 15px 22px;margin:0;font-weight:600;color:#757575;line-height:1em;text-decoration:none;cursor:pointer}.drawer-nav ul li a:active,.drawer-nav ul li a:hover{background-color:#f0f0f0}.drawer-nav ul li.active a{color:#4caf50;font-weight:500}h1.page-title{font-size:34px;font-weight:400;line-height:40px;margin-bottom:30px;color:#4caf50}p.lead{font-size:20px;line-height:32px}table{border-collapse:collapse;border-spacing:0;background-color:#fff;table-layout:auto}table thead th{background-color:#fafafa;border:1px solid #eee;color:#757575;padding:12px 12px 12px 24px;vertical-align:top}table tbody td{border:1px solid #eee;padding:12px 12px 12px 24px;vertical-align:top}table.params-table{width:100%}table.params-table col.col-param{width:25%}table.params-table col.col-description{width:75%}table.overview-table{width:100%}table.overview-table col.col-name{width:25%}table.overview-table col.col-description{width:75%}table.overview-table td p{margin:0}hr{margin-top:40px;margin-bottom:40px}nav.toc{border-left:5px solid #4caf50;padding-left:20px;margin-bottom:48px}nav.toc h1,nav.toc h2{font-size:15px;line-height:16px;padding-bottom:12px;margin-bottom:0;font-weight:400;color:#757575}nav.toc ul{list-style:none;margin-top:0;padding-left:0}nav.toc ul li{font-size:20px;line-height:40px}nav.toc ul li a{color:#4caf50}.page-content{margin-left:auto;margin-right:auto;padding-top:60px;padding-bottom:60px;width:760px}.page-content a{text-decoration:none}.page-content h1{font-size:34px;font-weight:400;line-height:40px;margin-bottom:30px;color:#4caf50}.page-content h2{font-size:24px;font-weight:400;line-height:32px;margin-bottom:30px;color:#4caf50}.page-content h3{font-size:20px;font-weight:400;line-height:32px;margin-bottom:30px;color:#4caf50}@media(max-width: 768px){.page-content{width:360px}}@media(min-width: 768px){.page-content{width:760px}}@media(min-width: 1476px){.page-content{width:1160px}}.mdl-mini-footer{padding-left:40px}/*# sourceMappingURL=main.css.map */ diff --git a/docs/api/protobufjs/ts_proto_library.html b/docs/api/protobufjs/ts_proto_library.html index c19d9db1..3e9228b5 100644 --- a/docs/api/protobufjs/ts_proto_library.html +++ b/docs/api/protobufjs/ts_proto_library.html @@ -1,195 +1,6 @@ - - - - - - - - Protocol Buffers - - - - - - + - -
    -
    -
    - Protocol Buffers -
    -
    - - -
    -
    -

    Protocol Buffers

    - - -
    - -

    ts_proto_library

    - -
    ts_proto_library(name, deps, output_name)
    - -

    Wraps https://github.com/dcodeIO/protobuf.js for use in Bazel.

    -

    ts_proto_library has identical outputs to ts_library, so it can be used anywhere -a ts_library can appear, such as in the deps[] of another ts_library.

    -
    load("@npm_bazel_typescript//:defs.bzl", "ts_library", "ts_proto_library")
    -
    -proto_library(
    -    name = "car_proto",
    -    srcs = ["car.proto"],
    -)
    -
    -ts_proto_library(
    -    name = "car",
    -    deps = [":car_proto"],
    -)
    -
    -ts_library(
    -    name = "test_lib",
    -    testonly = True,
    -    srcs = ["car.spec.ts"],
    -    deps = [":car"],
    -)
    -
    -

    Note in this example we named the ts_proto_library rule car so that the -result will be car.d.ts. This means our TypeScript code can just -import {symbols} from './car'. Use the output_name attribute if you want to -name the rule differently from the output file.

    -

    The JavaScript produced by protobuf.js has a runtime dependency on a support library. -Under devmode (e.g. ts_devserver, ts_web_test_suite) you'll need to include these scripts -in the bootstrap phase (before Require.js loads). You can use the label -@npm_bazel_typescript//:protobufjs_bootstrap_scripts to reference these scripts -in the bootstrap attribute of ts_web_test_suite or ts_devserver.

    -

    To complete the example above, you could write a ts_web_test_suite:

    -
    load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite")
    -
    -ts_web_test_suite(
    -    name = "test",
    -    deps = ["test_lib"],
    -    bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"],
    -    browsers = [
    -      "@io_bazel_rules_webtesting//browsers:chromium-local",
    -      "@io_bazel_rules_webtesting//browsers:firefox-local",
    -    ],
    -)
    -
    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    A unique name for this rule.

    -
    deps -

    List of labels; Optional; Default is []

    -

    proto_library targets

    -
    output_name -

    String; Optional; Default is ''

    -

    Name of the resulting module, which you will import from. - If not specified, the name will match the target's name.

    -
    - - -
    - - -
    -
    - diff --git a/docs/api/ts_config.html b/docs/api/ts_config.html index c5dcbcb9..795df4b2 100644 --- a/docs/api/ts_config.html +++ b/docs/api/ts_config.html @@ -1,155 +1,6 @@ - - - - - - - - tsconfig.json files using extends - - - - - - + - -
    -
    -
    - tsconfig.json files using extends -
    -
    - - -
    -
    -

    tsconfig.json files using extends

    - - -
    - -

    ts_config

    - -
    ts_config(name, deps, src)
    - -

    Allows a tsconfig.json file to extend another file.

    -

    Normally, you just give a single tsconfig.json file as the tsconfig attribute -of a ts_library rule. However, if your tsconfig.json uses the extends -feature from TypeScript, then the Bazel implementation needs to know about that -extended configuration file as well, to pass them both to the TypeScript compiler.

    - - -

    Attributes

    - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    A unique name for this rule.

    -
    deps -

    List of labels; Required

    -

    Additional tsconfig.json files referenced via extends

    -
    src -

    Label; Required

    -

    The tsconfig.json file passed to the TypeScript compiler

    -
    - - -
    - - -
    -
    - diff --git a/docs/api/ts_repositories.html b/docs/api/ts_repositories.html deleted file mode 100644 index 1b27aaf4..00000000 --- a/docs/api/ts_repositories.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - Install toolchain dependencies - - - - - - - - -
    -
    -
    - Install toolchain dependencies -
    -
    - - -
    -
    -

    Install toolchain dependencies

    - - -
    - -

    ts_setup_workspace

    - -
    ts_setup_workspace()
    - -

    This repository rule should be called from your WORKSPACE file.

    -

    It creates some additional Bazel external repositories that are used internally -by the TypeScript rules.

    - - -
    - -

    ts_setup_dev_workspace

    - -
    ts_setup_dev_workspace()
    - -

    Setup the toolchain needed for local development, but not needed by users.

    -

    These needs to be in a separate file from ts_setup_workspace() so as not -to leak load statements.

    - - - - -
    - - -
    -
    - - From ef1e4db2e45d7708ce4fa63d9987fbbdc52eb1f7 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Thu, 28 Mar 2019 08:14:59 -0700 Subject: [PATCH 136/316] Move rules_typescript to protobufjs 6.8. protobufjs 6 is a full, API incompatible rewrite. This change updates any proto use, and also rewrite the partial message reading logic. PiperOrigin-RevId: 240776103 --- defs.bzl | 16 +- defs.bzl.oss | 33 ++++ internal/BUILD.bazel | 1 + .../{tsconfig.json => tsconfig.json.oss} | 0 internal/tsc_wrapped/worker.ts | 174 ++++++++++++------ .../tests/ban_expect_truthy_promise/BUILD | 2 +- .../tests/ban_promise_as_condition/BUILD | 2 +- .../tsetse/tests/check_return_value/BUILD | 2 +- internal/tsetse/tests/equals_nan/BUILD | 2 +- internal/tsetse/tests/must_use_promises/BUILD | 2 +- package.json | 2 +- 11 files changed, 161 insertions(+), 75 deletions(-) create mode 100644 defs.bzl.oss rename internal/karma/{tsconfig.json => tsconfig.json.oss} (100%) diff --git a/defs.bzl b/defs.bzl index 2e223e82..17c6f741 100644 --- a/defs.bzl +++ b/defs.bzl @@ -17,17 +17,13 @@ Users should not load files under "/internal" """ -load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") -load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") -load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") -load("//internal:ts_config.bzl", _ts_config = "ts_config") -load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") +load( + "//javascript/typescript:build_defs.bzl", + _ts_config = "ts_config", + _ts_devserver = "ts_devserver", + _ts_library = "ts_library", +) -ts_setup_workspace = _ts_setup_workspace ts_library = _ts_library ts_config = _ts_config ts_devserver = _ts_devserver - -ts_proto_library = _ts_proto_library -# DO NOT ADD MORE rules here unless they appear in the generated docsite. -# Run yarn skydoc to re-generate the docsite. diff --git a/defs.bzl.oss b/defs.bzl.oss new file mode 100644 index 00000000..2e223e82 --- /dev/null +++ b/defs.bzl.oss @@ -0,0 +1,33 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" Public API surface is re-exported here. + +Users should not load files under "/internal" +""" + +load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") +load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") +load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") +load("//internal:ts_config.bzl", _ts_config = "ts_config") +load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") + +ts_setup_workspace = _ts_setup_workspace +ts_library = _ts_library +ts_config = _ts_config +ts_devserver = _ts_devserver + +ts_proto_library = _ts_proto_library +# DO NOT ADD MORE rules here unless they appear in the generated docsite. +# Run yarn skydoc to re-generate the docsite. diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 8b42aa89..375a5ce3 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -67,6 +67,7 @@ ts_library( # Workaround for https://github.com/Microsoft/TypeScript/issues/22208 deps = [ "@npm//@types/node", + "@npm//protobufjs", "@npm//tsickle", "@npm//tsutils", "@npm//typescript", diff --git a/internal/karma/tsconfig.json b/internal/karma/tsconfig.json.oss similarity index 100% rename from internal/karma/tsconfig.json rename to internal/karma/tsconfig.json.oss diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 7e52ba8f..29983182 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -1,20 +1,24 @@ import * as path from 'path'; -/* tslint:disable:no-require-imports */ -const protobufjs = require('protobufjs'); -// tslint:disable-next-line:variable-name: ByteBuffer is instantiatable. -const ByteBuffer = require('bytebuffer'); +import * as protobufjs from 'protobufjs'; // Equivalent of running node with --expose-gc // but easier to write tooling since we don't need to inject that arg to // nodejs_binary if (typeof global.gc !== 'function') { + // tslint:disable-next-line:no-require-imports require('v8').setFlagsFromString('--expose_gc'); + // tslint:disable-next-line:no-require-imports global.gc = require('vm').runInNewContext('gc'); } +/** + * Whether to print debug messages (to console.error) from the debug function + * below. + */ export const DEBUG = false; -export function debug(...args: Array<{}>) { +/** Maybe print a debug message (depending on a flag defaulting to false). */ +export function debug(...args: Array) { if (DEBUG) console.error.apply(console, args); } @@ -26,14 +30,52 @@ export function log(...args: Array<{}>) { console.error.apply(console, args); } +/** + * runAsWorker returns true if the given arguments indicate the process should + * run as a persistent worker. + */ export function runAsWorker(args: string[]) { return args.indexOf('--persistent_worker') !== -1; } -const workerpb = (function loadWorkerPb() { - const protoPath = '../worker_protocol.proto'; +/** + * workerProto declares the static type of the object constructed at runtime by + * protobufjs, based on reading the protocol buffer definition. + */ +declare namespace workerProto { + /** Input represents the blaze.worker.Input message. */ + interface Input extends protobufjs.Message { + path: string; + /** + * In Node, digest is a Buffer. In the browser, it's a replacement + * implementation. We only care about its toString(encoding) method. + */ + digest: {toString(encoding: string): string}; + } + + /** WorkRequest repesents the blaze.worker.WorkRequest message. */ + interface WorkRequest extends protobufjs.Message { + arguments: string[]; + inputs: Input[]; + } + + // tslint:disable:variable-name reflected, constructable types. + const WorkRequest: protobufjs.Type; + const WorkResponse: protobufjs.Type; + // tslint:enable:variable-name +} + +/** + * loadWorkerPb finds and loads the protocol buffer definition for bazel's + * worker protocol using protobufjs. In protobufjs, this means it's a reflection + * object that also contains properties for the individual messages. + */ +function loadWorkerPb() { + const protoPath = + '../worker_protocol.proto'; - // Use node module resolution so we can find the .proto file in any of the root dirs + // Use node module resolution so we can find the .proto file in any of the + // root dirs let protofile; try { // Look for the .proto file relative in its @bazel/typescript npm package @@ -50,35 +92,32 @@ const workerpb = (function loadWorkerPb() { '../../third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'); } - // Under Bazel, we use the version of TypeScript installed in the user's - // workspace This means we also use their version of protobuf.js. Handle both. - // v5 and v6 by checking which one is present. - if (protobufjs.loadProtoFile) { - // Protobuf.js v5 - const protoNamespace = protobufjs.loadProtoFile(protofile); - if (!protoNamespace) { - throw new Error('Cannot find ' + path.resolve(protoPath)); - } - return protoNamespace.build('blaze.worker'); - } else { - // Protobuf.js v6 - const protoNamespace = protobufjs.loadSync(protofile); - if (!protoNamespace) { - throw new Error('Cannot find ' + path.resolve(protoPath)); - } - return protoNamespace.lookup('blaze.worker'); + const protoNamespace = protobufjs.loadSync(protofile); + if (!protoNamespace) { + throw new Error('Cannot find ' + path.resolve(protoPath)); } -})(); - -interface Input { - getPath(): string; - getDigest(): {toString(encoding: string): string}; // npm:ByteBuffer -} -interface WorkRequest { - getArguments(): string[]; - getInputs(): Input[]; + const workerpb = protoNamespace.lookup('blaze.worker'); + if (!workerpb) { + throw new Error(`Cannot find namespace blaze.worker`); + } + return workerpb as protobufjs.ReflectionObject & typeof workerProto; } +/** + * workerpb contains the runtime representation of the worker protocol buffer, + * including accessor for the defined messages. + */ +const workerpb = loadWorkerPb(); + +/** + * runWorkerLoop handles the interacton between bazel workers and the + * TypeScript compiler. It reads compilation requests from stdin, unmarshals the + * data, and dispatches into `runOneBuild` for the actual compilation to happen. + * + * The compilation handler is parameterized so that this code can be used by + * different compiler entry points (currently TypeScript compilation and Angular + * compilation). + */ export function runWorkerLoop( runOneBuild: (args: string[], inputs?: {[path: string]: string}) => boolean) { @@ -88,39 +127,54 @@ export function runWorkerLoop( // user as expected. let consoleOutput = ''; process.stderr.write = - (chunk: string | Buffer, ...otherArgs: any[]): boolean => { + (chunk: string|Buffer, ...otherArgs: Array): boolean => { consoleOutput += chunk.toString(); return true; }; // Accumulator for asynchronously read input. - // tslint:disable-next-line:no-any protobufjs is untyped - let buf: any; + // protobufjs uses node's Buffer, but has its own reader abstraction on top of + // it (for browser compatiblity). It ignores Buffer's builtin start and + // offset, which means the handling code below cannot use Buffer in a + // meaningful way (such as cycling data through it). The handler below reads + // any data available on stdin, concatenating it into this buffer. It then + // attempts to read a delimited Message from it. If a message is incomplete, + // it exits and waits for more input. If a message has been read, it strips + // its data of this buffer. + let buf: Buffer = Buffer.alloc(0); process.stdin.on('readable', () => { - const chunk = process.stdin.read(); + const chunk = process.stdin.read() as Buffer; if (!chunk) return; - - const wrapped = ByteBuffer.wrap(chunk); - buf = buf ? ByteBuffer.concat([buf, wrapped]) : wrapped; + buf = Buffer.concat([buf, chunk]); try { - let req: WorkRequest; + const reader = new protobufjs.Reader(buf); // Read all requests that have accumulated in the buffer. - while ((req = workerpb.WorkRequest.decodeDelimited(buf)) != null) { + while (reader.len - reader.pos > 0) { + const messageStart = reader.len; + const msgLength: number = reader.uint32(); + // chunk might be an incomplete read from stdin. If there are not enough + // bytes for the next full message, wait for more input. + if ((reader.len - reader.pos) < msgLength) return; + + const req = workerpb.WorkRequest.decode(reader, msgLength) as + workerProto.WorkRequest; + // Once a message has been read, remove it from buf so that if we pause + // to read more input, this message will not be processed again. + buf = buf.slice(messageStart); debug('=== Handling new build request'); // Reset accumulated log output. consoleOutput = ''; - const args = req.getArguments(); + const args = req.arguments; const inputs: {[path: string]: string} = {}; - for (const input of req.getInputs()) { - inputs[input.getPath()] = input.getDigest().toString('hex'); + for (const input of req.inputs) { + inputs[input.path] = input.digest.toString('hex'); } debug('Compiling with:\n\t' + args.join('\n\t')); const exitCode = runOneBuild(args, inputs) ? 0 : 1; - process.stdout.write(new workerpb.WorkResponse() - .setExitCode(exitCode) - .setOutput(consoleOutput) - .encodeDelimited() - .toBuffer()); + process.stdout.write((workerpb.WorkResponse.encodeDelimited({ + exitCode, + output: consoleOutput, + })).finish() as Buffer); // Force a garbage collection pass. This keeps our memory usage // consistent across multiple compilations, and allows the file // cache to use the current memory usage as a guideline for expiring @@ -128,17 +182,19 @@ export function runWorkerLoop( // we want to gc only after all its locals have gone out of scope. global.gc(); } - // Avoid growing the buffer indefinitely. - buf.compact(); + // All messages have been handled, make sure the invariant holds and + // Buffer is empty once all messages have been read. + if (buf.length > 0) { + throw new Error('buffer not empty after reading all messages'); + } } catch (e) { log('Compilation failed', e.stack); - process.stdout.write(new workerpb.WorkResponse() - .setExitCode(1) - .setOutput(consoleOutput) - .encodeDelimited() - .toBuffer()); + process.stdout.write( + workerpb.WorkResponse + .encodeDelimited({exitCode: 1, output: consoleOutput}) + .finish() as Buffer); // Clear buffer so the next build won't read an incomplete request. - buf = null; + buf = Buffer.alloc(0); } }); } diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index 46b5590f..4946205b 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//internal:defaults.bzl", "ts_library") +load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 83817bd7..2108c6bc 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//internal:defaults.bzl", "ts_library") +load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index 502aa274..4a1c05d3 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//internal:defaults.bzl", "ts_library") +load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index 6fad1470..6371d070 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//internal:defaults.bzl", "ts_library") +load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index 9f88bd51..917c3ef9 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//internal:defaults.bzl", "ts_library") +load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/package.json b/package.json index dd1a0292..b0579be1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", "devDependencies": { - "protobufjs": "5.0.3", + "protobufjs": "6.8.8", "semver": "5.6.0", "source-map-support": "0.5.9", "tsutils": "2.27.2", From 34f21af0284d6c4dbd5575f0ae86ac45be76c7c4 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 1 Apr 2019 16:20:13 -0700 Subject: [PATCH 137/316] Tear out OSS-only parts of rules_typescript These already moved to rules_nodejs Closes #429 PiperOrigin-RevId: 241422158 --- .bazelci/presubmit.yml | 3 - BUILD.bazel | 33 +- README.md | 3 - WORKSPACE | 36 +- defs.bzl | 29 - defs.bzl.oss | 33 - devserver/devserver/devserver_test.go | 4 +- examples/BUILD.bazel | 60 - examples/app/BUILD.bazel | 45 - examples/app/app.ts | 4 - examples/app/app_e2e_test.ts | 25 - examples/app/index.html | 21 - examples/bar.ts | 27 - examples/bazel_managed_deps/BUILD.bazel | 8 - examples/bazel_managed_deps/README.md | 12 - examples/bazel_managed_deps/index.ts | 1 - examples/bazel_managed_deps/package.json | 8 - examples/bazel_managed_deps/tsconfig.json | 5 - examples/bazel_managed_deps/yarn.lock | 21 - examples/devmode_consumer/BUILD.bazel | 15 - .../devmode_consumer/devmode_consumer.bzl | 40 - .../devmode_consumer/devmode_consumer_test.sh | 88 - examples/devserver/BUILD.bazel | 44 - examples/devserver/app.ts | 7 - examples/devserver/index.html | 16 - examples/es6_output/BUILD.bazel | 31 - examples/es6_output/es6_consumer.bzl | 33 - examples/es6_output/es6_output_test.sh | 53 - examples/foo.ts | 28 - examples/generated_ts/BUILD.bazel | 14 - examples/googmodule/BUILD.bazel | 23 - examples/googmodule/a.ts | 1 - examples/googmodule/googmodule_output_test.js | 20 - examples/googmodule/tsconfig.json | 12 - examples/protocol_buffers/BUILD.bazel | 139 - examples/protocol_buffers/app.ts | 8 - examples/protocol_buffers/app_e2e_test.ts | 25 - examples/protocol_buffers/car.proto | 12 - examples/protocol_buffers/car.spec.ts | 35 - examples/protocol_buffers/index.html | 10 - examples/protocol_buffers/tire.proto | 11 - examples/some_library/BUILD.bazel | 26 - examples/some_library/library.ts | 18 - examples/some_module/BUILD.bazel | 52 - examples/some_module/index.ts | 3 - examples/some_module/main.ts | 4 - examples/some_module/module_load_test.sh | 35 - examples/testing/BUILD.bazel | 96 - examples/testing/decrement.spec.ts | 7 - examples/testing/decrement.ts | 3 - examples/testing/karma.conf.js | 12 - examples/testing/setup_script.spec.ts | 9 - examples/testing/setup_script.ts | 6 - examples/testing/static_script.js | 2 - examples/testing/static_script.spec.ts | 20 - examples/testing/tsconfig.json | 7 - examples/tsconfig-bar.json | 11 - examples/tsconfig-test.json | 7 - examples/tsconfig.json | 15 - examples/tsconfig_extends/BUILD.bazel | 36 - examples/tsconfig_extends/tsconfig-base.json | 9 - examples/tsconfig_extends/tsconfig.json | 4 - examples/tsconfig_extends/uses_promise.ts | 3 - examples/types.d.ts | 3 - internal/BUILD.bazel | 5 +- internal/build_defs.bzl | 407 --- internal/defaults.bzl | 28 - internal/devserver/BUILD | 42 - internal/devserver/README.md | 9 - internal/devserver/launcher_template.sh | 59 - internal/devserver/package.json | 6 - internal/devserver/ts_devserver.bzl | 264 -- internal/devserver/yarn.lock | 7 - internal/karma/.bazelrc | 1 - internal/karma/BUILD.bazel | 106 - internal/karma/WORKSPACE | 69 - internal/karma/browser_repositories.bzl | 111 - internal/karma/defaults.bzl | 37 - internal/karma/defs.bzl | 33 - internal/karma/docs/BUILD.bazel | 11 - internal/karma/docs/index.md | 89 - internal/karma/docs/install.md | 80 - internal/karma/docs/karma_web_test.md | 315 --- internal/karma/docs/ts_web_test.md | 272 -- internal/karma/index.ts | 101 - internal/karma/karma.conf.js | 423 --- internal/karma/karma.js | 3 - internal/karma/karma_web_test.bzl | 447 ---- internal/karma/package.bzl | 46 - internal/karma/package.json | 47 - internal/karma/ts_web_test.bzl | 201 -- internal/karma/tsconfig.json.oss | 9 - internal/karma/web_test.bzl | 40 - internal/karma/yarn.lock | 2320 ----------------- internal/protobufjs/BUILD.bazel | 69 - internal/protobufjs/package.json | 20 - internal/protobufjs/ts_proto_library.bzl | 193 -- internal/protobufjs/yarn.lock | 467 ---- internal/ts_config.bzl | 44 - internal/ts_repositories.bzl | 21 - internal/tsc_wrapped/yarn.lock | 24 +- .../tests/ban_expect_truthy_promise/BUILD | 2 +- .../tests/ban_promise_as_condition/BUILD | 2 +- .../tsetse/tests/check_return_value/BUILD | 2 +- internal/tsetse/tests/equals_nan/BUILD | 2 +- internal/tsetse/tests/must_use_promises/BUILD | 2 +- package.bzl | 39 +- package.json | 2 +- protractor.conf.js | 13 - ts_auto_deps/ts_auto_deps.js | 34 - tsconfig.json | 12 + version.bzl | 1 - yarn.lock | 53 +- 113 files changed, 56 insertions(+), 7965 deletions(-) delete mode 100644 defs.bzl delete mode 100644 defs.bzl.oss delete mode 100644 examples/BUILD.bazel delete mode 100644 examples/app/BUILD.bazel delete mode 100644 examples/app/app.ts delete mode 100644 examples/app/app_e2e_test.ts delete mode 100644 examples/app/index.html delete mode 100644 examples/bar.ts delete mode 100644 examples/bazel_managed_deps/BUILD.bazel delete mode 100644 examples/bazel_managed_deps/README.md delete mode 100644 examples/bazel_managed_deps/index.ts delete mode 100644 examples/bazel_managed_deps/package.json delete mode 100644 examples/bazel_managed_deps/tsconfig.json delete mode 100644 examples/bazel_managed_deps/yarn.lock delete mode 100644 examples/devmode_consumer/BUILD.bazel delete mode 100644 examples/devmode_consumer/devmode_consumer.bzl delete mode 100755 examples/devmode_consumer/devmode_consumer_test.sh delete mode 100644 examples/devserver/BUILD.bazel delete mode 100644 examples/devserver/app.ts delete mode 100644 examples/devserver/index.html delete mode 100644 examples/es6_output/BUILD.bazel delete mode 100644 examples/es6_output/es6_consumer.bzl delete mode 100755 examples/es6_output/es6_output_test.sh delete mode 100644 examples/foo.ts delete mode 100644 examples/generated_ts/BUILD.bazel delete mode 100644 examples/googmodule/BUILD.bazel delete mode 100644 examples/googmodule/a.ts delete mode 100644 examples/googmodule/googmodule_output_test.js delete mode 100644 examples/googmodule/tsconfig.json delete mode 100644 examples/protocol_buffers/BUILD.bazel delete mode 100644 examples/protocol_buffers/app.ts delete mode 100644 examples/protocol_buffers/app_e2e_test.ts delete mode 100644 examples/protocol_buffers/car.proto delete mode 100644 examples/protocol_buffers/car.spec.ts delete mode 100644 examples/protocol_buffers/index.html delete mode 100644 examples/protocol_buffers/tire.proto delete mode 100644 examples/some_library/BUILD.bazel delete mode 100644 examples/some_library/library.ts delete mode 100644 examples/some_module/BUILD.bazel delete mode 100644 examples/some_module/index.ts delete mode 100644 examples/some_module/main.ts delete mode 100755 examples/some_module/module_load_test.sh delete mode 100644 examples/testing/BUILD.bazel delete mode 100644 examples/testing/decrement.spec.ts delete mode 100644 examples/testing/decrement.ts delete mode 100644 examples/testing/karma.conf.js delete mode 100644 examples/testing/setup_script.spec.ts delete mode 100644 examples/testing/setup_script.ts delete mode 100644 examples/testing/static_script.js delete mode 100644 examples/testing/static_script.spec.ts delete mode 100644 examples/testing/tsconfig.json delete mode 100644 examples/tsconfig-bar.json delete mode 100644 examples/tsconfig-test.json delete mode 100644 examples/tsconfig.json delete mode 100644 examples/tsconfig_extends/BUILD.bazel delete mode 100644 examples/tsconfig_extends/tsconfig-base.json delete mode 100644 examples/tsconfig_extends/tsconfig.json delete mode 100644 examples/tsconfig_extends/uses_promise.ts delete mode 100644 examples/types.d.ts delete mode 100644 internal/build_defs.bzl delete mode 100644 internal/defaults.bzl delete mode 100644 internal/devserver/BUILD delete mode 100644 internal/devserver/README.md delete mode 100644 internal/devserver/launcher_template.sh delete mode 100644 internal/devserver/package.json delete mode 100644 internal/devserver/ts_devserver.bzl delete mode 100644 internal/devserver/yarn.lock delete mode 100644 internal/karma/.bazelrc delete mode 100644 internal/karma/BUILD.bazel delete mode 100644 internal/karma/WORKSPACE delete mode 100644 internal/karma/browser_repositories.bzl delete mode 100644 internal/karma/defaults.bzl delete mode 100644 internal/karma/defs.bzl delete mode 100644 internal/karma/docs/BUILD.bazel delete mode 100644 internal/karma/docs/index.md delete mode 100644 internal/karma/docs/install.md delete mode 100644 internal/karma/docs/karma_web_test.md delete mode 100644 internal/karma/docs/ts_web_test.md delete mode 100644 internal/karma/index.ts delete mode 100644 internal/karma/karma.conf.js delete mode 100644 internal/karma/karma.js delete mode 100644 internal/karma/karma_web_test.bzl delete mode 100644 internal/karma/package.bzl delete mode 100644 internal/karma/package.json delete mode 100644 internal/karma/ts_web_test.bzl delete mode 100644 internal/karma/tsconfig.json.oss delete mode 100644 internal/karma/web_test.bzl delete mode 100644 internal/karma/yarn.lock delete mode 100644 internal/protobufjs/BUILD.bazel delete mode 100644 internal/protobufjs/package.json delete mode 100644 internal/protobufjs/ts_proto_library.bzl delete mode 100644 internal/protobufjs/yarn.lock delete mode 100644 internal/ts_config.bzl delete mode 100644 protractor.conf.js delete mode 100644 ts_auto_deps/ts_auto_deps.js create mode 100644 tsconfig.json delete mode 100644 version.bzl diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 92b8746f..dc31779c 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -17,9 +17,6 @@ platforms: - "@nodejs//:yarn" build_targets: - "..." - # Run some targets again, but addressed as an external repo - # TODO(alexeagle): run all of them after fixing https://github.com/bazelbuild/rules_typescript/issues/243 - - "@npm_bazel_typescript//examples/some_library:lib" test_flags: # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1604 - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" diff --git a/BUILD.bazel b/BUILD.bazel index 74d8f248..d5422316 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -22,48 +22,19 @@ load("@bazel_gazelle//:def.bzl", "gazelle") load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") -# ts_library defaults to this label in the top-level package. -# Point to where the file actually lives. -alias( - name = "tsconfig.json", - actual = "//examples:tsconfig.json", - visibility = ["//visibility:public"], -) - -exports_files(["LICENSE"]) +exports_files(["LICENSE", "tsconfig.json"]) gazelle( name = "gazelle", prefix = "github.com/bazelbuild/rules_typescript", ) -# Runtime libraries needed by the protobufjs library. -# Any JS code produced by the ts_proto_library rule has a runtime dependency on these scripts. -js_library( - name = "protobufjs_bootstrap_scripts", - srcs = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/long:dist/long.js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/protobufjs:dist/minimal/protobuf.min.js", - ], - # Make devmode loading work when it does require("protobufjs/minimal") - # so this is shimmed to define it to equal global.protobuf - amd_names = { - "long": "Long", - "protobufjs/minimal": "protobuf", - }, - visibility = ["//visibility:public"], -) - - # This package is included in the npm_bazel_typescript package in rules_nodejs/packages/typescript npm_package( name = "npm_bazel_typescript_package", srcs = [ "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", - "//internal:common/compilation.bzl", - "//internal:common/json_marshal.bzl", - "//internal:common/module_mappings.bzl", - "//internal:common/tsconfig.bzl", + "//internal:npm_package_assets", ], deps = [ "//internal:generated_BUILD", diff --git a/README.md b/README.md index 8c999b34..41028ada 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # build_bazel_rules_typescript -> Looking for documentation for TypeScript bazel rules that used to be here? -> See https://npmjs.com/package/@bazel/typescript - This repo contains a mirror of some Google-internal bits that support TypeScript development under Bazel. It contains these utilities: diff --git a/WORKSPACE b/WORKSPACE index e6fc9e84..7bb63466 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -12,26 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "npm_bazel_typescript") - -# Load nested npm_bazel_karma repository -local_repository( - name = "npm_bazel_karma", - path = "internal/karma", -) +workspace(name = "build_bazel_rules_typescript") # Load our dependencies load("//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() -# Load rules_karma dependencies -load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") - -rules_karma_dependencies() - # Setup nodejs toolchain -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") +load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") # Use a bazel-managed npm dependency, allowing us to test resolution to these paths yarn_install( @@ -40,9 +29,6 @@ yarn_install( yarn_lock = "//examples/bazel_managed_deps:yarn.lock", ) -# Install a hermetic version of node. -node_repositories() - # Download npm dependencies yarn_install( name = "npm", @@ -50,6 +36,9 @@ yarn_install( yarn_lock = "//:yarn.lock", ) +load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") +install_bazel_dependencies() + # Setup rules_go toolchain load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") @@ -67,21 +56,6 @@ load("//internal:ts_repositories.bzl", "ts_setup_dev_workspace") ts_setup_dev_workspace() -# Dependencies for generating documentation -load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") - -sass_repositories() - -# Setup rules_webtesting toolchain -load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories") - -web_test_repositories() - -# Setup browser repositories -load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories") - -browser_repositories() - local_repository( name = "devserver_test_workspace", path = "devserver/devserver/test/test-workspace", diff --git a/defs.bzl b/defs.bzl deleted file mode 100644 index 17c6f741..00000000 --- a/defs.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" Public API surface is re-exported here. - -Users should not load files under "/internal" -""" - -load( - "//javascript/typescript:build_defs.bzl", - _ts_config = "ts_config", - _ts_devserver = "ts_devserver", - _ts_library = "ts_library", -) - -ts_library = _ts_library -ts_config = _ts_config -ts_devserver = _ts_devserver diff --git a/defs.bzl.oss b/defs.bzl.oss deleted file mode 100644 index 2e223e82..00000000 --- a/defs.bzl.oss +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" Public API surface is re-exported here. - -Users should not load files under "/internal" -""" - -load("//internal/devserver:ts_devserver.bzl", _ts_devserver = "ts_devserver_macro") -load("//internal/protobufjs:ts_proto_library.bzl", _ts_proto_library = "ts_proto_library") -load("//internal:build_defs.bzl", _ts_library = "ts_library_macro") -load("//internal:ts_config.bzl", _ts_config = "ts_config") -load("//internal:ts_repositories.bzl", _ts_setup_workspace = "ts_setup_workspace") - -ts_setup_workspace = _ts_setup_workspace -ts_library = _ts_library -ts_config = _ts_config -ts_devserver = _ts_devserver - -ts_proto_library = _ts_proto_library -# DO NOT ADD MORE rules here unless they appear in the generated docsite. -# Run yarn skydoc to re-generate the docsite. diff --git a/devserver/devserver/devserver_test.go b/devserver/devserver/devserver_test.go index 1fa91294..0c0ba56a 100644 --- a/devserver/devserver/devserver_test.go +++ b/devserver/devserver/devserver_test.go @@ -47,9 +47,9 @@ func TestDevserverFileHandling(t *testing.T) { handler := CreateFileHandler("/app.js", "manifest.MF", []string{ // This verifies that we can resolve relatively to the current package. Usually the // devserver Bazel rule adds the current package here. - "npm_bazel_typescript/devserver/devserver", + "build_bazel_rules_typescript/devserver/devserver", // Verifies that we can specify subfolders of workspaces - "npm_bazel_typescript/devserver/devserver/test", + "build_bazel_rules_typescript/devserver/devserver/test", // Verifies that we can specify external workspaces as root dirs. "devserver_test_workspace", // Verifies that we can specify subfolders from external workspaces. diff --git a/examples/BUILD.bazel b/examples/BUILD.bazel deleted file mode 100644 index a5a30728..00000000 --- a/examples/BUILD.bazel +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//:defs.bzl", "ts_config") -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -exports_files(["tsconfig.json"]) - -ts_library( - name = "types", - srcs = ["types.d.ts"], -) - -ts_library( - name = "foo_ts_library", - srcs = ["foo.ts"], - tsconfig = ":tsconfig.json", - deps = [ - ":types", - "//examples/generated_ts", - ], -) - -ts_library( - name = "bar_ts_library", - srcs = ["bar.ts"], - tsconfig = ":tsconfig-bar.json", - deps = [ - ":foo_ts_library", - "//examples/generated_ts", - "//examples/some_library:lib", - "@npm//typescript", - # Example of using the `@npm//@types` target to depend on all - # @types packages and with the types attribute of tsconfig not - # specified. In this case, typescript will automatically discover - # all types under node_modules/@types and included them in the compile. - # See getAutomaticTypeDirectiveNames in - # https://github.com/Microsoft/TypeScript/blob/master/src/compiler/moduleNameResolver.ts. - "@npm//@types", - ], -) - -ts_config( - name = "tsconfig-test", - src = "tsconfig-test.json", - deps = [":tsconfig.json"], -) diff --git a/examples/app/BUILD.bazel b/examples/app/BUILD.bazel deleted file mode 100644 index 89842d1d..00000000 --- a/examples/app/BUILD.bazel +++ /dev/null @@ -1,45 +0,0 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") -load("//:defs.bzl", "ts_devserver") -load("//internal:defaults.bzl", "ts_library") - -ts_library( - name = "app", - srcs = ["app.ts"], -) - -ts_devserver( - name = "devserver", - port = 8080, - # This is the path we'll request from the browser, see index.html - serving_path = "/bundle.min.js", - # The devserver can serve our static files too - static_files = ["index.html"], - # We'll collect all the devmode JS sources from these TypeScript libraries - deps = [":app"], -) - -rollup_bundle( - name = "bundle", - entry_point = "examples/app/app", - deps = [":app"], -) - -http_server( - name = "prodserver", - data = [ - "index.html", - ":bundle", - ], -) - -ts_library( - name = "e2e", - testonly = 1, - srcs = ["app_e2e_test.ts"], - tsconfig = "//examples:tsconfig-test", - deps = [ - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//protractor", - ], -) diff --git a/examples/app/app.ts b/examples/app/app.ts deleted file mode 100644 index 6c1c6e9d..00000000 --- a/examples/app/app.ts +++ /dev/null @@ -1,4 +0,0 @@ -const el: HTMLDivElement = document.createElement('div'); -el.innerText = 'Hello, TypeScript'; -el.className = 'ts1'; -document.body.appendChild(el); diff --git a/examples/app/app_e2e_test.ts b/examples/app/app_e2e_test.ts deleted file mode 100644 index 1ce56fbc..00000000 --- a/examples/app/app_e2e_test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {browser, by, element, ExpectedConditions} from 'protractor'; - -// This test uses Protractor without Angular, so disable Angular features -browser.waitForAngularEnabled(false); - -// Since we don't have a protractor bazel rule yet, the test is brought up in -// parallel with building the service under test. So the timeout must include -// compiling the application as well as starting the server. -const timeoutMs = 90 * 1000; - -describe('app', () => { - beforeAll(() => { - browser.get(''); - // Don't run any specs until we see a
    on the page. - browser.wait( - ExpectedConditions.presenceOf(element(by.css('div.ts1'))), - timeoutMs); - }, timeoutMs); - - it('should display: Hello, TypeScript', (done) => { - const div = element(by.css('div.ts1')); - div.getText().then(t => expect(t).toEqual(`Hello, TypeScript`)); - done(); - }); -}); diff --git a/examples/app/index.html b/examples/app/index.html deleted file mode 100644 index 8af1e7f6..00000000 --- a/examples/app/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - ts_devserver example - - - - - - diff --git a/examples/bar.ts b/examples/bar.ts deleted file mode 100644 index d363ae37..00000000 --- a/examples/bar.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @license - * Copyright 2017 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Greeter} from 'npm_bazel_typescript/examples/foo'; -import {a} from 'npm_bazel_typescript/examples/generated_ts/foo'; -// Repro for #31, should automatically discover @types/node -import * as fs from 'fs'; -import {cool} from 'some-lib'; -import * as ts from 'typescript'; - -import('./foo').then(({greeter}) => { - console.log(Greeter, fs, cool, ts, greeter, a); -}); \ No newline at end of file diff --git a/examples/bazel_managed_deps/BUILD.bazel b/examples/bazel_managed_deps/BUILD.bazel deleted file mode 100644 index 43c5bd6d..00000000 --- a/examples/bazel_managed_deps/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("//internal:defaults.bzl", "ts_library") - -ts_library( - name = "bazel_managed_deps", - srcs = ["index.ts"], - node_modules = "@build_bazel_rules_typescript_internal_bazel_managed_deps//:node_modules", - tsconfig = ":tsconfig.json", -) diff --git a/examples/bazel_managed_deps/README.md b/examples/bazel_managed_deps/README.md deleted file mode 100644 index c0cff30a..00000000 --- a/examples/bazel_managed_deps/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Bazel-managed deps - -The NodeJS rules allow you to skip the install step, and have Bazel run yarn/npm for you. - -See the /WORKSPACE file where we declare a workspace called -build_bazel_rules_typescript_internal_bazel_managed_deps -that will be installed automatically by Bazel. - -We then can build the code in this directory without installing the package.json located here. - -Regression test for -https://github.com/bazelbuild/rules_typescript/issues/179 diff --git a/examples/bazel_managed_deps/index.ts b/examples/bazel_managed_deps/index.ts deleted file mode 100644 index 5b3b16a2..00000000 --- a/examples/bazel_managed_deps/index.ts +++ /dev/null @@ -1 +0,0 @@ -import * as t from 'three'; diff --git a/examples/bazel_managed_deps/package.json b/examples/bazel_managed_deps/package.json deleted file mode 100644 index 4a39fc56..00000000 --- a/examples/bazel_managed_deps/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "bazel_managed_deps", - "devDependencies": { - "@types/three": "^0.91.10", - "three": "^0.92.0", - "typescript": "^2.8.3" - } -} diff --git a/examples/bazel_managed_deps/tsconfig.json b/examples/bazel_managed_deps/tsconfig.json deleted file mode 100644 index aee0ec94..00000000 --- a/examples/bazel_managed_deps/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "strict": true - } -} diff --git a/examples/bazel_managed_deps/yarn.lock b/examples/bazel_managed_deps/yarn.lock deleted file mode 100644 index 4ba79ac7..00000000 --- a/examples/bazel_managed_deps/yarn.lock +++ /dev/null @@ -1,21 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/three@^0.91.10": - version "0.91.10" - resolved "https://registry.yarnpkg.com/@types/three/-/three-0.91.10.tgz#996b82993902d564daa1c29d0c3d653f2b15243a" - dependencies: - "@types/webvr-api" "*" - -"@types/webvr-api@*": - version "0.0.34" - resolved "https://registry.yarnpkg.com/@types/webvr-api/-/webvr-api-0.0.34.tgz#8fa49028de925c7b8bce3d559d3374ce2c89ee28" - -three@^0.92.0: - version "0.92.0" - resolved "https://registry.yarnpkg.com/three/-/three-0.92.0.tgz#8d3d1f5af890e62da7f4cb45d20c09fa51057dcd" - -typescript@^2.8.3: - version "2.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170" diff --git a/examples/devmode_consumer/BUILD.bazel b/examples/devmode_consumer/BUILD.bazel deleted file mode 100644 index 78d6a463..00000000 --- a/examples/devmode_consumer/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load(":devmode_consumer.bzl", "devmode_consumer") - -devmode_consumer( - name = "devmode_consumer", - deps = ["//examples:bar_ts_library"], -) - -sh_test( - name = "devmode_consumer_test", - srcs = ["devmode_consumer_test.sh"], - data = [ - ":devmode_consumer", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/examples/devmode_consumer/devmode_consumer.bzl b/examples/devmode_consumer/devmode_consumer.bzl deleted file mode 100644 index b23a4b42..00000000 --- a/examples/devmode_consumer/devmode_consumer.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Example of a rule that requires es2015 (devmode) inputs. -""" - -load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") - -def _devmode_consumer(ctx): - files = depset() - - # Since we apply the sources_aspect to our deps below, we can iterate through - # the deps and grab the attribute attached by that aspect, which is called - # "node_sources". - # See https://github.com/bazelbuild/rules_nodejs/blob/master/internal/node.bzl - for d in ctx.attr.deps: - files = depset(transitive = [files, d.node_sources]) - - return [DefaultInfo( - files = files, - runfiles = ctx.runfiles(files.to_list()), - )] - -devmode_consumer = rule( - implementation = _devmode_consumer, - attrs = { - "deps": attr.label_list(aspects = [sources_aspect]), - }, -) diff --git a/examples/devmode_consumer/devmode_consumer_test.sh b/examples/devmode_consumer/devmode_consumer_test.sh deleted file mode 100755 index eb511803..00000000 --- a/examples/devmode_consumer/devmode_consumer_test.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -set -e - -# --- begin runfiles.bash initialization --- -# Source the runfiles library: -# https://github.com/bazelbuild/bazel/blob/master/tools/bash/runfiles/runfiles.bash -# The runfiles library defines rlocation, which is a platform independent function -# used to lookup the runfiles locations. This code snippet is needed at the top -# of scripts that use rlocation to lookup the location of runfiles.bash and source it -if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - if [[ -f "$0.runfiles_manifest" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest" - elif [[ -f "$0.runfiles/MANIFEST" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST" - elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - export RUNFILES_DIR="$0.runfiles" - fi -fi -if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash" -elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \ - "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)" -else - echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash" - exit 1 -fi -# --- end runfiles.bash initialization --- - -readonly LIBRARY_JS=$(cat $(rlocation "npm_bazel_typescript/examples/some_library/library.js")) -readonly BAR_JS=$(cat $(rlocation "npm_bazel_typescript/examples/bar.js")) -readonly FOO_JS=$(cat $(rlocation "npm_bazel_typescript/examples/foo.js")) - -# should produce named UMD modules -if [[ "$LIBRARY_JS" != *"define(\"some-lib\""* ]]; then - echo "Expected library.js to declare module named some-lib, but was" - echo "$LIBRARY_JS" - exit 1 -fi - -# should produce named UMD modules -if [[ "$BAR_JS" != *"define(\"npm_bazel_typescript/examples/bar\""* ]]; then - echo "Expected bar.js to declare named module, but was" - echo "$BAR_JS" - exit 1 -fi - -# should give a name to required modules -if [[ "$BAR_JS" != *"require(\"npm_bazel_typescript/examples/foo\")"* ]]; then - echo "Expected bar.js to require named module foo, but was" - echo "$BAR_JS" - exit 1 -fi - -# should give a name to required modules from other compilation unit -if [[ "$BAR_JS" != *"require(\"some-lib\")"* ]]; then - echo "Expected bar.js to require named module library, but was" - echo "$BAR_JS" - exit 1 -fi - -# should give a name to required generated modules without bazel-bin -if [[ "$BAR_JS" != *"require(\"npm_bazel_typescript/examples/generated_ts/foo\")"* ]]; then - echo "Expected bar.js to require generated named module foo, but was" - echo "$BAR_JS" - exit 1 -fi - -# should not give a module name to external modules -if [[ "$BAR_JS" != *"require(\"typescript\")"* ]]; then - echo "Expected bar.js to require typescript by its original name, but was" - echo "$BAR_JS" - exit 1 -fi - -# should produce named UMD modules -if [[ "$FOO_JS" != *"define(\"npm_bazel_typescript/examples/foo\""* ]]; then - echo "Expected foo.js to declare named module, but was" - echo "$FOO_JS" - exit 1 -fi - -# should produce es2015 classes -if [[ "$FOO_JS" != *"class Greeter"* ]]; then - echo "Expected foo.js produce a es2015, but was" - echo "$FOO_JS" - exit 1 -fi \ No newline at end of file diff --git a/examples/devserver/BUILD.bazel b/examples/devserver/BUILD.bazel deleted file mode 100644 index 249e7282..00000000 --- a/examples/devserver/BUILD.bazel +++ /dev/null @@ -1,44 +0,0 @@ -load("//:defs.bzl", "ts_devserver") -load("//internal:defaults.bzl", "ts_library") - -ts_library( - name = "app", - srcs = ["app.ts"], - tsconfig = "//examples:tsconfig.json", - deps = [ - "@npm//@types/node", - ], -) - -ts_devserver( - name = "devserver", - additional_root_paths = [ - "npm/node_modules/tslib", - "npm_bazel_typescript/examples/devserver/", - ], - port = 80, - serving_path = "/bundle.js", - static_files = [ - # Files you want to import from the "additional_root_paths", still need to be explicitly specified - # as files that should be served. The root paths just make it more convenient to import those dependencies. - "@npm//tslib", - ":say-hello", - ":print-host", - ":index.html", - ], - # Dependencies that produce JavaScript output will be automatically picked up by ConcatJS and will be - # part of the serving_path bundle. - deps = [":app"], -) - -genrule( - name = "say-hello", - outs = ["say-hello.js"], - cmd = "echo 'console.log(\"Hello!\")' > $@", -) - -genrule( - name = "print-host", - outs = ["test/print-host.js"], - cmd = "echo 'console.log(location.host)' > $@", -) diff --git a/examples/devserver/app.ts b/examples/devserver/app.ts deleted file mode 100644 index a200b403..00000000 --- a/examples/devserver/app.ts +++ /dev/null @@ -1,7 +0,0 @@ -const body = document.body; -const textElement = document.createElement('span'); - -textElement.innerText = 'Hello from TypeScript'; - -// Append element to the body. -body.appendChild(textElement); \ No newline at end of file diff --git a/examples/devserver/index.html b/examples/devserver/index.html deleted file mode 100644 index 991a2f18..00000000 --- a/examples/devserver/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - Devserver example - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/es6_output/BUILD.bazel b/examples/es6_output/BUILD.bazel deleted file mode 100644 index b5ff91c9..00000000 --- a/examples/es6_output/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load(":es6_consumer.bzl", "es6_consumer") - -package(default_visibility = ["//visibility:public"]) - -es6_consumer( - name = "es6_output", - deps = ["//examples:bar_ts_library"], -) - -sh_test( - name = "es6_output_test", - srcs = ["es6_output_test.sh"], - data = [ - ":es6_output", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/examples/es6_output/es6_consumer.bzl b/examples/es6_output/es6_consumer.bzl deleted file mode 100644 index 16726baf..00000000 --- a/examples/es6_output/es6_consumer.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Example of a rule that requires ES6 inputs. -""" - -load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources") - -def _es6_consumer(ctx): - es6_sources = collect_es6_sources(ctx) - - return [DefaultInfo( - files = es6_sources, - runfiles = ctx.runfiles(es6_sources.to_list()), - )] - -es6_consumer = rule( - implementation = _es6_consumer, - attrs = { - "deps": attr.label_list(), - }, -) diff --git a/examples/es6_output/es6_output_test.sh b/examples/es6_output/es6_output_test.sh deleted file mode 100755 index c6a0102f..00000000 --- a/examples/es6_output/es6_output_test.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -e - -# --- begin runfiles.bash initialization --- -# Source the runfiles library: -# https://github.com/bazelbuild/bazel/blob/master/tools/bash/runfiles/runfiles.bash -# The runfiles library defines rlocation, which is a platform independent function -# used to lookup the runfiles locations. This code snippet is needed at the top -# of scripts that use rlocation to lookup the location of runfiles.bash and source it -if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - if [[ -f "$0.runfiles_manifest" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest" - elif [[ -f "$0.runfiles/MANIFEST" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST" - elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - export RUNFILES_DIR="$0.runfiles" - fi -fi -if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash" -elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \ - "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)" -else - echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash" - exit 1 -fi -# --- end runfiles.bash initialization --- - -readonly FOO_JS=$(cat $(rlocation "npm_bazel_typescript/examples/es6_output/es6_output.es6/examples/foo.js")) -readonly BAR_JS=$(cat $(rlocation "npm_bazel_typescript/examples/es6_output/es6_output.es6/examples/bar.js")) -readonly LIBRARY_JS=$(cat $(rlocation "npm_bazel_typescript/examples/es6_output/es6_output.es6/examples/some_library/library.js")) - -# should not down-level ES2015 syntax, eg. `class` -if [[ "$FOO_JS" != *"class Greeter"* ]]; then - echo "Expected foo.js to contain 'class Greeter' but was" - echo "$FOO_JS" - exit 1 -fi - -# should not down-level ES Modules -if [[ "$LIBRARY_JS" != *"export const cool = 1;"* ]]; then - echo "Expected library.js to contain 'export const cool = 1;' but was" - echo "$LIBRARY_JS" - exit 1 -fi - -# should not down-level dynamic import -if [[ "$BAR_JS" != *"import('./foo')"* ]]; then - echo "Expected bar.js to contain 'import('./foo')' but was" - echo "$BAR_JS" - exit 1 -fi diff --git a/examples/foo.ts b/examples/foo.ts deleted file mode 100644 index b05c8cef..00000000 --- a/examples/foo.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2017 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Polite} from './types'; - -export class Greeter implements Polite { - constructor(public greeting: string) {} - greet(): Promise { - return Promise.resolve('

    ' + this.greeting + '

    '); - } -} - -export const greeter = new Greeter('Hello, world!'); -greeter.greet().then(msg => { document.body.innerHTML = msg; }); diff --git a/examples/generated_ts/BUILD.bazel b/examples/generated_ts/BUILD.bazel deleted file mode 100644 index d7869814..00000000 --- a/examples/generated_ts/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -genrule( - name = "foo_ts", - outs = ["foo.ts"], - cmd = "echo 'export const a = 1;' > $@", -) - -ts_library( - name = "generated_ts", - srcs = [":foo.ts"], -) diff --git a/examples/googmodule/BUILD.bazel b/examples/googmodule/BUILD.bazel deleted file mode 100644 index efaa52e7..00000000 --- a/examples/googmodule/BUILD.bazel +++ /dev/null @@ -1,23 +0,0 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") -load("//examples/devmode_consumer:devmode_consumer.bzl", "devmode_consumer") -load("//internal:defaults.bzl", "ts_library") - -ts_library( - name = "googmodule", - srcs = ["a.ts"], - tsconfig = "tsconfig.json", -) - -devmode_consumer( - name = "devmode_output", - deps = [":googmodule"], -) - -jasmine_node_test( - name = "googmodule_output_test", - srcs = ["googmodule_output_test.js"], - data = [ - ":devmode_output", - "@npm//jasmine", - ], -) diff --git a/examples/googmodule/a.ts b/examples/googmodule/a.ts deleted file mode 100644 index 4f633f63..00000000 --- a/examples/googmodule/a.ts +++ /dev/null @@ -1 +0,0 @@ -const a: number = 1; diff --git a/examples/googmodule/googmodule_output_test.js b/examples/googmodule/googmodule_output_test.js deleted file mode 100644 index 82d9e209..00000000 --- a/examples/googmodule/googmodule_output_test.js +++ /dev/null @@ -1,20 +0,0 @@ -const fs = require('fs'); - -describe('googmodule', () => { - let output; - beforeAll(() => { - output = require.resolve( - 'npm_bazel_typescript/examples/googmodule/a.js'); - }); - - it('should have goog module syntax in devmode', () => { - expect(fs.readFileSync(output, {encoding: 'utf-8'})) - .toContain( - `goog.module('npm_bazel_typescript.examples.googmodule.a')`); - }); - it('should have tsickle type annotations', () => { - expect(fs.readFileSync(output, { - encoding: 'utf-8' - })).toContain(`@type {number}`); - }); -}); \ No newline at end of file diff --git a/examples/googmodule/tsconfig.json b/examples/googmodule/tsconfig.json deleted file mode 100644 index c3c478f7..00000000 --- a/examples/googmodule/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - // Explicitly set types settings so typescript doesn't auto-discover types. - // If all types are discovered then all types need to be included as deps - // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. - "types": [] - }, - "bazelOptions": { - "tsickle": true, - "googmodule": true - } -} \ No newline at end of file diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel deleted file mode 100644 index 4594ffef..00000000 --- a/examples/protocol_buffers/BUILD.bazel +++ /dev/null @@ -1,139 +0,0 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") -load("@npm_bazel_karma//:defaults.bzl", "ts_web_test_suite") -load( - "//:defs.bzl", - "ts_devserver", - "ts_proto_library", -) -load("//internal:defaults.bzl", "ts_library") - -proto_library( - name = "tire_proto", - srcs = ["tire.proto"], -) - -proto_library( - name = "car_proto", - srcs = ["car.proto"], - deps = [":tire_proto"], -) - -ts_proto_library( - # The result will be "car.d.ts" named after this target. - # We could use the output_name attribute if we want the output named - # differently than the target. - name = "car", - deps = [":car_proto"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = ["car.spec.ts"], - tsconfig = "//examples:tsconfig-test", - deps = [ - ":car", - "@npm//@types/jasmine", - "@npm//@types/long", - "@npm//@types/node", - "@npm//long", - ], -) - -ts_web_test_suite( - name = "test", - bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"], - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - "@io_bazel_rules_webtesting//browsers:firefox-local", - ], - deps = ["test_lib"], -) - -ts_library( - name = "app", - srcs = ["app.ts"], - deps = [":car"], -) - -ts_devserver( - name = "devserver", - bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"], - entry_module = "npm_bazel_typescript/examples/protocol_buffers/app", - port = 8080, - deps = [":bundle"], -) - -# Test for production mode -rollup_bundle( - name = "bundle", - entry_point = "examples/protocol_buffers/app", - # TODO(alexeagle): we should be able to get this from //:protobufjs_bootstrap_scripts - # and automatically plumb it through to Rollup. - globals = { - "long": "Long", - "protobufjs/minimal": "protobuf", - }, - deps = [":app"], -) - -# Needed because the prodserver only loads static files that appear under this -# package. -genrule( - name = "protobufjs", - srcs = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/protobufjs:dist/minimal/protobuf.min.js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/long:dist/long.js", - ], - outs = [ - "protobuf.min.js", - "long.js", - ], - cmd = "outs=($(OUTS)); d=$$(dirname $${outs[0]}); for s in $(SRCS); do cp $$s $$d; done", -) - -http_server( - name = "prodserver", - data = [ - "index.html", - ":bundle", - ":protobufjs", - ], -) - -ts_library( - name = "e2e", - testonly = 1, - srcs = ["app_e2e_test.ts"], - tsconfig = "//examples:tsconfig-test", - deps = [ - "@npm//@types/jasmine", - "@npm//@types/node", - "@npm//protractor", - ], -) - -proto_library( - name = "rules_typescript_proto", - srcs = [ - "car.proto", - "tire.proto", - ], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "rules_typescript_go_proto", - importpath = "github.com/bazelbuild/rules_typescript/examples/protocol_buffers", - proto = ":rules_typescript_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - embed = [":rules_typescript_go_proto"], - importpath = "github.com/bazelbuild/rules_typescript/examples/protocol_buffers", - visibility = ["//visibility:public"], -) diff --git a/examples/protocol_buffers/app.ts b/examples/protocol_buffers/app.ts deleted file mode 100644 index 0cf23d9a..00000000 --- a/examples/protocol_buffers/app.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {Car} from './car'; - -const serverResponse = `{"make": "Porsche"}`; -const car = Car.create(JSON.parse(serverResponse)); -const el: HTMLDivElement = document.createElement('div'); -el.innerText = `Car from server: ${car.make}`; -el.className = 'ts1'; -document.body.appendChild(el); diff --git a/examples/protocol_buffers/app_e2e_test.ts b/examples/protocol_buffers/app_e2e_test.ts deleted file mode 100644 index 639392e1..00000000 --- a/examples/protocol_buffers/app_e2e_test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {browser, by, element, ExpectedConditions} from 'protractor'; - -// This test uses Protractor without Angular, so disable Angular features -browser.waitForAngularEnabled(false); - -// Since we don't have a protractor bazel rule yet, the test is brought up in -// parallel with building the service under test. So the timeout must include -// compiling the application as well as starting the server. -const timeoutMs = 90 * 1000; - -describe('protocol_buffers', () => { - beforeAll(() => { - browser.get(''); - // Don't run any specs until we see a
    on the page. - browser.wait( - ExpectedConditions.presenceOf(element(by.css('div.ts1'))), - timeoutMs); - }, timeoutMs); - - it('should display: Car from server: Porsche', (done) => { - const div = element(by.css('div.ts1')); - div.getText().then(t => expect(t).toEqual(`Car from server: Porsche`)); - done(); - }); -}); diff --git a/examples/protocol_buffers/car.proto b/examples/protocol_buffers/car.proto deleted file mode 100644 index d8b04d14..00000000 --- a/examples/protocol_buffers/car.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -import "examples/protocol_buffers/tire.proto"; - -message Car { - string make = 1; - string model = 2; - int32 year = 3; - Tire front_tires = 4; - Tire rear_tires = 5; - int64 mileage = 6; -} diff --git a/examples/protocol_buffers/car.spec.ts b/examples/protocol_buffers/car.spec.ts deleted file mode 100644 index 803b9df2..00000000 --- a/examples/protocol_buffers/car.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Car} from './car'; -import Long = require('long'); - -describe('protocol buffers', () => { - - it('allows creation of an object described by proto', () => { - const pontiac = Car.create({ - make: "pontiac", - frontTires: { - width: 225, - aspectRatio: 65, - construction: 'R', - diameter: 17, - }, - }); - expect(pontiac.make).toEqual('pontiac'); - if (!pontiac.frontTires) { - fail('Should have frontTires set'); - } else { - expect(pontiac.frontTires.width).toEqual(225); - } - }); - - // Asserts that longs are handled correctly. - // This value comes from https://github.com/dcodeIO/long.js#background - it('handles long values correctly', () => { - const pontiac = Car.create({ - make: "pontiac", - // Long.MAX_VALUE - mileage: new Long(0xFFFFFFFF, 0x7FFFFFFF), - }); - const object = Car.toObject(pontiac, {longs: String}); - expect(object["mileage"]).toEqual("9223372036854775807"); - }); -}); diff --git a/examples/protocol_buffers/index.html b/examples/protocol_buffers/index.html deleted file mode 100644 index 6f8690ee..00000000 --- a/examples/protocol_buffers/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - protocol_buffers example - - - - - - - \ No newline at end of file diff --git a/examples/protocol_buffers/tire.proto b/examples/protocol_buffers/tire.proto deleted file mode 100644 index a7de133a..00000000 --- a/examples/protocol_buffers/tire.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -message Tire { - string type = 1; - int32 width = 2; - int32 aspect_ratio = 3; - string construction = 4; - int32 diameter = 5; - int32 load_index = 6; - string speed_rating = 7; -} diff --git a/examples/some_library/BUILD.bazel b/examples/some_library/BUILD.bazel deleted file mode 100644 index 2668d2c9..00000000 --- a/examples/some_library/BUILD.bazel +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -ts_library( - name = "lib", - srcs = ["library.ts"], - # Allow this library to be imported from `some-lib` - module_name = "some-lib", - # The imported path should be the library.d.ts file - module_root = "library", -) diff --git a/examples/some_library/library.ts b/examples/some_library/library.ts deleted file mode 100644 index 1cc6cf30..00000000 --- a/examples/some_library/library.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2017 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const cool = 1; diff --git a/examples/some_module/BUILD.bazel b/examples/some_module/BUILD.bazel deleted file mode 100644 index ecd8224a..00000000 --- a/examples/some_module/BUILD.bazel +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -# We compile this library with the module name "sm" to make it possible to -# use `import {} from 'sm';` both at type-check time (we include the mapping in -# the paths map in tsconfig) as well as runtime (we patch the nodejs module -# loader to discover the path in the runfiles). -ts_library( - name = "some_module", - srcs = ["index.ts"], - module_name = "sm", -) - -ts_library( - name = "main", - srcs = ["main.ts"], - deps = [":some_module"], -) - -nodejs_binary( - name = "bin", - data = [ - ":main", - ":some_module", - ], - entry_point = "npm_bazel_typescript/examples/some_module/main.js", -) - -sh_test( - name = "module_load_test", - srcs = ["module_load_test.sh"], - data = [ - ":bin", - "@bazel_tools//tools/bash/runfiles", - ], -) diff --git a/examples/some_module/index.ts b/examples/some_module/index.ts deleted file mode 100644 index 0f0c4133..00000000 --- a/examples/some_module/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function hello() { - console.log("hello world"); -} diff --git a/examples/some_module/main.ts b/examples/some_module/main.ts deleted file mode 100644 index bb7d4224..00000000 --- a/examples/some_module/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -import {hello} from 'sm'; - -hello(); - diff --git a/examples/some_module/module_load_test.sh b/examples/some_module/module_load_test.sh deleted file mode 100755 index 752979ae..00000000 --- a/examples/some_module/module_load_test.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -set -e - -# --- begin runfiles.bash initialization --- -# Source the runfiles library: -# https://github.com/bazelbuild/bazel/blob/master/tools/bash/runfiles/runfiles.bash -# The runfiles library defines rlocation, which is a platform independent function -# used to lookup the runfiles locations. This code snippet is needed at the top -# of scripts that use rlocation to lookup the location of runfiles.bash and source it -if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - if [[ -f "$0.runfiles_manifest" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest" - elif [[ -f "$0.runfiles/MANIFEST" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST" - elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - export RUNFILES_DIR="$0.runfiles" - fi -fi -if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash" -elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \ - "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)" -else - echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash" - exit 1 -fi -# --- end runfiles.bash initialization --- - -readonly OUT=$($(rlocation "npm_bazel_typescript/examples/some_module/bin")) - -if [ "$OUT" != "hello world" ]; then - echo "Expected output 'hello world' but was $OUT" - exit 1 -fi diff --git a/examples/testing/BUILD.bazel b/examples/testing/BUILD.bazel deleted file mode 100644 index 133ee68e..00000000 --- a/examples/testing/BUILD.bazel +++ /dev/null @@ -1,96 +0,0 @@ -load("@npm_bazel_karma//:defaults.bzl", "karma_web_test_suite", "ts_web_test_suite") -load("//internal:defaults.bzl", "ts_library") - -ts_library( - name = "lib", - srcs = ["decrement.ts"], -) - -ts_library( - name = "tests", - testonly = 1, - srcs = glob(["*.spec.ts"]), - tsconfig = "//examples:tsconfig-test", - deps = [ - ":lib", - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -ts_library( - name = "tests_setup", - testonly = 1, - srcs = ["setup_script.ts"], - tsconfig = "//examples:tsconfig-test", - deps = [ - "@npm//@types/jasmine", - "@npm//@types/node", - ], -) - -karma_web_test_suite( - name = "testing_karma", - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - "@io_bazel_rules_webtesting//browsers:firefox-local", - ], - config_file = ":karma.conf.js", - static_files = [ - "static_script.js", - ], - runtime_deps = [ - ":tests_setup", - ], - deps = [ - ":tests", - "@npm//karma-json-result-reporter", - ], -) - -karma_web_test_suite( - name = "testing_karma_sauce", - browsers = [ - "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10", - ], - tags = [ - "sauce", - # TODO(alexeagle): enable on CI once we have set the SAUCE env variables - "manual", - ], - deps = [ - ":tests", - ], -) - -ts_web_test_suite( - name = "testing", - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - "@io_bazel_rules_webtesting//browsers:firefox-local", - ], - static_files = [ - "static_script.js", - ], - runtime_deps = [ - ":tests_setup", - ], - deps = [ - ":tests", - ], -) - -ts_web_test_suite( - name = "testing_sauce", - browsers = [ - "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10", - ], - tags = [ - "sauce", - # TODO(alexeagle): enable on CI once we have set the SAUCE env variables - "manual", - ], - deps = [ - ":tests", - ], -) diff --git a/examples/testing/decrement.spec.ts b/examples/testing/decrement.spec.ts deleted file mode 100644 index bf1bd91d..00000000 --- a/examples/testing/decrement.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {decrement} from './decrement'; - -describe('decrementing', () => { - it('should do that', () => { - expect(decrement(1)).toBe(0); - }); -}); diff --git a/examples/testing/decrement.ts b/examples/testing/decrement.ts deleted file mode 100644 index 7173ecc4..00000000 --- a/examples/testing/decrement.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function decrement(n: number) { - return n - 1; -} diff --git a/examples/testing/karma.conf.js b/examples/testing/karma.conf.js deleted file mode 100644 index f96e698b..00000000 --- a/examples/testing/karma.conf.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = function(config) { - config.set({ - plugins: ['karma-json-result-reporter'], - reporters: ['dots', 'progress', 'json-result'], - logLevel: config.LOG_DEBUG, - colors: false, - jsonResultReporter: { - outputFile: `${process.env['TEST_UNDECLARED_OUTPUTS_DIR']}/karma-result.json`, - isSynchronous: true, - }, - }); -} diff --git a/examples/testing/setup_script.spec.ts b/examples/testing/setup_script.spec.ts deleted file mode 100644 index 1b39eff8..00000000 --- a/examples/testing/setup_script.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -describe('setup script', () => { - it('should load before the spec', async () => { - expect((window as any).setupGlobal).toBe("setupGlobalValue"); - }); -}); - -// at least one import or export is needed for this file to -// be compiled into an named-UMD module by typescript -export {}; diff --git a/examples/testing/setup_script.ts b/examples/testing/setup_script.ts deleted file mode 100644 index 7bca6f89..00000000 --- a/examples/testing/setup_script.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Setup global value that the test expect to be present. -(window as any).setupGlobal = "setupGlobalValue"; - -// at least one import or export is needed for this file to -// be compiled into an named-UMD module by typescript -export { }; diff --git a/examples/testing/static_script.js b/examples/testing/static_script.js deleted file mode 100644 index 06fd64ee..00000000 --- a/examples/testing/static_script.js +++ /dev/null @@ -1,2 +0,0 @@ -// Some test data that is loaded dynamically from the test -window.someGlobal = "someGlobalValue"; diff --git a/examples/testing/static_script.spec.ts b/examples/testing/static_script.spec.ts deleted file mode 100644 index 6651308f..00000000 --- a/examples/testing/static_script.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -const someGlobal = new Promise((resolve, reject) => { - const script = document.createElement('script'); - script.src = `base/npm_bazel_typescript/examples/testing/static_script.js`; - script.onerror = reject; - script.onload = () => { - document.body.removeChild(script); - resolve((window as any).someGlobal); - }; - document.body.appendChild(script); -}); - -describe('static script', () => { - it('should load', async () => { - expect(await someGlobal).toBe("someGlobalValue"); - }); -}); - -// at least one import or export is needed for this file to -// be compiled into an named-UMD module by typescript -export {}; diff --git a/examples/testing/tsconfig.json b/examples/testing/tsconfig.json deleted file mode 100644 index c4faf5a9..00000000 --- a/examples/testing/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "lib": ["es2015.promise", "dom", "es5"], - } -} - diff --git a/examples/tsconfig-bar.json b/examples/tsconfig-bar.json deleted file mode 100644 index 0307f474..00000000 --- a/examples/tsconfig-bar.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "lib": ["es2015.promise", "dom", "es5"], - // Auto-discover all types in this configuration since we don't - // specify `types = []` and the ts_library rule depends on `@npm//@types`. - // Typescript will automatically discover all types under node_modules/@types - // and included them in the build. See getAutomaticTypeDirectiveNames in - // https://github.com/Microsoft/TypeScript/blob/master/src/compiler/moduleNameResolver.ts. - } -} diff --git a/examples/tsconfig-test.json b/examples/tsconfig-test.json deleted file mode 100644 index 634f3993..00000000 --- a/examples/tsconfig-test.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - - "compilerOptions": { - "types": ["jasmine", "node"] - } -} diff --git a/examples/tsconfig.json b/examples/tsconfig.json deleted file mode 100644 index 39b27cb2..00000000 --- a/examples/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "lib": ["es2015.promise", "dom", "es5"], - // Include the output directory in rootDirs so that generated .d.ts files - // can be used for type-checking in the editor, for example the car.proto - // produces a car.d.ts. - "rootDirs": [".", "../bazel-bin/examples"], - // Explicitly set types settings so typescript doesn't auto-discover types. - // If all types are discovered then all types need to be included as deps - // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. - "types": [] - } -} - diff --git a/examples/tsconfig_extends/BUILD.bazel b/examples/tsconfig_extends/BUILD.bazel deleted file mode 100644 index 51258971..00000000 --- a/examples/tsconfig_extends/BUILD.bazel +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("//:defs.bzl", "ts_config") -load("//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -# Because our tsconfig.json has an extends property, we must also tell the -# ts_library to include the extended tsconfig file in compilations. -# The ts_library rule will generate its own tsconfig which extends from the -# src file. -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = ["tsconfig-base.json"], -) - -ts_library( - name = "tsconfig_extends", - srcs = [ - "uses_promise.ts", - ], - tsconfig = ":tsconfig", -) diff --git a/examples/tsconfig_extends/tsconfig-base.json b/examples/tsconfig_extends/tsconfig-base.json deleted file mode 100644 index 9aa1316f..00000000 --- a/examples/tsconfig_extends/tsconfig-base.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "lib": ["es2015.promise", "es5"], - // Explicitly set types settings so typescript doesn't auto-discover types. - // If all types are discovered then all types need to be included as deps - // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. - "types": [] - } -} \ No newline at end of file diff --git a/examples/tsconfig_extends/tsconfig.json b/examples/tsconfig_extends/tsconfig.json deleted file mode 100644 index 712de299..00000000 --- a/examples/tsconfig_extends/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig-base" -} - diff --git a/examples/tsconfig_extends/uses_promise.ts b/examples/tsconfig_extends/uses_promise.ts deleted file mode 100644 index 4d2e73b4..00000000 --- a/examples/tsconfig_extends/uses_promise.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function hiLater(): Promise { - return Promise.resolve('hi'); -} diff --git a/examples/types.d.ts b/examples/types.d.ts deleted file mode 100644 index d23a0603..00000000 --- a/examples/types.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface Polite { - greet(): Promise; -} diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 375a5ce3..d953a010 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -16,7 +16,7 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//internal:defaults.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) @@ -87,7 +87,7 @@ nodejs_binary( "@npm//tsutils", "@npm//typescript", ], - entry_point = "npm_bazel_typescript/internal/tsc_wrapped/tsc_wrapped.js", + entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js", visibility = ["//visibility:public"], ) @@ -95,6 +95,7 @@ ts_library( name = "test_lib", srcs = glob(["tsc_wrapped/*_test.ts"]) + ["tsc_wrapped/test_support.ts"], tsconfig = "//internal:tsc_wrapped/tsconfig.json", + compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", deps = [ ":tsc_wrapped", "@npm//@types/jasmine", diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl deleted file mode 100644 index 16395468..00000000 --- a/internal/build_defs.bzl +++ /dev/null @@ -1,407 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"TypeScript compilation" - -load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo", "collect_node_modules_aspect") - -# pylint: disable=unused-argument -# pylint: disable=missing-docstring -load(":common/compilation.bzl", "COMMON_ATTRIBUTES", "DEPS_ASPECTS", "compile_ts", "ts_providers_dict_to_struct") -load(":common/tsconfig.bzl", "create_tsconfig") -load(":ts_config.bzl", "TsConfigInfo") - -_DEFAULT_COMPILER = "@npm//@bazel/typescript/bin:tsc_wrapped" - -def _trim_package_node_modules(package_name): - # trim a package name down to its path prior to a node_modules - # segment. 'foo/node_modules/bar' would become 'foo' and - # 'node_modules/bar' would become '' - segments = [] - for n in package_name.split("/"): - if n == "node_modules": - break - segments += [n] - return "/".join(segments) - -def _compute_node_modules_root(ctx): - """Computes the node_modules root from the node_modules and deps attributes. - - Args: - ctx: the skylark execution context - - Returns: - The node_modules root as a string - """ - node_modules_root = None - if ctx.files.node_modules: - # ctx.files.node_modules is not an empty list - node_modules_root = "/".join([f for f in [ - ctx.attr.node_modules.label.workspace_root, - _trim_package_node_modules(ctx.attr.node_modules.label.package), - "node_modules", - ] if f]) - for d in ctx.attr.deps: - if NodeModuleInfo in d: - possible_root = "/".join(["external", d[NodeModuleInfo].workspace, "node_modules"]) - if not node_modules_root: - node_modules_root = possible_root - elif node_modules_root != possible_root: - fail("All npm dependencies need to come from a single workspace. Found '%s' and '%s'." % (node_modules_root, possible_root)) - if not node_modules_root: - # there are no fine grained deps and the node_modules attribute is an empty filegroup - # but we still need a node_modules_root even if its empty - node_modules_root = "/".join([f for f in [ - ctx.attr.node_modules.label.workspace_root, - ctx.attr.node_modules.label.package, - "node_modules", - ] if f]) - return node_modules_root - -def _filter_ts_inputs(all_inputs): - return [ - f - for f in all_inputs - if f.path.endswith(".js") or f.path.endswith(".ts") or f.path.endswith(".json") - ] - -def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description = "prodmode"): - externs_files = [] - action_inputs = [] - action_outputs = [] - for output in outputs: - if output.basename.endswith(".externs.js"): - externs_files.append(output) - elif output.basename.endswith(".es5.MF"): - ctx.actions.write(output, content = "") - else: - action_outputs.append(output) - - # TODO(plf): For now we mock creation of files other than {name}.js. - for externs_file in externs_files: - ctx.actions.write(output = externs_file, content = "") - - # A ts_library that has only .d.ts inputs will have no outputs, - # therefore there are no actions to execute - if not action_outputs: - return None - - action_inputs.extend(_filter_ts_inputs(ctx.files.node_modules)) - - # Also include files from npm fine grained deps as action_inputs. - # These deps are identified by the NodeModuleInfo provider. - for d in ctx.attr.deps: - if NodeModuleInfo in d: - action_inputs.extend(_filter_ts_inputs(d.files.to_list())) - - if ctx.file.tsconfig: - action_inputs.append(ctx.file.tsconfig) - if TsConfigInfo in ctx.attr.tsconfig: - action_inputs.extend(ctx.attr.tsconfig[TsConfigInfo].deps) - - # Pass actual options for the node binary in the special "--node_options" argument. - arguments = ["--node_options=%s" % opt for opt in node_opts] - - # One at-sign makes this a params-file, enabling the worker strategy. - # Two at-signs escapes the argument so it's passed through to tsc_wrapped - # rather than the contents getting expanded. - if ctx.attr.supports_workers: - arguments.append("@@" + tsconfig_file.path) - mnemonic = "TypeScriptCompile" - else: - arguments.append("-p") - arguments.append(tsconfig_file.path) - mnemonic = "tsc" - - ctx.actions.run( - progress_message = "Compiling TypeScript (%s) %s" % (description, ctx.label), - mnemonic = mnemonic, - inputs = depset(action_inputs, transitive = [inputs]), - outputs = action_outputs, - # Use the built-in shell environment - # Allow for users who set a custom shell that can locate standard binaries like tr and uname - # See https://github.com/NixOS/nixpkgs/issues/43955#issuecomment-407546331 - use_default_shell_env = True, - arguments = arguments, - executable = ctx.executable.compiler, - execution_requirements = { - "supports-workers": str(int(ctx.attr.supports_workers)), - }, - ) - - # Enable the replay_params in case an aspect needs to re-build this library. - return struct( - label = ctx.label, - tsconfig = tsconfig_file, - inputs = depset(action_inputs, transitive = [inputs]), - outputs = action_outputs, - compiler = ctx.executable.compiler, - ) - -def _devmode_compile_action(ctx, inputs, outputs, tsconfig_file, node_opts): - _compile_action( - ctx, - inputs, - outputs, - tsconfig_file, - node_opts, - description = "devmode", - ) - -def tsc_wrapped_tsconfig( - ctx, - files, - srcs, - devmode_manifest = None, - jsx_factory = None, - **kwargs): - """Produce a tsconfig.json that sets options required under Bazel. - """ - - # The location of tsconfig.json is interpreted as the root of the project - # when it is passed to the TS compiler with the `-p` option: - # https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. - # Our tsconfig.json is in bazel-foo/bazel-out/local-fastbuild/bin/{package_path} - # because it's generated in the execution phase. However, our source files are in - # bazel-foo/ and therefore we need to strip some parent directories for each - # f.path. - - node_modules_root = _compute_node_modules_root(ctx) - config = create_tsconfig( - ctx, - files, - srcs, - devmode_manifest = devmode_manifest, - node_modules_root = node_modules_root, - **kwargs - ) - config["bazelOptions"]["nodeModulesPrefix"] = node_modules_root - - # Override the target so we use es2015 for devmode - # Since g3 isn't ready to do this yet - config["compilerOptions"]["target"] = "es2015" - - # If the user gives a tsconfig attribute, the generated file should extend - # from the user's tsconfig. - # See https://github.com/Microsoft/TypeScript/issues/9876 - # We subtract the ".json" from the end before handing to TypeScript because - # this gives extra error-checking. - if ctx.file.tsconfig: - workspace_path = config["compilerOptions"]["rootDir"] - config["extends"] = "/".join([workspace_path, ctx.file.tsconfig.path[:-len(".json")]]) - - if jsx_factory: - config["compilerOptions"]["jsxFactory"] = jsx_factory - - tsetse_disabled_rules = [] - - # Matches section in javascript/typescript/tsconfig.bzl - # TODO(alexeagle): make them share code - if ctx.label.workspace_root.startswith("external/"): - # Violated by rxjs - tsetse_disabled_rules += ["ban-promise-as-condition"] - - # For local testing - tsetse_disabled_rules += ["check-return-value"] - - config["compilerOptions"]["plugins"] = [{ - "name": "@bazel/tsetse", - "disabledRules": tsetse_disabled_rules, - }] - - return config - -# ************ # -# ts_library # -# ************ # - -def _ts_library_impl(ctx): - """Implementation of ts_library. - - Args: - ctx: the context. - - Returns: - the struct returned by the call to compile_ts. - """ - ts_providers = compile_ts( - ctx, - is_library = True, - # Filter out the node_modules from deps passed to TypeScript compiler - # since they don't have the required providers. - # They were added to the action inputs for tsc_wrapped already. - # strict_deps checking currently skips node_modules. - # TODO(alexeagle): turn on strict deps checking when we have a real - # provider for JS/DTS inputs to ts_library. - deps = [d for d in ctx.attr.deps if not NodeModuleInfo in d], - compile_action = _compile_action, - devmode_compile_action = _devmode_compile_action, - tsc_wrapped_tsconfig = tsc_wrapped_tsconfig, - ) - return ts_providers_dict_to_struct(ts_providers) - -local_deps_aspects = [collect_node_modules_aspect] - -# Workaround skydoc bug which assumes DEPS_ASPECTS is a str type -[local_deps_aspects.append(a) for a in DEPS_ASPECTS] - -ts_library = rule( - _ts_library_impl, - attrs = dict(COMMON_ATTRIBUTES, **{ - "srcs": attr.label_list( - doc = "The TypeScript source files to compile.", - allow_files = [".ts", ".tsx"], - mandatory = True, - ), - "compile_angular_templates": attr.bool( - doc = """Run the Angular ngtsc compiler under ts_library""", - ), - "compiler": attr.label( - doc = """Sets a different TypeScript compiler binary to use for this library. - For example, we use the vanilla TypeScript tsc.js for bootstrapping, - and Angular compilations can replace this with `ngc`. - - The default ts_library compiler depends on the `@npm//@bazel/typescript` - target which is setup for projects that use bazel managed npm deps that - fetch the @bazel/typescript npm package. It is recommended that you use - the workspace name `@npm` for bazel managed deps so the default - compiler works out of the box. Otherwise, you'll have to override - the compiler attribute manually. - """, - default = Label(_DEFAULT_COMPILER), - allow_files = True, - executable = True, - cfg = "host", - ), - "internal_testing_type_check_dependencies": attr.bool(default = False, doc = "Testing only, whether to type check inputs that aren't srcs."), - "node_modules": attr.label( - doc = """The npm packages which should be available during the compile. - - The default value is `@npm//typescript:typescript__typings` is setup - for projects that use bazel managed npm deps that. It is recommended - that you use the workspace name `@npm` for bazel managed deps so the - default node_modules works out of the box. Otherwise, you'll have to - override the node_modules attribute manually. This default is in place - since ts_library will always depend on at least the typescript - default libs which are provided by `@npm//typescript:typescript__typings`. - - This attribute is DEPRECATED. As of version 0.18.0 the recommended - approach to npm dependencies is to use fine grained npm dependencies - which are setup with the `yarn_install` or `npm_install` rules. - - For example, in targets that used a `//:node_modules` filegroup, - - ``` - ts_library( - name = "my_lib", - ... - node_modules = "//:node_modules", - ) - ``` - - which specifies all files within the `//:node_modules` filegroup - to be inputs to the `my_lib`. Using fine grained npm dependencies, - `my_lib` is defined with only the npm dependencies that are - needed: - - ``` - ts_library( - name = "my_lib", - ... - deps = [ - "@npm//@types/foo", - "@npm//@types/bar", - "@npm//foo", - "@npm//bar", - ... - ], - ) - ``` - - In this case, only the listed npm packages and their - transitive deps are includes as inputs to the `my_lib` target - which reduces the time required to setup the runfiles for this - target (see https://github.com/bazelbuild/bazel/issues/5153). - The default typescript libs are also available via the node_modules - default in this case. - - The @npm external repository and the fine grained npm package - targets are setup using the `yarn_install` or `npm_install` rule - in your WORKSPACE file: - - yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", - ) - """, - default = Label("@npm//typescript:typescript__typings"), - ), - "supports_workers": attr.bool( - doc = """Intended for internal use only. - Allows you to disable the Bazel Worker strategy for this library. - Typically used together with the "compiler" setting when using a - non-worker aware compiler binary.""", - default = True, - ), - - # TODO(alexeagle): reconcile with google3: ts_library rules should - # be portable across internal/external, so we need this attribute - # internally as well. - "tsconfig": attr.label( - doc = """A tsconfig.json file containing settings for TypeScript compilation. - Note that some properties in the tsconfig are governed by Bazel and will be - overridden, such as `target` and `module`. - - The default value is set to `//:tsconfig.json` by a macro. This means you must - either: - - - Have your `tsconfig.json` file in the workspace root directory - - Use an alias in the root BUILD.bazel file to point to the location of tsconfig: - `alias(name="tsconfig.json", actual="//path/to:tsconfig-something.json")` - - Give an explicit `tsconfig` attribute to all `ts_library` targets - """, - allow_single_file = True, - ), - "tsickle_typed": attr.bool(default = True), - "deps": attr.label_list(aspects = local_deps_aspects), - }), - outputs = { - "tsconfig": "%{name}_tsconfig.json", - }, -) -""" -`ts_library` type-checks and compiles a set of TypeScript sources to JavaScript. - -It produces declarations files (`.d.ts`) which are used for compiling downstream -TypeScript targets and JavaScript for the browser and Closure compiler. -""" - -def ts_library_macro(tsconfig = None, **kwargs): - """Wraps `ts_library` to set the default for the `tsconfig` attribute. - - This must be a macro so that the string is converted to a label in the context of the - workspace that declares the `ts_library` target, rather than the workspace that defines - `ts_library`, or the workspace where the build is taking place. - - This macro is re-exported as `ts_library` in the public API. - - Args: - tsconfig: the label pointing to a tsconfig.json file - **kwargs: remaining args to pass to the ts_library rule - """ - if not tsconfig: - tsconfig = "//:tsconfig.json" - - ts_library(tsconfig = tsconfig, **kwargs) diff --git a/internal/defaults.bzl b/internal/defaults.bzl deleted file mode 100644 index 9ef73e2f..00000000 --- a/internal/defaults.bzl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"Defaults for rules_typescript repository not meant to be used downstream" - -load( - "@npm_bazel_typescript//:defs.bzl", - _ts_library = "ts_library", -) - -# We can't use the defaults for ts_library compiler and ts_web_test_suite karma -# internally because the defaults are .js dependencies on the npm packages that are -# published and internally we are building the things themselves to publish to npm -INTERNAL_TS_LIBRARY_COMPILER = "@npm_bazel_typescript//internal:tsc_wrapped_bin" - -def ts_library(compiler = INTERNAL_TS_LIBRARY_COMPILER, **kwargs): - _ts_library(compiler = compiler, **kwargs) diff --git a/internal/devserver/BUILD b/internal/devserver/BUILD deleted file mode 100644 index 25b03e15..00000000 --- a/internal/devserver/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache 2.0 - -package(default_visibility = [ - "//third_party/bazel_rules/rules_typescript/internal:__subpackages__", -]) - -exports_files([ - "launcher_template.sh", - # Exported to be consumed for generating skydoc. - "ts_devserver.bzl", -]) - -filegroup( - name = "source_tree", - srcs = glob(["**/*"]), -) - -filegroup( - name = "npm_package_assets", - srcs = [ - "BUILD", - "launcher_template.sh", - "package.json", - "ts_devserver.bzl", - "yarn.lock", - ], - visibility = ["//internal:__pkg__"], -) diff --git a/internal/devserver/README.md b/internal/devserver/README.md deleted file mode 100644 index 7000c251..00000000 --- a/internal/devserver/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# TypeScript devserver - -This development server is very simple. It's meant to be a convenient step in -the "getting started" workflow. Once you have any real requirements, you should -develop against your real frontend server instead. - -This devserver includes the "concatjs" bundling strategy. If you use a different -frontend server, you should port this library to whatever language you run in. - diff --git a/internal/devserver/launcher_template.sh b/internal/devserver/launcher_template.sh deleted file mode 100644 index 13722a99..00000000 --- a/internal/devserver/launcher_template.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -# --- begin runfiles.bash initialization --- -# Source the runfiles library: -# https://github.com/bazelbuild/bazel/blob/master/tools/bash/runfiles/runfiles.bash -# The runfiles library defines rlocation, which is a platform independent function -# used to lookup the runfiles locations. This code snippet is needed at the top -# of scripts that use rlocation to lookup the location of runfiles.bash and source it -if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - if [[ -f "$0.runfiles_manifest" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest" - elif [[ -f "$0.runfiles/MANIFEST" ]]; then - export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST" - elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - export RUNFILES_DIR="$0.runfiles" - fi -fi -if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then - source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash" -elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then - source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \ - "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)" -else - echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash" - exit 1 -fi -# --- end runfiles.bash initialization --- - - -readonly main=$(rlocation "TEMPLATED_main") -readonly manifest=$(rlocation "TEMPLATED_manifest") -readonly scripts_manifest=$(rlocation "TEMPLATED_scripts_manifest") - -# Workaround for https://github.com/bazelbuild/bazel/issues/6764 -# If this issue is incorporated into Bazel, the workaround here should be removed. -MSYS2_ARG_CONV_EXCL="*" "${main}" \ - -packages=TEMPLATED_packages \ - -serving_path=TEMPLATED_serving_path \ - -entry_module=TEMPLATED_entry_module \ - -port=TEMPLATED_port \ - -manifest="${manifest}" \ - -scripts_manifest="${scripts_manifest}" \ - "$@" diff --git a/internal/devserver/package.json b/internal/devserver/package.json deleted file mode 100644 index 5391d982..00000000 --- a/internal/devserver/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "description": "runtime dependencies for devserver", - "devDependencies": { - "requirejs": "2.3.5" - } -} diff --git a/internal/devserver/ts_devserver.bzl b/internal/devserver/ts_devserver.bzl deleted file mode 100644 index 399bd4e3..00000000 --- a/internal/devserver/ts_devserver.bzl +++ /dev/null @@ -1,264 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"Simple development server" - -load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") -load( - "@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", - "write_amd_names_shim", -) -load( - "@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", - "html_asset_inject", -) - -# Helper function to convert a short path to a path that is -# found in the MANIFEST file. -def _short_path_to_manifest_path(ctx, short_path): - if short_path.startswith("../"): - return short_path[3:] - else: - return ctx.workspace_name + "/" + short_path - -def _ts_devserver(ctx): - files = depset() - for d in ctx.attr.deps: - if hasattr(d, "node_sources"): - files = depset(transitive = [files, d.node_sources]) - elif hasattr(d, "files"): - files = depset(transitive = [files, d.files]) - - if ctx.label.workspace_root: - # We need the workspace_name for the target being visited. - # Skylark doesn't have this - instead they have a workspace_root - # which looks like "external/repo_name" - so grab the second path segment. - # TODO(alexeagle): investigate a better way to get the workspace name - workspace_name = ctx.label.workspace_root.split("/")[1] - else: - workspace_name = ctx.workspace_name - - # Create a manifest file with the sources in arbitrary order, and without - # bazel-bin prefixes ("root-relative paths"). - # TODO(alexeagle): we should experiment with keeping the files toposorted, to - # see if we can get performance gains out of the module loader. - ctx.actions.write(ctx.outputs.manifest, "".join([ - workspace_name + "/" + f.short_path + "\n" - for f in files.to_list() - ])) - - amd_names_shim = ctx.actions.declare_file( - "_%s.amd_names_shim.js" % ctx.label.name, - sibling = ctx.outputs.script, - ) - write_amd_names_shim(ctx.actions, amd_names_shim, ctx.attr.bootstrap) - - # Requirejs is always needed so its included as the first script - # in script_files before any user specified scripts for the devserver - # to concat in order. - script_files = [] - script_files.extend(ctx.files.bootstrap) - script_files.append(ctx.file._requirejs_script) - script_files.append(amd_names_shim) - script_files.extend(ctx.files.scripts) - ctx.actions.write(ctx.outputs.scripts_manifest, "".join([ - workspace_name + "/" + f.short_path + "\n" - for f in script_files - ])) - - devserver_runfiles = [ - ctx.executable._devserver, - ctx.outputs.manifest, - ctx.outputs.scripts_manifest, - ] - devserver_runfiles += ctx.files.static_files - devserver_runfiles += script_files - devserver_runfiles += ctx.files._bash_runfile_helpers - - if ctx.file.index_html: - injected_index = ctx.actions.declare_file("index.html") - bundle_script = ctx.attr.serving_path - if bundle_script.startswith("/"): - bundle_script = bundle_script[1:] - html_asset_inject( - ctx.file.index_html, - ctx.actions, - ctx.executable._injector, - ctx.attr.additional_root_paths + [ - ctx.label.package, - "/".join([ctx.bin_dir.path, ctx.label.package]), - "/".join([ctx.genfiles_dir.path, ctx.label.package]), - ], - [_short_path_to_manifest_path(ctx, f.short_path) for f in ctx.files.static_files] + [bundle_script], - injected_index, - ) - devserver_runfiles += [injected_index] - - packages = depset(["/".join([workspace_name, ctx.label.package])] + ctx.attr.additional_root_paths) - - ctx.actions.expand_template( - template = ctx.file._launcher_template, - output = ctx.outputs.script, - substitutions = { - "TEMPLATED_entry_module": ctx.attr.entry_module, - "TEMPLATED_main": _short_path_to_manifest_path(ctx, ctx.executable._devserver.short_path), - "TEMPLATED_manifest": _short_path_to_manifest_path(ctx, ctx.outputs.manifest.short_path), - "TEMPLATED_packages": ",".join(packages.to_list()), - "TEMPLATED_port": str(ctx.attr.port), - "TEMPLATED_scripts_manifest": _short_path_to_manifest_path(ctx, ctx.outputs.scripts_manifest.short_path), - "TEMPLATED_serving_path": ctx.attr.serving_path if ctx.attr.serving_path else "", - "TEMPLATED_workspace": workspace_name, - }, - is_executable = True, - ) - - return [DefaultInfo( - runfiles = ctx.runfiles( - files = devserver_runfiles, - # We don't expect executable targets to depend on the devserver, but if they do, - # they can see the JavaScript code. - transitive_files = depset(ctx.files.data, transitive = [files]), - collect_data = True, - collect_default = True, - ), - )] - -ts_devserver = rule( - implementation = _ts_devserver, - attrs = { - "additional_root_paths": attr.string_list( - doc = """Additional root paths to serve static_files from. - Paths should include the workspace name such as [\"__main__/resources\"] - """, - ), - "bootstrap": attr.label_list( - doc = "Scripts to include in the JS bundle before the module loader (require.js)", - allow_files = [".js"], - ), - "data": attr.label_list( - doc = "Dependencies that can be require'd while the server is running", - allow_files = True, - ), - "entry_module": attr.string( - doc = """The entry_module should be the AMD module name of the entry module such as `"__main__/src/index"` - ts_devserver concats the following snippet after the bundle to load the application: - `require(["entry_module"]);` - """, - ), - "index_html": attr.label( - allow_single_file = True, - doc = """An index.html file, we'll inject the script tag for the bundle, - as well as script tags for .js static_files and link tags for .css - static_files""", - ), - "port": attr.int( - doc = """The port that the devserver will listen on.""", - default = 5432, - ), - "scripts": attr.label_list( - doc = "User scripts to include in the JS bundle before the application sources", - allow_files = [".js"], - ), - "serving_path": attr.string( - # This default repeats the one in the go program. We make it explicit here so we can read it - # when injecting scripts into the index file. - default = "/_/ts_scripts.js", - doc = """The path you can request from the client HTML which serves the JavaScript bundle. - If you don't specify one, the JavaScript can be loaded at /_/ts_scripts.js""", - ), - "static_files": attr.label_list( - doc = """Arbitrary files which to be served, such as index.html. - They are served relative to the package where this rule is declared.""", - allow_files = True, - ), - "deps": attr.label_list( - doc = "Targets that produce JavaScript, such as `ts_library`", - allow_files = True, - aspects = [sources_aspect], - ), - "_bash_runfile_helpers": attr.label(default = Label("@bazel_tools//tools/bash/runfiles")), - "_devserver": attr.label( - # For local development in rules_typescript, we build the devserver from sources. - # This requires that we have the go toolchain available. - # NB: this value is replaced by "//devserver:server" in the packaged distro - # //devserver:server is the pre-compiled binary. - # That means that our users don't need the go toolchain. - default = Label("//devserver:devserver_bin"), - executable = True, - cfg = "host", - ), - "_injector": attr.label( - default = "@build_bazel_rules_nodejs//internal/web_package:injector", - executable = True, - cfg = "host", - ), - "_launcher_template": attr.label(allow_single_file = True, default = Label("//internal/devserver:launcher_template.sh")), - "_requirejs_script": attr.label(allow_single_file = True, default = Label("@build_bazel_rules_typescript_devserver_deps//node_modules/requirejs:require.js")), - }, - outputs = { - "manifest": "%{name}.MF", - "script": "%{name}.sh", - "scripts_manifest": "scripts_%{name}.MF", - }, -) -"""ts_devserver is a simple development server intended for a quick "getting started" experience. - -Additional documentation at https://github.com/alexeagle/angular-bazel-example/wiki/Running-a-devserver-under-Bazel -""" - -def ts_devserver_macro(name, data = [], args = [], visibility = None, tags = [], testonly = 0, **kwargs): - """Macro for creating a `ts_devserver` - - This macro re-exposes a `sh_binary` and `ts_devserver` target that can run the - actual devserver implementation. - The `ts_devserver` rule is just responsible for generating a launcher script - that runs the Go devserver implementation. The `sh_binary` is the primary - target that matches the specified "name" and executes the generated bash - launcher script. - This is re-exported in `//:defs.bzl` as `ts_devserver` so if you load the rule - from there, you actually get this macro. - Args: - name: Name of the devserver target - data: Runtime dependencies for the devserver - args: Command line arguments that will be passed to the devserver Go implementation - visibility: Visibility of the devserver targets - tags: Standard Bazel tags, this macro adds a couple for ibazel - testonly: Whether the devserver should only run in `bazel test` - **kwargs: passed through to `ts_devserver` - """ - ts_devserver( - name = "%s_launcher" % name, - data = data + ["@bazel_tools//tools/bash/runfiles"], - testonly = testonly, - visibility = ["//visibility:private"], - tags = tags, - **kwargs - ) - - native.sh_binary( - name = name, - args = args, - # Users don't need to know that these tags are required to run under ibazel - tags = tags + [ - # Tell ibazel not to restart the devserver when its deps change. - "ibazel_notify_changes", - # Tell ibazel to serve the live reload script, since we expect a browser will connect to - # this program. - "ibazel_live_reload", - ], - srcs = ["%s_launcher.sh" % name], - data = [":%s_launcher" % name], - testonly = testonly, - visibility = visibility, - ) diff --git a/internal/devserver/yarn.lock b/internal/devserver/yarn.lock deleted file mode 100644 index 95ae199a..00000000 --- a/internal/devserver/yarn.lock +++ /dev/null @@ -1,7 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" diff --git a/internal/karma/.bazelrc b/internal/karma/.bazelrc deleted file mode 100644 index ad69514f..00000000 --- a/internal/karma/.bazelrc +++ /dev/null @@ -1 +0,0 @@ -build --workspace_status_command=../../tools/bazel_stamp_vars.sh diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel deleted file mode 100644 index 54f69edf..00000000 --- a/internal/karma/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# BEGIN-DEV-ONLY -# Parts of this BUILD file only necessary when building within the bazelbuild/rules_typescript repo. -# The generated `@bazel/karma` npm package contains a trimmed BUILD file using # DEV-ONLY fences. -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package") -load("@npm_bazel_typescript//:version.bzl", "COMPAT_VERSION") -load("@npm_bazel_typescript//internal:defaults.bzl", "ts_library") - -package(default_visibility = ["//visibility:public"]) - -# Exports to be consumed for generating skydoc. -exports_files([ - "karma_web_test.bzl", - "ts_web_test.bzl", - "web_test.bzl", -]) - -ts_library( - name = "bazel_karma", - srcs = glob(["*.ts"]), - module_name = "@bazel/karma", - tsconfig = ":tsconfig.json", - deps = [ - "@npm//@types/node", - "@npm//tmp", - ], -) - -nodejs_binary( - name = "karma_bin", - data = [ - ":bazel_karma", - "@npm//jasmine-core", - "@npm//karma", - "@npm//karma-chrome-launcher", - "@npm//karma-firefox-launcher", - "@npm//karma-jasmine", - "@npm//karma-requirejs", - "@npm//karma-sauce-launcher", - "@npm//karma-sourcemap-loader", - "@npm//requirejs", - "@npm//tmp", - ], - entry_point = "karma/bin/karma", - install_source_map_support = False, -) - -genrule( - name = "license_copy", - srcs = ["@npm_bazel_typescript//:LICENSE"], - outs = ["LICENSE"], - cmd = "cp $< $@", -) - -# Ugly genrule depending on local linux environment to build the README out of skylark doc generation. -# Only referenced when we do a release. -# TODO: This ought to be possible with stardoc alone. Need to coordinate with Chris Parsons. -genrule( - name = "generate_README", - srcs = ["//docs", "//docs:install.md"], - outs = ["README.md"], - cmd = "unzip -o -d docs $(location //docs:docs) && cat docs/install.md docs/*_web_test.md | sed 's/^##/\\\n##/' > $@", -) - -npm_package( - name = "npm_package", - srcs = [ - "BUILD.bazel", - "WORKSPACE", - "browser_repositories.bzl", - "defaults.bzl", - "defs.bzl", - "karma.conf.js", - "karma.js", - "karma_web_test.bzl", - "package.bzl", - "package.json", - "ts_web_test.bzl", - "web_test.bzl", - ], - replacements = { - "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "", - "0.0.0-COMPAT_VERSION": COMPAT_VERSION, - }, - deps = [ - ":bazel_karma", - ":license_copy", - ":generate_README" - ], -) - -# END-DEV-ONLY -exports_files(["karma.conf.js"]) diff --git a/internal/karma/WORKSPACE b/internal/karma/WORKSPACE deleted file mode 100644 index f584c273..00000000 --- a/internal/karma/WORKSPACE +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -workspace(name = "npm_bazel_karma") - -# Load nested npm_bazel_typescript repository -local_repository( - name = "npm_bazel_typescript", - path = "../..", -) - -# Load our dependencies -load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dev_dependencies") - -rules_typescript_dev_dependencies() - -# Load rules_karma dependencies -load("//:package.bzl", "rules_karma_dependencies") - -rules_karma_dependencies() - -# Setup nodejs toolchain -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") - -# Install a hermetic version of node. -node_repositories() - -# Download npm dependencies -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -# Setup typescript toolchain -load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace") - -ts_setup_workspace() - -# Dependencies for generating documentation -load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") - -sass_repositories() - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "com_google_protobuf", - strip_prefix = "protobuf-3.6.1.3", - sha256 = "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2", - # v3.6.1.3 as of 2019-01-15 - urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.6.1.3.zip"], - type = "zip", -) - -load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories") - -skydoc_repositories() diff --git a/internal/karma/browser_repositories.bzl b/internal/karma/browser_repositories.bzl deleted file mode 100644 index cc58e5c6..00000000 --- a/internal/karma/browser_repositories.bzl +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Pinned browser versions tested against in https://github.com/bazelbuild/rules_typescript CI. -""" - -load("@io_bazel_rules_webtesting//web/internal:platform_http_file.bzl", "platform_http_file") - -def browser_repositories(): - """Load pinned rules_webtesting browser versions.""" - - platform_http_file( - name = "org_chromium_chromium", - amd64_sha256 = - "941de83d78b27d43db07f427136ba159d661bb111db8d9ffe12499b863a003e1", - amd64_urls = [ - # Chromium 69.0.3497.0 (2018-07-19 snaphot 576668) - # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/576668/ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/576668/chrome-linux.zip", - ], - licenses = ["notice"], # BSD 3-clause (maybe more?) - macos_sha256 = - "bd01783e7d179e9f85d4b6f0c9df53118d13977cc7d365a1caa9d198c6afcfd8", - macos_urls = [ - # Chromium 69.0.3497.0 (2018-07-19 snaphot 576668) - # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/576668/ - # NOTE: There is an issue with ChromeHeadless on OSX chromium 70+ - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/576668/chrome-mac.zip", - ], - windows_sha256 = - "d1bb728118c12ea436d8ea07dba980789e7d860aa664dd1fad78bc20e8d9391c", - windows_urls = [ - # Chromium 66.0.3359.0 (2018-03-01 snaphot 540270) - # https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/612439/ - # NOTE: There is an issue with chromium 68-71 with Windows: https://bugs.chromium.org/p/chromium/issues/detail?id=540270 - # and pinning to 72 is not possible as the archive name has changed to chrome-win.zip which breaks - # as the executable path the hard-coded in rules_webtesting and includes the archive name. - "https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win_x64/540270/chrome-win32.zip", - ], - ) - - platform_http_file( - name = "org_chromium_chromedriver", - amd64_sha256 = - "687d2e15c42908e2911344c08a949461b3f20a83017a7a682ef4d002e05b5d46", - amd64_urls = [ - # ChromeDriver 2.44 supports Chrome v69-71 - # http://chromedriver.chromium.org/downloads - "https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip", - ], - licenses = ["reciprocal"], # BSD 3-clause, ICU, MPL 1.1, libpng (BSD/MIT-like), Academic Free License v. 2.0, BSD 2-clause, MIT - macos_sha256 = - "3fd49c2782a5f93cb48ff2dee021004d9a7fb393798e4c4807b391cedcd30ed9", - macos_urls = [ - # ChromeDriver 2.44 supports Chrome v69-71 - # http://chromedriver.chromium.org/downloads - "https://chromedriver.storage.googleapis.com/2.44/chromedriver_mac64.zip", - ], - windows_sha256 = - "a8fa028acebef7b931ef9cb093f02865f9f7495e49351f556e919f7be77f072e", - windows_urls = [ - # ChromeDriver 2.38 supports Chrome v65-67 - # http://chromedriver.chromium.org/downloads - "https://chromedriver.storage.googleapis.com/2.38/chromedriver_win32.zip", - ], - ) - - platform_http_file( - name = "org_mozilla_firefox", - amd64_sha256 = - "3a729ddcb1e0f5d63933177a35177ac6172f12edbf9fbbbf45305f49333608de", - amd64_urls = [ - "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", - "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/linux-x86_64/en-US/firefox-61.0.2.tar.bz2", - ], - licenses = ["reciprocal"], # MPL 2.0 - macos_sha256 = - "bf23f659ae34832605dd0576affcca060d1077b7bf7395bc9874f62b84936dc5", - macos_urls = [ - "https://mirror.bazel.build/ftp.mozilla.org/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg", - "https://ftp.mozilla.org/pub/firefox/releases/61.0.2/mac/en-US/Firefox%2061.0.2.dmg", - ], - ) - - platform_http_file( - name = "org_mozilla_geckodriver", - amd64_sha256 = - "c9ae92348cf00aa719be6337a608fae8304691a95668e8e338d92623ba9e0ec6", - amd64_urls = [ - "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", - "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz", - ], - licenses = ["reciprocal"], # MPL 2.0 - macos_sha256 = - "ce4a3e9d706db94e8760988de1ad562630412fa8cf898819572522be584f01ce", - macos_urls = [ - "https://mirror.bazel.build/github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-macos.tar.gz", - "https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-macos.tar.gz", - ], - ) diff --git a/internal/karma/defaults.bzl b/internal/karma/defaults.bzl deleted file mode 100644 index 954a9915..00000000 --- a/internal/karma/defaults.bzl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"Defaults for rules_karma repository not meant to be used downstream" - -load( - "@npm_bazel_karma//:defs.bzl", - _karma_web_test = "karma_web_test", - _karma_web_test_suite = "karma_web_test_suite", - _ts_web_test = "ts_web_test", - _ts_web_test_suite = "ts_web_test_suite", -) - -INTERNAL_KARMA_BIN = "@npm_bazel_karma//:karma_bin" - -def karma_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): - _karma_web_test(karma = karma, **kwargs) - -def karma_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): - _karma_web_test_suite(karma = karma, **kwargs) - -def ts_web_test(karma = INTERNAL_KARMA_BIN, **kwargs): - _ts_web_test(karma = karma, **kwargs) - -def ts_web_test_suite(karma = INTERNAL_KARMA_BIN, **kwargs): - _ts_web_test_suite(karma = karma, **kwargs) diff --git a/internal/karma/defs.bzl b/internal/karma/defs.bzl deleted file mode 100644 index b8053b97..00000000 --- a/internal/karma/defs.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" Public API surface is re-exported here. -""" - -load( - ":karma_web_test.bzl", - _karma_web_test = "karma_web_test", - _karma_web_test_suite = "karma_web_test_suite", -) -load( - ":ts_web_test.bzl", - _ts_web_test = "ts_web_test", - _ts_web_test_suite = "ts_web_test_suite", -) - -# TODO(alexeagle): make ts_web_test && ts_web_test_suite work in google3 -ts_web_test = _ts_web_test -ts_web_test_suite = _ts_web_test_suite -karma_web_test = _karma_web_test -karma_web_test_suite = _karma_web_test_suite diff --git a/internal/karma/docs/BUILD.bazel b/internal/karma/docs/BUILD.bazel deleted file mode 100644 index ff0476c2..00000000 --- a/internal/karma/docs/BUILD.bazel +++ /dev/null @@ -1,11 +0,0 @@ -load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc") -exports_files(["install.md"]) -skylark_doc( - name = "docs", - srcs = [ - "//:karma_web_test.bzl", - "//:ts_web_test.bzl", - ], - format = "markdown", - visibility = ["//:__subpackages__"], -) diff --git a/internal/karma/docs/index.md b/internal/karma/docs/index.md deleted file mode 100644 index 697f82ff..00000000 --- a/internal/karma/docs/index.md +++ /dev/null @@ -1,89 +0,0 @@ - -# Overview - - - - -

    Unit testing with Karma

    - -

    Macros

    - - - - - - - - - - - - - - - - - - - -
    - - run_karma_web_test - - -

    Creates an action that can run karma.

    - -
    - - karma_web_test - - -

    Runs unit tests in a browser with Karma.

    - -
    - - karma_web_test_suite - - -

    Defines a test_suite of web_test targets that wrap a karma_web_test target.

    - -
    -

    Unit testing in a browser

    - -

    Macros

    - - - - - - - - - - - - - - - -
    - - ts_web_test - - -

    Runs unit tests in a browser.

    - -
    - - ts_web_test_suite - - -

    Defines a test_suite of web_test targets that wrap a ts_web_test target.

    - -
    diff --git a/internal/karma/docs/install.md b/internal/karma/docs/install.md deleted file mode 100644 index e04b5584..00000000 --- a/internal/karma/docs/install.md +++ /dev/null @@ -1,80 +0,0 @@ -# Karma rules for Bazel - -**WARNING: this is beta-quality software. Breaking changes are likely. Not recommended for production use without expert support.** - -The Karma rules run karma tests with Bazel. - -## Installation - -Add the `@bazel/karma` npm package to your `devDependencies` in `package.json`. - -Your `WORKSPACE` should declare a `yarn_install` or `npm_install` rule named `npm`. -It should then install the rules found in the npm packages. - -This is copied from the README for rules_nodejs: - -```python -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# Fetch rules_nodejs -# (you can check https://github.com/bazelbuild/rules_nodejs/releases for a newer release than this) -http_archive( - name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", -) - -# Setup the NodeJS toolchain -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") -node_repositories() - -yarn_install( - name = "npm", - package_json = "//:package.json", - yarn_lock = "//:yarn.lock", -) - -# Install all Bazel dependencies needed for npm packages that supply Bazel rules -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") -install_bazel_dependencies() -``` - -This causes the `@bazel/karma` package to be installed as a Bazel workspace named `npm_bazel_karma`. - -Now add this to your `WORKSPACE` to install the Karma dependencies: - -```python -# Fetch transitive Bazel dependencies of npm_bazel_karma -load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies") -rules_karma_dependencies() -``` - -This installs the `io_bazel_rules_webtesting` repository, if you haven't installed it earlier. - -Finally, configure the rules_webtesting: - -```python -# Setup web testing, choose browsers we can test on -load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories") - -web_test_repositories() -browser_repositories( - chromium = True, -) -``` - -## Installing with self-managed dependencies - -If you didn't use the `yarn_install` or `npm_install` rule to create an `npm` workspace, you'll have to declare a rule in your root `BUILD.bazel` file to execute karma: - -```python -# Create a karma rule to use in ts_web_test_suite karma -# attribute when using self-managed dependencies -nodejs_binary( - name = "karma/karma", - entry_point = "karma/bin/karma", - # Point bazel to your node_modules to find the entry point - node_modules = ["//:node_modules"], -) -``` - diff --git a/internal/karma/docs/karma_web_test.md b/internal/karma/docs/karma_web_test.md deleted file mode 100644 index 39c65434..00000000 --- a/internal/karma/docs/karma_web_test.md +++ /dev/null @@ -1,315 +0,0 @@ - - -

    Unit testing with Karma

    - - - - -## run_karma_web_test - -
    -run_karma_web_test(ctx)
    -
    - -Creates an action that can run karma. - -This is also used by ts_web_test_rule. - -Returns: - The runfiles for the generated action. - - - -### Attributes - - - - - - - - - - - - - -
    ctx -

    Unknown; Required

    -

    Bazel rule execution context

    -
    - -## karma_web_test - -
    -karma_web_test(srcs, deps, data, configuration_env_vars, bootstrap, runtime_deps, static_files, config_file, tags, **kwargs)
    -
    - -Runs unit tests in a browser with Karma. - -When executed under `bazel test`, this uses a headless browser for speed. -This is also because `bazel test` allows multiple targets to be tested together, -and we don't want to open a Chrome window on your machine for each one. Also, -under `bazel test` the test will execute and immediately terminate. - -Running under `ibazel test` gives you a "watch mode" for your tests. The rule is -optimized for this case - the test runner server will stay running and just -re-serve the up-to-date JavaScript source bundle. - -To debug a single test target, run it with `bazel run` instead. This will open a -browser window on your computer. Also you can use any other browser by opening -the URL printed when the test starts up. The test will remain running until you -cancel the `bazel run` command. - -This rule will use your system Chrome by default. In the default case, your -environment must specify CHROME_BIN so that the rule will know which Chrome binary to run. -Other `browsers` and `customLaunchers` may be set using the a base Karma configuration -specified in the `config_file` attribute. - - - -### Attributes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    srcs -

    List of strings; Optional

    -

    A list of JavaScript test files

    -
    deps -

    List of strings; Optional

    -

    Other targets which produce JavaScript such as ts_library

    -
    data -

    List of strings; Optional

    -

    Runtime dependencies

    -
    configuration_env_vars -

    List of strings; Optional

    -

    Pass these configuration environment variables to the resulting binary. -Chooses a subset of the configuration environment variables (taken from ctx.var), which also -includes anything specified via the --define flag. -Note, this can lead to different outputs produced by this rule.

    -
    bootstrap -

    List of strings; Optional

    -

    JavaScript files to include before the module loader (require.js). -For example, you can include Reflect,js for TypeScript decorator metadata reflection, -or UMD bundles for third-party libraries.

    -
    runtime_deps -

    List of strings; Optional

    -

    Dependencies which should be loaded after the module loader but before the srcs and deps. -These should be a list of targets which produce JavaScript such as ts_library. -The files will be loaded in the same order they are declared by that rule.

    -
    static_files -

    List of strings; Optional

    -

    Arbitrary files which are available to be served on request. -Files are served at: -/base/&lt;WORKSPACE_NAME&gt;/&lt;path-to-file&gt;, e.g. -/base/npm_bazel_typescript/examples/testing/static_script.js

    -
    config_file -

    Unknown; Optional

    -

    User supplied Karma configuration file. Bazel will override -certain attributes of this configuration file. Attributes that are -overridden will be outputted to the test log.

    -
    tags -

    List of strings; Optional

    -

    Standard Bazel tags, this macro adds tags for ibazel support

    -
    **kwargs -

    Unknown; Optional

    -

    Passed through to karma_web_test

    -
    - -## karma_web_test_suite - -
    -karma_web_test_suite(name, browsers, args, browser_overrides, config, flaky, local, shard_count, size, tags, test_suite_tags, timeout, visibility, web_test_data, wrapped_test_tags, **remaining_keyword_args)
    -
    - -Defines a test_suite of web_test targets that wrap a karma_web_test target. - -This macro also accepts all parameters in karma_web_test. See karma_web_test docs -for details. - - - -### Attributes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    The base name of the test

    -
    browsers -

    List of strings; Optional

    -

    A sequence of labels specifying the browsers to use.

    -
    args -

    Unknown; Optional

    -

    Args for web_test targets generated by this extension.

    -
    browser_overrides -

    Unknown; Optional

    -

    Dictionary; optional; default is an empty dictionary. A -dictionary mapping from browser names to browser-specific web_test -attributes, such as shard_count, flakiness, timeout, etc. For example: -{'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} -'//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}.

    -
    config -

    Unknown; Optional

    -

    Label; optional; Configuration of web test features.

    -
    flaky -

    Unknown; Optional

    -

    A boolean specifying that the test is flaky. If set, the test will -be retried up to 3 times (default: 0)

    -
    local -

    Unknown; Optional

    -

    boolean; optional.

    -
    shard_count -

    Unknown; Optional

    -

    The number of test shards to use per browser. (default: 1)

    -
    size -

    Unknown; Optional

    -

    A string specifying the test size. (default: 'large')

    -
    tags -

    List of strings; Optional

    -

    A list of test tag strings to apply to each generated web_test target. -This macro adds a couple for ibazel.

    -
    test_suite_tags -

    Unknown; Optional

    -

    A list of tag strings for the generated test_suite.

    -
    timeout -

    Unknown; Optional

    -

    A string specifying the test timeout (default: computed from size)

    -
    visibility -

    Unknown; Optional

    -

    List of labels; optional.

    -
    web_test_data -

    List of strings; Optional

    -

    Data dependencies for the web_test.

    -
    wrapped_test_tags -

    Unknown; Optional

    -

    A list of test tag strings to use for the wrapped test

    -
    **remaining_keyword_args -

    Unknown; Optional

    -

    Arguments for the wrapped test target.

    -
    diff --git a/internal/karma/docs/ts_web_test.md b/internal/karma/docs/ts_web_test.md deleted file mode 100644 index eca85355..00000000 --- a/internal/karma/docs/ts_web_test.md +++ /dev/null @@ -1,272 +0,0 @@ - - -

    Unit testing in a browser

    - - - - -## ts_web_test - -
    -ts_web_test(srcs, deps, data, configuration_env_vars, bootstrap, runtime_deps, static_files, tags, **kwargs)
    -
    - -Runs unit tests in a browser. - -When executed under `bazel test`, this uses a headless browser for speed. -This is also because `bazel test` allows multiple targets to be tested together, -and we don't want to open a Chrome window on your machine for each one. Also, -under `bazel test` the test will execute and immediately terminate. - -Running under `ibazel test` gives you a "watch mode" for your tests. The rule is -optimized for this case - the test runner server will stay running and just -re-serve the up-to-date JavaScript source bundle. - -To debug a single test target, run it with `bazel run` instead. This will open a -browser window on your computer. Also you can use any other browser by opening -the URL printed when the test starts up. The test will remain running until you -cancel the `bazel run` command. - -This rule will use your system Chrome. Your environment must specify CHROME_BIN -so that the rule will know which Chrome binary to run. - -Currently this rule uses Karma as the test runner under the hood, but this is -an implementation detail. We might switch to another runner like Jest in the future. - - - -### Attributes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    srcs -

    List of strings; Optional

    -

    A list of JavaScript test files

    -
    deps -

    List of strings; Optional

    -

    Other targets which produce JavaScript such as ts_library

    -
    data -

    List of strings; Optional

    -

    Runtime dependencies

    -
    configuration_env_vars -

    List of strings; Optional

    -

    Pass these configuration environment variables to the resulting binary. -Chooses a subset of the configuration environment variables (taken from ctx.var), which also -includes anything specified via the --define flag. -Note, this can lead to different outputs produced by this rule.

    -
    bootstrap -

    List of strings; Optional

    -

    JavaScript files to include before the module loader (require.js). -For example, you can include Reflect,js for TypeScript decorator metadata reflection, -or UMD bundles for third-party libraries.

    -
    runtime_deps -

    List of strings; Optional

    -

    Dependencies which should be loaded after the module loader but before the srcs and deps. -These should be a list of targets which produce JavaScript such as ts_library. -The files will be loaded in the same order they are declared by that rule.

    -
    static_files -

    List of strings; Optional

    -

    Arbitrary files which are available to be served on request. -Files are served at: -/base/&lt;WORKSPACE_NAME&gt;/&lt;path-to-file&gt;, e.g. -/base/npm_bazel_typescript/examples/testing/static_script.js

    -
    tags -

    List of strings; Optional

    -

    Standard Bazel tags, this macro adds tags for ibazel support as well as

    -
    **kwargs -

    Unknown; Optional

    -

    Passed through to ts_web_test

    -
    - -## ts_web_test_suite - -
    -ts_web_test_suite(name, browsers, args, browser_overrides, config, flaky, local, shard_count, size, tags, test_suite_tags, timeout, visibility, web_test_data, wrapped_test_tags, **remaining_keyword_args)
    -
    - -Defines a test_suite of web_test targets that wrap a ts_web_test target. - -This macro also accepts all parameters in ts_web_test. See ts_web_test docs for -details. - - - -### Attributes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    name -

    Name; Required

    -

    The base name of the test.

    -
    browsers -

    List of strings; Optional

    -

    A sequence of labels specifying the browsers to use.

    -
    args -

    Unknown; Optional

    -

    Args for web_test targets generated by this extension.

    -
    browser_overrides -

    Unknown; Optional

    -

    Dictionary; optional; default is an empty dictionary. A -dictionary mapping from browser names to browser-specific web_test -attributes, such as shard_count, flakiness, timeout, etc. For example: -{'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} -'//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}.

    -
    config -

    Unknown; Optional

    -

    Label; optional; Configuration of web test features.

    -
    flaky -

    Unknown; Optional

    -

    A boolean specifying that the test is flaky. If set, the test will -be retried up to 3 times (default: 0)

    -
    local -

    Unknown; Optional

    -

    boolean; optional.

    -
    shard_count -

    Unknown; Optional

    -

    The number of test shards to use per browser. (default: 1)

    -
    size -

    Unknown; Optional

    -

    A string specifying the test size. (default: 'large')

    -
    tags -

    List of strings; Optional

    -

    A list of test tag strings to apply to each generated web_test_suite target. -This macro adds a couple for ibazel.

    -
    test_suite_tags -

    Unknown; Optional

    -

    A list of tag strings for the generated test_suite.

    -
    timeout -

    Unknown; Optional

    -

    A string specifying the test timeout (default: computed from size)

    -
    visibility -

    Unknown; Optional

    -

    List of labels; optional.

    -
    web_test_data -

    List of strings; Optional

    -

    Data dependencies for the web_test_suite.

    -
    wrapped_test_tags -

    Unknown; Optional

    -

    A list of test tag strings to use for the wrapped test

    -
    **remaining_keyword_args -

    Unknown; Optional

    -

    Arguments for the wrapped test target.

    -
    diff --git a/internal/karma/index.ts b/internal/karma/index.ts deleted file mode 100644 index 511a6fbb..00000000 --- a/internal/karma/index.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Concat all JS files before serving. - */ -import * as crypto from 'crypto'; -import * as fs from 'fs'; -import * as path from 'path'; -import * as process from 'process'; -import * as tmp from 'tmp'; -import {createInterface} from 'readline'; -/// - -/** - * Return SHA1 of data buffer. - */ -function sha1(data) { - const hash = crypto.createHash('sha1'); - hash.update(data); - return hash.digest('hex'); -} - -/** - * Entry-point for the Karma plugin. - */ -function initConcatJs(logger, emitter, basePath, hostname, port) { - const log = logger.create('framework.concat_js'); - - // Create a tmp file for the concat bundle that is automatically cleaned up on - // exit. - const tmpFile = tmp.fileSync({keep: false, dir: process.env['TEST_TMPDIR']}); - - emitter.on('file_list_modified', files => { - const bundleFile = { - path: '/concatjs_bundle.js', - contentPath: tmpFile.name, - isUrl: false, - content: '', - encodings: {}, - } as any; - const included = []; - - files.included.forEach(file => { - if (path.extname(file.originalPath) !== '.js') { - // Preserve all non-JS that were there in the included list. - included.push(file); - } else { - const relativePath = - path.relative(basePath, file.originalPath).replace(/\\/g, '/'); - - // Remove 'use strict'. - let content = file.content.replace(/('use strict'|"use strict");?/, - ''); - content = JSON.stringify( - `${content}\n//# sourceURL=http://${hostname}:${port}/base/` + - `${relativePath}\n`); - content = `//${relativePath}\neval(${content});\n`; - bundleFile.content += content; - } - }); - - bundleFile.sha = sha1(Buffer.from(bundleFile.content)); - bundleFile.mtime = new Date(); - included.unshift(bundleFile); - - files.included = included; - files.served.push(bundleFile); - - log.debug('Writing concatjs bundle to tmp file %s', - bundleFile.contentPath); - fs.writeFileSync(bundleFile.contentPath, bundleFile.content); - }); -} - -(initConcatJs as any).$inject = ['logger', 'emitter', 'config.basePath', 'config.hostname', 'config.port']; - -function watcher(fileList: {refresh: () => void}) { - // ibazel will write this string after a successful build - // We don't want to re-trigger tests if the compilation fails, so - // we should only listen for this event. - const IBAZEL_NOTIFY_BUILD_SUCCESS = 'IBAZEL_BUILD_COMPLETED SUCCESS'; - // ibazel communicates with us via stdin - const rl = createInterface({input: process.stdin, terminal: false}); - rl.on('line', (chunk: string) => { - if (chunk === IBAZEL_NOTIFY_BUILD_SUCCESS) { - fileList.refresh(); - } - }); - rl.on('close', () => { - // Give ibazel 5s to kill our process, otherwise do it ourselves - setTimeout(() => { - console.error('ibazel failed to stop karma after 5s; probably a bug'); - process.exit(1); - }, 5000); - }); -} - -(watcher as any).$inject = ['fileList']; - -module.exports = { - 'framework:concat_js': ['factory', initConcatJs], - 'watcher': ['value', watcher], -}; diff --git a/internal/karma/karma.conf.js b/internal/karma/karma.conf.js deleted file mode 100644 index 1d82ff1f..00000000 --- a/internal/karma/karma.conf.js +++ /dev/null @@ -1,423 +0,0 @@ -// Karma configuration -// GENERATED BY Bazel -try -{ - const fs = require('fs'); - const path = require('path'); - const tmp = require('tmp'); - const child_process = require('child_process'); - - const DEBUG = false; - - TMPL_env_vars - - const configPath = 'TMPL_config_file'; - - if (DEBUG) - console.info(`Karma test starting with: - cwd: ${process.cwd()} - configPath: ${configPath}`); - - /** - * Helper function to find a particular namedFile - * within the webTestMetadata webTestFiles - */ - function findNamedFile(webTestMetadata, key) { - let result; - webTestMetadata['webTestFiles'].forEach(entry => { - const webTestNamedFiles = entry['namedFiles']; - if (webTestNamedFiles && webTestNamedFiles[key]) { - result = webTestNamedFiles[key]; - } - }); - return result; - } - - /** - * Helper function to extract a browser archive - * and return the path to extract executable - */ - function extractWebArchive(extractExe, archiveFile, executablePath) { - try { - // Paths are relative to the root runfiles folder - extractExe = extractExe ? path.join('..', extractExe) : extractExe; - archiveFile = path.join('..', archiveFile); - const extractedExecutablePath = path.join(process.cwd(), executablePath); - if (!extractExe) { - throw new Error('No EXTRACT_EXE found'); - } - child_process.execFileSync( - extractExe, [archiveFile, '.'], - {stdio: [process.stdin, process.stdout, process.stderr]}); - if (DEBUG) console.info(`Extracting web archive ${archiveFile} with ${extractExe} to ${extractedExecutablePath}`); - return extractedExecutablePath; - } catch (e) { - console.error(`Failed to extract ${archiveFile}`); - throw e; - } - } - - /** - * Chrome on Linux uses sandboxing, which needs user namespaces to be enabled. - * This is not available on all kernels and it might be turned off even if it is available. - * Notable examples where user namespaces are not available include: - * - In Debian it is compiled-in but disabled by default. - * - The Docker daemon for Windows or OSX does not support user namespaces. - * We can detect if user namespaces are supported via /proc/sys/kernel/unprivileged_userns_clone. - * For more information see: - * https://github.com/Googlechrome/puppeteer/issues/290 - * https://superuser.com/questions/1094597/enable-user-namespaces-in-debian-kernel#1122977 - * https://github.com/karma-runner/karma-chrome-launcher/issues/158 - * https://github.com/angular/angular/pull/24906 - */ - function supportsSandboxing() { - if (process.platform !== 'linux') { - return true; - } - try { - const res = child_process - .execSync('cat /proc/sys/kernel/unprivileged_userns_clone').toString().trim(); - return res === '1'; - } catch (error) { } - - return false; - } - - /** - * Helper function to override base karma config values. - */ - function overrideConfigValue(conf, name, value) { - if (conf.hasOwnProperty(name)) { - console.warn( - `Your karma configuration specifies '${name}' which will be overwritten by Bazel`); - } - conf[name] = value; - } - - /** - * Helper function to merge base karma config values that are arrays. - */ - function mergeConfigArray(conf, name, values) { - if (!conf[name]) { - conf[name] = []; - } - values.forEach(v => { - if (!conf[name].includes(v)) { - conf[name].push(v); - } - }) - } - - /** - * Configuration settings for karma under Bazel common to karma_web_test - * and karma_web_test_suite. - */ - function configureBazelConfig(config, conf) { - // list of karma plugins - mergeConfigArray(conf, 'plugins', [ - 'karma-*', - '@bazel/karma', - 'karma-sourcemap-loader', - 'karma-chrome-launcher', - 'karma-firefox-launcher', - 'karma-sauce-launcher', - ]); - - // list of karma preprocessors - if (!conf.preprocessors) { - conf.preprocessors = {} - } - conf.preprocessors['**/*.js'] = ['sourcemap']; - - // list of test frameworks to use - overrideConfigValue(conf, 'frameworks', ['jasmine', 'concat_js']); - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - mergeConfigArray(conf, 'reporters', ['progress']); - - // enable / disable colors in the output (reporters and logs) - if (!conf.colors) { - conf.colors = true; - } - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || - // config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - if (!conf.logLevel) { - conf.logLevel = config.LOG_INFO; - } - - // enable / disable watching file and executing tests whenever - // any file changes - overrideConfigValue(conf, 'autoWatch', process.env['IBAZEL_NOTIFY_CHANGES'] === 'y'); - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - // note: run_karma.sh may override this as a command-line option. - overrideConfigValue(conf, 'singleRun', false); - - // Concurrency level - // how many browser should be started simultaneous - overrideConfigValue(conf, 'concurrency', Infinity); - - // base path that will be used to resolve all patterns - // (eg. files, exclude) - overrideConfigValue(conf, 'basePath', 'TMPL_runfiles_path'); - - // Do not show "no timestamp" errors from "karma-requirejs" for proxied file - // requests. Files which are passed as "static_files" are proxied by default and - // therefore should not cause such an exception when loaded as expected. - // See: https://github.com/karma-runner/karma-requirejs/issues/6 - const requireJsShowNoTimestampsError = '^(?!/base/).*$'; - - if (conf.client) { - overrideConfigValue(conf.client, 'requireJsShowNoTimestampsError', - requireJsShowNoTimestampsError); - } else { - conf.client = {requireJsShowNoTimestampsError}; - } - } - - /** - * Configure the 'files' and 'proxies' configuration attributes. - * These are concatenated into a single file by karma-concat-js. - */ - function configureFiles(conf) { - overrideConfigValue(conf, 'files', [ - TMPL_bootstrap_files - TMPL_user_files - ].map(f => { - if (f.startsWith('NODE_MODULES/')) { - try { - // attempt to resolve in @bazel/typescript nested node_modules first - return require.resolve(f.replace(/^NODE_MODULES\//, '@bazel/karma/node_modules/')); - } catch (e) { - // if that failed then attempt to resolve in root node_modules - return require.resolve(f.replace(/^NODE_MODULES\//, '')); - } - } else { - return require.resolve(f); - } - })); - overrideConfigValue(conf, 'exclude', []); - overrideConfigValue(conf, 'proxies', {}); - - // static files are added to the files array but - // configured to not be included so karma-concat-js does - // not included them in the bundle - [TMPL_static_files].forEach((f) => { - // In Windows, the runfile will probably not be symlinked. Se we need to - // serve the real file through karma, and proxy calls to the expected file - // location in the runfiles to the real file. - const resolvedFile = require.resolve(f); - conf.files.push({pattern: resolvedFile, included: false}); - // Prefixing the proxy path with '/absolute' allows karma to load local - // files. This doesn't see to be an official API. - // https://github.com/karma-runner/karma/issues/2703 - conf.proxies['/base/' + f] = '/absolute' + resolvedFile; - }); - - var requireConfigContent = ` -// A simplified version of Karma's requirejs.config.tpl.js for use with Karma under Bazel. -// This does an explicit \`require\` on each test script in the files, otherwise nothing will be loaded. -(function(){ - var runtimeFiles = [TMPL_runtime_files].map(function(file) { return file.replace(/\\.js$/, ''); }); - var allFiles = [TMPL_user_files]; - var allTestFiles = []; - allFiles.forEach(function (file) { - if (/[^a-zA-Z0-9](spec|test)\\.js$/i.test(file) && !/\\/node_modules\\//.test(file)) { - allTestFiles.push(file.replace(/\\.js$/, '')) - } - }); - require(runtimeFiles, function() { return require(allTestFiles, window.__karma__.start); }); -})(); -`; - - const requireConfigFile = tmp.fileSync( - {keep: false, postfix: '.js', dir: process.env['TEST_TMPDIR']}); - fs.writeFileSync(requireConfigFile.name, requireConfigContent); - conf.files.push(requireConfigFile.name); - } - - /** - * Configure karma under karma_web_test_suite. - * `browsers` and `customLaunchers` are setup by Bazel. - */ - function configureTsWebTestSuiteConfig(conf) { - // WEB_TEST_METADATA is configured in rules_webtesting based on value - // of the browsers attribute passed to karms_web_test_suite - // We setup the karma configuration based on the values in this object - if (!process.env['WEB_TEST_METADATA']) { - // This is a karma_web_test rule since there is no WEB_TEST_METADATA - return; - } - - overrideConfigValue(conf, 'browsers', []); - overrideConfigValue(conf, 'customLaunchers', null); - - const webTestMetadata = require(process.env['WEB_TEST_METADATA']); - if (DEBUG) console.info(`WEB_TEST_METADATA: ${JSON.stringify(webTestMetadata, null, 2)}`); - if (webTestMetadata['environment'] === 'sauce') { - // If a sauce labs browser is chosen for the test such as - // "@io_bazel_rules_webtesting//browsers/sauce:chrome-win10" - // than the 'environment' will equal 'sauce'. - // We expect that a SAUCE_USERNAME and SAUCE_ACCESS_KEY is available - // from the environment for this test to run - if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) { - console.error('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.'); - process.exit(1); - } - // 'capabilities' will specify the sauce labs configuration to use - const capabilities = webTestMetadata['capabilities']; - conf.customLaunchers = { - 'sauce': { - base: 'SauceLabs', - browserName: capabilities['browserName'], - platform: capabilities['platform'], - version: capabilities['version'], - } - }; - conf.browsers.push('sauce'); - } else if (webTestMetadata['environment'] === 'local') { - // When a local chrome or firefox browser is chosen such as - // "@io_bazel_rules_webtesting//browsers:chromium-local" or - // "@io_bazel_rules_webtesting//browsers:firefox-local" - // then the 'environment' will equal 'local' and - // 'webTestFiles' will contain the path to the binary to use - const extractExe = findNamedFile(webTestMetadata, 'EXTRACT_EXE'); - webTestMetadata['webTestFiles'].forEach(webTestFiles => { - const webTestNamedFiles = webTestFiles['namedFiles']; - const archiveFile = webTestFiles['archiveFile']; - if (webTestNamedFiles['CHROMIUM']) { - // When karma is configured to use Chrome it will look for a CHROME_BIN - // environment variable. - if (archiveFile) { - process.env.CHROME_BIN = extractWebArchive(extractExe, archiveFile, webTestNamedFiles['CHROMIUM']); - } else { - process.env.CHROME_BIN = require.resolve(webTestNamedFiles['CHROMIUM']); - } - const browser = process.env['DISPLAY'] ? 'Chrome' : 'ChromeHeadless'; - if (!supportsSandboxing()) { - const launcher = 'CustomChromeWithoutSandbox'; - conf.customLaunchers = { - [launcher]: { - base: browser, - flags: ['--no-sandbox'] - } - }; - conf.browsers.push(launcher); - } else { - conf.browsers.push(browser); - } - } - if (webTestNamedFiles['FIREFOX']) { - // When karma is configured to use Firefox it will look for a - // FIREFOX_BIN environment variable. - if (archiveFile) { - process.env.FIREFOX_BIN = extractWebArchive(extractExe, archiveFile, webTestNamedFiles['FIREFOX']); - } else { - process.env.FIREFOX_BIN = require.resolve(webTestNamedFiles['FIREFOX']); - } - conf.browsers.push(process.env['DISPLAY'] ? 'Firefox' : 'FirefoxHeadless'); - } - }); - } else { - throw new Error(`Unknown WEB_TEST_METADATA environment '${webTestMetadata['environment']}'`); - } - - if (!conf.browsers.length) { - throw new Error('No browsers configured in web test suite'); - } - - // Extra configuration is needed for saucelabs - // See: https://github.com/karma-runner/karma-sauce-launcher - if (conf.customLaunchers) { - // set the test name for sauce labs to use - // TEST_BINARY is set by Bazel and contains the name of the test - // target postfixed with the browser name such as - // 'examples/testing/testing_sauce_chrome-win10' for the - // test target examples/testing:testing - if (!conf.sauceLabs) { - conf.sauceLabs = {} - } - conf.sauceLabs.testName = process.env['TEST_BINARY'] || 'karma'; - - // Try "websocket" for a faster transmission first. Fallback to "polling" if necessary. - overrideConfigValue(conf, 'transports', ['websocket', 'polling']); - - // add the saucelabs reporter - mergeConfigArray(conf, 'reporters', ['saucelabs']); - } - } - - function configureTsWebTestConfig(conf) { - if (process.env['WEB_TEST_METADATA']) { - // This is a karma_web_test_suite rule since there is a WEB_TEST_METADATA - return; - } - - // Fallback to using the system local chrome if no valid browsers have been - // configured above - if (!conf.browsers || !conf.browsers.length) { - console.warn('No browsers configured. Configuring Karma to use system Chrome.'); - conf.browsers = [process.env['DISPLAY'] ? 'Chrome': 'ChromeHeadless']; - } - } - - function configureFormatError(conf) { - conf.formatError = (msg) => { - // This is a bazel specific formatError that removes the workspace - // name from stack traces. - // Look for filenames of the format "(::" - const FILENAME_REGEX = /\(([^:]+)(:\d+:\d+)/gm; - msg = msg.replace(FILENAME_REGEX, (_, p1, p2) => { - if (p1. startsWith('../')) { - // Remove all leading "../" - while (p1.startsWith('../')) { - p1 = p1.substr(3); - } - } else { - // Remove workspace name(angular, ngdeps etc.) from the beginning. - const index = p1.indexOf('/'); - if (index >= 0) { - p1 = p1.substr(index + 1); - } - } - return '(' + p1 + p2; - }); - return msg + '\n\n'; - }; - } - - module.exports = function(config) { - let conf = {}; - - // Import the user's base karma configuration if specified - if (configPath) { - const baseConf = require(configPath); - if (typeof baseConf !== 'function') { - throw new Error('Invalid base karma configuration. Expected config function to be exported.'); - } - const originalSetConfig = config.set; - config.set = function(c) { conf = c; }; - baseConf(config); - config.set = originalSetConfig; - if (DEBUG) console.info(`Base karma configuration: ${JSON.stringify(conf, null, 2)}`); - } - - configureBazelConfig(config, conf); - configureFiles(conf); - configureTsWebTestSuiteConfig(conf); - configureTsWebTestConfig(conf); - configureFormatError(conf); - - if (DEBUG) console.info(`Karma configuration: ${JSON.stringify(conf, null, 2)}`); - - config.set(conf); - } -} catch (e) { - console.error('Error in karma configuration', e.toString()); - throw e; -} diff --git a/internal/karma/karma.js b/internal/karma/karma.js deleted file mode 100644 index 2653ede1..00000000 --- a/internal/karma/karma.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require('karma/lib/cli').run(); diff --git a/internal/karma/karma_web_test.bzl b/internal/karma/karma_web_test.bzl deleted file mode 100644 index 2002fd22..00000000 --- a/internal/karma/karma_web_test.bzl +++ /dev/null @@ -1,447 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"Unit testing with Karma" - -load("@build_bazel_rules_nodejs//internal/common:expand_into_runfiles.bzl", "expand_path_into_runfiles") -load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") -load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "write_amd_names_shim") -load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") -load(":web_test.bzl", "COMMON_WEB_TEST_ATTRS") - -_CONF_TMPL = "//:karma.conf.js" -_DEFAULT_KARMA_BIN = "@npm//@bazel/karma/bin:karma" - -# Attributes for karma_web_test that are shared with ts_web_test which -# uses Karma under the hood -KARMA_GENERIC_WEB_TEST_ATTRS = dict(COMMON_WEB_TEST_ATTRS, **{ - "bootstrap": attr.label_list( - doc = """JavaScript files to include *before* the module loader (require.js). - For example, you can include Reflect,js for TypeScript decorator metadata reflection, - or UMD bundles for third-party libraries.""", - allow_files = [".js"], - ), - "karma": attr.label( - doc = "karma binary label", - default = Label(_DEFAULT_KARMA_BIN), - executable = True, - cfg = "target", - allow_files = True, - ), - "static_files": attr.label_list( - doc = """Arbitrary files which are available to be served on request. - Files are served at: - `/base//`, e.g. - `/base/npm_bazel_typescript/examples/testing/static_script.js`""", - allow_files = True, - ), - "runtime_deps": attr.label_list( - doc = """Dependencies which should be loaded after the module loader but before the srcs and deps. - These should be a list of targets which produce JavaScript such as `ts_library`. - The files will be loaded in the same order they are declared by that rule.""", - allow_files = True, - aspects = [sources_aspect], - ), - "_conf_tmpl": attr.label( - default = Label(_CONF_TMPL), - allow_single_file = True, - ), -}) - -# Attributes for karma_web_test that are specific to karma_web_test -KARMA_WEB_TEST_ATTRS = dict(KARMA_GENERIC_WEB_TEST_ATTRS, **{ - "config_file": attr.label( - doc = """User supplied Karma configuration file. Bazel will override - certain attributes of this configuration file. Attributes that are - overridden will be outputted to the test log.""", - allow_single_file = True, - aspects = [sources_aspect], - ), -}) - -# Helper function to convert a short path to a path that is -# found in the MANIFEST file. -def _short_path_to_manifest_path(ctx, short_path): - if short_path.startswith("../"): - return short_path[3:] - else: - return ctx.workspace_name + "/" + short_path - -# Write the AMD names shim bootstrap file -def _write_amd_names_shim(ctx): - amd_names_shim = ctx.actions.declare_file( - "_%s.amd_names_shim.js" % ctx.label.name, - sibling = ctx.outputs.executable, - ) - write_amd_names_shim(ctx.actions, amd_names_shim, ctx.attr.bootstrap) - return amd_names_shim - -# Generates the karma configuration file for the rule -def _write_karma_config(ctx, files, amd_names_shim): - configuration = ctx.actions.declare_file( - "%s.conf.js" % ctx.label.name, - sibling = ctx.outputs.executable, - ) - - config_file = "" - if hasattr(ctx.file, "config_file"): - config_file = ctx.file.config_file - if hasattr(ctx.attr.config_file, "typescript"): - config_file = ctx.attr.config_file.typescript.es5_sources.to_list()[0] - - # The files in the bootstrap attribute come before the require.js support. - # Note that due to frameworks = ['jasmine'], a few scripts will come before - # the bootstrap entries: - # jasmine-core/lib/jasmine-core/jasmine.js - # karma-jasmine/lib/boot.js - # karma-jasmine/lib/adapter.js - # This is desired so that the bootstrap entries can patch jasmine, as zone.js does. - bootstrap_entries = [ - expand_path_into_runfiles(ctx, f.short_path) - for f in ctx.files.bootstrap - ] - - # Explicitly list the requirejs library files here, rather than use - # `frameworks: ['requirejs']` - # so that we control the script order, and the bootstrap files come before - # require.js. - # That allows bootstrap files to have anonymous AMD modules, or to do some - # polyfilling before test libraries load. - # See https://github.com/karma-runner/karma/issues/699 - # `NODE_MODULES/` is a prefix recogized by karma.conf.js to allow - # for a priority require of nested `@bazel/typescript/node_modules` before - # looking in root node_modules. - bootstrap_entries += [ - "NODE_MODULES/requirejs/require.js", - "NODE_MODULES/karma-requirejs/lib/adapter.js", - "/".join([ctx.workspace_name, amd_names_shim.short_path]), - ] - - # Next we load the "runtime_deps" which we expect to contain named AMD modules - # Thus they should come after the require.js script, but before any srcs or deps - runtime_files = [] - for d in ctx.attr.runtime_deps: - if not hasattr(d, "typescript"): - # Workaround https://github.com/bazelbuild/rules_nodejs/issues/57 - # We should allow any JS source as long as it yields something that - # can be loaded by require.js - fail("labels in runtime_deps must be created by ts_library") - for src in d.typescript.es5_sources.to_list(): - runtime_files.append(expand_path_into_runfiles(ctx, src.short_path)) - - # Finally we load the user's srcs and deps - user_entries = [ - expand_path_into_runfiles(ctx, f.short_path) - for f in files.to_list() - ] - - # Expand static_files paths to runfiles for config - static_files = [ - expand_path_into_runfiles(ctx, f.short_path) - for f in ctx.files.static_files - ] - - # root-relative (runfiles) path to the directory containing karma.conf - config_segments = len(configuration.short_path.split("/")) - - # configuration_env_vars are set using process.env() - env_vars = "" - for k in ctx.attr.configuration_env_vars: - if k in ctx.var.keys(): - env_vars += "process.env[\"%s\"]=\"%s\";\n" % (k, ctx.var[k]) - - ctx.actions.expand_template( - output = configuration, - template = ctx.file._conf_tmpl, - substitutions = { - "TMPL_bootstrap_files": "\n".join([" '%s'," % e for e in bootstrap_entries]), - "TMPL_config_file": expand_path_into_runfiles(ctx, config_file.short_path) if config_file else "", - "TMPL_env_vars": env_vars, - "TMPL_runfiles_path": "/".join([".."] * config_segments), - "TMPL_runtime_files": "\n".join([" '%s'," % e for e in runtime_files]), - "TMPL_static_files": "\n".join([" '%s'," % e for e in static_files]), - "TMPL_user_files": "\n".join([" '%s'," % e for e in user_entries]), - }, - ) - - return configuration - -def run_karma_web_test(ctx): - """Creates an action that can run karma. - - This is also used by ts_web_test_rule. - - Args: - ctx: Bazel rule execution context - - Returns: - The runfiles for the generated action. - """ - files = depset(ctx.files.srcs) - for d in ctx.attr.deps + ctx.attr.runtime_deps: - if hasattr(d, "node_sources"): - files = depset(transitive = [files, d.node_sources]) - elif hasattr(d, "files"): - files = depset(transitive = [files, d.files]) - - amd_names_shim = _write_amd_names_shim(ctx) - - configuration = _write_karma_config(ctx, files, amd_names_shim) - - ctx.actions.write( - output = ctx.outputs.executable, - is_executable = True, - content = """#!/usr/bin/env bash -# Immediately exit if any command fails. -set -e - -if [ -e "$RUNFILES_MANIFEST_FILE" ]; then - while read line; do - declare -a PARTS=($line) - if [ "${{PARTS[0]}}" == "{TMPL_karma}" ]; then - readonly KARMA=${{PARTS[1]}} - elif [ "${{PARTS[0]}}" == "{TMPL_conf}" ]; then - readonly CONF=${{PARTS[1]}} - fi - done < $RUNFILES_MANIFEST_FILE -else - readonly KARMA=../{TMPL_karma} - readonly CONF=../{TMPL_conf} -fi - -export HOME=$(mktemp -d) - -# Print the karma version in the test log -echo $($KARMA --version) - -ARGV=( "start" $CONF ) - -# Detect that we are running as a test, by using well-known environment -# variables. See go/test-encyclopedia -# Note: in Bazel 0.14 and later, TEST_TMPDIR is set for both bazel test and bazel run -# so we also check for the BUILD_WORKSPACE_DIRECTORY which is set only for bazel run -if [[ ! -z "${{TEST_TMPDIR}}" && ! -n "${{BUILD_WORKSPACE_DIRECTORY}}" ]]; then - ARGV+=( "--single-run" ) -fi - -$KARMA ${{ARGV[@]}} -""".format( - TMPL_workspace = ctx.workspace_name, - TMPL_karma = _short_path_to_manifest_path(ctx, ctx.executable.karma.short_path), - TMPL_conf = _short_path_to_manifest_path(ctx, configuration.short_path), - ), - ) - - config_sources = [] - if hasattr(ctx.file, "config_file"): - if ctx.file.config_file: - config_sources = [ctx.file.config_file] - if hasattr(ctx.attr.config_file, "node_sources"): - config_sources = ctx.attr.config_file.node_sources.to_list() - - runfiles = [ - configuration, - amd_names_shim, - ] - runfiles += config_sources - runfiles += ctx.files.srcs - runfiles += ctx.files.deps - runfiles += ctx.files.runtime_deps - runfiles += ctx.files.bootstrap - runfiles += ctx.files.static_files - runfiles += ctx.files.data - - return ctx.runfiles( - files = runfiles, - transitive_files = files, - ).merge(ctx.attr.karma[DefaultInfo].data_runfiles) - -def _karma_web_test_impl(ctx): - runfiles = run_karma_web_test(ctx) - - return [DefaultInfo( - files = depset([ctx.outputs.executable]), - runfiles = runfiles, - executable = ctx.outputs.executable, - )] - -_karma_web_test = rule( - implementation = _karma_web_test_impl, - test = True, - executable = True, - attrs = KARMA_WEB_TEST_ATTRS, -) - -def karma_web_test( - srcs = [], - deps = [], - data = [], - configuration_env_vars = [], - bootstrap = [], - runtime_deps = [], - static_files = [], - config_file = None, - tags = [], - **kwargs): - """Runs unit tests in a browser with Karma. - - When executed under `bazel test`, this uses a headless browser for speed. - This is also because `bazel test` allows multiple targets to be tested together, - and we don't want to open a Chrome window on your machine for each one. Also, - under `bazel test` the test will execute and immediately terminate. - - Running under `ibazel test` gives you a "watch mode" for your tests. The rule is - optimized for this case - the test runner server will stay running and just - re-serve the up-to-date JavaScript source bundle. - - To debug a single test target, run it with `bazel run` instead. This will open a - browser window on your computer. Also you can use any other browser by opening - the URL printed when the test starts up. The test will remain running until you - cancel the `bazel run` command. - - This rule will use your system Chrome by default. In the default case, your - environment must specify CHROME_BIN so that the rule will know which Chrome binary to run. - Other `browsers` and `customLaunchers` may be set using the a base Karma configuration - specified in the `config_file` attribute. - - Args: - srcs: A list of JavaScript test files - deps: Other targets which produce JavaScript such as `ts_library` - data: Runtime dependencies - configuration_env_vars: Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from ctx.var), which also - includes anything specified via the --define flag. - Note, this can lead to different outputs produced by this rule. - bootstrap: JavaScript files to include *before* the module loader (require.js). - For example, you can include Reflect,js for TypeScript decorator metadata reflection, - or UMD bundles for third-party libraries. - runtime_deps: Dependencies which should be loaded after the module loader but before the srcs and deps. - These should be a list of targets which produce JavaScript such as `ts_library`. - The files will be loaded in the same order they are declared by that rule. - static_files: Arbitrary files which are available to be served on request. - Files are served at: - `/base//`, e.g. - `/base/npm_bazel_typescript/examples/testing/static_script.js` - config_file: User supplied Karma configuration file. Bazel will override - certain attributes of this configuration file. Attributes that are - overridden will be outputted to the test log. - tags: Standard Bazel tags, this macro adds tags for ibazel support - **kwargs: Passed through to `karma_web_test` - """ - - _karma_web_test( - srcs = srcs, - deps = deps, - data = data, - configuration_env_vars = configuration_env_vars, - bootstrap = bootstrap, - runtime_deps = runtime_deps, - static_files = static_files, - config_file = config_file, - tags = tags + [ - # Users don't need to know that this tag is required to run under ibazel - "ibazel_notify_changes", - ], - **kwargs - ) - -def karma_web_test_suite( - name, - browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"], - args = None, - browser_overrides = None, - config = None, - flaky = None, - local = None, - shard_count = None, - size = None, - tags = [], - test_suite_tags = None, - timeout = None, - visibility = None, - web_test_data = [], - wrapped_test_tags = None, - **remaining_keyword_args): - """Defines a test_suite of web_test targets that wrap a karma_web_test target. - - This macro also accepts all parameters in karma_web_test. See karma_web_test docs - for details. - - Args: - name: The base name of the test - browsers: A sequence of labels specifying the browsers to use. - args: Args for web_test targets generated by this extension. - browser_overrides: Dictionary; optional; default is an empty dictionary. A - dictionary mapping from browser names to browser-specific web_test - attributes, such as shard_count, flakiness, timeout, etc. For example: - {'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} - '//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}. - config: Label; optional; Configuration of web test features. - flaky: A boolean specifying that the test is flaky. If set, the test will - be retried up to 3 times (default: 0) - local: boolean; optional. - shard_count: The number of test shards to use per browser. (default: 1) - size: A string specifying the test size. (default: 'large') - tags: A list of test tag strings to apply to each generated web_test target. - This macro adds a couple for ibazel. - test_suite_tags: A list of tag strings for the generated test_suite. - timeout: A string specifying the test timeout (default: computed from size) - visibility: List of labels; optional. - web_test_data: Data dependencies for the web_test. - wrapped_test_tags: A list of test tag strings to use for the wrapped test - **remaining_keyword_args: Arguments for the wrapped test target. - """ - - # Check explicitly for None so that users can set this to the empty list - if wrapped_test_tags == None: - wrapped_test_tags = DEFAULT_WRAPPED_TEST_TAGS - - size = size or "large" - - wrapped_test_name = name + "_wrapped_test" - - _karma_web_test( - name = wrapped_test_name, - args = args, - flaky = flaky, - local = local, - shard_count = shard_count, - size = size, - tags = wrapped_test_tags, - timeout = timeout, - visibility = ["//visibility:private"], - **remaining_keyword_args - ) - - web_test_suite( - name = name, - launcher = ":" + wrapped_test_name, - args = args, - browsers = browsers, - browser_overrides = browser_overrides, - config = config, - data = web_test_data, - flaky = flaky, - local = local, - shard_count = shard_count, - size = size, - tags = tags + [ - # Users don't need to know that this tag is required to run under ibazel - "ibazel_notify_changes", - ], - test = wrapped_test_name, - test_suite_tags = test_suite_tags, - timeout = timeout, - visibility = visibility, - ) diff --git a/internal/karma/package.bzl b/internal/karma/package.bzl deleted file mode 100644 index ed31fee8..00000000 --- a/internal/karma/package.bzl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Package file which defines npm_bazel_karma dependencies -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def rules_karma_dependencies(): - """ - Fetch our transitive dependencies. - - If the user wants to get a different version of these, they can just fetch it - from their WORKSPACE before calling this function, or not call this function at all. - """ - - # TypeScript compiler runs on node.js runtime - _maybe( - http_archive, - name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", - ) - - # ts_web_test depends on the web testing rules to provision browsers. - _maybe( - http_archive, - name = "io_bazel_rules_webtesting", - urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.0/rules_webtesting.tar.gz"], - sha256 = "1c0900547bdbe33d22aa258637dc560ce6042230e41e9ea9dad5d7d2fca8bc42", - ) - -def _maybe(repo_rule, name, **kwargs): - if name not in native.existing_rules(): - repo_rule(name = name, **kwargs) diff --git a/internal/karma/package.json b/internal/karma/package.json deleted file mode 100644 index 5f71978d..00000000 --- a/internal/karma/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "@bazel/karma", - "description": "Karma rules for Bazel", - "homepage": "https://github.com/bazelbuild/rules_typescript", - "license": "Apache-2.0", - "version": "0.0.0-PLACEHOLDER", - "keywords": [ - "karma", - "bazel" - ], - "main": "./index.js", - "typings": "./index.d.ts", - "bin": { - "karma": "./karma.js" - }, - "dependencies": { - "jasmine-core": "2.8.0", - "karma": "^4.0.0", - "karma-chrome-launcher": "2.2.0", - "karma-firefox-launcher": "1.1.0", - "karma-jasmine": "1.1.1", - "karma-requirejs": "1.1.0", - "karma-sauce-launcher": "2.0.2", - "karma-sourcemap-loader": "0.3.7", - "requirejs": "2.3.5", - "semver": "5.6.0", - "tmp": "0.0.33" - }, - "devDependencies": { - "@bazel/bazel": "~0.22.0", - "@types/node": "7.0.18", - "protobufjs": "5.0.3", - "semver": "5.6.0", - "source-map-support": "0.5.9", - "tsickle": "0.33.1", - "tsutils": "2.27.2", - "typescript": "~3.1.6", - "jasmine-core": "2.8.0" - }, - "bazelWorkspaces": { - "npm_bazel_karma": { - "version": "0.0.0-PLACEHOLDER", - "compatVersion": "0.0.0-COMPAT_VERSION", - "rootPath": "." - } - } -} diff --git a/internal/karma/ts_web_test.bzl b/internal/karma/ts_web_test.bzl deleted file mode 100644 index ab5329b2..00000000 --- a/internal/karma/ts_web_test.bzl +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"Unit testing in a browser" - -load("@io_bazel_rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") -load(":karma_web_test.bzl", "KARMA_GENERIC_WEB_TEST_ATTRS", "run_karma_web_test") - -# Using generic karma_web_test attributes under the hood -TS_WEB_TEST_ATTRS = dict(KARMA_GENERIC_WEB_TEST_ATTRS, **{}) - -def _ts_web_test_impl(ctx): - # Using karma_web_test under the hood - runfiles = run_karma_web_test(ctx) - - return [DefaultInfo( - files = depset([ctx.outputs.executable]), - runfiles = runfiles, - executable = ctx.outputs.executable, - )] - -_ts_web_test = rule( - implementation = _ts_web_test_impl, - test = True, - executable = True, - attrs = TS_WEB_TEST_ATTRS, -) - -def ts_web_test( - srcs = [], - deps = [], - data = [], - configuration_env_vars = [], - bootstrap = [], - runtime_deps = [], - static_files = [], - tags = [], - **kwargs): - """Runs unit tests in a browser. - - When executed under `bazel test`, this uses a headless browser for speed. - This is also because `bazel test` allows multiple targets to be tested together, - and we don't want to open a Chrome window on your machine for each one. Also, - under `bazel test` the test will execute and immediately terminate. - - Running under `ibazel test` gives you a "watch mode" for your tests. The rule is - optimized for this case - the test runner server will stay running and just - re-serve the up-to-date JavaScript source bundle. - - To debug a single test target, run it with `bazel run` instead. This will open a - browser window on your computer. Also you can use any other browser by opening - the URL printed when the test starts up. The test will remain running until you - cancel the `bazel run` command. - - This rule will use your system Chrome. Your environment must specify CHROME_BIN - so that the rule will know which Chrome binary to run. - - Currently this rule uses Karma as the test runner under the hood, but this is - an implementation detail. We might switch to another runner like Jest in the future. - - Args: - srcs: A list of JavaScript test files - deps: Other targets which produce JavaScript such as `ts_library` - data: Runtime dependencies - configuration_env_vars: Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from ctx.var), which also - includes anything specified via the --define flag. - Note, this can lead to different outputs produced by this rule. - bootstrap: JavaScript files to include *before* the module loader (require.js). - For example, you can include Reflect,js for TypeScript decorator metadata reflection, - or UMD bundles for third-party libraries. - runtime_deps: Dependencies which should be loaded after the module loader but before the srcs and deps. - These should be a list of targets which produce JavaScript such as `ts_library`. - The files will be loaded in the same order they are declared by that rule. - static_files: Arbitrary files which are available to be served on request. - Files are served at: - `/base//`, e.g. - `/base/npm_bazel_typescript/examples/testing/static_script.js` - tags: Standard Bazel tags, this macro adds tags for ibazel support as well as - `browser:chromium-system` to allow for filtering on systems with no - system Chrome. - **kwargs: Passed through to `ts_web_test` - """ - - _ts_web_test( - srcs = srcs, - deps = deps, - data = data, - configuration_env_vars = configuration_env_vars, - bootstrap = bootstrap, - runtime_deps = runtime_deps, - static_files = static_files, - tags = tags + [ - # Users don't need to know that this tag is required to run under ibazel - "ibazel_notify_changes", - # Always attach this label to allow filtering, eg. envs w/ no browser - "browser:chromium-system", - ], - **kwargs - ) - -def ts_web_test_suite( - name, - browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"], - args = None, - browser_overrides = None, - config = None, - flaky = None, - local = None, - shard_count = None, - size = None, - tags = [], - test_suite_tags = None, - timeout = None, - visibility = None, - web_test_data = [], - wrapped_test_tags = None, - **remaining_keyword_args): - """Defines a test_suite of web_test targets that wrap a ts_web_test target. - - This macro also accepts all parameters in ts_web_test. See ts_web_test docs for - details. - - Args: - name: The base name of the test. - browsers: A sequence of labels specifying the browsers to use. - args: Args for web_test targets generated by this extension. - browser_overrides: Dictionary; optional; default is an empty dictionary. A - dictionary mapping from browser names to browser-specific web_test - attributes, such as shard_count, flakiness, timeout, etc. For example: - {'//browsers:chrome-native': {'shard_count': 3, 'flaky': 1} - '//browsers:firefox-native': {'shard_count': 1, 'timeout': 100}}. - config: Label; optional; Configuration of web test features. - flaky: A boolean specifying that the test is flaky. If set, the test will - be retried up to 3 times (default: 0) - local: boolean; optional. - shard_count: The number of test shards to use per browser. (default: 1) - size: A string specifying the test size. (default: 'large') - tags: A list of test tag strings to apply to each generated web_test_suite target. - This macro adds a couple for ibazel. - test_suite_tags: A list of tag strings for the generated test_suite. - timeout: A string specifying the test timeout (default: computed from size) - visibility: List of labels; optional. - web_test_data: Data dependencies for the web_test_suite. - wrapped_test_tags: A list of test tag strings to use for the wrapped test - **remaining_keyword_args: Arguments for the wrapped test target. - """ - - # Check explicitly for None so that users can set this to the empty list - if wrapped_test_tags == None: - wrapped_test_tags = DEFAULT_WRAPPED_TEST_TAGS - - size = size or "large" - - wrapped_test_name = name + "_wrapped_test" - - _ts_web_test( - name = wrapped_test_name, - args = args, - flaky = flaky, - local = local, - shard_count = shard_count, - size = size, - tags = wrapped_test_tags, - timeout = timeout, - visibility = ["//visibility:private"], - **remaining_keyword_args - ) - - web_test_suite( - name = name, - launcher = ":" + wrapped_test_name, - args = args, - browsers = browsers, - browser_overrides = browser_overrides, - config = config, - data = web_test_data, - flaky = flaky, - local = local, - shard_count = shard_count, - size = size, - tags = tags + [ - # Users don't need to know that this tag is required to run under ibazel - "ibazel_notify_changes", - ], - test = wrapped_test_name, - test_suite_tags = test_suite_tags, - timeout = timeout, - visibility = visibility, - ) diff --git a/internal/karma/tsconfig.json.oss b/internal/karma/tsconfig.json.oss deleted file mode 100644 index bce2c5c4..00000000 --- a/internal/karma/tsconfig.json.oss +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - // Explicitly set types settings so typescript doesn't auto-discover types. - // If all types are discovered then all types need to be included as deps - // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. - "types": ["node"] - } -} - diff --git a/internal/karma/web_test.bzl b/internal/karma/web_test.bzl deleted file mode 100644 index 7ebb58b2..00000000 --- a/internal/karma/web_test.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"Common web_test attributes" - -load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") - -# Attributes shared by any web_test rule (ts_web_test, karma_web_test, protractor_web_test) -COMMON_WEB_TEST_ATTRS = { - "srcs": attr.label_list( - doc = "A list of JavaScript test files", - allow_files = [".js"], - ), - "configuration_env_vars": attr.string_list( - doc = """Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from ctx.var), which also - includes anything specified via the --define flag. - Note, this can lead to different outputs produced by this rule.""", - default = [], - ), - "data": attr.label_list( - doc = "Runtime dependencies", - allow_files = True, - ), - "deps": attr.label_list( - doc = "Other targets which produce JavaScript such as `ts_library`", - allow_files = True, - aspects = [sources_aspect], - ), -} diff --git a/internal/karma/yarn.lock b/internal/karma/yarn.lock deleted file mode 100644 index 1d21df68..00000000 --- a/internal/karma/yarn.lock +++ /dev/null @@ -1,2320 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@bazel/bazel-darwin_x64@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.22.0.tgz#a2bea5922dba9a32554a218ba4849a200115b248" - integrity sha512-LFxkyQgPATeB64z/1IvOWZhK+lc3JVHejbmdo96qB4lsoD8zselvOlgHvVXxlAjRxVZ9mlmXDvDRDyaXyyRdwA== - -"@bazel/bazel-linux_x64@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.22.0.tgz#12e5884f2a7b7f3b62afbef9f8da4de0976f3bc8" - integrity sha512-xDs8cb2bbGZ9uvzYZOzCVrMBywzRhLj0J/t+py+FYZj+VO5B3wVg9eUf6nWWR0oJ2mzvToI9h31t2tNdqwy2kQ== - -"@bazel/bazel-win32_x64@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.22.0.tgz#a8a65986639583a8cc7b018e001aedfdafe41b50" - integrity sha512-FbJaXVDoCLnpIFLnPHFkQdfriYPXfnfQNuf9EXMliERdRuoeBVbwEZfwcuArxZWNFus7bD8QiTj0XzKVWO+Wbw== - -"@bazel/bazel@~0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.22.0.tgz#feb0f2d82f9d169cb47951d95d55e512eda72bc9" - integrity sha512-uaXZsfCXOASBXzmge56akRIhJnKYdShn1X3AdEBzq2NNCf2llkc1H25gKGm4BfuWDBXRbXDMmcXup+fw39h+WQ== - optionalDependencies: - "@bazel/bazel-darwin_x64" "0.22.0" - "@bazel/bazel-linux_x64" "0.22.0" - "@bazel/bazel-win32_x64" "0.22.0" - -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= - -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== - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -adm-zip@~0.4.3: - version "0.4.13" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.13.tgz#597e2f8cc3672151e1307d3e95cddbc75672314a" - integrity sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw== - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= - -agent-base@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - integrity sha1-GdOGodntxufByF04iu28xW0zYC0= - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -async@^2.1.2: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== - dependencies: - lodash "^4.17.10" - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - integrity sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - integrity sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI= - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" - integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== - -blob@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" - integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== - -bluebird@^3.3.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" - integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== - -body-parser@^1.16.1: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - integrity sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY= - dependencies: - expand-range "^0.1.0" - -braces@^2.3.0, braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= - -camelcase@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -chokidar@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.0" - braces "^2.3.0" - glob-parent "^3.1.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - lodash.debounce "^4.0.8" - normalize-path "^2.1.1" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - upath "^1.0.5" - optionalDependencies: - fsevents "^1.2.2" - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== - -circular-json@^0.5.5: - version "0.5.9" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" - integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -colors@^1.1.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" - integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== - -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - integrity sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y= - dependencies: - lodash "^4.5.0" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - integrity sha1-AMYIq33Nk4l8AAllGx06jh5zu9E= - -component-emitter@1.2.1, component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - integrity sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM= - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - integrity sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ= - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js@^2.2.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49" - integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ== - -core-js@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.3.0.tgz#fab83fbb0b2d8dc85fa636c4b9d34c75420c6d65" - integrity sha1-+rg/uwstjchfpjbEudNMdUIMbWU= - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - integrity sha1-YV6CjiM90aubua4JUODOzPpuytg= - -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@=3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -engine.io-client@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.2.1.tgz#6f54c0475de487158a1a7c77d10178708b6add36" - integrity sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw== - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.3.tgz#757ab970fbf2dfb32c7b74b033216d5739ef79a6" - integrity sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA== - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.5" - has-binary2 "~1.0.2" - -engine.io@~3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.2.1.tgz#b60281c35484a70ee0351ea0ebff83ec8c9522a2" - integrity sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w== - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - -es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" - integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== - -es6-promise@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.0.2.tgz#010d5858423a5f118979665f46486a95c6ee2bb6" - integrity sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y= - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - integrity sha1-SIsdHSRRyz06axks/AMPRMWFX+o= - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - integrity sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ= - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - integrity sha1-zgtoVbRYU+eRsvzGgARtiCU91/U= - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== - -follow-redirects@^1.0.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" - integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== - dependencies: - debug "=3.1.0" - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-access@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= - dependencies: - null-check "^1.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.2.2: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" - integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@^7.0.5, glob@^7.1.1, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -has-binary2@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" - integrity sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw== - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= - -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= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -http-errors@1.6.3, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.4.4: - 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-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= - dependencies: - is-extglob "^2.1.1" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - integrity sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY= - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= - -isbinaryfile@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.3.tgz#5d6def3edebf6e8ca8cae9c30183a804b5f8be80" - integrity sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw== - dependencies: - buffer-alloc "^1.2.0" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jasmine-core@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" - integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= - -jszip@^3.1.3: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.1.5.tgz#e3c2a6c6d706ac6e603314036d43cd40beefdf37" - integrity sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ== - dependencies: - core-js "~2.3.0" - es6-promise "~3.0.2" - lie "~3.1.0" - pako "~1.0.2" - readable-stream "~2.0.6" - -karma-chrome-launcher@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz#cf1b9d07136cc18fe239327d24654c3dbc368acf" - integrity sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w== - dependencies: - fs-access "^1.0.0" - which "^1.2.1" - -karma-firefox-launcher@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz#2c47030452f04531eb7d13d4fc7669630bb93339" - integrity sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA== - -karma-jasmine@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-1.1.1.tgz#6fe840e75a11600c9d91e84b33c458e1c46a3529" - integrity sha1-b+hA51oRYAydkehLM8RY4cRqNSk= - -karma-requirejs@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/karma-requirejs/-/karma-requirejs-1.1.0.tgz#fddae2cb87d7ebc16fb0222893564d7fee578798" - integrity sha1-/driy4fX68FvsCIok1ZNf+5Xh5g= - -karma-sauce-launcher@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/karma-sauce-launcher/-/karma-sauce-launcher-2.0.2.tgz#dbf98e70d86bf287b03a537cf637eb7aefa975c3" - integrity sha512-jLUFaJhHMcKpxFWUesyWYihzM5FvQiJsDwGcCtKeOy2lsWhkVw0V0Byqb1d+wU6myU1mribBtsIcub23HS4kWA== - dependencies: - sauce-connect-launcher "^1.2.4" - saucelabs "^1.5.0" - selenium-webdriver "^4.0.0-alpha.1" - -karma-sourcemap-loader@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.7.tgz#91322c77f8f13d46fed062b042e1009d4c4505d8" - integrity sha1-kTIsd/jxPUb+0GKwQuEAnUxFBdg= - dependencies: - graceful-fs "^4.1.2" - -karma@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/karma/-/karma-4.0.0.tgz#f28e38a2b66243fde3f98e12a8dcaa2c6ff8ca9c" - integrity sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g== - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - flatted "^2.0.0" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.5" - log4js "^3.0.0" - mime "^2.3.1" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.1.1" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.3.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lie@~3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= - dependencies: - immediate "~3.0.5" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= - -lodash@^4.16.6, lodash@^4.17.10, lodash@^4.17.5, lodash@^4.5.0: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -log4js@^3.0.0: - version "3.0.6" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" - integrity sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ== - dependencies: - circular-json "^0.5.5" - date-format "^1.2.0" - debug "^3.1.0" - rfdc "^1.1.2" - streamroller "0.7.0" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= - -lru-cache@4.1.x: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -micromatch@^3.1.10, micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mime-db@~1.37.0: - version "1.37.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" - integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== - -mime-types@~2.1.18: - version "2.1.21" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" - integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== - dependencies: - mime-db "~1.37.0" - -mime@^2.3.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" - integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -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== - -nan@^2.9.2: - version "2.12.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" - integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" - integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== - -npm-packlist@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" - integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -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= - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - integrity sha1-8MaapQ78lbhmwYb0AKM3acsvEpE= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - -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-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, 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= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -pako@~1.0.2: - version "1.0.8" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.8.tgz#6844890aab9c635af868ad5fecc62e8acbba3ea4" - integrity sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA== - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - integrity sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0= - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - integrity sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo= - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -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= - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= - -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== - -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - -qs@6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - integrity sha1-x6jTI2BoNiBZp+RlH8aITosftK4= - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -requirejs@2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" - integrity sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rfdc@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.2.tgz#e6e72d74f5dc39de8f538f65e00c36c18018e349" - integrity sha512-92ktAgvZhBzYTIK0Mja9uen5q5J3NRVMoDkJL2VMwq6SXjVCgqvQeVP2XAaUY6HT+XpQYeLSjb3UoitBryKmdA== - -rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: - 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" - -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== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sauce-connect-launcher@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sauce-connect-launcher/-/sauce-connect-launcher-1.2.4.tgz#8d38f85242a9fbede1b2303b559f7e20c5609a1c" - integrity sha512-X2vfwulR6brUGiicXKxPm1GJ7dBEeP1II450Uv4bHGrcGOapZNgzJvn9aioea5IC5BPp/7qjKdE3xbbTBIVXMA== - dependencies: - adm-zip "~0.4.3" - async "^2.1.2" - https-proxy-agent "^2.2.1" - lodash "^4.16.6" - rimraf "^2.5.4" - -saucelabs@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.5.0.tgz#9405a73c360d449b232839919a86c396d379fd9d" - integrity sha512-jlX3FGdWvYf4Q3LFfFWS1QvPg3IGCGWxIc8QBFdPTbpTJnt/v17FHXYVAn7C8sHf1yUXo2c7yIM0isDryfYtHQ== - dependencies: - https-proxy-agent "^2.2.1" - -sax@>=0.6.0, sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -selenium-webdriver@^4.0.0-alpha.1: - version "4.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.1.tgz#cc93415e21d2dc1dfd85dfc5f6b55f3ac53933b1" - integrity sha512-z88rdjHAv3jmTZ7KSGUkTvo4rGzcDGMq0oXWHNIDK96Gs31JKVdu9+FMtT4KBrVoibg8dUicJDok6GnqqttO5Q== - dependencies: - jszip "^3.1.3" - rimraf "^2.5.4" - tmp "0.0.30" - xml2js "^0.4.17" - -semver@5.6.0, semver@^5.3.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= - -socket.io-client@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.1.1.tgz#dcb38103436ab4578ddb026638ae2f21b623671f" - integrity sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ== - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~3.1.0" - engine.io-client "~3.2.0" - has-binary2 "~1.0.2" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.2.0" - to-array "0.1.4" - -socket.io-parser@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.2.0.tgz#e7c6228b6aa1f814e6148aea325b51aa9499e077" - integrity sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA== - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - isarray "2.0.1" - -socket.io@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.1.1.tgz#a069c5feabee3e6b214a75b40ce0652e1cfb9980" - integrity sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA== - dependencies: - debug "~3.1.0" - engine.io "~3.2.0" - has-binary2 "~1.0.2" - socket.io-adapter "~1.1.0" - socket.io-client "2.1.1" - socket.io-parser "~3.2.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" - integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - integrity sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4= - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - integrity sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ== - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-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= - -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -tmp@0.0.30: - version "0.0.30" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed" - integrity sha1-ckGdSovn1s51FI/YsyTlk6cRwu0= - dependencies: - os-tmpdir "~1.0.1" - -tmp@0.0.33, tmp@0.0.x: - 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" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - integrity sha1-F+bBH3PdTz10zaek/zI46a2b+JA= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tsickle@0.33.1: - version "0.33.1" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" - integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.7.3" - -tslib@^1.8.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -type-is@~1.6.16: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -typescript@~3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -useragent@2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.3.0.tgz#217f943ad540cb2128658ab23fc960f6a88c9972" - integrity sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw== - dependencies: - lru-cache "4.1.x" - tmp "0.0.x" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - -which@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xml2js@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" - integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q== - dependencies: - sax ">=0.6.0" - xmlbuilder "~9.0.1" - -xmlbuilder@~9.0.1: - version "9.0.7" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" - integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0= - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= - -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" - integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= diff --git a/internal/protobufjs/BUILD.bazel b/internal/protobufjs/BUILD.bazel deleted file mode 100644 index ae06e171..00000000 --- a/internal/protobufjs/BUILD.bazel +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2018 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") - -package(default_visibility = ["//visibility:public"]) - -exports_files([ - "node_modules/protobufjs/dist/minimal/protobuf.min.js", - # Exported to be consumed for generating skydoc. - "ts_proto_library.bzl", -]) - -nodejs_binary( - name = "pbjs", - data = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//protobufjs", - # these deps are needed even tho they are not automatic transitive deps of - # protobufjs since if they are not in the runfiles then protobufjs attempts to - # run `npm install` at runtime to get thhem which fails as it tries to access - # the npm cache outside of the sandbox - "@build_bazel_rules_typescript_protobufs_compiletime_deps//semver", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//chalk", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//glob", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//jsdoc", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//minimist", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//tmp", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//uglify-js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//espree", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//escodegen", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//estraverse", - ], - entry_point = "protobufjs/bin/pbjs", - install_source_map_support = False, -) - -nodejs_binary( - name = "pbts", - data = [ - "@build_bazel_rules_typescript_protobufs_compiletime_deps//protobufjs", - # these deps are needed even tho they are not automatic transitive deps of - # protobufjs since if they are not in the runfiles then protobufjs attempts to - # run `npm install` at runtime to get thhem which fails as it tries to access - # the npm cache outside of the sandbox - "@build_bazel_rules_typescript_protobufs_compiletime_deps//semver", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//chalk", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//glob", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//jsdoc", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//minimist", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//tmp", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//uglify-js", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//espree", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//escodegen", - "@build_bazel_rules_typescript_protobufs_compiletime_deps//estraverse", - ], - entry_point = "protobufjs/bin/pbts", - install_source_map_support = False, -) diff --git a/internal/protobufjs/package.json b/internal/protobufjs/package.json deleted file mode 100644 index 7d669f6c..00000000 --- a/internal/protobufjs/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "protobufjs", - "version": "1.0.0", - "main": "index.js", - "license": "MIT", - "devDependencies": { - "chalk": "^1.1.3", - "escodegen": "^1.9.0", - "espree": "^3.5.3", - "estraverse": "^4.2.0", - "glob": "^7.1.2", - "jsdoc": "^3.5.5", - "minimist": "^1.2.0", - "protobufjs": "Use HEAD to pick up fix for https://github.com/dcodeIO/protobuf.js/pull/1018", - "protobufjs": "github:dcodeIO/protobuf.js#65d113b0079fa2570837f3cf95268ce24714a248", - "semver": "^5.5.0", - "tmp": "0.0.33", - "uglify-js": "^2.8.29" - } -} diff --git a/internal/protobufjs/ts_proto_library.bzl b/internal/protobufjs/ts_proto_library.bzl deleted file mode 100644 index 807dea0f..00000000 --- a/internal/protobufjs/ts_proto_library.bzl +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"Protocol Buffers" - -def _run_pbjs(actions, executable, output_name, proto_files, suffix = ".js", wrap = "amd", amd_name = ""): - js_file = actions.declare_file(output_name + suffix) - - # Create an intermediate file so that we can do some manipulation of the - # generated .js output that makes it compatible with our named AMD loading. - js_tmpl_file = actions.declare_file(output_name + suffix + ".tmpl") - - # Reference of arguments: - # https://github.com/dcodeIO/ProtoBuf.js/#pbjs-for-javascript - args = actions.args() - args.add_all(["--target", "static-module"]) - args.add_all(["--wrap", wrap]) - args.add("--strict-long") # Force usage of Long type with int64 fields - args.add_all(["--out", js_file.path + ".tmpl"]) - args.add_all(proto_files) - - actions.run( - executable = executable._pbjs, - inputs = proto_files, - outputs = [js_tmpl_file], - arguments = [args], - ) - - actions.expand_template( - template = js_tmpl_file, - output = js_file, - substitutions = { - # convert anonymous AMD module - # define(["protobufjs/minimal"], function($protobuf) { - # to named - # define("wksp/path/to/module", ["protobufjs/minimal"], ... - "define([": "define('%s/%s', [" % (amd_name, output_name), - }, - ) - return js_file - -def _run_pbts(actions, executable, js_file): - ts_file = actions.declare_file(js_file.basename[:-len(".closure.js")] + ".d.ts") - - # Reference of arguments: - # https://github.com/dcodeIO/ProtoBuf.js/#pbts-for-typescript - args = actions.args() - args.add_all(["--out", ts_file.path]) - args.add(js_file.path) - - actions.run( - executable = executable._pbts, - progress_message = "Generating typings from %s" % js_file.short_path, - inputs = [js_file], - outputs = [ts_file], - arguments = [args], - ) - return ts_file - -def _ts_proto_library(ctx): - sources = depset() - for dep in ctx.attr.deps: - if not hasattr(dep, "proto"): - fail("ts_proto_library dep %s must be a proto_library rule" % dep.label) - - # TODO(alexeagle): go/new-proto-library suggests - # > should not parse .proto files. Instead, they should use the descriptor - # > set output from proto_library - # but protobuf.js doesn't seem to accept that bin format - sources = depset(transitive = [sources, dep.proto.transitive_sources]) - - output_name = ctx.attr.output_name or ctx.label.name - - js_es5 = _run_pbjs( - ctx.actions, - ctx.executable, - output_name, - sources, - amd_name = "/".join([p for p in [ - ctx.workspace_name, - ctx.label.package, - ] if p]), - ) - js_es6 = _run_pbjs( - ctx.actions, - ctx.executable, - output_name, - sources, - suffix = ".closure.js", - wrap = "es6", - ) - dts = _run_pbts(ctx.actions, ctx.executable, js_es6) - - # Return a structure that is compatible with the deps[] of a ts_library. - return struct( - files = depset([dts]), - typescript = struct( - declarations = depset([dts]), - transitive_declarations = depset([dts]), - type_blacklisted_declarations = depset(), - es5_sources = depset([js_es5]), - es6_sources = depset([js_es6]), - transitive_es5_sources = depset(), - transitive_es6_sources = depset([js_es6]), - ), - ) - -ts_proto_library = rule( - implementation = _ts_proto_library, - attrs = { - "output_name": attr.string( - doc = """Name of the resulting module, which you will import from. - If not specified, the name will match the target's name.""", - ), - "deps": attr.label_list(doc = "proto_library targets"), - "_pbjs": attr.label( - default = Label("//internal/protobufjs:pbjs"), - executable = True, - cfg = "host", - ), - "_pbts": attr.label( - default = Label("//internal/protobufjs:pbts"), - executable = True, - cfg = "host", - ), - }, -) -""" -Wraps https://github.com/dcodeIO/protobuf.js for use in Bazel. - -`ts_proto_library` has identical outputs to `ts_library`, so it can be used anywhere -a `ts_library` can appear, such as in the `deps[]` of another `ts_library`. - -Example: - -``` -load("@npm_bazel_typescript//:defs.bzl", "ts_library", "ts_proto_library") - -proto_library( - name = "car_proto", - srcs = ["car.proto"], -) - -ts_proto_library( - name = "car", - deps = [":car_proto"], -) - -ts_library( - name = "test_lib", - testonly = True, - srcs = ["car.spec.ts"], - deps = [":car"], -) -``` - -Note in this example we named the `ts_proto_library` rule `car` so that the -result will be `car.d.ts`. This means our TypeScript code can just -`import {symbols} from './car'`. Use the `output_name` attribute if you want to -name the rule differently from the output file. - -The JavaScript produced by protobuf.js has a runtime dependency on a support library. -Under devmode (e.g. `ts_devserver`, `ts_web_test_suite`) you'll need to include these scripts -in the `bootstrap` phase (before Require.js loads). You can use the label -`@npm_bazel_typescript//:protobufjs_bootstrap_scripts` to reference these scripts -in the `bootstrap` attribute of `ts_web_test_suite` or `ts_devserver`. - -To complete the example above, you could write a `ts_web_test_suite`: - -``` -load("@npm_bazel_karma//:defs.bzl", "ts_web_test_suite") - -ts_web_test_suite( - name = "test", - deps = ["test_lib"], - bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"], - browsers = [ - "@io_bazel_rules_webtesting//browsers:chromium-local", - "@io_bazel_rules_webtesting//browsers:firefox-local", - ], -) -``` -""" diff --git a/internal/protobufjs/yarn.lock b/internal/protobufjs/yarn.lock deleted file mode 100644 index caa71009..00000000 --- a/internal/protobufjs/yarn.lock +++ /dev/null @@ -1,467 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" - -"@protobufjs/base64@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" - -"@protobufjs/codegen@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" - -"@protobufjs/eventemitter@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" - -"@protobufjs/fetch@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" - dependencies: - "@protobufjs/aspromise" "^1.1.1" - "@protobufjs/inquire" "^1.1.0" - -"@protobufjs/float@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" - -"@protobufjs/inquire@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" - -"@protobufjs/path@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" - -"@protobufjs/pool@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" - -"@protobufjs/utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" - -"@types/long@^3.0.32": - version "3.0.32" - resolved "https://registry.yarnpkg.com/@types/long/-/long-3.0.32.tgz#f4e5af31e9e9b196d8e5fca8a5e2e20aa3d60b69" - -"@types/node@^8.9.4": - version "8.10.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.10.tgz#fec07bc2ad549d9e6d2f7aa0fb0be3491b83163a" - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^5.5.0: - version "5.5.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -babylon@7.0.0-beta.19: - version "7.0.0-beta.19" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.19.tgz#e928c7e807e970e0536b078ab3e0c48f9e052503" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -bluebird@~3.5.0: - version "3.5.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -catharsis@~0.8.9: - version "0.8.9" - resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.8.9.tgz#98cc890ca652dd2ef0e70b37925310ff9e90fc8b" - dependencies: - underscore-contrib "~0.3.0" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -decamelize@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -escape-string-regexp@^1.0.2, 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" - -escodegen@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -espree@^3.5.3: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" - -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -graceful-fs@^4.1.9: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -js2xmlparser@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-3.0.0.tgz#3fb60eaa089c5440f9319f51760ccd07e2499733" - dependencies: - xmlcreate "^1.0.1" - -jsdoc@^3.5.5: - version "3.5.5" - resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.5.5.tgz#484521b126e81904d632ff83ec9aaa096708fa4d" - dependencies: - babylon "7.0.0-beta.19" - bluebird "~3.5.0" - catharsis "~0.8.9" - escape-string-regexp "~1.0.5" - js2xmlparser "~3.0.0" - klaw "~2.0.0" - marked "~0.3.6" - mkdirp "~0.5.1" - requizzle "~0.2.1" - strip-json-comments "~2.0.1" - taffydb "2.6.2" - underscore "~1.8.3" - -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -klaw@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-2.0.0.tgz#59c128e0dc5ce410201151194eeb9cbf858650f6" - dependencies: - graceful-fs "^4.1.9" - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -marked@~0.3.6: - version "0.3.19" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optionator@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - 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-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -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" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -"protobufjs@github:dcodeIO/protobuf.js#65d113b0079fa2570837f3cf95268ce24714a248": - version "6.8.7" - resolved "https://codeload.github.com/dcodeIO/protobuf.js/tar.gz/65d113b0079fa2570837f3cf95268ce24714a248" - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^3.0.32" - "@types/node" "^8.9.4" - long "^4.0.0" - -repeat-string@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -requizzle@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.1.tgz#6943c3530c4d9a7e46f1cddd51c158fc670cdbde" - dependencies: - underscore "~1.6.0" - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -semver@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -source-map@~0.5.1: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-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" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -taffydb@2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" - -tmp@0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -uglify-js@^2.8.29: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -underscore-contrib@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/underscore-contrib/-/underscore-contrib-0.3.0.tgz#665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7" - dependencies: - underscore "1.6.0" - -underscore@1.6.0, underscore@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" - -underscore@~1.8.3: - version "1.8.3" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -xmlcreate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-1.0.2.tgz#fa6bf762a60a413fb3dd8f4b03c5b269238d308f" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" diff --git a/internal/ts_config.bzl b/internal/ts_config.bzl deleted file mode 100644 index db56b397..00000000 --- a/internal/ts_config.bzl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2017 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"tsconfig.json files using extends" - -TsConfigInfo = provider() - -def _ts_config_impl(ctx): - files = depset([ctx.file.src]) - return [DefaultInfo(files = files), TsConfigInfo(deps = ctx.files.deps)] - -ts_config = rule( - implementation = _ts_config_impl, - attrs = { - "src": attr.label( - doc = """The tsconfig.json file passed to the TypeScript compiler""", - allow_single_file = True, - mandatory = True, - ), - "deps": attr.label_list( - doc = """Additional tsconfig.json files referenced via extends""", - allow_files = True, - mandatory = True, - ), - }, -) -"""Allows a tsconfig.json file to extend another file. - -Normally, you just give a single `tsconfig.json` file as the tsconfig attribute -of a `ts_library` rule. However, if your `tsconfig.json` uses the `extends` -feature from TypeScript, then the Bazel implementation needs to know about that -extended configuration file as well, to pass them both to the TypeScript compiler. -""" diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index 16c3e40c..e37ca2f7 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -35,27 +35,6 @@ def ts_setup_workspace(): # 0.16.8: ng_package fix for packaging binary files check_rules_nodejs_version("0.16.8") - # Included here for backward compatability for downstream repositories - # that use @build_bazel_rules_typescript_tsc_wrapped_deps such as rxjs. - # @build_bazel_rules_typescript_tsc_wrapped_deps is not used locally. - yarn_install( - name = "build_bazel_rules_typescript_tsc_wrapped_deps", - package_json = "@npm_bazel_typescript//internal:tsc_wrapped/package.json", - yarn_lock = "@npm_bazel_typescript//internal:tsc_wrapped/yarn.lock", - ) - - yarn_install( - name = "build_bazel_rules_typescript_devserver_deps", - package_json = "@npm_bazel_typescript//internal/devserver:package.json", - yarn_lock = "@npm_bazel_typescript//internal/devserver:yarn.lock", - ) - - yarn_install( - name = "build_bazel_rules_typescript_protobufs_compiletime_deps", - package_json = "@npm_bazel_typescript//internal/protobufjs:package.json", - yarn_lock = "@npm_bazel_typescript//internal/protobufjs:yarn.lock", - ) - # BEGIN-DEV-ONLY def ts_setup_dev_workspace(): """ diff --git a/internal/tsc_wrapped/yarn.lock b/internal/tsc_wrapped/yarn.lock index af6b06ff..de1c0b0c 100644 --- a/internal/tsc_wrapped/yarn.lock +++ b/internal/tsc_wrapped/yarn.lock @@ -36,13 +36,18 @@ balanced-match@^1.0.0: integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" - integrity sha1-wHshHHyVLsH479Uad+8NHTmQopI= + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + bytebuffer@~5: version "5.0.1" resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" @@ -207,10 +212,11 @@ protobufjs@5.0.3: yargs "^3.10.0" source-map-support@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76" - integrity sha512-eKkTgWYeBOQqFGXRfKabMFdnWepo51vWqEdoeikaEPFiJC7MCU5j2h4+6Q8npkZTeLGbSyecZvRxiSoWl3rh+w== + version "0.5.10" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" + integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== dependencies: + buffer-from "^1.0.0" source-map "^0.6.0" source-map@^0.6.0: @@ -252,9 +258,9 @@ tsickle@0.28.0: source-map-support "^0.5.0" tslib@^1.8.1: - version "1.9.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" - integrity sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ== + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== tsutils@2.27.2: version "2.27.2" diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index 4946205b..2e59f91b 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") +load("//javascript/typescript:build_defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 2108c6bc..47e09ec7 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") +load("//javascript/typescript:build_defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index 4a1c05d3..c09ea5f8 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") +load("//javascript/typescript:build_defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index 6371d070..7dc59596 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") +load("//javascript/typescript:build_defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index 917c3ef9..bc8c34b3 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//third_party/bazel_rules/rules_typescript:defs.bzl", "ts_library") +load("//javascript/typescript:build_defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/package.bzl b/package.bzl index e19ba502..ae42990d 100644 --- a/package.bzl +++ b/package.bzl @@ -12,19 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Package file which defines npm_bazel_typescript dependencies +"""Package file which defines build dependencies """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -def rules_typescript_dependencies(): - print("""DEPRECATION WARNING: - rules_typescript_dependencies is no longer needed, and will be removed in a future release. - We assume you will fetch rules_nodejs in your WORKSPACE file, and no other dependencies remain here. - Simply remove any calls to this function and the corresponding call to - load("@npm_bazel_typescript//:package.bzl", "rules_typescript_dependencies") - """) - def rules_typescript_dev_dependencies(): """ Fetch dependencies needed for local development. @@ -38,11 +30,11 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.5/rules_nodejs-0.18.5.tar.gz"], - sha256 = "c8cd6a77433f7d3bb1f4ac87f15822aa102989f8e9eb1907ca0cad718573985b", + sha256 = "213dcf7e72f3acd4d1e369b7a356f3e5d9560f380bd655b13b7c0ea425d7c419", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.9/rules_nodejs-0.27.9.tar.gz"], ) - # For running skylint + # For protocol buffers _maybe( http_archive, name = "io_bazel", @@ -80,29 +72,6 @@ def rules_typescript_dev_dependencies(): sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79", ) - # io_bazel_rules_webtesting depends on bazel_skylib. It is installed by - # web_test_repositories() but we depend on it here in case users don't call - # web_test_repositories(). This will get cleaned up by https://github.com/bazelbuild/rules_typescript/pull/374 - # which introduces npm_bazel_karma with its own defs.bzl file - # that will allow this dep to be removed from rules_typescript_dependencies() - _maybe( - http_archive, - name = "bazel_skylib", - url = "https://github.com/bazelbuild/bazel-skylib/archive/d7c5518fa061ae18a20d00b14082705d3d2d885d.zip", - strip_prefix = "bazel-skylib-d7c5518fa061ae18a20d00b14082705d3d2d885d", - ) - - ############################################# - # Dependencies for generating documentation # - ############################################# - - http_archive( - name = "io_bazel_rules_sass", - urls = ["https://github.com/bazelbuild/rules_sass/archive/8ccf4f1c351928b55d5dddf3672e3667f6978d60.zip"], # 2018-11-23 - strip_prefix = "rules_sass-8ccf4f1c351928b55d5dddf3672e3667f6978d60", - sha256 = "894d7928df8da85e263d743c8434d4c10ab0a3f0708fed0d53394e688e3faf70", - ) - def _maybe(repo_rule, name, **kwargs): if name not in native.existing_rules(): repo_rule(name = name, **kwargs) diff --git a/package.json b/package.json index b0579be1..3d4a646d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@bazel/bazel": "~0.22.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/typescript": "0.19.1", + "@bazel/typescript": "0.27.9", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", diff --git a/protractor.conf.js b/protractor.conf.js deleted file mode 100644 index ae5555b5..00000000 --- a/protractor.conf.js +++ /dev/null @@ -1,13 +0,0 @@ -exports.config = { - suites: { - app: 'bazel-bin/examples/app/*_e2e_test.js', - protocol_buffers: 'bazel-bin/examples/protocol_buffers/*_e2e_test.js', - }, - capabilities: { - browserName: 'chrome', - chromeOptions: {args: ['--no-sandbox']} - }, - directConnect: true, - baseUrl: 'http://localhost:8080/', - framework: 'jasmine', -}; diff --git a/ts_auto_deps/ts_auto_deps.js b/ts_auto_deps/ts_auto_deps.js deleted file mode 100644 index 68f4f7e8..00000000 --- a/ts_auto_deps/ts_auto_deps.js +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env node - -// This file is a shim to execute the ts_auto_deps binary from the right platform-specific package. -const os = require('os'); -const fs = require('fs'); -const path = require('path'); -const spawnSync = require('child_process').spawnSync; - -/** - * @return '.exe' for Windows and '' for all other platforms - */ -function getNativeBinaryExt() { - return os.platform() === 'win32' ? '.exe' : ''; -} - -/** - * @return the native `ts_auto_deps` binary for the current platform - * @throws when the `ts_auto_deps` executable can not be found - */ -function getNativeBinary() { - try { - return require.resolve(`./ts_auto_deps-${os.platform()}_${os.arch()}${getNativeBinaryExt()}`); - } catch (e) { - const message = 'ts_auto_deps executable not found for your platform: ' + - `(${os.platform()}_${os.arch()})\n`; - throw new Error(message); - } -} - -/** Starts a new synchronous child process that runs with the specified arguments. */ -const spawnedProcess = spawnSync(getNativeBinary(), process.argv.slice(2), {stdio: 'inherit'}); - -// Ensure that this wrapper script exits with the same exit code as the child process. -process.exit(spawnedProcess.status); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..51648625 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "strict": true, + "lib": ["es2015.promise", "dom", "es5"], + // Explicitly set types settings so typescript doesn't auto-discover types. + // If all types are discovered then all types need to be included as deps + // or typescript may error out with TS2688: Cannot find type definition file for 'foo'. + "types": [] + } + } + + \ No newline at end of file diff --git a/version.bzl b/version.bzl deleted file mode 100644 index 35f5df82..00000000 --- a/version.bzl +++ /dev/null @@ -1 +0,0 @@ -COMPAT_VERSION = "0.25.0" diff --git a/yarn.lock b/yarn.lock index eb756630..6d1c5390 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,14 +49,14 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= -"@bazel/typescript@0.19.1": - version "0.19.1" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.19.1.tgz#61dd57c0ab8a6c9930d2463d44e9522ec007fe3a" - integrity sha512-rNpNNRAQmtb+AdX5CvLzDGOADO2PRbZWoQfd7I2NXTuWk8BaJEb0D5W+WxQGcNim6qTUD1JLAknfOVYICf3OaQ== +"@bazel/typescript@0.27.9": + version "0.27.9" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.27.9.tgz#6cd6a7162167bec67cfae3a3b973a6bfe8c65f3e" + integrity sha512-o/MDGV2YNHMrsxJMpjWHQwezR7jlh7LJ+7FEmzG/LrepRtyYdaDev5bRhVn2XxnD7cPDx8zvyer35NJTnK0hnw== dependencies: - protobufjs "5.0.0" + protobufjs "5.0.3" + semver "5.6.0" source-map-support "0.5.9" - tsickle "0.28.0" tsutils "2.27.2" "@types/jasmine@^2.8.2": @@ -1179,17 +1179,6 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@^5.0.10: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -1924,7 +1913,7 @@ mime@^2.3.1: resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== -"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -2271,16 +2260,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== -protobufjs@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1" - integrity sha1-QiMGMjPqlqwGPKK1VANSBNtST6E= - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^5.0.10" - yargs "^3.10.0" - protobufjs@5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" @@ -2762,14 +2741,6 @@ source-map-support@0.5.9: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.0: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" - integrity sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@~0.4.0: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" @@ -3003,16 +2974,6 @@ tree-kill@^1.1.0: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" integrity sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg== -tsickle@0.28.0: - version "0.28.0" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875" - integrity sha512-cb/Z4NlKMPGiIIbgmklfBJIxDl4EQoYqC+0/BnPxZWzWcUvikeOHFkkkEmabJVqKh47jUqOwU/uMAu6UvhicZg== - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.6.0" - source-map-support "^0.5.0" - tsickle@0.33.1: version "0.33.1" resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" From 21e300463ac13932a43ebfc34600e492be669f2d Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 1 Apr 2019 17:16:52 -0700 Subject: [PATCH 138/316] Restore missing copybara transform. BuildKite didn't catch it because the build succeeds there even if some packages don't load. I emailed bazel-engprod to get to the bottom of it. PiperOrigin-RevId: 241432310 --- internal/tsetse/tests/ban_expect_truthy_promise/BUILD | 2 +- internal/tsetse/tests/ban_promise_as_condition/BUILD | 2 +- internal/tsetse/tests/check_return_value/BUILD | 2 +- internal/tsetse/tests/equals_nan/BUILD | 2 +- internal/tsetse/tests/must_use_promises/BUILD | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index 2e59f91b..c8a7fa36 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//javascript/typescript:build_defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 47e09ec7..0e7e07d5 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//javascript/typescript:build_defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index c09ea5f8..c319f132 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//javascript/typescript:build_defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index 7dc59596..77062536 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//javascript/typescript:build_defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index bc8c34b3..eb9dcde9 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//javascript/typescript:build_defs.bzl", "ts_library") +load("@npm_bazel_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 From 768f6f27d62d8572ec5dc75b62fdc5ac319345e9 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 3 Apr 2019 04:37:45 -0700 Subject: [PATCH 139/316] Add an optional Fix to the Failure type in Tsetse. Nothing consumes this for now. PiperOrigin-RevId: 241706383 --- internal/tsetse/failure.ts | 29 +++++++++++++++++++--- internal/tsetse/language_service_plugin.ts | 16 ++++++------ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/internal/tsetse/failure.ts b/internal/tsetse/failure.ts index 2f055e37..56355adc 100644 --- a/internal/tsetse/failure.ts +++ b/internal/tsetse/failure.ts @@ -6,22 +6,45 @@ import * as ts from 'typescript'; * (1) The error code is defined by each individual Tsetse rule. * (2) The optional `source` property is set to `Tsetse` so the host (VS Code * for instance) would use that to indicate where the error comes from. + * (3) There's an optional suggestedFix field. */ export class Failure { constructor( - private sourceFile: ts.SourceFile, private start: number, - private end: number, private failureText: string, private code: number) {} + private readonly sourceFile: ts.SourceFile, + private readonly start: number, private readonly end: number, + private readonly failureText: string, private readonly code: number, + private readonly suggestedFix?: Fix) {} - toDiagnostic(): ts.Diagnostic { + /** + * This returns a structure compatible with ts.Diagnostic, but with added + * fields, for convenience and to support suggested fixes. + */ + toDiagnostic(): ts.Diagnostic&{end: number, fix?: Fix} { return { file: this.sourceFile, start: this.start, + end: this.end, // Not in ts.Diagnostic, but always useful for + // start-end-using systems. length: this.end - this.start, messageText: this.failureText, category: ts.DiagnosticCategory.Error, code: this.code, // source is the name of the plugin. source: 'Tsetse', + fix: this.suggestedFix }; } } + +/** + * A Fix is a potential repair to the associated Failure. + */ +export interface Fix { + /** + * The individual text replacements composing that fix. + */ + changes: IndividualChange[], +} +export interface IndividualChange { + sourceFile: ts.SourceFile, start: number, end: number, replacement: string +} diff --git a/internal/tsetse/language_service_plugin.ts b/internal/tsetse/language_service_plugin.ts index d20343a1..4969f4db 100644 --- a/internal/tsetse/language_service_plugin.ts +++ b/internal/tsetse/language_service_plugin.ts @@ -1,7 +1,5 @@ import * as ts from 'typescript/lib/tsserverlibrary'; - import * as pluginApi from '../tsc_wrapped/plugin_api'; - import {Checker} from './checker'; import {registerRules} from './runner'; @@ -14,10 +12,12 @@ function init() { const oldService = info.languageService; const program = oldService.getProgram(); - // Signature of `getProgram` is `getProgram(): Program | undefined;` in ts 3.1 - // so we must check if the return value is valid to compile with ts 3.1. + // Signature of `getProgram` is `getProgram(): Program | undefined;` in + // ts 3.1 so we must check if the return value is valid to compile with + // ts 3.1. if (!program) { - throw new Error('Failed to initialize tsetse language_service_plugin: program is undefined'); + throw new Error( + 'Failed to initialize tsetse language_service_plugin: program is undefined'); } const checker = new Checker(program); @@ -31,9 +31,9 @@ function init() { const proxy = pluginApi.createProxy(oldService); proxy.getSemanticDiagnostics = (fileName: string) => { const result = [...oldService.getSemanticDiagnostics(fileName)]; - result.push( - ...checker.execute(program.getSourceFile(fileName)!) - .map(failure => failure.toDiagnostic())); + // Note that this ignores suggested fixes. + result.push(...checker.execute(program.getSourceFile(fileName)!) + .map(failure => failure.toDiagnostic())); return result; }; return proxy; From e311bf85123b55d766a7efb5cb1f0e0d5623a7cc Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 3 Apr 2019 14:39:20 -0700 Subject: [PATCH 140/316] When choosing the canonical dep for an import, favor the dep that is already on the rule. PiperOrigin-RevId: 241808406 --- ts_auto_deps/analyze/analyze.go | 30 ++++----- ts_auto_deps/analyze/analyze_test.go | 2 +- ts_auto_deps/analyze/loader.go | 94 ++++++++++++++++++++-------- 3 files changed, 83 insertions(+), 43 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index a80a5543..b81c4b01 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -82,7 +82,7 @@ type TargetLoader interface { // // Only returns rules visible to currentPkg. If currentPkg is an empty string // returns all targets regardless of visibility. - LoadImportPaths(ctx context.Context, currentPkg, root string, paths []string) (map[string]*appb.Rule, error) + LoadImportPaths(ctx context.Context, targetToAnalyze *appb.Rule, currentPkg, root string, paths []string) (map[string]*appb.Rule, error) } // Analyzer uses a BuildLoader to generate dependency reports. @@ -315,9 +315,9 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo // resolveImports finds targets which provide the imported file or library // for imports without known targets. func (a *Analyzer) resolveImports(ctx context.Context, currentPkg, root string, targets map[string]*resolvedTarget) error { - var paths []string - needingResolution := make(map[string][]*ts_auto_depsImport) for _, target := range targets { + var paths []string + needingResolution := make(map[string][]*ts_auto_depsImport) for _, imports := range target.imports { handlingImports: for _, imp := range imports { @@ -343,18 +343,18 @@ func (a *Analyzer) resolveImports(ctx context.Context, currentPkg, root string, imp.knownTarget = d } } - } - if len(needingResolution) == 0 { - return nil - } - res, err := a.loader.LoadImportPaths(ctx, currentPkg, root, paths) - if err != nil { - return err - } - for path, imports := range needingResolution { - if target, ok := res[path]; ok { - for _, imp := range imports { - imp.knownTarget = redirectedLabel(target) + if len(needingResolution) == 0 { + continue + } + res, err := a.loader.LoadImportPaths(ctx, target.rule, currentPkg, root, paths) + if err != nil { + return err + } + for path, imports := range needingResolution { + if target, ok := res[path]; ok { + for _, imp := range imports { + imp.knownTarget = redirectedLabel(target) + } } } } diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index 9e97220a..140e0259 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -67,7 +67,7 @@ func (bl *fakeTargetLoader) byLabel(label, value string) { bl.targetsByLabels[label] = value } -func (bl *fakeTargetLoader) LoadImportPaths(_ context.Context, _, _ string, paths []string) (map[string]*appb.Rule, error) { +func (bl *fakeTargetLoader) LoadImportPaths(_ context.Context, _ *appb.Rule, _, _ string, paths []string) (map[string]*appb.Rule, error) { return bl.loadRules(bl.targetsByImportPaths, paths) } diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index c42ddb8a..90b61fa3 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -153,7 +153,7 @@ func possibleFilepaths(importPath string) []string { // LoadImportPaths uses Bazel Query to load targets associated with import // paths from BUILD files. -func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg, workspaceRoot string, paths []string) (map[string]*appb.Rule, error) { +func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, targetToAnalyze *appb.Rule, currentPkg, workspaceRoot string, paths []string) (map[string]*appb.Rule, error) { debugf("loading imports visible to %q relative to %q: %q", currentPkg, workspaceRoot, paths) results := make(map[string]*appb.Rule) @@ -270,7 +270,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg matchingDeps = append(matchingDeps, candidate) } if len(matchingDeps) > 0 { - canonicalRule, err := q.chooseCanonicalRule(currentPkg, matchingDeps) + canonicalRule, err := q.chooseCanonicalDep(currentPkg, targetToAnalyze, matchingDeps) if err != nil { return nil, err } @@ -282,11 +282,11 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg return results, nil } -// chooseCanonicalRule chooses between rules which include the imported file as +// chooseCanonicalDep chooses between rules which include the imported file as // a source (ie the rule that includes the file as a src, and any reexporting // libraries). // -// It filters the rules in a 2 stage process: +// It filters the rules in a 3 stage process: // // 1. If only one of the rules is visible, choose that one, since the rule // creator intended it to be imported. @@ -294,41 +294,81 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, currentPkg // 2. If all or none of the rules are visible, choose the rule that directly // includes the file as a src, since that reduces the chance of introducing // circular dependencies. -func (q *QueryBasedTargetLoader) chooseCanonicalRule(currentPkg string, rules []*appb.Rule) (*appb.Rule, error) { +// +// 3. Choose the rule that is already included as a dep. +func (q *QueryBasedTargetLoader) chooseCanonicalDep(currentPkg string, targetToAnalyze *appb.Rule, deps []*appb.Rule) (*appb.Rule, error) { // check for visibility - var labels []string - for _, r := range rules { - labels = append(labels, r.GetName()) - } - visibleRulesMap, err := q.LoadRules(currentPkg, labels) - if err != nil { - return nil, err - } + filterForVisibility := func(deps []*appb.Rule) ([]*appb.Rule, error) { + var labels []string + for _, d := range deps { + labels = append(labels, d.GetName()) + } + visibleDepsMap, err := q.LoadRules(currentPkg, labels) + if err != nil { + return nil, err + } - var visibleRules []*appb.Rule - for _, r := range visibleRulesMap { - if r != nil { - visibleRules = append(visibleRules, r) + var visibleDeps []*appb.Rule + for _, d := range visibleDepsMap { + if d != nil { + visibleDeps = append(visibleDeps, d) + } } - } - if len(visibleRules) == 1 { - return visibleRules[0], nil - } else if len(visibleRules) > 0 { - rules = visibleRules + return visibleDeps, nil } // if there's a visible reexporting lib and a visible lib with the src, favor // the lib with the src, to reduce the chance of introducing a circular // dependency - for _, r := range rules { - if !isReexportingLib(r) { - return r, nil + filterForBaseLibs := func(deps []*appb.Rule) ([]*appb.Rule, error) { + var baseDeps []*appb.Rule + for _, d := range deps { + if !isReexportingLib(d) { + baseDeps = append(baseDeps, d) + } + } + + return baseDeps, nil + } + + // favor the dep that's already on the rule + filterForExistingDeps := func(deps []*appb.Rule) ([]*appb.Rule, error) { + var existingDeps []*appb.Rule + for _, d := range deps { + for _, existing := range listAttribute(targetToAnalyze, "deps") { + if d.GetName() == existing { + existingDeps = append(existingDeps, d) + } + } + } + + return existingDeps, nil + } + + filters := []func(deps []*appb.Rule) ([]*appb.Rule, error){ + filterForVisibility, + filterForBaseLibs, + filterForExistingDeps, + } + + // for each filter, return if it returned a single rule, narrow the set of deps if + // it discarded some, but not all, and try the full set with the next filter if it + // discarded them all + for _, filter := range filters { + filteredDeps, err := filter(deps) + if err != nil { + return nil, err + } + if len(filteredDeps) == 1 { + return filteredDeps[0], nil + } else if len(filteredDeps) > 0 { + deps = filteredDeps } } - // if no rules matched the filter, just return the first rule - return rules[0], nil + // no filter got down to a single rule, just return the first + return deps[0], nil } // ruleLabel returns the label for a target which is a rule. Returns an error if From 766573e6e29025992767e38bdde09e2224a7f4cf Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 4 Apr 2019 07:26:47 -0700 Subject: [PATCH 141/316] Add a fix to the error reporting mechanism in Tsetse. I forgot that Rules don't generate their own Failures... Now there's a way to get a Fix in, though it's still not consumed. PiperOrigin-RevId: 241926568 --- internal/tsetse/checker.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 72fdbaa4..9fba3b70 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -5,8 +5,8 @@ import * as ts from 'typescript'; +import {Failure, Fix} from './failure'; -import {Failure} from './failure'; /** * A Handler contains a handler function and its corresponding error code so @@ -28,7 +28,7 @@ export class Checker { */ private nodeHandlersMap = new Map(); private failures: Failure[] = []; - private currentSourceFile: ts.SourceFile | undefined; + private currentSourceFile: ts.SourceFile|undefined; // currentCode will be set before invoking any handler functions so the value // initialized here is never used. private currentCode = 0; @@ -48,8 +48,8 @@ export class Checker { * handlers, the source file AST will be traversed. */ on( - nodeKind: T['kind'], - handlerFunction: (checker: Checker, node: T) => void, code: number) { + nodeKind: T['kind'], handlerFunction: (checker: Checker, node: T) => void, + code: number) { const newHandler: Handler = {handlerFunction, code}; const registeredHandlers: Handler[]|undefined = this.nodeHandlersMap.get(nodeKind); @@ -64,7 +64,8 @@ export class Checker { * Add a failure with a span. addFailure() is currently private because * `addFailureAtNode` is preferred. */ - private addFailure(start: number, end: number, failureText: string) { + private addFailure( + start: number, end: number, failureText: string, fix?: Fix) { if (!this.currentSourceFile) { throw new Error('Source file not defined'); } @@ -76,15 +77,15 @@ export class Checker { } const failure = new Failure( - this.currentSourceFile, start, end, failureText, this.currentCode); + this.currentSourceFile, start, end, failureText, this.currentCode, fix); this.failures.push(failure); } - addFailureAtNode(node: ts.Node, failureText: string) { + addFailureAtNode(node: ts.Node, failureText: string, fix?: Fix) { // node.getStart() takes a sourceFile as argument whereas node.getEnd() // doesn't need it. this.addFailure( - node.getStart(this.currentSourceFile), node.getEnd(), failureText); + node.getStart(this.currentSourceFile), node.getEnd(), failureText, fix); } /** From daa1a7e060dcf34fdccb30d0fd67b8bd1add07b1 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 4 Apr 2019 10:18:59 -0700 Subject: [PATCH 142/316] Register all ts_libraries with ts_development_sources/ts_config, not just the last one in a file. PiperOrigin-RevId: 241953581 --- ts_auto_deps/updater/test_register.go | 2 +- ts_auto_deps/updater/updater.go | 30 +++++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index b5f9e67b..130e3d1a 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -56,7 +56,7 @@ func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (boo if err != nil { return false, err } - if tr := getRule(bld, "ts_library", ruleTypeTest); tr != nil { + for _, tr := range getRules(bld, "ts_library", ruleTypeTest) { // don't register all_test libraries themselves if isAllTestLibrary(bld, tr) { continue diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 8c156eda..828d46f1 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -995,10 +995,10 @@ func updateWebAssets(ctx context.Context, buildFilePath string, bld *build.File) } // Add to the last rule, to match behaviour with *.ts sources. - lastModule := getRule(bld, "ng_module", ruleTypeRegular) + lastModule := getLastRule(bld, "ng_module", ruleTypeRegular) if lastModule == nil { // Fall back to using any ng_module - lastModule = getRule(bld, "ng_module", ruleTypeAny) + lastModule = getLastRule(bld, "ng_module", ruleTypeAny) } if lastModule == nil { // Should not happen by preconditions of this function. @@ -1016,7 +1016,7 @@ func updateWebAssets(ctx context.Context, buildFilePath string, bld *build.File) // rt. If there's no such rule, it creates a new rule with the given ruleName. // If there is more than one rule matching, it returns the *last* rule. func getOrCreateRule(bld *build.File, ruleName, ruleKind string, rt ruleType) *build.Rule { - if r := getRule(bld, ruleKind, rt); r != nil { + if r := getLastRule(bld, ruleKind, rt); r != nil { return r } @@ -1086,15 +1086,27 @@ func targetRegisteredInRule(bld *build.File, ruleKind string, rt ruleType, targe // getRule returns the last rule in bld that has the given ruleKind and matches // the specified rt value. -func getRule(bld *build.File, ruleKind string, rt ruleType) *build.Rule { - rs := bld.Rules("") - for i := len(rs) - 1; i >= 0; i-- { - r := rs[i] +func getLastRule(bld *build.File, ruleKind string, rt ruleType) *build.Rule { + rules := getRules(bld, ruleKind, rt) + + if len(rules) == 0 { + return nil + } + + return rules[len(rules)-1] +} + +// getRules returns all the rules in bld that have the given ruleKind and +// matches the specified rt value. +func getRules(bld *build.File, ruleKind string, rt ruleType) []*build.Rule { + var rules []*build.Rule + for _, r := range bld.Rules("") { if ruleMatches(bld, r, ruleKind, rt) { - return r + rules = append(rules, r) } } - return nil + + return rules } // FilterPaths filters the given paths, returning the deduplicated set of From 8ec10174c618cde2b33f5b9541115050d5f0bf7f Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 4 Apr 2019 10:25:00 -0700 Subject: [PATCH 143/316] internal change PiperOrigin-RevId: 241954724 --- package.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.bzl b/package.bzl index ae42990d..6ec6afe2 100644 --- a/package.bzl +++ b/package.bzl @@ -73,5 +73,5 @@ def rules_typescript_dev_dependencies(): ) def _maybe(repo_rule, name, **kwargs): - if name not in native.existing_rules(): + if not native.existing_rule(name): repo_rule(name = name, **kwargs) From 0418d4db5b28a113c0c2eb1025867ab74f65f050 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 5 Apr 2019 14:55:20 -0700 Subject: [PATCH 144/316] Use chooseCanonicalDep to choose the dep when finding a module by name, instead of randomly selecting the first matching dep. PiperOrigin-RevId: 242199615 --- ts_auto_deps/analyze/loader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 90b61fa3..4a98600f 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -246,9 +246,9 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, targetToAn // get the file path that corresponds to the normalized typescript import // path filePath := labelToPath(label) - var matchingDeps []*appb.Rule allRules := pkgToAllRules[pkg] actualToAlias := pkgToActualToAlias[pkg] + var matchingDeps []*appb.Rule for _, candidate := range typeScriptRules(allRules) { // check if the rule has the file or the generator of the file in its // srcs From 5570e62c12bd432bc37b0693204c6e68c26d5cda Mon Sep 17 00:00:00 2001 From: martinprobst Date: Fri, 5 Apr 2019 15:46:48 -0700 Subject: [PATCH 145/316] Internal change. PiperOrigin-RevId: 242208600 --- internal/tsc_wrapped/compiler_host.ts | 32 +++++++++++++++---- internal/tsc_wrapped/tsc_wrapped.ts | 36 +++++++++++++++++++-- internal/tsc_wrapped/tsc_wrapped_test.ts | 40 ++++++++++++++++++------ internal/tsc_wrapped/tsconfig.ts | 24 +++++++++++--- internal/tsc_wrapped/worker.ts | 2 +- 5 files changed, 110 insertions(+), 24 deletions(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index e0b2d031..9008a087 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -42,13 +42,23 @@ function validateBazelOptions(bazelOpts: BazelOptions) { if (bazelOpts.compilationTargetSrc && bazelOpts.compilationTargetSrc.length > 1) { - throw new Error("In JS transpilation mode, only one file can appear in " + - "bazelOptions.compilationTargetSrc."); + throw new Error( + 'In JS transpilation mode, only one file can appear in ' + + 'bazelOptions.compilationTargetSrc.'); } - if (!bazelOpts.transpiledJsOutputFileName) { - throw new Error("In JS transpilation mode, transpiledJsOutputFileName " + - "must be specified in tsconfig."); + if (!bazelOpts.transpiledJsOutputFileName && + !bazelOpts.transpiledJsOutputDirectory) { + throw new Error( + 'In JS transpilation mode, either transpiledJsOutputFileName or ' + + 'transpiledJsOutputDirectory must be specified in tsconfig.'); + } + + if (bazelOpts.transpiledJsOutputFileName && + bazelOpts.transpiledJsOutputDirectory) { + throw new Error( + 'In JS transpilation mode, cannot set both ' + + 'transpiledJsOutputFileName and transpiledJsOutputDirectory.'); } } @@ -483,7 +493,17 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { fileName = this.flattenOutDir(fileName); if (this.bazelOpts.isJsTranspilation) { - fileName = this.bazelOpts.transpiledJsOutputFileName!; + if (this.bazelOpts.transpiledJsOutputFileName) { + fileName = this.bazelOpts.transpiledJsOutputFileName!; + } else { + // Strip the input directory path off of fileName to get the logical + // path within the input directory. + fileName = + path.relative(this.bazelOpts.transpiledJsInputDirectory!, fileName); + // Then prepend the output directory name. + fileName = + path.join(this.bazelOpts.transpiledJsOutputDirectory!, fileName); + } } else if (!this.bazelOpts.es5Mode) { // Write ES6 transpiled files to *.closure.js. if (this.bazelOpts.locale) { diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 2062b735..9113ede7 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -47,6 +47,12 @@ const cache = new ProgramAndFileCache(debug); function isCompilationTarget( bazelOpts: BazelOptions, sf: ts.SourceFile): boolean { + if (bazelOpts.isJsTranspilation && bazelOpts.transpiledJsInputDirectory) { + // transpiledJsInputDirectory is a relative logical path, so we cannot + // compare it to the resolved, absolute path of sf here. + // compilationTargetSrc is resolved, so use that for the comparison. + return sf.fileName.startsWith(bazelOpts.compilationTargetSrc[0]); + } return (bazelOpts.compilationTargetSrc.indexOf(sf.fileName) !== -1); } @@ -114,6 +120,24 @@ export function gatherDiagnostics( return diagnostics; } +/** + * expandSourcesFromDirectories finds any directories under filePath and expands + * them to their .js or .ts contents. + */ +function expandSourcesFromDirectories(fileList: string[], filePath: string) { + if (!fs.statSync(filePath).isDirectory()) { + if (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || + filePath.endsWith('.js')) { + fileList.push(filePath); + } + return; + } + const entries = fs.readdirSync(filePath); + for (const entry of entries) { + expandSourcesFromDirectories(fileList, path.join(filePath, entry)); + } +} + /** * Runs a single build, returning false on failure. This is potentially called * multiple times (once per bazel request) when running as a bazel worker. @@ -147,6 +171,12 @@ function runOneBuild( angularCompilerOptions } = parsed; + const sourceFiles: string[] = []; + for (let i = 0; i < files.length; i++) { + const filePath = files[i]; + expandSourcesFromDirectories(sourceFiles, filePath); + } + if (bazelOpts.maxCacheSizeMb !== undefined) { const maxCacheSizeBytes = bazelOpts.maxCacheSizeMb * (1 << 20); cache.setMaxCacheSize(maxCacheSizeBytes); @@ -170,7 +200,7 @@ function runOneBuild( const perfTracePath = bazelOpts.perfTracePath; if (!perfTracePath) { return runFromOptions( - fileLoader, options, bazelOpts, files, disabledTsetseRules, + fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, angularCompilerOptions); } @@ -178,7 +208,7 @@ function runOneBuild( const success = perfTrace.wrap( 'runOneBuild', () => runFromOptions( - fileLoader, options, bazelOpts, files, disabledTsetseRules, + fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, angularCompilerOptions)); if (!success) return false; // Force a garbage collection pass. This keeps our memory usage @@ -212,7 +242,7 @@ function runFromOptions( const moduleResolver = bazelOpts.isJsTranspilation ? makeJsModuleResolver(bazelOpts.workspaceName) : ts.resolveModuleName; - const tsickleCompilerHost: CompilerHost = new CompilerHost( + const tsickleCompilerHost = new CompilerHost( files, options, bazelOpts, compilerHostDelegate, fileLoader, moduleResolver); let compilerHost: PluginCompilerHost = tsickleCompilerHost; diff --git a/internal/tsc_wrapped/tsc_wrapped_test.ts b/internal/tsc_wrapped/tsc_wrapped_test.ts index cc5af0af..3f77c07f 100644 --- a/internal/tsc_wrapped/tsc_wrapped_test.ts +++ b/internal/tsc_wrapped/tsc_wrapped_test.ts @@ -149,12 +149,16 @@ describe('compiler host', () => { moduleRoots = {} as {[moduleName: string]: string}, isJsTranspilation = false, transpiledJsOutputFileName = undefined as string | undefined, + transpiledJsInputDirectory = undefined as string | undefined, + transpiledJsOutputDirectory = undefined as string | undefined, } = {}) { const bazelOpts = { ...defaultBazelOpts, es5Mode: es5, isJsTranspilation, transpiledJsOutputFileName, + transpiledJsInputDirectory, + transpiledJsOutputDirectory, } as BazelOptions; return new CompilerHost( [], COMPILER_OPTIONS, bazelOpts, delegateHost, testFileLoader, @@ -272,16 +276,32 @@ describe('compiler host', () => { ]); }); - it('writes to closureOptions.transpiledJsOutputFileName in JS transpilation mode', - () => { - createFakeGoogle3Host({ - isJsTranspilation: true, - transpiledJsOutputFileName: 'foo/bar/a/b.dev_es5.js', - }).writeFile('a/b.js', 'some.code();', false, undefined, []); - expect(Object.keys(writtenFiles)).toEqual([ - '/root/google3/blaze-out/k8-fastbuild/bin/foo/bar/a/b.dev_es5.js' - ]); - }); + describe('transpiled JS', () => { + it('writes to transpiledJsOutputFileName', () => { + const host = createFakeGoogle3Host({ + isJsTranspilation: true, + transpiledJsOutputFileName: 'foo/bar/a/b.dev_es5.js', + }); + host.writeFile('a/b.js', 'some.code();', false, undefined, []); + expect(Object.keys(writtenFiles)).toEqual([ + '/root/google3/blaze-out/k8-fastbuild/bin/foo/bar/a/b.dev_es5.js' + ]); + }); + + it('writes to transpiledJsOutputDirectory', () => { + const host = createFakeGoogle3Host({ + isJsTranspilation: true, + transpiledJsInputDirectory: 'foo/bar/jsinputdir', + transpiledJsOutputDirectory: 'foo/bar/jsoutputdir', + }); + host.writeFile( + 'foo/bar/jsinputdir/a/b.js', 'some.code();', false, undefined, + []); + expect(Object.keys(writtenFiles)).toEqual([ + '/root/google3/blaze-out/k8-fastbuild/bin/foo/bar/jsoutputdir/a/b.js' + ]); + }); + }); }); }); }); diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index f8460c34..c147d3b0 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -143,17 +143,33 @@ export interface BazelOptions { /** * If true, indicates that this job is transpiling JS sources. If true, only - * one file can appear in compilationTargetSrc, and transpiledJsOutputFileName - * must be set. + * one file can appear in compilationTargetSrc, and either + * transpiledJsOutputFileName or the transpiledJs*Directory options must be + * set. */ isJsTranspilation?: boolean; /** - * The path where the file containing the JS transpiled output should - * be written. Ignored if isJsTranspilation is false. + * The path where the file containing the JS transpiled output should be + * written. Ignored if isJsTranspilation is false. transpiledJsOutputFileName + * */ transpiledJsOutputFileName?: string; + /** + * The path where transpiled JS output should be written. Ignored if + * isJsTranspilation is false. Must not be set together with + * transpiledJsOutputFileName. + */ + transpiledJsInputDirectory?: string; + + /** + * The path where transpiled JS output should be written. Ignored if + * isJsTranspilation is false. Must not be set together with + * transpiledJsOutputFileName. + */ + transpiledJsOutputDirectory?: string; + /** * Whether the user provided an implementation shim for .d.ts files in the * compilation unit. diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 29983182..2f9828e7 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -26,7 +26,7 @@ export function debug(...args: Array) { * Write a message to stderr, which appears in the bazel log and is visible to * the end user. */ -export function log(...args: Array<{}>) { +export function log(...args: Array) { console.error.apply(console, args); } From 251db0e9eb3d5432ce3fd393d430e99d36d1f6ab Mon Sep 17 00:00:00 2001 From: lucassloan Date: Mon, 8 Apr 2019 14:16:47 -0700 Subject: [PATCH 146/316] Replicate blaze analyze's behavior with generated files. 1. If a library has all generated files, error. 2. If a library has a mix of literal and generated files, retain any unused deps, since they might have been manually added for the generated file. There were also some major changes to the tests, since work that was previously done in a separate method was moved into setSources(). PiperOrigin-RevId: 242537197 --- ts_auto_deps/analyze/analyze.go | 56 ++++---- ts_auto_deps/analyze/analyze_test.go | 187 ++++++++------------------- 2 files changed, 79 insertions(+), 164 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index b81c4b01..9e005cce 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -139,11 +139,16 @@ type resolvedTarget struct { missingSources []string // A map from the labels in the target's srcs to the Targets those // labels refer. - sources map[string]*appb.Target + sources map[string]*appb.Target + literalSourcePaths []string + generatedSourcePaths []string } // setSources sets the sources on t. It returns an error if one of the srcs of -// t's rule isn't in loadedSrcs. +// t's rule isn't in loadedSrcs. It also sorts the sources into literal and +// generated sources, setting literalSourcePaths and generatedSourcePaths. +// Returns an error if all the sources are generated - ts_auto_deps can't read the +// import statements to determine deps. func (t *resolvedTarget) setSources(loadedSrcs map[string]*appb.Target) error { for _, label := range listAttribute(t.rule, "srcs") { src := loadedSrcs[label] @@ -151,6 +156,14 @@ func (t *resolvedTarget) setSources(loadedSrcs map[string]*appb.Target) error { return fmt.Errorf("no source found for label %s", label) } t.sources[label] = src + if src.GetType() == appb.Target_SOURCE_FILE { + t.literalSourcePaths = append(t.literalSourcePaths, labelToPath(label)) + } else { + t.generatedSourcePaths = append(t.generatedSourcePaths, labelToPath(label)) + } + } + if len(t.literalSourcePaths) == 0 && len(t.generatedSourcePaths) > 0 { + return fmt.Errorf("rule has generated sources - cannot determine dependencies") } return nil } @@ -165,37 +178,12 @@ func (t *resolvedTarget) srcs() ([]string, error) { return srcs, nil } -// literalSrcPaths returns the file paths of the non-generated sources of t. -func (t *resolvedTarget) literalSrcPaths() ([]string, error) { - srcs := listAttribute(t.rule, "srcs") - if srcs == nil { - return nil, fmt.Errorf("target %q missing \"srcs\" attribute", t.label) - } - var literalFilePaths []string - for _, label := range listAttribute(t.rule, "srcs") { - src := t.sources[label] - if src == nil { - return nil, fmt.Errorf("src %q has no associated target", label) - } - // There's no syntactic way to determine if a label is a source file - // so check against the type of the relevant target - if src.GetType() == appb.Target_SOURCE_FILE { - literalFilePaths = append(literalFilePaths, labelToPath(label)) - } - } - return literalFilePaths, nil -} - // getAllLiteralSrcPaths returns the file paths of all the non-generated sources // of the targets. func getAllLiteralSrcPaths(targets map[string]*resolvedTarget) ([]string, error) { var allLiteralSrcPaths []string for _, t := range targets { - literalSrcPaths, err := t.literalSrcPaths() - if err != nil { - return nil, err - } - allLiteralSrcPaths = append(allLiteralSrcPaths, literalSrcPaths...) + allLiteralSrcPaths = append(allLiteralSrcPaths, t.literalSourcePaths...) } return allLiteralSrcPaths, nil @@ -292,10 +280,7 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo } } for _, t := range targets { - srcs, err := t.literalSrcPaths() - if err != nil { - return nil, err - } + srcs := t.literalSourcePaths for _, src := range srcs { v, ok := imports[src] if ok { @@ -570,7 +555,12 @@ func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyRepor // annotations. Unlike ts_declaration, there's no flag to remove them, so // there's no need to report a warning. default: - report.UnnecessaryDependency = append(report.UnnecessaryDependency, label) + // The contents of generated files aren't visible, so ts_auto_deps can't discover + // the import statements/deps that they contain. To be safe, don't remove + // any unused deps, since they might be used by the generated file(s). + if len(target.generatedSourcePaths) == 0 { + report.UnnecessaryDependency = append(report.UnnecessaryDependency, label) + } } } return report, nil diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index 140e0259..ff529b8d 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -7,8 +7,6 @@ import ( "os" "path/filepath" "reflect" - "sort" - "strconv" "strings" "testing" @@ -493,164 +491,84 @@ func TestStringAttribute(t *testing.T) { } } -func createResolvedTarget(srcs []string) *resolvedTarget { - return &resolvedTarget{ - rule: &appb.Rule{ - Attribute: []*appb.Attribute{ - &appb.Attribute{ - Name: proto.String("srcs"), - Type: appb.Attribute_STRING_LIST.Enum(), - StringListValue: srcs, - }, - }, - }, - sources: map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, - "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, - }, - } -} - -func TestLiteralSrcPaths(t *testing.T) { +func TestSetSources(t *testing.T) { tests := []struct { - name string - srcs []string - err error - expected []string + name string + srcs []string + loadedSrcs map[string]*appb.Target + err error + expected map[string]*appb.Target + expectedLiteralPaths []string + expectedGeneratedPaths []string }{ { - "OneLiteralSource", - []string{"//a:file.ts"}, + "NoSources", nil, - []string{"a/file.ts"}, - }, - { - "MultipleLiteralSources", - []string{"//a:file.ts", "//b:file.ts"}, nil, - []string{"a/file.ts", "b/file.ts"}, - }, - { - "MultipleGeneratedSources", - []string{"//b:generator", "//b:wiz"}, nil, nil, - }, - { - "MixedSources", - []string{"//a:file.ts", "//b:file.ts", "//b:generator", "//b:wiz"}, nil, - []string{"a/file.ts", "b/file.ts"}, - }, - { - "MissingSource", - []string{"//not/in/the/set/of/resolved:sources"}, - fmt.Errorf("src %q has no associated target", "//not/in/the/set/of/resolved:sources"), nil, }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - rt := createResolvedTarget(test.srcs) - literalSrcPaths, err := rt.literalSrcPaths() - if !reflect.DeepEqual(err, test.err) { - t.Errorf("got err %q, expected %q", err, test.err) - } - - if diff := pretty.Compare(literalSrcPaths, test.expected); diff != "" { - t.Errorf("failed to get correct literal source paths: (-got, +want)\n%s", diff) - } - }) - } -} - -func TestGetAllLiteralSrcPaths(t *testing.T) { - tests := []struct { - name string - srcsLists [][]string - err error - expected []string - }{ { - "OneTarget", - [][]string{ - []string{"//a:file.ts", "//b:file.ts"}, + "OneSource", + []string{"//a:file.ts"}, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, }, nil, - []string{"a/file.ts", "b/file.ts"}, - }, - { - "MultipleTargets", - [][]string{ - []string{"//a:file.ts"}, - []string{"//b:file.ts"}, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, }, + []string{"a/file.ts"}, nil, - []string{"a/file.ts", "b/file.ts"}, }, { - "MissingSource", - [][]string{ - []string{"//not/in/the/set/of/resolved:sources"}, + "ExtraSources", + []string{"//a:file.ts"}, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, + "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, }, - fmt.Errorf("src %q has no associated target", "//not/in/the/set/of/resolved:sources"), - nil, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - rts := make(map[string]*resolvedTarget) - for i, srcs := range test.srcsLists { - rts[strconv.Itoa(i)] = createResolvedTarget(srcs) - } - literalSrcPaths, err := getAllLiteralSrcPaths(rts) - if !reflect.DeepEqual(err, test.err) { - t.Errorf("got err %q, expected %q", err, test.err) - } - - // getAllLiteralSrcPaths takes a map, so its output ordering isn't - // deterministic - sort.Strings(literalSrcPaths) - if diff := pretty.Compare(literalSrcPaths, test.expected); diff != "" { - t.Errorf("failed to get correct literal source paths: (-got, +want)\n%s", diff) - } - }) - } -} - -func TestSetSources(t *testing.T) { - tests := []struct { - name string - srcs []string - loadedSrcs map[string]*appb.Target - err error - expected map[string]*appb.Target - }{ - { - "NoSources", - nil, - nil, nil, + map[string]*appb.Target{ + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + }, + []string{"a/file.ts"}, nil, }, { - "OneSource", - []string{"//a:file.ts"}, + "MultipleLiteralSources", + []string{"//a:file.ts", "//b:file.ts"}, map[string]*appb.Target{ "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, }, nil, map[string]*appb.Target{ "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, }, + []string{"a/file.ts", "b/file.ts"}, + nil, }, { - "ExtraSources", - []string{"//a:file.ts"}, + "MultipleGeneratedSources", + []string{"//b:generator", "//b:wiz"}, + map[string]*appb.Target{ + "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, + "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, + }, + fmt.Errorf("rule has generated sources - cannot determine dependencies"), + nil, + nil, + nil, + }, + { + "MixedSources", + []string{"//a:file.ts", "//b:file.ts", "//b:generator", "//b:wiz"}, map[string]*appb.Target{ "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, @@ -659,8 +577,13 @@ func TestSetSources(t *testing.T) { }, nil, map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, + "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, + "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, }, + []string{"a/file.ts", "b/file.ts"}, + []string{"//b:generator", "//b:wiz"}, }, { "MissingSources", @@ -668,6 +591,8 @@ func TestSetSources(t *testing.T) { nil, fmt.Errorf("no source found for label %s", "//a:file.ts"), nil, + nil, + nil, }, } @@ -691,7 +616,7 @@ func TestSetSources(t *testing.T) { t.Errorf("got err %q, expected %q", err, test.err) } - if diff := pretty.Compare(rt.sources, test.expected); diff != "" { + if diff := pretty.Compare(rt.sources, test.expected); err == nil && diff != "" { t.Errorf("failed to set correct sources: (-got, +want)\n%s", diff) } }) From 0bd17912e8e0327d3529bf3309d97534f4b17688 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 8 Apr 2019 15:48:50 -0700 Subject: [PATCH 147/316] script names are prepended to scripts that are eval'ed but the names are missing for prescripts. PiperOrigin-RevId: 242554372 --- devserver/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devserver/main.go b/devserver/main.go index a41b8991..466a63de 100644 --- a/devserver/main.go +++ b/devserver/main.go @@ -130,7 +130,7 @@ func loadScript(path string) (string, error) { if err != nil { return "", err } - return string(buf), nil + return fmt.Sprintf("// %s\n%s", path, buf), nil } // manifestFiles parses a manifest, returning a list of the files in the manifest. From e50c806efc6f8c2bb46f16118d79dc3dbbad4337 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 30 Apr 2019 14:43:44 +0200 Subject: [PATCH 148/316] Update rules_nodejs to 0.28.0 This allows testing //internal:tests on Windows with Bazel 0.25.0 rc8 and --incompatible_windows_native_test_wrapper (see https://github.com/bazelbuild/bazel/issues/6622). --- package.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.bzl b/package.bzl index 6ec6afe2..bf14bed1 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "213dcf7e72f3acd4d1e369b7a356f3e5d9560f380bd655b13b7c0ea425d7c419", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.9/rules_nodejs-0.27.9.tar.gz"], + sha256 = "4c702ffeeab2d24dd4101601b6d27cf582d2e0d4cdc3abefddd4834664669b6b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.28.0/rules_nodejs-0.28.0.tar.gz"], ) # For protocol buffers From 476291d3517849fb9ae424e872d45e1c0fccaa71 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 3 May 2019 14:06:55 -0700 Subject: [PATCH 149/316] Test and make use of the new blaze analyze flag which allows it to handle module name imports of .ngsummary files. PiperOrigin-RevId: 246569952 --- package.bzl | 4 ++-- ts_auto_deps/updater/updater.go | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.bzl b/package.bzl index bf14bed1..6ec6afe2 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "4c702ffeeab2d24dd4101601b6d27cf582d2e0d4cdc3abefddd4834664669b6b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.28.0/rules_nodejs-0.28.0.tar.gz"], + sha256 = "213dcf7e72f3acd4d1e369b7a356f3e5d9560f380bd655b13b7c0ea425d7c419", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.9/rules_nodejs-0.27.9.tar.gz"], ) # For protocol buffers diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 828d46f1..b5b7720c 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -99,7 +99,7 @@ func (g *GarbledBazelResponseError) Error() string { // exchanging it for a different implementation in the ts_auto_deps presubmit service. func (upd *Updater) runBazelAnalyze(buildFilePath string, bld *build.File, rules []*build.Rule) ([]*arpb.DependencyReport, error) { args := []string{} - args = append(args, "--analysis_output=PROTO") + args = append(args, "--analysis_output=PROTO", "--static_analysis_option=checkdeps=--ng_summary") var targets []string for _, r := range rules { fullTarget := AbsoluteBazelTarget(bld, r.Name()) @@ -754,9 +754,10 @@ func buildHasDisableTaze(bld *build.File) bool { // QueryBasedBazelAnalyze uses bazel query to analyze targets. It is available under a flag or // an environment variable on engineer's workstations. func QueryBasedBazelAnalyze(buildFilePath string, args []string) ([]byte, []byte, error) { - // The first member of args is the '--analysis_output=PROTO' flag. Remove - // this flag to get only the targets. - targets := args[1:] + // The first 2 args are '--analysis_output=PROTO' and + // '--static_analysis_option=checkdeps=--ng_summary', which are needed for + // bazel. Remove them to get only the targets. + targets := args[2:] root, err := workspace.Root(buildFilePath) if err != nil { return nil, nil, err From f6e179a6be72d6d60f17655b1424b5d958dc2d23 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Thu, 9 May 2019 10:37:48 -0700 Subject: [PATCH 150/316] Enable strict deps for npm dependencies under Bazel now that npm deps provide a typescript provider with their declaration files The change in rules_nodejs that supplies the provider was here https://github.com/bazelbuild/rules_nodejs/pull/726 Update to latest @bazel/typescript 0.28.0 and add temporary post-install patch to allow from strict deps in ts_library from published @bazel/typescript package Closes #445 PiperOrigin-RevId: 247453547 --- WORKSPACE | 1 + internal/BUILD.bazel | 1 - internal/tsc_wrapped/strict_deps.ts | 10 +- internal/tsc_wrapped/strict_deps_test.ts | 11 -- internal/tsc_wrapped/tsc_wrapped.ts | 14 -- package.bzl | 5 +- package.json | 3 +- postinstall-patches.js | 45 ++++++ yarn.lock | 197 ++++++++++------------- 9 files changed, 138 insertions(+), 149 deletions(-) create mode 100644 postinstall-patches.js diff --git a/WORKSPACE b/WORKSPACE index 7bb63466..d83690a7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -34,6 +34,7 @@ yarn_install( name = "npm", package_json = "//:package.json", yarn_lock = "//:yarn.lock", + data = ["//:postinstall-patches.js"], ) load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index d953a010..9cb5167e 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -110,7 +110,6 @@ jasmine_node_test( srcs = [], deps = [ ":test_lib", - "@npm//bytebuffer", "@npm//jasmine", "@npm//protobufjs", "@npm//source-map", diff --git a/internal/tsc_wrapped/strict_deps.ts b/internal/tsc_wrapped/strict_deps.ts index 3c3dc1e8..7afa4d99 100644 --- a/internal/tsc_wrapped/strict_deps.ts +++ b/internal/tsc_wrapped/strict_deps.ts @@ -25,11 +25,6 @@ export interface StrictDepsPluginConfig { compilationTargetSrc: string[]; allowedStrictDeps: string[]; rootDir: string; - /** - * Paths where users may freely import without declared dependencies. - * This is used in Bazel where dependencies on node_modules may be undeclared. - */ - ignoredFilesPrefixes?: string[]; } /** The TypeScript diagnostic code for "Cannot find module ...". */ @@ -60,7 +55,7 @@ export const PLUGIN: pluginApi.Plugin = { perfTrace.wrap('checkModuleDeps', () => { result.push(...checkModuleDeps( sourceFile, program.getTypeChecker(), config.allowedStrictDeps, - config.rootDir, config.ignoredFilesPrefixes)); + config.rootDir)); }); return result; }; @@ -71,7 +66,7 @@ export const PLUGIN: pluginApi.Plugin = { // Exported for testing export function checkModuleDeps( sf: ts.SourceFile, tc: ts.TypeChecker, allowedDeps: string[], - rootDir: string, ignoredFilesPrefixes: string[] = []): ts.Diagnostic[] { + rootDir: string): ts.Diagnostic[] { function stripExt(fn: string) { return fn.replace(/(\.d)?\.tsx?$/, ''); } @@ -95,7 +90,6 @@ export function checkModuleDeps( // Module imports can only have one declaration location. const declFileName = sym.declarations[0].getSourceFile().fileName; if (allowedMap[stripExt(declFileName)]) continue; - if (ignoredFilesPrefixes.some(p => declFileName.startsWith(p))) continue; const importName = path.posix.relative(rootDir, declFileName); result.push({ file: sf, diff --git a/internal/tsc_wrapped/strict_deps_test.ts b/internal/tsc_wrapped/strict_deps_test.ts index 891dbf8a..2b555172 100644 --- a/internal/tsc_wrapped/strict_deps_test.ts +++ b/internal/tsc_wrapped/strict_deps_test.ts @@ -67,17 +67,6 @@ describe('strict deps', () => { return p; } - it('permits dependencies on ignored files', () => { - const p = createProgram({ - '/src/node_modules/somepkg/index.d.ts': 'export const a = 1;', - '/src/p/sd1.ts': 'import {a} from "somepkg";', - }); - const diags = checkModuleDeps( - p.getSourceFile('p/sd1.ts')!, p.getTypeChecker(), [], '/src', - ['/src/node_modules']); - expect(diags.length).toBe(0, diags); - }); - it('reports errors for transitive dependencies', () => { const p = createProgram({ '/src/p/sd1.ts': 'export let x = 1;', diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 9113ede7..02d5040c 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -65,23 +65,9 @@ export function gatherDiagnostics( disabledTsetseRules: string[], angularPlugin?: TscPlugin): ts.Diagnostic[] { // Install extra diagnostic plugins if (!bazelOpts.disableStrictDeps) { - const ignoredFilesPrefixes: string[] = []; - if (bazelOpts.nodeModulesPrefix) { - // Under Bazel, we exempt external files fetched from npm from strict - // deps. This is because we allow users to implicitly depend on all the - // node_modules. - // TODO(alexeagle): if users opt-in to fine-grained npm dependencies, we - // should be able to enforce strict deps for them. - ignoredFilesPrefixes.push(bazelOpts.nodeModulesPrefix); - if (options.rootDir) { - ignoredFilesPrefixes.push( - path.resolve(options.rootDir!, 'node_modules')); - } - } program = strictDepsPlugin.wrap(program, { ...bazelOpts, rootDir: options.rootDir, - ignoredFilesPrefixes, }); } if (!bazelOpts.isJsTranspilation) { diff --git a/package.bzl b/package.bzl index 6ec6afe2..feabcbed 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,9 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "213dcf7e72f3acd4d1e369b7a356f3e5d9560f380bd655b13b7c0ea425d7c419", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.9/rules_nodejs-0.27.9.tar.gz"], + urls = ["https://github.com/bazelbuild/rules_nodejs/archive/39c941ddf4ba2c730cd69505dd190770e60d6315.zip"], + strip_prefix = "rules_nodejs-39c941ddf4ba2c730cd69505dd190770e60d6315", + sha256 = "94aa159e95359d828edd878f5748cba22a515b9a6f7626892fb9fdf2e6676bb8", ) # For protocol buffers diff --git a/package.json b/package.json index 3d4a646d..765534af 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@bazel/bazel": "~0.22.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/typescript": "0.27.9", + "@bazel/typescript": "0.28.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", @@ -37,6 +37,7 @@ "which": "~1.0.5" }, "scripts": { + "postinstall": "node --preserve-symlinks --preserve-symlinks-main ./postinstall-patches.js", "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e", "e2e": "yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver", "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", diff --git a/postinstall-patches.js b/postinstall-patches.js new file mode 100644 index 00000000..8a8623bf --- /dev/null +++ b/postinstall-patches.js @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2017 The Bazel Authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +try { + require.resolve('shelljs'); +} catch (e) { + // We are in an bazel managed external node_modules repository + // and the resolve has failed because node did not preserve the symlink + // when loading the script. + // This can be fixed using the --preserve-symlinks-main flag which + // is introduced in node 10.2.0 + throw new Error( + `Running postinstall-patches.js script in an external repository requires --preserve-symlinks-main node flag introduced in node 10.2.0. ` + + `Current node version is ${process.version}. Node called with '${process.argv.join(' ')}'.`); +} + +const {set, cd, sed, rm} = require('shelljs'); +const path = require('path'); + +// fail on first error +set('-e'); +// print commands as being executed +set('-v'); +// jump to project root +cd(__dirname); + +// Temporary patch to land strict npm deps +console.log( + '\n# patching ts_library in @bazel/typescript to support strict deps'); +sed('-i', 'deps \\= \\[d for d in ctx\\.attr\\.deps if not NodeModuleInfo in d\\],', 'deps = ctx.attr.deps,', + 'node_modules/@bazel/typescript/internal/build_defs.bzl'); diff --git a/yarn.lock b/yarn.lock index 6d1c5390..5ebc1f4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,16 +49,69 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= -"@bazel/typescript@0.27.9": - version "0.27.9" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.27.9.tgz#6cd6a7162167bec67cfae3a3b973a6bfe8c65f3e" - integrity sha512-o/MDGV2YNHMrsxJMpjWHQwezR7jlh7LJ+7FEmzG/LrepRtyYdaDev5bRhVn2XxnD7cPDx8zvyer35NJTnK0hnw== +"@bazel/typescript@0.28.0": + version "0.28.0" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.28.0.tgz#fdc9ca63c097c8de6aa8c3e81b3dd870b5605791" + integrity sha512-sGi8+pRuPDe7bmK1cUmHfN/3uxHHpJTX9S3edq75pr6MytORIQZBxjSu9aRCgposIe1dPFTGt4B7TOZT8Ln+zw== dependencies: - protobufjs "5.0.3" + protobufjs "6.8.8" semver "5.6.0" source-map-support "0.5.9" tsutils "2.27.2" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + "@types/jasmine@^2.8.2": version "2.8.2" resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.8.2.tgz#6ae4d8740c0da5d5a627df725b4eed71b8e36668" @@ -74,6 +127,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= +"@types/node@^10.1.0": + version "10.14.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.6.tgz#9cbfcb62c50947217f4d88d4d274cc40c22625a9" + integrity sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg== + "@types/node@^6.0.46": version "6.0.92" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.92.tgz#e7f721ae282772e12ba2579968c00d9cce422c5d" @@ -255,14 +313,6 @@ arrify@^1.0.0: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - integrity sha1-vPpZdKYvGOgcq660lzKrSoj5Brw= - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" @@ -473,13 +523,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - integrity sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0= - dependencies: - long "~3" - bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -505,11 +548,6 @@ callsite@1.0.0: resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= -camelcase@^2.0.1: - 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" @@ -586,15 +624,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -cliui@^3.0.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -623,11 +652,6 @@ colors@^1.1.0: resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - integrity sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g= - combine-lists@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" @@ -774,11 +798,6 @@ debug@^3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" -decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -1433,11 +1452,6 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1790,13 +1804,6 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - lie@~3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" @@ -1830,10 +1837,10 @@ log4js@^3.0.0: rfdc "^1.1.2" streamroller "0.7.0" -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - integrity sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s= +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== lru-cache@4.1.x: version "4.1.3" @@ -2135,23 +2142,11 @@ options@>=0.0.5: resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" integrity sha1-7CLTEoBrtT5zF3Pnza788cZDEo8= -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - integrity sha1-aabOicRCpEQDFBrS+bNwvVu29O4= - 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-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2260,15 +2255,24 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== -protobufjs@5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - integrity sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA== - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" +protobufjs@6.8.8: + version "6.8.8" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" + integrity sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.0" + "@types/node" "^10.1.0" + long "^4.0.0" protractor@^5.2.0: version "5.2.0" @@ -3161,24 +3165,11 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - integrity sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY= - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -3227,11 +3218,6 @@ xmlhttprequest-ssl@~1.5.4: resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= -y18n@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= - yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -3242,19 +3228,6 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - integrity sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU= - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" - yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" From 23353681e5b5c085fcc341b001c073e65b6dac8b Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Thu, 9 May 2019 15:45:49 -0700 Subject: [PATCH 151/316] Update to nodejs rules 0.29.0 and @bazel/bazel 0.25.1 Can now remove temporary postinstall patch Closes #446 PiperOrigin-RevId: 247510682 --- WORKSPACE | 1 - package.bzl | 5 ++-- package.json | 5 ++-- postinstall-patches.js | 45 ------------------------------------ yarn.lock | 52 +++++++++++++++++++++--------------------- 5 files changed, 30 insertions(+), 78 deletions(-) delete mode 100644 postinstall-patches.js diff --git a/WORKSPACE b/WORKSPACE index d83690a7..7bb63466 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -34,7 +34,6 @@ yarn_install( name = "npm", package_json = "//:package.json", yarn_lock = "//:yarn.lock", - data = ["//:postinstall-patches.js"], ) load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") diff --git a/package.bzl b/package.bzl index feabcbed..f4511ea0 100644 --- a/package.bzl +++ b/package.bzl @@ -30,9 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/archive/39c941ddf4ba2c730cd69505dd190770e60d6315.zip"], - strip_prefix = "rules_nodejs-39c941ddf4ba2c730cd69505dd190770e60d6315", - sha256 = "94aa159e95359d828edd878f5748cba22a515b9a6f7626892fb9fdf2e6676bb8", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.0/rules_nodejs-0.29.0.tar.gz"], + sha256 = "1db950bbd27fb2581866e307c0130983471d4c3cd49c46063a2503ca7b6770a4", ) # For protocol buffers diff --git a/package.json b/package.json index 765534af..5d98dad9 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "semver": "5.6.0", "source-map-support": "0.5.9", "tsutils": "2.27.2", - "@bazel/bazel": "~0.22.0", + "@bazel/bazel": "0.25.1", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/typescript": "0.28.0", + "@bazel/typescript": "0.29.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", @@ -37,7 +37,6 @@ "which": "~1.0.5" }, "scripts": { - "postinstall": "node --preserve-symlinks --preserve-symlinks-main ./postinstall-patches.js", "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e", "e2e": "yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver", "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", diff --git a/postinstall-patches.js b/postinstall-patches.js deleted file mode 100644 index 8a8623bf..00000000 --- a/postinstall-patches.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2017 The Bazel Authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -try { - require.resolve('shelljs'); -} catch (e) { - // We are in an bazel managed external node_modules repository - // and the resolve has failed because node did not preserve the symlink - // when loading the script. - // This can be fixed using the --preserve-symlinks-main flag which - // is introduced in node 10.2.0 - throw new Error( - `Running postinstall-patches.js script in an external repository requires --preserve-symlinks-main node flag introduced in node 10.2.0. ` + - `Current node version is ${process.version}. Node called with '${process.argv.join(' ')}'.`); -} - -const {set, cd, sed, rm} = require('shelljs'); -const path = require('path'); - -// fail on first error -set('-e'); -// print commands as being executed -set('-v'); -// jump to project root -cd(__dirname); - -// Temporary patch to land strict npm deps -console.log( - '\n# patching ts_library in @bazel/typescript to support strict deps'); -sed('-i', 'deps \\= \\[d for d in ctx\\.attr\\.deps if not NodeModuleInfo in d\\],', 'deps = ctx.attr.deps,', - 'node_modules/@bazel/typescript/internal/build_defs.bzl'); diff --git a/yarn.lock b/yarn.lock index 5ebc1f4f..7e860269 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,29 +2,29 @@ # yarn lockfile v1 -"@bazel/bazel-darwin_x64@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.22.0.tgz#a2bea5922dba9a32554a218ba4849a200115b248" - integrity sha512-LFxkyQgPATeB64z/1IvOWZhK+lc3JVHejbmdo96qB4lsoD8zselvOlgHvVXxlAjRxVZ9mlmXDvDRDyaXyyRdwA== - -"@bazel/bazel-linux_x64@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.22.0.tgz#12e5884f2a7b7f3b62afbef9f8da4de0976f3bc8" - integrity sha512-xDs8cb2bbGZ9uvzYZOzCVrMBywzRhLj0J/t+py+FYZj+VO5B3wVg9eUf6nWWR0oJ2mzvToI9h31t2tNdqwy2kQ== - -"@bazel/bazel-win32_x64@0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.22.0.tgz#a8a65986639583a8cc7b018e001aedfdafe41b50" - integrity sha512-FbJaXVDoCLnpIFLnPHFkQdfriYPXfnfQNuf9EXMliERdRuoeBVbwEZfwcuArxZWNFus7bD8QiTj0XzKVWO+Wbw== - -"@bazel/bazel@~0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.22.0.tgz#feb0f2d82f9d169cb47951d95d55e512eda72bc9" - integrity sha512-uaXZsfCXOASBXzmge56akRIhJnKYdShn1X3AdEBzq2NNCf2llkc1H25gKGm4BfuWDBXRbXDMmcXup+fw39h+WQ== +"@bazel/bazel-darwin_x64@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.25.1.tgz#6526aba1cd912830595c3903ad29dfcb338114a3" + integrity sha512-VYPHaXZFlyl/1MOnUdByusox0RataI+dvQ37FiuuK9byFlcgCoIvhAx20nLK56tEhi/obXXaG2AO4w6rfOcgWg== + +"@bazel/bazel-linux_x64@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.25.1.tgz#7f0d098725f0bde4f0904b72b64ea2f22fdbf2bc" + integrity sha512-i+b6RSWn5qGZlrcct+lpWVHd3sen7UaBqQyi/0Rn+J72XCIbY2AFoi+j6SlCXb3EFltxJBCHKJHZqEtkP79bDQ== + +"@bazel/bazel-win32_x64@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.25.1.tgz#43bdec698fbb7babfd02470a1dcab384f01f9d6b" + integrity sha512-LM/rY8cxioCFe0m6WxdfvZ6pbD9eKzp69C1BhIkoESyp0IDLDvnLJ6uvs722e3hl8Zj1sIEIbiCwrYk33lPkTg== + +"@bazel/bazel@0.25.1": + version "0.25.1" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.25.1.tgz#fc76ad9c07371e9ce0bf5bde6ff61cf8abbeaefd" + integrity sha512-HM2IsX9M4siW8b2AHZP4ixtT1NH9H74M0/DJfh0hr15NlivTapvkVQSfEfW57CCMfkuMcDjvfJQK+KzfuVyMgw== optionalDependencies: - "@bazel/bazel-darwin_x64" "0.22.0" - "@bazel/bazel-linux_x64" "0.22.0" - "@bazel/bazel-win32_x64" "0.22.0" + "@bazel/bazel-darwin_x64" "0.25.1" + "@bazel/bazel-linux_x64" "0.25.1" + "@bazel/bazel-win32_x64" "0.25.1" "@bazel/buildifier-darwin_x64@0.20.0": version "0.20.0" @@ -49,10 +49,10 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= -"@bazel/typescript@0.28.0": - version "0.28.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.28.0.tgz#fdc9ca63c097c8de6aa8c3e81b3dd870b5605791" - integrity sha512-sGi8+pRuPDe7bmK1cUmHfN/3uxHHpJTX9S3edq75pr6MytORIQZBxjSu9aRCgposIe1dPFTGt4B7TOZT8Ln+zw== +"@bazel/typescript@0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.29.0.tgz#d276afe034f37b5f35ee1369c99dc33c637fc9f6" + integrity sha512-Dp5ucrE1vXTORGiwEi6Ur4dlICpLsmZ1dscsEQT4ywF7xTT0/NmIG0ecBghiCFPFQTxt1D05TR3SH06rPtTAew== dependencies: protobufjs "6.8.8" semver "5.6.0" From 695059fc893d31ead40bf88e5d6a587e0d699837 Mon Sep 17 00:00:00 2001 From: Laurent Le Brun Date: Fri, 17 May 2019 20:10:00 +0200 Subject: [PATCH 152/316] Update Bazel dependency With this change, the code works with Bazel flag `--incompatible_disable_deprecated_attr_params`, which will be enabled soon. --- package.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.bzl b/package.bzl index f4511ea0..63e0714d 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "io_bazel", - urls = ["https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-dist.zip"], - sha256 = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4", + urls = ["https://github.com/bazelbuild/bazel/releases/download/0.25.0/bazel-0.25.0-dist.zip"], + sha256 = "f624fe9ca8d51de192655369ac538c420afb7cde16e1ad052554b582fff09287", ) # For building ts_devserver and ts_auto_deps binaries From d4388397a9b30d0ebe27790194c12b4a4b3a68c3 Mon Sep 17 00:00:00 2001 From: rjamet Date: Fri, 10 May 2019 05:10:24 -0700 Subject: [PATCH 153/316] Add utilities to Tsetse in prevision of the future rule to ban conformance patterns. PiperOrigin-RevId: 247593544 --- internal/BUILD.bazel | 13 +- internal/tsetse/util/ast_tools.ts | 169 ++++++++++++++++ internal/tsetse/util/fixer.ts | 191 +++++++++++++++++++ internal/tsetse/util/is_literal.ts | 94 +++++++++ internal/tsetse/util/match_symbol.ts | 146 ++++++++++++++ internal/tsetse/util/testing/test_support.ts | 110 +++++++++++ package.bzl | 4 +- 7 files changed, 721 insertions(+), 6 deletions(-) create mode 100644 internal/tsetse/util/ast_tools.ts create mode 100644 internal/tsetse/util/fixer.ts create mode 100644 internal/tsetse/util/is_literal.ts create mode 100644 internal/tsetse/util/match_symbol.ts create mode 100644 internal/tsetse/util/testing/test_support.ts diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 9cb5167e..8b24d69d 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -45,8 +45,7 @@ ts_library( srcs = glob( [ "tsc_wrapped/*.ts", - "tsetse/*.ts", - "tsetse/rules/*.ts", + "tsetse/**/*.ts", ], exclude = [ "**/test_support.ts", @@ -93,9 +92,15 @@ nodejs_binary( ts_library( name = "test_lib", - srcs = glob(["tsc_wrapped/*_test.ts"]) + ["tsc_wrapped/test_support.ts"], - tsconfig = "//internal:tsc_wrapped/tsconfig.json", + srcs = glob([ + "tsc_wrapped/*_test.ts", + "tsetse/**/*_test.ts", + ]) + [ + "tsc_wrapped/test_support.ts", + "tsetse/util/testing/test_support.ts", + ], compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", + tsconfig = "//internal:tsc_wrapped/tsconfig.json", deps = [ ":tsc_wrapped", "@npm//@types/jasmine", diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts new file mode 100644 index 00000000..44d26ee2 --- /dev/null +++ b/internal/tsetse/util/ast_tools.ts @@ -0,0 +1,169 @@ +/** + * @fileoverview This is a collection of smaller utility functions to operate on + * a TypeScript AST, used by JSConformance rules and elsewhere. + */ + +import * as ts from 'typescript'; + +/** + * Returns `n`'s parents in order. + */ +export function parents(n: ts.Node): ts.Node[] { + const p = []; + while (n.parent) { + n = n.parent; + p.push(n); + } + return p; +} + +/** + * Searches for something satisfying the given test in `n` or its children. + */ +export function findInChildren( + n: ts.Node, test: (n: ts.Node) => boolean): boolean { + let toExplore: ts.Node[] = [n]; + let cur: ts.Node|undefined; + while (cur = toExplore.pop()) { + if (test(cur)) { + return true; + } + // Recurse + toExplore = toExplore.concat(cur.getChildren()); + } + return false; +} + +/** + * Returns true if the pattern-based Rule should look at that node and consider + * warning there. The goal is to make it easy to exclude on source files, + * blocks, module declarations, JSDoc, lib.d.ts nodes, that kind of things. + */ +export function shouldExamineNode(n: ts.Node) { + return !( + ts.isBlock(n) || ts.isModuleBlock(n) || ts.isModuleDeclaration(n) || + ts.isSourceFile(n) || (n.parent && ts.isTypeNode(n.parent)) || + ts.isJSDoc(n) || isInStockLibraries(n)); +} + +/** + * Return whether the given declaration is ambient. + */ +export function isAmbientDeclaration(d: ts.Declaration): boolean { + return Boolean( + d.modifiers && + d.modifiers.some(m => m.kind === ts.SyntaxKind.DeclareKeyword)); +} + +/** + * Return whether the given Node is (or is in) a library included as default. + * We currently look for a node_modules/typescript/ prefix, but this could + * be expanded if needed. + */ +export function isInStockLibraries(n: ts.Node|ts.SourceFile): boolean { + const sourceFile = ts.isSourceFile(n) ? n : n.getSourceFile(); + if (sourceFile) { + return sourceFile.fileName.indexOf('node_modules/typescript/') !== -1; + } else { + // the node is nowhere? Consider it as part of the core libs: we can't do + // anything with it anyways, and it was likely included as default. + return true; + } +} + +/** + * Turns the given Symbol into its non-aliased version (which could be itself). + * Returns undefined if given an undefined Symbol (so you can call + * `dealias(typeChecker.getSymbolAtLocation(node))`). + */ +export function dealias( + symbol: ts.Symbol|undefined, tc: ts.TypeChecker): ts.Symbol|undefined { + if (!symbol) { + return undefined; + } + if (symbol.getFlags() & (ts.SymbolFlags.Alias | ts.SymbolFlags.TypeAlias)) { + return dealias(tc.getAliasedSymbol(symbol), tc); + } + return symbol; +} + +/** + * Returns whether `n`'s parents are something indicating a type. + */ +export function isPartOfTypeDeclaration(n: ts.Node) { + return [n, ...parents(n)].some( + p => p.kind === ts.SyntaxKind.TypeReference || + p.kind === ts.SyntaxKind.TypeLiteral); +} + +/** + * Returns whether `n` is under an import statement. + */ +export function isPartOfImportStatement(n: ts.Node) { + return [n, ...parents(n)].some( + p => p.kind === ts.SyntaxKind.ImportDeclaration); +} + +/** + * Returns whether `n` is a declaration. + */ +export function isDeclaration(n: ts.Node): n is ts.VariableDeclaration| + ts.ClassDeclaration|ts.FunctionDeclaration|ts.MethodDeclaration| + ts.PropertyDeclaration|ts.VariableDeclarationList|ts.InterfaceDeclaration| + ts.TypeAliasDeclaration|ts.EnumDeclaration|ts.ModuleDeclaration| + ts.ImportDeclaration|ts.ImportEqualsDeclaration|ts.ExportDeclaration| + ts.MissingDeclaration { + return ts.isVariableDeclaration(n) || ts.isClassDeclaration(n) || + ts.isFunctionDeclaration(n) || ts.isMethodDeclaration(n) || + ts.isPropertyDeclaration(n) || ts.isVariableDeclarationList(n) || + ts.isInterfaceDeclaration(n) || ts.isTypeAliasDeclaration(n) || + ts.isEnumDeclaration(n) || ts.isModuleDeclaration(n) || + ts.isImportDeclaration(n) || ts.isImportEqualsDeclaration(n) || + ts.isExportDeclaration(n) || ts.isMissingDeclaration(n); +} + +/** Type guard for expressions that looks like property writes. */ +export function isPropertyWriteExpression(node: ts.Node): + node is(ts.BinaryExpression & { + left: ts.PropertyAccessExpression; + }) { + if (!ts.isBinaryExpression(node)) { + return false; + } + if (node.operatorToken.getText().trim() !== '=') { + return false; + } + if (!ts.isPropertyAccessExpression(node.left) || + node.left.expression.getFullText().trim() === '') { + return false; + } + + // TODO: Destructuring assigments aren't covered. This would be a potential + // bypass, but I doubt we'd catch bugs, so fixing it seems low priority + // overall. + + return true; +} + +/** + * Debug helper. + */ +export function debugLog(verbose: boolean|undefined, msg: string) { + if (verbose) console.info(msg); +} + +/** + * If verbose, logs the given error that happened while walking n, with a + * stacktrace. + */ +export function logASTWalkError(verbose: boolean, n: ts.Node, e: Error) { + let nodeText = `[error getting name for ${JSON.stringify(n)}]`; + try { + nodeText = '"' + n.getFullText().trim() + '"'; + } catch { + } + debugLog( + verbose, + `Walking node ${nodeText} failed with error ${e}.\n` + + `Stacktrace:\n${e.stack}`); +} diff --git a/internal/tsetse/util/fixer.ts b/internal/tsetse/util/fixer.ts new file mode 100644 index 00000000..19de12a2 --- /dev/null +++ b/internal/tsetse/util/fixer.ts @@ -0,0 +1,191 @@ +import * as ts from 'typescript'; +import {Fix, IndividualChange} from '../failure'; +import {debugLog} from './ast_tools'; + +/** + * A Fixer turns Nodes (that are supposed to have been matched before) into a + * Fix. This is meant to be implemented by Rule implementers (or + * ban-preset-pattern users). See also `buildReplacementFixer` for a simpler way + * of implementing a Fixer. + */ +export interface Fixer { + getFixForFlaggedNode(node: NodeType, v?: boolean): Fix|undefined; +} + +/** + * A simple Fixer builder based on a function that looks at a node, and + * output either nothing, or a replacement. If this is too limiting, implement + * Fixer instead. + */ +export function buildReplacementFixer( + potentialReplacementGenerator: (node: ts.Node, v?: boolean) => + ({replaceWith: string} | undefined)): Fixer { + return { + getFixForFlaggedNode: (n: ts.Node, v?: boolean): Fix | undefined => { + const partialFix = potentialReplacementGenerator(n, v); + if (!partialFix) { + return; + } + return { + changes: [{ + sourceFile: n.getSourceFile(), + start: n.getStart(), + end: n.getEnd(), + replacement: partialFix.replaceWith, + }], + }; + } + }; +} + +// TODO(rjamet): Both maybeAddNamedImport and maybeAddNamespacedImport are too +// hard to read to my taste. This could probably be improved upon by being more +// functionnal, to show the filter passes and get rid of the continues and +// returns (which are confusing). + +/** + * Builds an IndividualChange that imports the required symbol from the given + * file under the given name. This might reimport the same thing twice in some + * cases, but it will always make it available under the right name (though + * its name might collide with other imports, as we don't currently check for + * that). + */ +export function maybeAddNamedImport( + source: ts.SourceFile, importWhat: string, fromFile: string, + importAs?: string, tazeComment?: string, v?: boolean): IndividualChange| + undefined { + const importStatements = source.statements.filter(ts.isImportDeclaration); + const importSpecifier = + importAs ? `${importWhat} as ${importAs}` : importWhat; + + for (const iDecl of importStatements) { + const parsedDecl = maybeParseImportNode(iDecl, v); + if (!parsedDecl || parsedDecl.fromFile !== fromFile) { + // Not an import from the right file, or couldn't understand the import. + continue; // Jump to the next import. + } + if (ts.isNamespaceImport(parsedDecl.namedBindings)) { + debugLog(v, `... but it's a wildcard import`); + continue; // Jump to the next import. + } + + // Else, bindings is a NamedImports. We can now search whether the right + // symbol is there under the right name. + const foundRightImport = parsedDecl.namedBindings.elements.some( + iSpec => iSpec.propertyName ? + iSpec.name.getText() === importAs && // import {foo as bar} + iSpec.propertyName.getText() === importWhat : + iSpec.name.getText() === importWhat); // import {foo} + + if (foundRightImport) { + debugLog(v, `"${iDecl.getFullText()}" imports ${importWhat} as we want.`); + return; // Our request is already imported under the right name. + } + + // Else, insert our symbol in the list of imports from that file. + debugLog(v, `No named imports from that file, generating new fix`); + return { + start: parsedDecl.namedBindings.elements[0].getStart(), + end: parsedDecl.namedBindings.elements[0].getStart(), + sourceFile: source, + replacement: `${importSpecifier}, `, + }; + } + + // If we get here, we didn't find anything imported from the wanted file, so + // we'll need the full import string. Add it after the last import, + // and let clang-format handle the rest. + const newImportStatement = `import {${importSpecifier}} from '${fromFile}';` + + (tazeComment ? ` ${tazeComment}\n` : `\n`); + const insertionPosition = importStatements.length ? + importStatements[importStatements.length - 1].getEnd() + 1 : + 0; + return { + start: insertionPosition, + end: insertionPosition, + sourceFile: source, + replacement: newImportStatement, + }; +} + +/** + * Builds an IndividualChange that imports the required namespace from the given + * file under the given name. This might reimport the same thing twice in some + * cases, but it will always make it available under the right name (though + * its name might collide with other imports, as we don't currently check for + * that). + */ +export function maybeAddNamespaceImport( + source: ts.SourceFile, fromFile: string, importAs: string, + tazeComment?: string, v?: boolean): IndividualChange|undefined { + const importStatements = source.statements.filter(ts.isImportDeclaration); + + const hasTheRightImport = importStatements.some(iDecl => { + const parsedDecl = maybeParseImportNode(iDecl, v); + if (!parsedDecl || parsedDecl.fromFile !== fromFile) { + // Not an import from the right file, or couldn't understand the import. + return false; + } + debugLog(v, `"${iDecl.getFullText()}" is an import from the right file`); + + if (ts.isNamedImports(parsedDecl.namedBindings)) { + debugLog(v, `... but it's a named import`); + return false; // irrelevant to our namespace imports + } + // Else, bindings is a NamespaceImport. + if (parsedDecl.namedBindings.name.getText() !== importAs) { + debugLog(v, `... but not the right name, we need to reimport`); + return false; + } + debugLog(v, `... and the right name, no need to reimport`); + return true; + }); + + if (!hasTheRightImport) { + const insertionPosition = importStatements.length ? + importStatements[importStatements.length - 1].getEnd() + 1 : + 0; + return { + start: insertionPosition, + end: insertionPosition, + sourceFile: source, + replacement: tazeComment ? + `import * as ${importAs} from '${fromFile}'; ${tazeComment}\n` : + `import * as ${importAs} from '${fromFile}';\n`, + }; + } + return; +} + +/** + * This tries to make sense of an ImportDeclaration, and returns the interesting + * parts, undefined if the import declaration is valid but not understandable by + * the checker. + */ +function maybeParseImportNode(iDecl: ts.ImportDeclaration, v?: boolean): { + namedBindings: ts.NamedImportBindings|ts.NamespaceImport, + fromFile: string +}|undefined { + if (!iDecl.importClause) { + // something like import "./file"; + debugLog( + v, `Ignoring import without imported symbol: ${iDecl.getFullText()}`); + return; + } + if (iDecl.importClause.name || !iDecl.importClause.namedBindings) { + // Seems to happen in defaults imports like import Foo from 'Bar'. + // Not much we can do with that when trying to get a hold of some symbols, + // so just ignore that line (worst case, we'll suggest another import + // style). + debugLog(v, `Ignoring import: ${iDecl.getFullText()}`); + return; + } + if (!ts.isStringLiteral(iDecl.moduleSpecifier)) { + debugLog(v, `Ignoring import whose module specifier is not literal`); + return; + } + return { + namedBindings: iDecl.importClause.namedBindings, + fromFile: iDecl.moduleSpecifier.text + }; +} diff --git a/internal/tsetse/util/is_literal.ts b/internal/tsetse/util/is_literal.ts new file mode 100644 index 00000000..8b7209c3 --- /dev/null +++ b/internal/tsetse/util/is_literal.ts @@ -0,0 +1,94 @@ +import * as ts from 'typescript'; +import {findInChildren} from './ast_tools'; + +/** + * Determines if the given ts.Node is literal enough for security purposes. + */ +export function isLiteral(typeChecker: ts.TypeChecker, node: ts.Node): boolean { + if (ts.isBinaryExpression(node) && + node.operatorToken.kind === ts.SyntaxKind.PlusToken) { + // Concatenation is fine, if the parts are literals. + return ( + isLiteral(typeChecker, node.left) && + isLiteral(typeChecker, node.right)); + } else if (ts.isTemplateExpression(node)) { + // Same for template expressions. + return node.templateSpans.every(span => { + return isLiteral(typeChecker, span.expression); + }); + } else if (ts.isTemplateLiteral(node)) { + // and literals (in that order). + return true; + } else if (ts.isConditionalExpression(node)) { + return isLiteral(typeChecker, node.whenTrue) && + isLiteral(typeChecker, node.whenFalse); + } else if (ts.isIdentifier(node)) { + return isUnderlyingValueAStringLiteral(node, typeChecker); + } + + const hasCasts = findInChildren(node, ts.isAsExpression); + + return !hasCasts && isLiteralAccordingToItsType(typeChecker, node); +} + +/** + * Given an identifier, this function goes around the AST to determine + * whether we should consider it a string literal, on a best-effort basis. It + * is an approximation, but should never have false positives. + */ +function isUnderlyingValueAStringLiteral( + identifier: ts.Identifier, tc: ts.TypeChecker) { + // The identifier references a value, and we try to follow the trail: if we + // find a variable declaration for the identifier, and it was declared as a + // const (so we know it wasn't altered along the way), then the value used + // in the declaration is the value our identifier references. That means we + // should look at the value used in its initialization (by applying the same + // rules as before). + // Since we're best-effort, if a part of that operation failed due to lack + // of support (for instance, the identifier was imported), then we fail + // closed and don't consider the value a literal. + + // TODO(rjamet): This doesn't follow imports, which is a feature that we need + // in a fair amount of cases. + return getVariableDeclarationsInSameFile(identifier, tc) + .filter(isConst) + .some(d => d.initializer !== undefined && isLiteral(tc, d.initializer)); +} + +/** + * Returns whether this thing is a literal based on TS's understanding. This is + * only looking at the local type, so there's no magic in that function. + */ +function isLiteralAccordingToItsType( + typeChecker: ts.TypeChecker, node: ts.Node): boolean { + const nodeType = typeChecker.getTypeAtLocation(node); + return (nodeType.flags & + (ts.TypeFlags.StringLiteral | ts.TypeFlags.NumberLiteral | + ts.TypeFlags.BooleanLiteral | ts.TypeFlags.EnumLiteral)) !== 0; +} + +/** + * Follows the symbol behind the given identifier, assuming it is a variable, + * and return all the variable declarations we can find that match it in the + * same file. + */ +function getVariableDeclarationsInSameFile( + node: ts.Identifier, tc: ts.TypeChecker): ts.VariableDeclaration[] { + const symbol = tc.getSymbolAtLocation(node); + if (!symbol) { + return []; + } + const decls = symbol.getDeclarations(); + if (!decls) { + return []; + } + return decls.filter(ts.isVariableDeclaration); +} + +// Tests whether the given variable declaration is Const. +function isConst(varDecl: ts.VariableDeclaration): boolean { + return Boolean( + varDecl && varDecl.parent && + ts.isVariableDeclarationList(varDecl.parent) && + varDecl.parent.flags & ts.NodeFlags.Const); +} diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts new file mode 100644 index 00000000..1a05c72b --- /dev/null +++ b/internal/tsetse/util/match_symbol.ts @@ -0,0 +1,146 @@ + + +import * as ts from 'typescript'; +import {dealias, debugLog, isAmbientDeclaration, isDeclaration, isInStockLibraries, isPartOfImportStatement} from './ast_tools'; + +const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; +const FQN_FORMAT = `(${JS_IDENTIFIER_FORMAT}\.)*${JS_IDENTIFIER_FORMAT}`; +// A fqn made out of a dot-separated chain of JS identifiers. +const ABSOLUTE_RE = new RegExp(`^${FQN_FORMAT}$`); + +/** + * This class matches symbols given a "foo.bar.baz" name, where none of the + * steps are instances of classes. + */ +export class AbsoluteMatcher { + /** + * From a "path/to/file.ts:foo.bar.baz" or "foo.bar.baz" matcher + * specification, builds a Matcher. + */ + constructor(readonly bannedName: string) { + if (!bannedName.match(ABSOLUTE_RE)) { + throw new Error('Malformed matcher selector.'); + } + + // JSConformance used to use a Foo.prototype.bar syntax for bar on + // instances of Foo. TS doesn't surface the prototype part in the FQN, and + // so you can't tell static `bar` on `foo` from the `bar` property/method + // on `foo`. To avoid any confusion, throw there if we see `prototype` in + // the spec: that way, it's obvious that you're not trying to match + // properties. + if (this.bannedName.includes('.prototype')) { + throw new Error( + 'Your pattern includes a .prototype, but the AbsoluteMatcher is ' + + 'meant for non-object matches. Use the PropertyMatcher instead.'); + } + } + + matches(n: ts.Node, tc: ts.TypeChecker, verbose?: boolean): boolean { + // Get the symbol (or the one at the other end of this alias) that we're + // looking at. + const s = dealias(tc.getSymbolAtLocation(n), tc); + if (!s) { + debugLog(verbose, `cannot get symbol`); + return false; + } + + // The TS-provided FQN tells us the full identifier, and the origin file + // in some circumstances. + const fqn = tc.getFullyQualifiedName(s); + debugLog(verbose, `got FQN ${fqn}`); + + // Name-based check + if (!(fqn.endsWith('.' + this.bannedName) || fqn === this.bannedName)) { + debugLog(verbose, `FQN ${fqn} doesn't match name ${this.bannedName}`); + return false; // not a use of the symbols we want + } + + // Check if it's part of a declaration or import. The check is cheap. If + // we're looking for the uses of a symbol, we don't alert on the imports, to + // avoid flooding users with warnings (as the actual use will be alerted) + // and bad fixes. + const p = n.parent; + if (p && (isDeclaration(p) || isPartOfImportStatement(p))) { + debugLog(verbose, `We don't flag symbol declarations`); + return false; + } + + // No file info in the FQN means it's not explicitly imported. + // That must therefore be a local variable, or an ambient symbol + // (and we only care about ambients here). Those could come from + // either a declare somewhere, or one of the core libraries that + // are loaded by default. + if (!fqn.startsWith('"')) { + // We need to trace things back, so get declarations of the symbol. + const declarations = s.getDeclarations(); + if (!declarations) { + debugLog(verbose, `Symbol never declared?`); + return false; + } + if (!declarations.some(isAmbientDeclaration) && + !declarations.some(isInStockLibraries)) { + debugLog( + verbose, `Symbol neither ambient nor from the stock libraries`); + return false; + } + } + + debugLog(verbose, `all clear, report finding`); + return true; + } +} + +// TODO: Export the matched node kinds here. +/** + * This class matches a property access node, based on a property holder type + * (through its name), i.e. a class, and a property name. + * + * The logic is voluntarily simple: if a matcher for `a.b` tests a `x.y` node, + * it will return true if: + * - `x` is of type `a` either directly (name-based) or through inheritance + * (ditto), + * - and, textually, `y` === `b`. + * + * Note that the logic is different from TS's type system: this matcher doesn't + * have any knowledge of structural typing. + */ +export class PropertyMatcher { + static fromSpec(spec: string): PropertyMatcher { + if (spec.indexOf('.prototype.') === -1) { + throw new Error(`BANNED_PROPERTY expects a .prototype in your query.`); + } + const requestParser = /^([\w\d_.-]+)\.prototype\.([\w\d_.-]+)$/; + const matches = requestParser.exec(spec); + if (!matches) { + throw new Error('Cannot understand the BannedProperty spec' + spec); + } + const [bannedType, bannedProperty] = matches.slice(1); + return new PropertyMatcher(bannedType, bannedProperty); + } + + constructor(readonly bannedType: string, readonly bannedProperty: string) {} + + /** + * @param n The PropertyAccessExpression we're looking at. + */ + matches( + n: ts.PropertyAccessExpression, tc: ts.TypeChecker, verbose?: boolean) { + return n.name.text === this.bannedProperty && + this.typeMatches(tc.getTypeAtLocation(n.expression)); + } + + private exactTypeMatches(inspectedType: ts.Type): boolean { + const typeSymbol = inspectedType.getSymbol() || false; + return typeSymbol && typeSymbol.getName() === this.bannedType; + } + + // TODO: Account for unknown types/ '?', and 'loose type matches', i.e. if the + // actual type is a supertype of the prohibited type. + private typeMatches(inspectedType: ts.Type): boolean { + if (this.exactTypeMatches(inspectedType)) { + return true; + } + const baseTypes = inspectedType.getBaseTypes() || []; + return baseTypes.some(base => this.exactTypeMatches(base)); + } +} diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts new file mode 100644 index 00000000..010ad8ca --- /dev/null +++ b/internal/tsetse/util/testing/test_support.ts @@ -0,0 +1,110 @@ +import 'jasmine'; + +import * as crypto from 'crypto'; +import * as fs from 'fs'; +import * as os from 'os'; +import * as ts from 'typescript'; + +import {Checker} from '../../checker'; +import {Failure, Fix} from '../../failure'; +import {AbstractRule} from '../../rule'; + + +function compile(...sourceCode: string[]): ts.Program { + const temporaryFolder = os.tmpdir() + + `/tslint_test_input_${crypto.randomBytes(16).toString('hex')}`; + const fullPaths: string[] = []; + sourceCode.forEach((s, i) => { + fullPaths.push(`${temporaryFolder}/file_${i}.ts`); + }); + + let error: Error|undefined = undefined; + let program: ts.Program|undefined = undefined; + try { // Wrap it all in a try/finally to clean up the temp files afterwards + fs.mkdirSync(temporaryFolder); + sourceCode.forEach((s, i) => { + fs.writeFileSync(fullPaths[i], s); + }); + program = ts.createProgram(fullPaths, {}); + if (ts.getPreEmitDiagnostics(program).length !== 0) { + throw new Error( + 'Your program does not compile cleanly. Diagnostics:\n' + + ts.formatDiagnostics( + ts.getPreEmitDiagnostics(program), ts.createCompilerHost({}))); + } + } catch (e) { + error = e; + } finally { + fullPaths.forEach(p => fs.unlinkSync(p)); + fs.rmdirSync(temporaryFolder); + } + if (program && !error) { + return program; + } else { + throw error; + } +} + +function check(rule: AbstractRule, program: ts.Program): Failure[] { + const checker = new Checker(program); + rule.register(checker); + return program.getSourceFiles() + .map(s => checker.execute(s)) + .reduce((prev, cur) => prev.concat(cur)); +} + +/** Builds and run the given Rule upon the source files that were provided. */ +export function compileAndCheck( + rule: AbstractRule, ...sourceCode: string[]): Failure[] { + const program = compile(...sourceCode); + return check(rule, program); +} + +// Custom matcher for Jasmine, for a better experience matching fixes. +export const customMatchers: jasmine.CustomMatcherFactories = { + toBeFailureMatching(): jasmine.CustomMatcher { + return { + compare: (actual: ts.Diagnostic&{end: number, fix?: Fix}, exp: { + fileName?: string, start: number, end: number, + }) => { + let regrets = ''; + if (exp === undefined) { + regrets += 'The rule requires two arguments. '; + } + if (exp.fileName) { + if (!actual.file) { + regrets += 'Expected diagnostic to have a source file. '; + } else if (!actual.file.fileName.endsWith(exp.fileName)) { + regrets += `Expected ${actual.file.fileName} to end with ${ + exp.fileName}. `; + } + } + if (exp.start && actual.start !== exp.start) { + regrets += expectation('start', exp.start, actual.start); + } + if (exp.end && actual.end !== exp.end) { + regrets += expectation('end', exp.end, actual.end); + } + return {pass: regrets === '', message: regrets}; + } + }; + } +}; + +function expectation(fieldname: string, expectation: any, actual: any) { + return `Expected .${fieldname} to be ${expectation}, was ${actual}. `; +} + +// And the matching type +declare global { + namespace jasmine { + interface Matchers { + toBeFailureMatching(expected: { + fileName?: string, + start: number, + end: number, + [i: string]: any // the rest + }): void; + } + } +} diff --git a/package.bzl b/package.bzl index 63e0714d..f4511ea0 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "io_bazel", - urls = ["https://github.com/bazelbuild/bazel/releases/download/0.25.0/bazel-0.25.0-dist.zip"], - sha256 = "f624fe9ca8d51de192655369ac538c420afb7cde16e1ad052554b582fff09287", + urls = ["https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-dist.zip"], + sha256 = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4", ) # For building ts_devserver and ts_auto_deps binaries From 6dd38c4ffcd3f5b5deb8bcab49d113bfa9ab1033 Mon Sep 17 00:00:00 2001 From: rjamet Date: Mon, 20 May 2019 05:17:27 -0700 Subject: [PATCH 154/316] Add a ConformancePattern rule to Tsetse, a configurable pattern-based rule. PiperOrigin-RevId: 249029529 --- internal/tsetse/error_code.ts | 1 + .../tsetse/rules/conformance_pattern_rule.ts | 52 +++++++++++ .../property_write_test.ts | 86 +++++++++++++++++++ internal/tsetse/util/pattern_config.ts | 33 +++++++ .../util/pattern_engines/pattern_engine.ts | 15 ++++ .../pattern_engines/property_write_engine.ts | 49 +++++++++++ 6 files changed, 236 insertions(+) create mode 100644 internal/tsetse/rules/conformance_pattern_rule.ts create mode 100644 internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts create mode 100644 internal/tsetse/util/pattern_config.ts create mode 100644 internal/tsetse/util/pattern_engines/pattern_engine.ts create mode 100644 internal/tsetse/util/pattern_engines/property_write_engine.ts diff --git a/internal/tsetse/error_code.ts b/internal/tsetse/error_code.ts index 1e0ea3a1..71ca712a 100644 --- a/internal/tsetse/error_code.ts +++ b/internal/tsetse/error_code.ts @@ -12,4 +12,5 @@ export enum ErrorCode { MUST_USE_PROMISES = 21225, BAN_PROMISE_AS_CONDITION = 21226, PROPERTY_RENAMING_SAFE = 21227, + CONFORMANCE_PATTERN = 21228, } diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts new file mode 100644 index 00000000..ec3c8bfe --- /dev/null +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -0,0 +1,52 @@ +import {Checker} from '../checker'; +import {ErrorCode} from '../error_code'; +import {AbstractRule} from '../rule'; +import {Fixer} from '../util/fixer'; +import {Config, MatchedNodeTypes, PatternKind} from '../util/pattern_config'; +import {PatternEngine} from '../util/pattern_engines/pattern_engine'; +import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; + +/** + * Builds a Rule that matches a certain pattern, given as parameter, and + * that can additionally run a suggested fix generator on the matches. + * + * This is templated, mostly to ensure the nodes that have been matched + * correspond to what the Fixer expects. + */ +export class ConformancePatternRule

    implements + AbstractRule { + readonly ruleName: string; + readonly code = ErrorCode.CONFORMANCE_PATTERN; + + private readonly engine: PatternEngine

    ; + + constructor( + config: Config

    , fixer?: Fixer, + verbose?: boolean) { + // TODO(rjamet): This cheats a bit with the typing, as TS doesn't realize + // that P is Config.kind. + // tslint:disable-next-line:no-any See above. + let engine: PatternEngine; + switch (config.kind) { + case PatternKind.BANNED_PROPERTY_WRITE: + engine = new PropertyWriteEngine(config, fixer, verbose); + break; + default: + throw new Error('Config type not recognized, or not implemented yet.'); + } + this.ruleName = `conformance-pattern-${config.kind}`; + this.engine = engine as PatternEngine

    ; + } + + register(checker: Checker) { + this.engine.register(checker); + } +} + +// Re-exported for convenience when instantiating rules. +/** + * The list of supported patterns useable in ConformancePatternRule. The + * patterns whose name match JSConformance patterns should behave similarly (see + * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework). + */ +export {PatternKind}; diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts new file mode 100644 index 00000000..45f0c3a9 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts @@ -0,0 +1,86 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +describe('BANNED_PROPERTY_WRITE', () => { + it('matches simple examples', () => { + const source = `const q = document.createElement('q');\n` + + `q.cite = 'some example string';\n`; + const rule = new ConformancePatternRule({ + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(1); + expect(results[0]) + .toBeFailureMatching({start: 39, end: 69, errorMessage: 'do not cite'}); + }); + + it('understands imported symbols', () => { + const sources = [ + `const q = document.createElement('q'); export {q};`, + `import {q} from './file_0'; q.cite = window.name;` + ]; + const rule = new ConformancePatternRule({ + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }); + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + start: 28, + end: 48, + errorMessage: 'do not cite', + // fileName: 'file_0.ts' + // TODO(rjamet): why is there no source file in the finding? + }); + }); + + + describe('with inheritance', () => { + const source = [ + `class Parent {x:number}`, + `class Child extends Parent {}`, + `const c:Child = new Child();`, + `c.x = 1;`, + ].join('\n'); + + // Both of these should have the same results: in `c.x`, `x` matches, + // and `c` is both a Parent and a Child. + const expectedFailure = { + start: 83, + end: 90, + errorMessage: 'found write to x', + }; + + it('banning Parent.x matches (instance of Child).x', () => { + const ruleOnParent = new ConformancePatternRule({ + errorMessage: 'found write to x', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['Parent.prototype.x'] + }); + const r = compileAndCheck(ruleOnParent, source); + expect(r.length).toBe(1); + expect(r[0]).toBeFailureMatching(expectedFailure); + }); + + it('banning Child.x matches x defined on Parent', () => { + const ruleOnChild = new ConformancePatternRule({ + errorMessage: 'found write to x', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['Child.prototype.x'] + }); + const r = compileAndCheck(ruleOnChild, source); + expect(r.length).toBe(1); + expect(r[0]).toBeFailureMatching(expectedFailure); + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts new file mode 100644 index 00000000..c2748d9a --- /dev/null +++ b/internal/tsetse/util/pattern_config.ts @@ -0,0 +1,33 @@ +import * as ts from 'typescript'; + +/** + * The list of supported patterns useable in ConformancePatternRule. The + * patterns whose name match JSConformance patterns should behave similarly (see + * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework) + */ +export enum PatternKind { + BANNED_PROPERTY_WRITE = 'banned-property-write', +} + +/** + * A config for ConformancePatternRule. + */ +export interface Config

    { + kind: P; + /** + * Values have a pattern-specific syntax. + * + * TODO(rjamet): We'll document them, but for now see each patternKind's tests + * for examples. + */ + values: string[]; + /** The error message this pattern will create. */ + errorMessage: string; +} + +/** Maps the type of nodes that each `PatternType` produces. */ +export interface MatchedNodeTypes { + [PatternKind.BANNED_PROPERTY_WRITE]: ts.BinaryExpression&{ + left: ts.PropertyAccessExpression; + }; +} diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts new file mode 100644 index 00000000..4d315b52 --- /dev/null +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -0,0 +1,15 @@ +import {Checker} from '../../checker'; +import {Fixer} from '../../util/fixer'; +import {Config, MatchedNodeTypes, PatternKind} from '../../util/pattern_config'; + +/** + * A patternEngine is the logic that handles a specific PatternKind. + */ +export abstract class PatternEngine

    { + constructor( + protected readonly config: Config

    , + protected readonly fixer?: Fixer, + protected readonly verbose?: boolean) {} + + abstract register(checker: Checker): void; +} diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts new file mode 100644 index 00000000..ea8fe35a --- /dev/null +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -0,0 +1,49 @@ +import * as ts from 'typescript'; +import {Checker} from '../../checker'; +import {ErrorCode} from '../../error_code'; +import {Fix} from '../../failure'; +import {debugLog, isPropertyWriteExpression, shouldExamineNode} from '../ast_tools'; +import {Fixer} from '../fixer'; +import {PropertyMatcher} from '../match_symbol'; +import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; +import {PatternEngine} from '../pattern_engines/pattern_engine'; + +/** + * The engine for BANNED_PROPERTY_WRITE. + */ +export class PropertyWriteEngine extends + PatternEngine { + private readonly matcher: PropertyMatcher; + constructor( + config: Config, + fixer?: Fixer, + verbose?: boolean) { + super(config, fixer, verbose); + // TODO: Support more than one single value here, or even build a + // multi-pattern engine. This would help for performance. + if (this.config.values.length !== 1) { + throw new Error(`BANNED_PROPERTY_WRITE expects one value, got(${ + this.config.values.join(',')})`); + } + this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); + } + + register(checker: Checker) { + checker.on( + ts.SyntaxKind.BinaryExpression, this.check.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + } + + check(c: Checker, n: ts.BinaryExpression) { + if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile || + !isPropertyWriteExpression(n)) { + return; + } + debugLog(this.verbose, `inspecting ${n.getFullText().trim()}`); + if (this.matcher.matches(n.left, c.typeChecker, this.verbose)) { + const fix: Fix|undefined = + this.fixer ? this.fixer.getFixForFlaggedNode(n) : undefined; + c.addFailureAtNode(n, this.config.errorMessage, fix); + } + } +} From 109307edb6a6d3a1e3af07d1ff39802e889051b2 Mon Sep 17 00:00:00 2001 From: Philipp Wollermann Date: Tue, 21 May 2019 08:27:59 -0700 Subject: [PATCH 155/316] -- Don't test on Ubuntu 14.04 Ubuntu 14.04 is about to be end-of-life and Bazel CI will stop supporting it shortly afterwards. Context: https://groups.google.com/d/msg/bazel-dev/_D6XzfNkQQE/8TNKiNmsCAAJ Closes #442 PiperOrigin-RevId: 249254890 --- .bazelci/presubmit.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index dc31779c..86727d19 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,24 +1,24 @@ --- platforms: - ubuntu1404: + ubuntu1604: run_targets: - "//:gazelle" - "@nodejs//:yarn" build_targets: - "..." test_flags: - # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1404 + # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1604 - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" test_targets: - "..." - ubuntu1604: + ubuntu1804: run_targets: - "//:gazelle" - "@nodejs//:yarn" build_targets: - "..." test_flags: - # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1604 + # TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1404 - "--test_tag_filters=-browser:chromium-local,-browser:firefox-local" test_targets: - "..." From 7b6fde8c41b5e882ea674e10f0dab3c10ede3105 Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Tue, 21 May 2019 08:37:02 -0700 Subject: [PATCH 156/316] Update rules_go to 0.18.5 This version contains forward fixes for Bazel 0.27. Closes #447 PiperOrigin-RevId: 249256466 --- WORKSPACE | 2 +- package.bzl | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 7bb63466..4fd6286f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -40,7 +40,7 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() # Setup rules_go toolchain -load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() diff --git a/package.bzl b/package.bzl index f4511ea0..b5b9e012 100644 --- a/package.bzl +++ b/package.bzl @@ -38,8 +38,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "io_bazel", - urls = ["https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel-0.21.0-dist.zip"], - sha256 = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4", + urls = ["https://github.com/bazelbuild/bazel/releases/download/0.25.0/bazel-0.25.0-dist.zip"], + sha256 = "f624fe9ca8d51de192655369ac538c420afb7cde16e1ad052554b582fff09287", ) # For building ts_devserver and ts_auto_deps binaries @@ -47,20 +47,22 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "io_bazel_rules_go", - # We need https://github.com/bazelbuild/rules_go/commit/109c520465fcb418f2c4be967f3744d959ad66d3 which - # is not part of any 0.16.x release yet. This commit provides runfile resolve support for Windows. - urls = ["https://github.com/bazelbuild/rules_go/archive/12a52e9845a5b06a28ffda06d7f2b07ff2320b97.zip"], - strip_prefix = "rules_go-12a52e9845a5b06a28ffda06d7f2b07ff2320b97", - sha256 = "5c0a059afe51c744c90ae2b33ac70b9b4f4c514715737e2ec0b5fd297400c10d", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz", + "https://github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz", + ], + sha256 = "a82a352bffae6bee4e95f68a8d80a70e87f42c4741e6a448bec11998fcc82329", ) # go_repository is defined in bazel_gazelle _maybe( http_archive, name = "bazel_gazelle", - urls = ["https://github.com/bazelbuild/bazel-gazelle/archive/c0880f7f9d7048b45be5d36115ec2bf444e723c4.zip"], # 2018-12-05 - strip_prefix = "bazel-gazelle-c0880f7f9d7048b45be5d36115ec2bf444e723c4", - sha256 = "d9980ae0c91d90aaf9131170adfec4e87464d53e58ce2eb01b350a53e93a87c7", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz", + ], + sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687", ) # ts_auto_deps depends on com_github_bazelbuild_buildtools From 650db0cc95b361a188d2ae7c6758fd6bfaccc999 Mon Sep 17 00:00:00 2001 From: rjamet Date: Wed, 22 May 2019 04:48:00 -0700 Subject: [PATCH 157/316] Swap the verbosity mechanism for ConformancePatternRule from an argument to a global switch. PiperOrigin-RevId: 249425522 --- .../tsetse/rules/conformance_pattern_rule.ts | 6 +-- .../ban_conformance_pattern/util_test.ts | 37 +++++++++++++++++++ internal/tsetse/util/ast_tools.ts | 29 ++++++++++----- internal/tsetse/util/fixer.ts | 32 ++++++++-------- internal/tsetse/util/match_symbol.ts | 20 +++++----- .../util/pattern_engines/pattern_engine.ts | 3 +- .../pattern_engines/property_write_engine.ts | 9 ++--- 7 files changed, 88 insertions(+), 48 deletions(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/util_test.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index ec3c8bfe..c78f90cb 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -20,16 +20,14 @@ export class ConformancePatternRule

    implements private readonly engine: PatternEngine

    ; - constructor( - config: Config

    , fixer?: Fixer, - verbose?: boolean) { + constructor(config: Config

    , fixer?: Fixer) { // TODO(rjamet): This cheats a bit with the typing, as TS doesn't realize // that P is Config.kind. // tslint:disable-next-line:no-any See above. let engine: PatternEngine; switch (config.kind) { case PatternKind.BANNED_PROPERTY_WRITE: - engine = new PropertyWriteEngine(config, fixer, verbose); + engine = new PropertyWriteEngine(config, fixer); break; default: throw new Error('Config type not recognized, or not implemented yet.'); diff --git a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts new file mode 100644 index 00000000..0588b474 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts @@ -0,0 +1,37 @@ +/** + * @fileoverview Tests for the various utilities that are not tied to a single + * rule. + */ + +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {setDebug} from '../../util/ast_tools'; +import {compileAndCheck} from '../../util/testing/test_support'; + +describe('Debug output', () => { + it('turns on and off', () => { + const source = `const obj = {prop:'val'}; obj.prop = 'foo';`; + const rule = new ConformancePatternRule({ + errorMessage: 'does not matter', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }); + + const logs: string[] = []; + const realConsoleLog = console.log; + spyOn(console, 'log').and.callFake((s: string) => { + logs.push(s); + realConsoleLog(s); + }); + setDebug(true); + compileAndCheck(rule, source); + + expect(logs).toEqual([`inspecting obj.prop = 'foo'`]); + + setDebug(false); + compileAndCheck(rule, source); + + // Nothing more appended: debug was false + expect(logs).toEqual([`inspecting obj.prop = 'foo'`]); + }); +}); diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index 44d26ee2..cb0f0cb9 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -5,6 +5,25 @@ import * as ts from 'typescript'; +/** + * Triggers increased verbosity in the rules. + */ +let DEBUG = false; + +/** + * Turns on or off logging for ConformancePatternRules. + */ +export function setDebug(state: boolean) { + DEBUG = state; +} + +/** + * Debug helper. + */ +export function debugLog(msg: string) { + if (DEBUG) console.log(msg); +} + /** * Returns `n`'s parents in order. */ @@ -145,13 +164,6 @@ export function isPropertyWriteExpression(node: ts.Node): return true; } -/** - * Debug helper. - */ -export function debugLog(verbose: boolean|undefined, msg: string) { - if (verbose) console.info(msg); -} - /** * If verbose, logs the given error that happened while walking n, with a * stacktrace. @@ -163,7 +175,6 @@ export function logASTWalkError(verbose: boolean, n: ts.Node, e: Error) { } catch { } debugLog( - verbose, `Walking node ${nodeText} failed with error ${e}.\n` + - `Stacktrace:\n${e.stack}`); + `Stacktrace:\n${e.stack}`); } diff --git a/internal/tsetse/util/fixer.ts b/internal/tsetse/util/fixer.ts index 19de12a2..f9b784e1 100644 --- a/internal/tsetse/util/fixer.ts +++ b/internal/tsetse/util/fixer.ts @@ -52,20 +52,19 @@ export function buildReplacementFixer( */ export function maybeAddNamedImport( source: ts.SourceFile, importWhat: string, fromFile: string, - importAs?: string, tazeComment?: string, v?: boolean): IndividualChange| - undefined { + importAs?: string, tazeComment?: string): IndividualChange|undefined { const importStatements = source.statements.filter(ts.isImportDeclaration); const importSpecifier = importAs ? `${importWhat} as ${importAs}` : importWhat; for (const iDecl of importStatements) { - const parsedDecl = maybeParseImportNode(iDecl, v); + const parsedDecl = maybeParseImportNode(iDecl); if (!parsedDecl || parsedDecl.fromFile !== fromFile) { // Not an import from the right file, or couldn't understand the import. continue; // Jump to the next import. } if (ts.isNamespaceImport(parsedDecl.namedBindings)) { - debugLog(v, `... but it's a wildcard import`); + debugLog(`... but it's a wildcard import`); continue; // Jump to the next import. } @@ -78,12 +77,12 @@ export function maybeAddNamedImport( iSpec.name.getText() === importWhat); // import {foo} if (foundRightImport) { - debugLog(v, `"${iDecl.getFullText()}" imports ${importWhat} as we want.`); + debugLog(`"${iDecl.getFullText()}" imports ${importWhat} as we want.`); return; // Our request is already imported under the right name. } // Else, insert our symbol in the list of imports from that file. - debugLog(v, `No named imports from that file, generating new fix`); + debugLog(`No named imports from that file, generating new fix`); return { start: parsedDecl.namedBindings.elements[0].getStart(), end: parsedDecl.namedBindings.elements[0].getStart(), @@ -117,27 +116,27 @@ export function maybeAddNamedImport( */ export function maybeAddNamespaceImport( source: ts.SourceFile, fromFile: string, importAs: string, - tazeComment?: string, v?: boolean): IndividualChange|undefined { + tazeComment?: string): IndividualChange|undefined { const importStatements = source.statements.filter(ts.isImportDeclaration); const hasTheRightImport = importStatements.some(iDecl => { - const parsedDecl = maybeParseImportNode(iDecl, v); + const parsedDecl = maybeParseImportNode(iDecl); if (!parsedDecl || parsedDecl.fromFile !== fromFile) { // Not an import from the right file, or couldn't understand the import. return false; } - debugLog(v, `"${iDecl.getFullText()}" is an import from the right file`); + debugLog(`"${iDecl.getFullText()}" is an import from the right file`); if (ts.isNamedImports(parsedDecl.namedBindings)) { - debugLog(v, `... but it's a named import`); + debugLog(`... but it's a named import`); return false; // irrelevant to our namespace imports } // Else, bindings is a NamespaceImport. if (parsedDecl.namedBindings.name.getText() !== importAs) { - debugLog(v, `... but not the right name, we need to reimport`); + debugLog(`... but not the right name, we need to reimport`); return false; } - debugLog(v, `... and the right name, no need to reimport`); + debugLog(`... and the right name, no need to reimport`); return true; }); @@ -162,14 +161,13 @@ export function maybeAddNamespaceImport( * parts, undefined if the import declaration is valid but not understandable by * the checker. */ -function maybeParseImportNode(iDecl: ts.ImportDeclaration, v?: boolean): { +function maybeParseImportNode(iDecl: ts.ImportDeclaration): { namedBindings: ts.NamedImportBindings|ts.NamespaceImport, fromFile: string }|undefined { if (!iDecl.importClause) { // something like import "./file"; - debugLog( - v, `Ignoring import without imported symbol: ${iDecl.getFullText()}`); + debugLog(`Ignoring import without imported symbol: ${iDecl.getFullText()}`); return; } if (iDecl.importClause.name || !iDecl.importClause.namedBindings) { @@ -177,11 +175,11 @@ function maybeParseImportNode(iDecl: ts.ImportDeclaration, v?: boolean): { // Not much we can do with that when trying to get a hold of some symbols, // so just ignore that line (worst case, we'll suggest another import // style). - debugLog(v, `Ignoring import: ${iDecl.getFullText()}`); + debugLog(`Ignoring import: ${iDecl.getFullText()}`); return; } if (!ts.isStringLiteral(iDecl.moduleSpecifier)) { - debugLog(v, `Ignoring import whose module specifier is not literal`); + debugLog(`Ignoring import whose module specifier is not literal`); return; } return { diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index 1a05c72b..5df53b10 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -35,23 +35,23 @@ export class AbsoluteMatcher { } } - matches(n: ts.Node, tc: ts.TypeChecker, verbose?: boolean): boolean { + matches(n: ts.Node, tc: ts.TypeChecker): boolean { // Get the symbol (or the one at the other end of this alias) that we're // looking at. const s = dealias(tc.getSymbolAtLocation(n), tc); if (!s) { - debugLog(verbose, `cannot get symbol`); + debugLog(`cannot get symbol`); return false; } // The TS-provided FQN tells us the full identifier, and the origin file // in some circumstances. const fqn = tc.getFullyQualifiedName(s); - debugLog(verbose, `got FQN ${fqn}`); + debugLog(`got FQN ${fqn}`); // Name-based check if (!(fqn.endsWith('.' + this.bannedName) || fqn === this.bannedName)) { - debugLog(verbose, `FQN ${fqn} doesn't match name ${this.bannedName}`); + debugLog(`FQN ${fqn} doesn't match name ${this.bannedName}`); return false; // not a use of the symbols we want } @@ -61,7 +61,7 @@ export class AbsoluteMatcher { // and bad fixes. const p = n.parent; if (p && (isDeclaration(p) || isPartOfImportStatement(p))) { - debugLog(verbose, `We don't flag symbol declarations`); + debugLog(`We don't flag symbol declarations`); return false; } @@ -74,18 +74,17 @@ export class AbsoluteMatcher { // We need to trace things back, so get declarations of the symbol. const declarations = s.getDeclarations(); if (!declarations) { - debugLog(verbose, `Symbol never declared?`); + debugLog(`Symbol never declared?`); return false; } if (!declarations.some(isAmbientDeclaration) && !declarations.some(isInStockLibraries)) { - debugLog( - verbose, `Symbol neither ambient nor from the stock libraries`); + debugLog(`Symbol neither ambient nor from the stock libraries`); return false; } } - debugLog(verbose, `all clear, report finding`); + debugLog(`all clear, report finding`); return true; } } @@ -123,8 +122,7 @@ export class PropertyMatcher { /** * @param n The PropertyAccessExpression we're looking at. */ - matches( - n: ts.PropertyAccessExpression, tc: ts.TypeChecker, verbose?: boolean) { + matches(n: ts.PropertyAccessExpression, tc: ts.TypeChecker) { return n.name.text === this.bannedProperty && this.typeMatches(tc.getTypeAtLocation(n.expression)); } diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index 4d315b52..5dbbddc1 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -8,8 +8,7 @@ import {Config, MatchedNodeTypes, PatternKind} from '../../util/pattern_config'; export abstract class PatternEngine

    { constructor( protected readonly config: Config

    , - protected readonly fixer?: Fixer, - protected readonly verbose?: boolean) {} + protected readonly fixer?: Fixer) {} abstract register(checker: Checker): void; } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index ea8fe35a..7af7ccf0 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -16,9 +16,8 @@ export class PropertyWriteEngine extends private readonly matcher: PropertyMatcher; constructor( config: Config, - fixer?: Fixer, - verbose?: boolean) { - super(config, fixer, verbose); + fixer?: Fixer) { + super(config, fixer); // TODO: Support more than one single value here, or even build a // multi-pattern engine. This would help for performance. if (this.config.values.length !== 1) { @@ -39,8 +38,8 @@ export class PropertyWriteEngine extends !isPropertyWriteExpression(n)) { return; } - debugLog(this.verbose, `inspecting ${n.getFullText().trim()}`); - if (this.matcher.matches(n.left, c.typeChecker, this.verbose)) { + debugLog(`inspecting ${n.getFullText().trim()}`); + if (this.matcher.matches(n.left, c.typeChecker)) { const fix: Fix|undefined = this.fixer ? this.fixer.getFixForFlaggedNode(n) : undefined; c.addFailureAtNode(n, this.config.errorMessage, fix); From c1fc9c1e9a166b1102c46060150cc673fb7a92b2 Mon Sep 17 00:00:00 2001 From: rjamet Date: Thu, 23 May 2019 06:52:22 -0700 Subject: [PATCH 158/316] Add a property_write_non_constant engine to Tsetse's ConformancePattern. Same as property_write, but only triggers on writing non-constant values. PiperOrigin-RevId: 249633880 --- .../tsetse/rules/conformance_pattern_rule.ts | 9 ++- .../property_non_constant_write_test.ts | 27 ++++++++ .../ban_conformance_pattern/util_test.ts | 64 ++++++++++++++++++- internal/tsetse/util/pattern_config.ts | 4 ++ .../property_non_constant_write_engine.ts | 58 +++++++++++++++++ internal/tsetse/util/testing/test_support.ts | 8 ++- 6 files changed, 166 insertions(+), 4 deletions(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts create mode 100644 internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index c78f90cb..b683355d 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -4,6 +4,7 @@ import {AbstractRule} from '../rule'; import {Fixer} from '../util/fixer'; import {Config, MatchedNodeTypes, PatternKind} from '../util/pattern_config'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; +import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; /** @@ -27,7 +28,13 @@ export class ConformancePatternRule

    implements let engine: PatternEngine; switch (config.kind) { case PatternKind.BANNED_PROPERTY_WRITE: - engine = new PropertyWriteEngine(config, fixer); + engine = new PropertyWriteEngine( + config as Config, fixer); + break; + case PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE: + engine = new PropertyNonConstantWriteEngine( + config as Config, + fixer); break; default: throw new Error('Config type not recognized, or not implemented yet.'); diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts new file mode 100644 index 00000000..8b517962 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts @@ -0,0 +1,27 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { + it('matches a trivial example', () => { + const source = `const q = document.createElement('q');\n` + + `q.cite = 'some example string';\n` + // literal + `q.cite = window.name;\n`; // non-literal + const rule = new ConformancePatternRule({ + errorMessage: 'do not cite dynamically', + kind: PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(1); + expect(results[0]) + .toBeFailureMatching( + {start: 71, end: 91, errorMessage: 'do not cite dynamically'}); + }); +}); + + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts index 0588b474..94ab2346 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts @@ -5,8 +5,9 @@ import 'jasmine'; import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {setDebug} from '../../util/ast_tools'; -import {compileAndCheck} from '../../util/testing/test_support'; +import {isInStockLibraries, setDebug} from '../../util/ast_tools'; +import {isLiteral} from '../../util/is_literal'; +import {compile, compileAndCheck} from '../../util/testing/test_support'; describe('Debug output', () => { it('turns on and off', () => { @@ -35,3 +36,62 @@ describe('Debug output', () => { expect(logs).toEqual([`inspecting obj.prop = 'foo'`]); }); }); + +describe('The constant-ness logic', () => { + it('understands constants', () => { + // Keep these to single-expression programs. + const constantExpressionsSources = [ + `'hello'`, + `'hello' + 'hi'`, + `1`, + `1 + 1`, + '`abcdef`', + '`abcd${"ef"}`', + '`abcd${1+1}`+`hi`', + `1 ? 'hi' : 'hello'`, + `window.name ? 'hi' : 'hello'`, + ]; + + // We don't bother with a rule for this one. + const constantProgram = compile(...constantExpressionsSources); + const constantCompiledSources = constantProgram.getSourceFiles(); + const constantTc = constantProgram.getTypeChecker(); + const constantExpressions = + constantCompiledSources.filter(s => !isInStockLibraries(s)) + .map(s => s.statements[0].getChildren()[0]); + + for (const expr of constantExpressions) { + expect(isLiteral(constantTc, expr)) + .toBe( + true, + `Expected "${expr.getFullText()}" to be considered constant.`); + } + }); + + + it('understands non-constants', () => { + const nonconstantExpressionsSources = [ + `window.name`, + `'hello' + window.name`, + `window.name + 'hello'`, + '`abcd${window.name}`', + `1 ? window.name : 'hello'`, + `1 ? 'hello' : window.name`, + ]; + + const nonconstantProgram = compile(...nonconstantExpressionsSources); + const nonconstantCompiledSources = nonconstantProgram.getSourceFiles(); + const nonconstantTc = nonconstantProgram.getTypeChecker(); + const nonconstantExpressions = + nonconstantCompiledSources.filter(s => !isInStockLibraries(s)) + .map(s => s.statements[0].getChildren()[0]); + + for (const expr of nonconstantExpressions) { + expect(isLiteral(nonconstantTc, expr)) + .toBe( + false, + `Expected "${ + expr.getFullText()}" not to be considered constant.`); + } + }); +}); diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index c2748d9a..76e2d713 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -7,6 +7,7 @@ import * as ts from 'typescript'; */ export enum PatternKind { BANNED_PROPERTY_WRITE = 'banned-property-write', + BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write' } /** @@ -30,4 +31,7 @@ export interface MatchedNodeTypes { [PatternKind.BANNED_PROPERTY_WRITE]: ts.BinaryExpression&{ left: ts.PropertyAccessExpression; }; + [PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE]: ts.BinaryExpression&{ + left: ts.PropertyAccessExpression; + }; } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts new file mode 100644 index 00000000..9e26cd77 --- /dev/null +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -0,0 +1,58 @@ +import * as ts from 'typescript'; +import {Checker} from '../../checker'; +import {ErrorCode} from '../../error_code'; +import {Fix} from '../../failure'; +import {debugLog, isPropertyWriteExpression, shouldExamineNode} from '../ast_tools'; +import {Fixer} from '../fixer'; +import {isLiteral} from '../is_literal'; +import {PropertyMatcher} from '../match_symbol'; +import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; +import {PatternEngine} from './pattern_engine'; + +// Just for conciseness. +type BanKind = PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE; + +/** + * The engine for BANNED_PROPERTY_NON_CONSTANT_WRITE. + */ +export class PropertyNonConstantWriteEngine extends PatternEngine { + private readonly matcher: PropertyMatcher; + constructor( + config: Config, fixer?: Fixer) { + super(config, fixer); + // TODO: Support more than one single value here, or even build a + // multi-pattern engine. This would help for performance. + if (this.config.values.length !== 1) { + throw new Error( + `BANNED_PROPERTY_NON_CONSTANT_WRITE expects one value, got(${ + this.config.values.join(',')})`); + } + this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); + } + + register(checker: Checker) { + checker.on( + ts.SyntaxKind.BinaryExpression, this.check.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + } + + check(c: Checker, n: ts.BinaryExpression) { + if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile || + !isPropertyWriteExpression(n)) { + return; + } + debugLog(`inspecting ${n.getFullText().trim()}`); + if (!this.matcher.matches(n.left, c.typeChecker)) { + debugLog('Not an assignment to the right property'); + return; + } + if (isLiteral(c.typeChecker, n.right)) { + debugLog(`Assigned value (${ + n.right.getFullText()}) is a compile-time constant.`); + return; + } + const fix: Fix|undefined = + this.fixer ? this.fixer.getFixForFlaggedNode(n) : undefined; + c.addFailureAtNode(n, this.config.errorMessage, fix); + } +} diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index 010ad8ca..8adb90a0 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -10,7 +10,13 @@ import {Failure, Fix} from '../../failure'; import {AbstractRule} from '../../rule'; -function compile(...sourceCode: string[]): ts.Program { + +/** + * Turns the provided source (as strings) into a ts.Program. The source files + * will be named `.../file_${n}.ts`, with n the index of the source file in + * the `sourceCode` array. + */ +export function compile(...sourceCode: string[]): ts.Program { const temporaryFolder = os.tmpdir() + `/tslint_test_input_${crypto.randomBytes(16).toString('hex')}`; const fullPaths: string[] = []; From 09f858aec16969660092cd83d62807247ab11f6e Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 23 May 2019 19:02:22 -0700 Subject: [PATCH 159/316] Fix for --incompatible_depset_is_not_iterable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We used a depset for a collection which is only used within the context of a single target: the files[] block in the generated tsconfig. As documented on https://docs.bazel.build/versions/master/skylark/depsets.html: "If you don’t need the merge operation, consider using another type, such as list or dict." The problem is exposed by --incompatible_depset_is_not_iterable which fails at the spot where we iterated the depset of files, showing that it should have been a list. Also clean up a warning about the deprecated load of jasmine_node_test See #443 Closes #451 PiperOrigin-RevId: 249758830 --- internal/BUILD.bazel | 3 +- internal/common/compilation.bzl | 7 +- internal/common/tsconfig.bzl | 3 + package.bzl | 4 +- package.json | 9 +- yarn.lock | 570 +++++++++++++++++++++++++++++++- 6 files changed, 578 insertions(+), 18 deletions(-) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 8b24d69d..26dc0fba 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -14,8 +14,9 @@ # gazelle:exclude worker_protocol.proto -load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test", "nodejs_binary") +load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 8bb4732d..9cc2b88b 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -288,7 +288,7 @@ def compile_ts( if "TYPESCRIPT_PERF_TRACE_TARGET" in ctx.var: perf_trace = str(ctx.label) == ctx.var["TYPESCRIPT_PERF_TRACE_TARGET"] - compilation_inputs = depset(srcs_files, transitive = [input_declarations]) + compilation_inputs = dep_declarations.transitive.to_list() + srcs_files tsickle_externs_path = tsickle_externs[0] if tsickle_externs else None # Calculate allowed dependencies for strict deps enforcement. @@ -344,7 +344,7 @@ def compile_ts( replay_params = None if has_sources: - inputs = depset([ctx.outputs.tsconfig], transitive = [compilation_inputs]) + inputs = compilation_inputs + [ctx.outputs.tsconfig] replay_params = compile_action( ctx, inputs, @@ -388,10 +388,9 @@ def compile_ts( ctx.actions.write(output = tsconfig_json_es5, content = json_marshal( tsconfig_es5, )) - inputs = depset([tsconfig_json_es5], transitive = [compilation_inputs]) devmode_compile_action( ctx, - inputs, + compilation_inputs + [tsconfig_json_es5], outputs, tsconfig_json_es5, node_profile_args, diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 349dc6f9..0fe82547 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -54,6 +54,9 @@ def create_tsconfig( Returns: A nested dict that corresponds to a tsconfig.json structure """ + if (type(files) != type([])): + fail("expected files argument to be a list, got " + type(files)) + outdir_path = out_dir if out_dir != None else ctx.configuration.bin_dir.path # Callers can choose the filename for the tsconfig, but it must always live diff --git a/package.bzl b/package.bzl index b5b9e012..5e07daa5 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.0/rules_nodejs-0.29.0.tar.gz"], - sha256 = "1db950bbd27fb2581866e307c0130983471d4c3cd49c46063a2503ca7b6770a4", + sha256 = "73325a155c16bfbde29fb2ffcaf59d9d5a1c13b06ada386d3edd5a9d82bda702", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.1/rules_nodejs-0.29.1.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index 5d98dad9..66994589 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,10 @@ "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", "devDependencies": { - "protobufjs": "6.8.8", - "semver": "5.6.0", - "source-map-support": "0.5.9", - "tsutils": "2.27.2", "@bazel/bazel": "0.25.1", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", + "@bazel/jasmine": "^0.29.0", "@bazel/typescript": "0.29.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", @@ -28,11 +25,15 @@ "karma-requirejs": "1.1.0", "karma-sauce-launcher": "2.0.2", "karma-sourcemap-loader": "0.3.7", + "protobufjs": "6.8.8", "protractor": "^5.2.0", "requirejs": "2.3.5", + "semver": "5.6.0", "shelljs": "^0.8.2", + "source-map-support": "0.5.9", "tmp": "0.0.33", "tsickle": "0.33.1", + "tsutils": "2.27.2", "typescript": "~3.1.6", "which": "~1.0.5" }, diff --git a/yarn.lock b/yarn.lock index 7e860269..68a5dbe3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,6 +49,15 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= +"@bazel/jasmine@^0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.29.0.tgz#347d9c512daf8576dcdaa9bb168733fa444c2263" + integrity sha512-QH/mLAH4e7gcJrfOT0BmJ4wk+5Ly3RU+RPLaCyacnCjmJCICukZJa/rrjbVtwd8u7ZM+Hf6tRaLLydSeKXGBug== + dependencies: + jasmine "~3.3.1" + jasmine-core "~3.3.0" + v8-coverage "1.0.9" + "@bazel/typescript@0.29.0": version "0.29.0" resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.29.0.tgz#d276afe034f37b5f35ee1369c99dc33c637fc9f6" @@ -548,6 +557,11 @@ callsite@1.0.0: resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" integrity sha1-KAOY5dZkvXQDi28JBRU+borxvCA= +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -624,6 +638,15 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -671,6 +694,11 @@ commander@2.6.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" integrity sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0= +commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -755,6 +783,23 @@ corser@~2.0.0: resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87" integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c= +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + cryptiles@3.x.x: version "3.1.2" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" @@ -798,6 +843,11 @@ debug@^3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -950,6 +1000,13 @@ ent@~2.2.0: resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + es6-promise@^4.0.3: version "4.2.5" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" @@ -982,6 +1039,19 @@ eventemitter3@^3.0.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -1094,6 +1164,20 @@ finalhandler@1.1.0: statuses "~1.3.1" unpipe "~1.0.0" +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + flatted@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" @@ -1111,6 +1195,14 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= +foreground-child@^1.5.6: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + integrity sha1-T9ca0t/elnibmApcCilZN8svXOk= + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -1178,6 +1270,16 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -1222,6 +1324,18 @@ glob@^7.1.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -1239,6 +1353,17 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= +handlebars@^4.0.3: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -1339,6 +1464,11 @@ hoek@4.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" integrity sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ== +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-errors@1.6.3, http-errors@~1.6.3: version "1.6.3" resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -1452,6 +1582,11 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" @@ -1466,6 +1601,11 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" @@ -1591,6 +1731,11 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -1640,11 +1785,38 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= +istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" + integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== + +istanbul-lib-report@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" + integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== + dependencies: + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-reports@^1.3.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" + integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== + dependencies: + handlebars "^4.0.3" + jasmine-core@2.8.0, jasmine-core@~2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= +jasmine-core@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.3.0.tgz#dea1cdc634bc93c7e0d4ad27185df30fa971b10e" + integrity sha512-3/xSmG/d35hf80BEN66Y6g9Ca5l/Isdeg/j6zvbTYlTzeKinzmaTM4p9am5kYqOmE05D7s1t8FGjzdSnbUbceA== + jasmine@^2.5.3: version "2.8.0" resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" @@ -1654,6 +1826,14 @@ jasmine@^2.5.3: glob "^7.0.6" jasmine-core "~2.8.0" +jasmine@~3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.3.1.tgz#d61bb1dd8888859bd11ea83074a78ee13d949905" + integrity sha512-/vU3/H7U56XsxIXHwgEuWpCgQ0bRi2iiZeUpx7Nqo8n1TpoDHfZhkPIc7CO8I4pnMzYsi3XaSZEiy8cnTfujng== + dependencies: + glob "^7.0.6" + jasmine-core "~3.3.0" + jasminewd2@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-2.2.0.tgz#e37cf0b17f199cce23bea71b2039395246b4ec4e" @@ -1664,6 +1844,11 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -1804,6 +1989,13 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + lie@~3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" @@ -1811,6 +2003,32 @@ lie@~3.1.0: dependencies: immediate "~3.0.5" +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -1850,6 +2068,14 @@ lru-cache@4.1.x: pseudomap "^1.0.2" yallist "^2.1.2" +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -1867,6 +2093,13 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -1920,6 +2153,11 @@ mime@^2.3.1: resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== +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.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -2008,6 +2246,11 @@ negotiator@0.6.1: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= +neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" @@ -2032,6 +2275,16 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" +normalize-package-data@^2.3.2: + 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" + normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -2052,6 +2305,13 @@ npm-packlist@^1.1.6: ignore-walk "^3.0.1" npm-bundled "^1.0.1" +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -2142,11 +2402,20 @@ options@>=0.0.5: resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f" integrity sha1-7CLTEoBrtT5zF3Pnza788cZDEo8= -os-homedir@^1.0.0: +os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2160,11 +2429,62 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + pako@~1.0.2: version "1.0.6" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + parseqs@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" @@ -2194,6 +2514,11 @@ path-dirname@^1.0.0: resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + 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" @@ -2204,11 +2529,28 @@ path-is-inside@^1.0.1: 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.0: + 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.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= +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@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.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" @@ -2219,6 +2561,11 @@ pify@^2.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -2355,6 +2702,23 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: version "2.3.6" resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -2452,6 +2816,21 @@ request@^2.78.0: tunnel-agent "^0.6.0" uuid "^3.1.0" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + requirejs@2.3.5: version "2.3.5" resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0" @@ -2474,6 +2853,13 @@ resolve@^1.1.6: dependencies: path-parse "^1.0.5" +resolve@^1.10.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232" + integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw== + dependencies: + path-parse "^1.0.6" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -2491,6 +2877,13 @@ rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.0, rimraf@^2.6.1: dependencies: glob "^7.0.5" +rimraf@^2.6.2: + 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" + rx@2.3.24: version "2.3.24" resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" @@ -2584,6 +2977,11 @@ selenium-webdriver@^4.0.0-alpha.1: tmp "0.0.30" xml2js "^0.4.17" +"semver@2 || 3 || 4 || 5": + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + semver@5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" @@ -2599,7 +2997,7 @@ semver@~5.0.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a" integrity sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no= -set-blocking@~2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -2629,6 +3027,18 @@ setprototypeof@1.1.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== +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= + shelljs@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" @@ -2638,7 +3048,7 @@ shelljs@^0.8.2: interpret "^1.0.0" rechoir "^0.6.2" -signal-exit@^3.0.0: +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= @@ -2762,7 +3172,7 @@ source-map@^0.5.6: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -2777,6 +3187,44 @@ spawn-command@^0.0.2-1: resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" integrity sha1-lUThpDygRfhTGqwaSMspva5iM44= +spawn-wrap@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" + integrity sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg== + dependencies: + foreground-child "^1.5.6" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.6.2" + signal-exit "^3.0.2" + which "^1.3.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.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -2836,7 +3284,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.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -2882,6 +3330,16 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + strip-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" @@ -2897,7 +3355,7 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^3.2.3: +supports-color@^3.1.2, supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= @@ -2917,6 +3375,16 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" +test-exclude@^5.2.2: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + tmp@0.0.24: version "0.0.24" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.24.tgz#d6a5e198d14a9835cc6f2d7c3d9e302428c8cf12" @@ -3024,6 +3492,14 @@ typescript@~3.1.6: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== +uglify-js@^3.1.4: + version "3.5.15" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.15.tgz#fe2b5378fd0b09e116864041437bff889105ce24" + integrity sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + ultron@1.0.x: version "1.0.2" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa" @@ -3107,6 +3583,43 @@ uuid@^3.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g== +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +v8-coverage@1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/v8-coverage/-/v8-coverage-1.0.9.tgz#780889680c0fea0f587adf22e2b5f443b9434745" + integrity sha512-JolsCH1JDI2QULrxkAGZaovJPvg/Q0p20Uj0F5N8fPtYDtz38gNBRPQ/WVXlLLd3d8WHvKN96AfE4XFk4u0g2g== + dependencies: + debug "^3.1.0" + foreground-child "^1.5.6" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-report "^1.1.3" + istanbul-reports "^1.3.0" + mkdirp "^0.5.1" + rimraf "^2.6.2" + signal-exit "^3.0.2" + spawn-wrap "^1.4.2" + test-exclude "^5.2.2" + uuid "^3.3.2" + v8-to-istanbul "1.2.0" + yargs "^11.0.0" + +v8-to-istanbul@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-1.2.0.tgz#f6a22ffb08b2202aaba8c2be497d1d41fe8fb4b6" + integrity sha512-rVSmjdEfJmOHN8GYCbg+XUhbzXZr7DzdaXIslB9DdcopGZEMsW5x5qIdxr/8DcW7msULHNnvs/xUY1TszvhKRw== + +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" @@ -3146,7 +3659,12 @@ webdriver-manager@^12.0.6: semver "^5.3.0" xml2js "^0.4.17" -which@^1.2.1: +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.1, which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -3170,6 +3688,14 @@ wordwrap@~0.0.2: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -3218,6 +3744,11 @@ xmlhttprequest-ssl@~1.5.4: resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" integrity sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4= +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -3228,6 +3759,31 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" integrity sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k= +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= + dependencies: + camelcase "^4.1.0" + +yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" From c160db910772b2e58a46aaa0430e9b167a77eb6c Mon Sep 17 00:00:00 2001 From: rjamet Date: Fri, 24 May 2019 04:23:18 -0700 Subject: [PATCH 160/316] Replace ranges with text matched in Tsetse matchers, and fix a type confusion Both check that their expectations match the actual item. The filenames thing was due to me testing the expected value as an extended ts.Diagnostic, while never converting it. Jasmine isn't typed that way. PiperOrigin-RevId: 249810909 --- internal/tsetse/failure.ts | 6 +++ .../property_write_test.ts | 9 ++-- internal/tsetse/util/testing/test_support.ts | 49 +++++++++++++------ 3 files changed, 43 insertions(+), 21 deletions(-) diff --git a/internal/tsetse/failure.ts b/internal/tsetse/failure.ts index 56355adc..20126acf 100644 --- a/internal/tsetse/failure.ts +++ b/internal/tsetse/failure.ts @@ -34,6 +34,12 @@ export class Failure { fix: this.suggestedFix }; } + + toString(): string { + return `Failure{sourceFile:${ + this.sourceFile ? this.sourceFile.fileName : + 'unknown'}, start:${this.start}, end:${this.end}}`; + } } /** diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts index 45f0c3a9..997577e4 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts @@ -32,11 +32,9 @@ describe('BANNED_PROPERTY_WRITE', () => { expect(results.length).toBe(1); expect(results[0]).toBeFailureMatching({ - start: 28, - end: 48, + matchedCode: 'q.cite = window.name;', + fileName: 'file_1.ts', errorMessage: 'do not cite', - // fileName: 'file_0.ts' - // TODO(rjamet): why is there no source file in the finding? }); }); @@ -52,8 +50,7 @@ describe('BANNED_PROPERTY_WRITE', () => { // Both of these should have the same results: in `c.x`, `x` matches, // and `c` is both a Parent and a Child. const expectedFailure = { - start: 83, - end: 90, + matchedCode: 'c.x = 1;', errorMessage: 'found write to x', }; diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index 8adb90a0..f79192ce 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -6,7 +6,7 @@ import * as os from 'os'; import * as ts from 'typescript'; import {Checker} from '../../checker'; -import {Failure, Fix} from '../../failure'; +import {Failure} from '../../failure'; import {AbstractRule} from '../../rule'; @@ -70,26 +70,44 @@ export function compileAndCheck( export const customMatchers: jasmine.CustomMatcherFactories = { toBeFailureMatching(): jasmine.CustomMatcher { return { - compare: (actual: ts.Diagnostic&{end: number, fix?: Fix}, exp: { - fileName?: string, start: number, end: number, + compare: (actualFailure: Failure, exp: { + fileName?: string, + start?: number, + end?: number, + matchedCode?: string }) => { + const actualDiagnostic = actualFailure.toDiagnostic(); let regrets = ''; if (exp === undefined) { regrets += 'The rule requires two arguments. '; } if (exp.fileName) { - if (!actual.file) { - regrets += 'Expected diagnostic to have a source file. '; - } else if (!actual.file.fileName.endsWith(exp.fileName)) { - regrets += `Expected ${actual.file.fileName} to end with ${ - exp.fileName}. `; + if (!actualDiagnostic.file) { + regrets += `Expected diagnostic to have a source file, but it had ${ + actualDiagnostic.file}. `; + } else if (!actualDiagnostic.file.fileName.endsWith(exp.fileName)) { + regrets += `Expected ${ + actualDiagnostic.file.fileName} to end with ${exp.fileName}. `; } } - if (exp.start && actual.start !== exp.start) { - regrets += expectation('start', exp.start, actual.start); + if (exp.start && actualDiagnostic.start !== exp.start) { + regrets += expectation('start', exp.start, actualDiagnostic.start); + } + if (exp.end && actualDiagnostic.end !== exp.end) { + regrets += expectation('end', exp.end, actualDiagnostic.end); } - if (exp.end && actual.end !== exp.end) { - regrets += expectation('end', exp.end, actual.end); + if (exp.matchedCode) { + if (!actualDiagnostic.file) { + regrets += `Expected diagnostic to have a source file, but it had ${ + actualDiagnostic.file}. `; + } else { + const foundMatchedCode = actualDiagnostic.file.getFullText().substr( + Number(actualDiagnostic.start), actualDiagnostic.end); + if (foundMatchedCode != exp.matchedCode) { + regrets += `Expected diagnostic to match ${ + exp.matchedCode}, but was ${foundMatchedCode}`; + } + } } return {pass: regrets === '', message: regrets}; } @@ -106,10 +124,11 @@ declare global { namespace jasmine { interface Matchers { toBeFailureMatching(expected: { + [i: string]: any, // the rest fileName?: string, - start: number, - end: number, - [i: string]: any // the rest + start?: number, + end?: number, + matchedCode?: string, }): void; } } From 134e0f3e8600f521eb79bf66d45a5c0124eaa2c8 Mon Sep 17 00:00:00 2001 From: rjamet Date: Mon, 27 May 2019 04:34:31 -0700 Subject: [PATCH 161/316] More tests for the ConformancePatterns, and fix substr-based confusion Adding a bunch more tests around various more complex cases (shadowing, function parameters, and whitespace) revealed a bug where I mixed start/end and start/length patterns. So I'm taking the opportunity to switch to String.prototype.slice for the matcher, which is slightly less surprising in its behavior. PiperOrigin-RevId: 250134904 --- .../property_write_test.ts | 90 +++++++++++++++---- .../pattern_engines/property_write_engine.ts | 4 +- internal/tsetse/util/testing/test_support.ts | 11 ++- 3 files changed, 84 insertions(+), 21 deletions(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts index 997577e4..42290f2b 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts @@ -3,19 +3,63 @@ import {ConformancePatternRule, PatternKind} from '../../rules/conformance_patte import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_PROPERTY_WRITE', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }); + it('matches simple examples', () => { - const source = `const q = document.createElement('q');\n` + - `q.cite = 'some example string';\n`; - const rule = new ConformancePatternRule({ - errorMessage: 'do not cite', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'] + const source = [ + `const q = document.createElement('q');`, + `q.cite = 'some example string';`, + ].join('\n'); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `q.cite = 'some example string'`, + errorMessage: 'do not cite' + }); + }); + + it('matches precisely, even with whitespace or comments', () => { + const source = [ + `const q = document.createElement('q');`, + ` q.cite = 'exampleA';`, + `q.cite = 'exampleB' ;`, + `/* test1 */ q.cite = /* test2 */ 'exampleC' /* test3 */;`, + ].join('\n'); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(3); + expect(results[0]).toBeFailureMatching({ + matchedCode: `q.cite = 'exampleA'`, + errorMessage: 'do not cite' + }); + expect(results[1]).toBeFailureMatching({ + matchedCode: `q.cite = 'exampleB'`, + errorMessage: 'do not cite' }); + expect(results[2]).toBeFailureMatching({ + matchedCode: `q.cite = /* test2 */ 'exampleC'`, + errorMessage: 'do not cite' + }); + }) + + it('understands function prototypes', () => { + const source = [ + `function foo(q:HTMLQuoteElement) {`, + ` q.cite = 'some example string';`, + `}`, + ].join('\n'); const results = compileAndCheck(rule, source); expect(results.length).toBe(1); - expect(results[0]) - .toBeFailureMatching({start: 39, end: 69, errorMessage: 'do not cite'}); + expect(results[0]).toBeFailureMatching({ + matchedCode: `q.cite = 'some example string'`, + errorMessage: 'do not cite' + }); }); it('understands imported symbols', () => { @@ -23,16 +67,11 @@ describe('BANNED_PROPERTY_WRITE', () => { `const q = document.createElement('q'); export {q};`, `import {q} from './file_0'; q.cite = window.name;` ]; - const rule = new ConformancePatternRule({ - errorMessage: 'do not cite', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'] - }); const results = compileAndCheck(rule, ...sources); expect(results.length).toBe(1); expect(results[0]).toBeFailureMatching({ - matchedCode: 'q.cite = window.name;', + matchedCode: 'q.cite = window.name', fileName: 'file_1.ts', errorMessage: 'do not cite', }); @@ -41,16 +80,16 @@ describe('BANNED_PROPERTY_WRITE', () => { describe('with inheritance', () => { const source = [ - `class Parent {x:number}`, + `class Parent { x: number }`, `class Child extends Parent {}`, - `const c:Child = new Child();`, + `const c: Child = new Child();`, `c.x = 1;`, ].join('\n'); // Both of these should have the same results: in `c.x`, `x` matches, // and `c` is both a Parent and a Child. const expectedFailure = { - matchedCode: 'c.x = 1;', + matchedCode: 'c.x = 1', errorMessage: 'found write to x', }; @@ -76,6 +115,23 @@ describe('BANNED_PROPERTY_WRITE', () => { expect(r[0]).toBeFailureMatching(expectedFailure); }); }); + + describe('with shadowing', () => { + it('does not over-match', () => { + const source = [ + `const q = document.createElement('q');`, + `const f1 = (q: {cite: string}) => { q.cite = 'example 1'; };`, + ].join('\n'); + const rule = new ConformancePatternRule({ + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(0); + }); + }); }); beforeEach(() => { diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 7af7ccf0..ea90e602 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -38,10 +38,12 @@ export class PropertyWriteEngine extends !isPropertyWriteExpression(n)) { return; } - debugLog(`inspecting ${n.getFullText().trim()}`); + debugLog(`inspecting ${n.getText().trim()}`); if (this.matcher.matches(n.left, c.typeChecker)) { const fix: Fix|undefined = this.fixer ? this.fixer.getFixForFlaggedNode(n) : undefined; + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); c.addFailureAtNode(n, this.config.errorMessage, fix); } } diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index f79192ce..61777103 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -79,7 +79,7 @@ export const customMatchers: jasmine.CustomMatcherFactories = { const actualDiagnostic = actualFailure.toDiagnostic(); let regrets = ''; if (exp === undefined) { - regrets += 'The rule requires two arguments. '; + regrets += 'The matcher requires two arguments. '; } if (exp.fileName) { if (!actualDiagnostic.file) { @@ -100,12 +100,17 @@ export const customMatchers: jasmine.CustomMatcherFactories = { if (!actualDiagnostic.file) { regrets += `Expected diagnostic to have a source file, but it had ${ actualDiagnostic.file}. `; + } else if (!actualDiagnostic.start) { + // I don't know how this could happen, but typings say so. + regrets += `Expected diagnostic to have a starting position. `; } else { - const foundMatchedCode = actualDiagnostic.file.getFullText().substr( + const foundMatchedCode = actualDiagnostic.file.getFullText().slice( Number(actualDiagnostic.start), actualDiagnostic.end); if (foundMatchedCode != exp.matchedCode) { regrets += `Expected diagnostic to match ${ - exp.matchedCode}, but was ${foundMatchedCode}`; + exp.matchedCode}, but was ${foundMatchedCode} (from ${ + Number( + actualDiagnostic.start)} to ${actualDiagnostic.end}). `; } } } From 8d8d398caf7d77620e66502adc51cc1a83def0f6 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Tue, 28 May 2019 11:23:23 -0700 Subject: [PATCH 162/316] Remove the tsconfig override warning feature. It is mostly unavoidable: users need pathMapping to make their editor happy with multiple named libs in a monorepo, some language features require specifying target, etc. Also it's reporting to every user on every compile, this is not usually the right time to fix it. If we want to rollforward a feature, it should be based more precisely on things that confused users, and should also take care to only warn if the users setting conflicts with Bazel's in a breaking way. Alternative to https://github.com/angular/angular/pull/30104 PiperOrigin-RevId: 250324968 --- internal/tsc_wrapped/tsconfig.ts | 68 +------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index c147d3b0..9c2980f6 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -126,6 +126,7 @@ export interface BazelOptions { /** * Suppress warnings about tsconfig.json properties that are overridden. + * Currently unused, remains here for backwards compat for users who set it. */ suppressTsconfigOverrideWarnings: boolean; @@ -207,69 +208,6 @@ interface PluginImportWithConfig extends ts.PluginImport { [optionName: string]: string|{}; } -/** - * Prints messages to stderr if the given config object contains certain known - * properties that Bazel will override in the generated tsconfig.json. - * Note that this is not an exhaustive list of such properties; just the ones - * thought to commonly cause problems. - * Note that we can't error out, because users might have a legitimate reason: - * - during a transition to Bazel they can use the same tsconfig with other - * tools - * - if they have multiple packages in their repo, they might need to use path - * mapping so the editor knows where to resolve some absolute imports - * - * @param userConfig the parsed json for the full tsconfig.json file - */ -function warnOnOverriddenOptions(userConfig: any) { - const overrideWarnings: string[] = []; - if (userConfig.files) { - overrideWarnings.push( - 'files is ignored because it is controlled by the srcs[] attribute'); - } - const options: ts.CompilerOptions = userConfig.compilerOptions; - if (options) { - if (options.target || options.module) { - overrideWarnings.push( - 'compilerOptions.target and compilerOptions.module are controlled by downstream dependencies, such as ts_devserver'); - } - if (options.declaration) { - overrideWarnings.push( - `compilerOptions.declaration is always true, as it's needed for dependent libraries to type-check`); - } - if (options.paths) { - overrideWarnings.push( - 'compilerOptions.paths is determined by the module_name attribute in transitive deps[]'); - } - if (options.typeRoots) { - overrideWarnings.push( - 'compilerOptions.typeRoots is always set to the @types subdirectory of the node_modules attribute'); - } - if (options.traceResolution || (options as any).diagnostics) { - overrideWarnings.push( - 'compilerOptions.traceResolution and compilerOptions.diagnostics are set by the DEBUG flag in tsconfig.bzl under rules_typescript'); - } - if (options.rootDir || options.baseUrl) { - overrideWarnings.push( - 'compilerOptions.rootDir and compilerOptions.baseUrl are always the workspace root directory'); - } - if (options.preserveConstEnums) { - overrideWarnings.push( - 'compilerOptions.preserveConstEnums is always false under Bazel'); - } - if (options.noEmitOnError) { - // TODO(alexeagle): why?? - overrideWarnings.push( - 'compilerOptions.noEmitOnError is always false under Bazel'); - } - } - if (overrideWarnings.length) { - console.error( - '\nWARNING: your tsconfig.json file specifies options which are overridden by Bazel:'); - for (const w of overrideWarnings) console.error(` - ${w}`); - console.error('\n'); - } -} - /** * The same as Node's path.resolve, however it returns a path with forward * slashes rather than joining the resolved path with the platform's path @@ -339,10 +277,6 @@ export function parseTsconfig( ? newBazelBazelOpts.devmodeTargetOverride : existingBazelOpts.devmodeTargetOverride, } - - if (!mergedConfig.bazelOptions.suppressTsconfigOverrideWarnings) { - warnOnOverriddenOptions(config); - } } if (config.extends) { From fa70bcef9332ed8eaf84f5f2602e0752f292dda4 Mon Sep 17 00:00:00 2001 From: rjamet Date: Wed, 29 May 2019 14:52:19 -0700 Subject: [PATCH 163/316] Fix a small type confusion bug in the test matcher for Failures PiperOrigin-RevId: 250572014 --- internal/tsetse/util/testing/test_support.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index 61777103..8e3d6d08 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -90,17 +90,17 @@ export const customMatchers: jasmine.CustomMatcherFactories = { actualDiagnostic.file.fileName} to end with ${exp.fileName}. `; } } - if (exp.start && actualDiagnostic.start !== exp.start) { + if (exp.start !== undefined && actualDiagnostic.start !== exp.start) { regrets += expectation('start', exp.start, actualDiagnostic.start); } - if (exp.end && actualDiagnostic.end !== exp.end) { + if (exp.end !== undefined && actualDiagnostic.end !== exp.end) { regrets += expectation('end', exp.end, actualDiagnostic.end); } if (exp.matchedCode) { if (!actualDiagnostic.file) { regrets += `Expected diagnostic to have a source file, but it had ${ actualDiagnostic.file}. `; - } else if (!actualDiagnostic.start) { + } else if (actualDiagnostic.start === undefined) { // I don't know how this could happen, but typings say so. regrets += `Expected diagnostic to have a starting position. `; } else { From c6fdfefe4b245683de4836a38bbc0ca4bc4ae8eb Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 31 May 2019 13:20:45 -0700 Subject: [PATCH 164/316] Opt-in to --incompatible_depset_is_not_iterable Closes #454 PiperOrigin-RevId: 250943883 --- .bazelrc | 6 ++++ WORKSPACE | 12 +++---- internal/BUILD.bazel | 1 + internal/tsc_wrapped/worker.ts | 2 +- package.bzl | 4 +-- package.json | 6 ++-- yarn.lock | 60 +++++++++++++++++----------------- 7 files changed, 47 insertions(+), 44 deletions(-) diff --git a/.bazelrc b/.bazelrc index adf60bc7..01852fef 100644 --- a/.bazelrc +++ b/.bazelrc @@ -7,3 +7,9 @@ test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test # Turn off legacy external runfiles run --nolegacy_external_runfiles test --nolegacy_external_runfiles + +# Enable the "Managed Directories" feature +build --experimental_allow_incremental_repository_updates + +# Opt-in to upcoming breaking change +build --incompatible_depset_is_not_iterable diff --git a/WORKSPACE b/WORKSPACE index 4fd6286f..00fe5027 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -12,7 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -workspace(name = "build_bazel_rules_typescript") +workspace( + name = "build_bazel_rules_typescript", + managed_directories = {"@npm": ["node_modules"]}, +) # Load our dependencies load("//:package.bzl", "rules_typescript_dev_dependencies") @@ -22,13 +25,6 @@ rules_typescript_dev_dependencies() # Setup nodejs toolchain load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") -# Use a bazel-managed npm dependency, allowing us to test resolution to these paths -yarn_install( - name = "build_bazel_rules_typescript_internal_bazel_managed_deps", - package_json = "//examples/bazel_managed_deps:package.json", - yarn_lock = "//examples/bazel_managed_deps:yarn.lock", -) - # Download npm dependencies yarn_install( name = "npm", diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 26dc0fba..a66f109c 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -86,6 +86,7 @@ nodejs_binary( "@npm//tsickle", "@npm//tsutils", "@npm//typescript", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js", visibility = ["//visibility:public"], diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 2f9828e7..6362aa15 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -89,7 +89,7 @@ function loadWorkerPb() { // This extra lookup should never happen in google3. It's only needed for // local development in the rules_typescript repo. protofile = require.resolve( - '../../third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'); + 'build_bazel_rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'); } const protoNamespace = protobufjs.loadSync(protofile); diff --git a/package.bzl b/package.bzl index 5e07daa5..3b13286c 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "73325a155c16bfbde29fb2ffcaf59d9d5a1c13b06ada386d3edd5a9d82bda702", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.1/rules_nodejs-0.29.1.tar.gz"], + sha256 = "bc180118b9e1c7f2b74dc76a8f798d706fe9fc53470ef9296728267b4cd29441", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.30.2/rules_nodejs-0.30.2.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index 66994589..5b85c2e0 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,11 @@ "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", "devDependencies": { - "@bazel/bazel": "0.25.1", + "@bazel/bazel": "^0.26.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/jasmine": "^0.29.0", - "@bazel/typescript": "0.29.0", + "@bazel/jasmine": "^0.30.0", + "@bazel/typescript": "^0.30.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", diff --git a/yarn.lock b/yarn.lock index 68a5dbe3..789b5f2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,29 +2,29 @@ # yarn lockfile v1 -"@bazel/bazel-darwin_x64@0.25.1": - version "0.25.1" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.25.1.tgz#6526aba1cd912830595c3903ad29dfcb338114a3" - integrity sha512-VYPHaXZFlyl/1MOnUdByusox0RataI+dvQ37FiuuK9byFlcgCoIvhAx20nLK56tEhi/obXXaG2AO4w6rfOcgWg== - -"@bazel/bazel-linux_x64@0.25.1": - version "0.25.1" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.25.1.tgz#7f0d098725f0bde4f0904b72b64ea2f22fdbf2bc" - integrity sha512-i+b6RSWn5qGZlrcct+lpWVHd3sen7UaBqQyi/0Rn+J72XCIbY2AFoi+j6SlCXb3EFltxJBCHKJHZqEtkP79bDQ== - -"@bazel/bazel-win32_x64@0.25.1": - version "0.25.1" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.25.1.tgz#43bdec698fbb7babfd02470a1dcab384f01f9d6b" - integrity sha512-LM/rY8cxioCFe0m6WxdfvZ6pbD9eKzp69C1BhIkoESyp0IDLDvnLJ6uvs722e3hl8Zj1sIEIbiCwrYk33lPkTg== - -"@bazel/bazel@0.25.1": - version "0.25.1" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.25.1.tgz#fc76ad9c07371e9ce0bf5bde6ff61cf8abbeaefd" - integrity sha512-HM2IsX9M4siW8b2AHZP4ixtT1NH9H74M0/DJfh0hr15NlivTapvkVQSfEfW57CCMfkuMcDjvfJQK+KzfuVyMgw== +"@bazel/bazel-darwin_x64@0.26.0": + version "0.26.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.26.0.tgz#24660853a01e286359636025618a1fda1aa978e1" + integrity sha512-9qcRlTW9g8TPJ1PWYIkNDUMsEjdhN4sJz5fDjva3GM7mnIST0sgJiRRW5Y9L3Ksv9+jNWmIOlj5wsibAUYyb5w== + +"@bazel/bazel-linux_x64@0.26.0": + version "0.26.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.26.0.tgz#9302b6df4363b5c492f2755174988935b84fb076" + integrity sha512-v9RTFIZb/A8Ej0Q1uCc/uTCRFZIRGqQpBVLO9Vqkbg4kScND9FxAI2RO0bv3Zhz7YTXBvJ8+kSfd/DY+0azwsA== + +"@bazel/bazel-win32_x64@0.26.0": + version "0.26.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.26.0.tgz#ae878cf2aae0ad9799141e554c47417f426c1aa7" + integrity sha512-hmhuWQUzTmVLDusSt701LFzkWoRdEsakDtEGKgIuQuAJ7zqwH8QUn3PpWIg5BA0qF0gxJBKMfTHGvNhMft3pmg== + +"@bazel/bazel@^0.26.0": + version "0.26.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.26.0.tgz#651513d5e11198f4c911024fdd57e76e0742fe9d" + integrity sha512-vxm3nuvYu97NRVkcRBfuLHqDytykCazZaTX13j+Ssqg0XIuuIiewTXGNKq2lcxeydJnscArMyYEv+gyXpexHDA== optionalDependencies: - "@bazel/bazel-darwin_x64" "0.25.1" - "@bazel/bazel-linux_x64" "0.25.1" - "@bazel/bazel-win32_x64" "0.25.1" + "@bazel/bazel-darwin_x64" "0.26.0" + "@bazel/bazel-linux_x64" "0.26.0" + "@bazel/bazel-win32_x64" "0.26.0" "@bazel/buildifier-darwin_x64@0.20.0": version "0.20.0" @@ -49,19 +49,19 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= -"@bazel/jasmine@^0.29.0": - version "0.29.0" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.29.0.tgz#347d9c512daf8576dcdaa9bb168733fa444c2263" - integrity sha512-QH/mLAH4e7gcJrfOT0BmJ4wk+5Ly3RU+RPLaCyacnCjmJCICukZJa/rrjbVtwd8u7ZM+Hf6tRaLLydSeKXGBug== +"@bazel/jasmine@^0.30.0": + version "0.30.2" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.30.2.tgz#113325e2f30b9dbdf7cf8cd422a22f01259705cc" + integrity sha512-cDyrKrfsga8jRsr8iOE4xCMiJSr/iDyLDS8GeZZPB9nIjBAVrcgnPyflMhvtIERJCOX1WBZ0NKQOo659dZhmig== dependencies: jasmine "~3.3.1" jasmine-core "~3.3.0" v8-coverage "1.0.9" -"@bazel/typescript@0.29.0": - version "0.29.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.29.0.tgz#d276afe034f37b5f35ee1369c99dc33c637fc9f6" - integrity sha512-Dp5ucrE1vXTORGiwEi6Ur4dlICpLsmZ1dscsEQT4ywF7xTT0/NmIG0ecBghiCFPFQTxt1D05TR3SH06rPtTAew== +"@bazel/typescript@^0.30.0": + version "0.30.2" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.30.2.tgz#962eb122b80d3ef4805cf0520fc0a50d069ecb21" + integrity sha512-SIYHbg05Zyh7lrB8msnRjJ9hQSAHMOOWEV8seCKmCOx0noGP1Q00zXc4VRfi3uQCyCLZSFJvI4BXxnnKDwl61g== dependencies: protobufjs "6.8.8" semver "5.6.0" From 4ae7cda81c7ea3215a024f10b00ee38a0755549d Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 4 Jun 2019 14:14:43 -0700 Subject: [PATCH 165/316] Remove some overloads of "updateCache" to unblock TS 3.4. PiperOrigin-RevId: 251513165 --- internal/tsc_wrapped/cache.ts | 12 ++---------- internal/tsc_wrapped/worker.ts | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/internal/tsc_wrapped/cache.ts b/internal/tsc_wrapped/cache.ts index 9b3b61b9..486bf4ee 100644 --- a/internal/tsc_wrapped/cache.ts +++ b/internal/tsc_wrapped/cache.ts @@ -186,15 +186,7 @@ export class FileCache { * updateCache must be called before loading files - only files that were * updated (with a digest) previously can be loaded. */ - updateCache(digests: {[k: string]: string}): void; - updateCache(digests: Map): void; - updateCache(digests: Map|{[k: string]: string}) { - // TODO(martinprobst): drop the Object based version, it's just here for - // backwards compatibility. - if (!(digests instanceof Map)) { - digests = new Map(Object.keys(digests).map( - (k): [string, string] => [k, (digests as {[k: string]: string})[k]])); - } + updateCache(digests: Map): void { this.debug('updating digests:', digests); this.lastDigests = digests; this.cannotEvict = false; @@ -309,7 +301,7 @@ export class ProgramAndFileCache extends FileCache { } resetStats() { - super.resetStats() + super.resetStats(); this.programCache.resetStats(); } diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 6362aa15..dc50055e 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -72,7 +72,7 @@ declare namespace workerProto { */ function loadWorkerPb() { const protoPath = - '../worker_protocol.proto'; + '../../third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; // Use node module resolution so we can find the .proto file in any of the // root dirs From f55d745968cb344a2d77da718b023cf4fd0a95b0 Mon Sep 17 00:00:00 2001 From: rjamet Date: Fri, 7 Jun 2019 03:33:59 -0700 Subject: [PATCH 166/316] Add an in-config ConformanceRule whitelist. This whitelist is file-granular, based on the jscompiler Conformance configs. PiperOrigin-RevId: 252021771 --- internal/tsetse/failure.ts | 4 +- .../ban_conformance_pattern/whitelist_test.ts | 122 ++++++++++++++++++ internal/tsetse/util/pattern_config.ts | 53 ++++++++ .../util/pattern_engines/pattern_engine.ts | 73 ++++++++++- .../property_non_constant_write_engine.ts | 19 ++- .../pattern_engines/property_write_engine.ts | 31 +++-- internal/tsetse/util/testing/test_support.ts | 45 ++++++- 7 files changed, 314 insertions(+), 33 deletions(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts diff --git a/internal/tsetse/failure.ts b/internal/tsetse/failure.ts index 20126acf..7db67ef6 100644 --- a/internal/tsetse/failure.ts +++ b/internal/tsetse/failure.ts @@ -36,9 +36,9 @@ export class Failure { } toString(): string { - return `Failure{sourceFile:${ + return `{ sourceFile:${ this.sourceFile ? this.sourceFile.fileName : - 'unknown'}, start:${this.start}, end:${this.end}}`; + 'unknown'}, start:${this.start}, end:${this.end} }`; } } diff --git a/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts b/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts new file mode 100644 index 00000000..a1c7342c --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts @@ -0,0 +1,122 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {WhitelistReason} from '../../util/pattern_config'; +import {compileAndCheck, customMatchers, getTempDirForWhitelist} from '../../util/testing/test_support'; + +const tmpPrefixForWhitelist = getTempDirForWhitelist(); +const tmpRegexpForWhitelist = + `^(?:${getTempDirForWhitelist().replace(/\\/g, '\\\\')})`; + + +describe('ConformancePatternRule', () => { + describe('whitelist handling', () => { + const source = `export {};\n` + + `const q = document.createElement('q');\n` + + `q.cite = 'some example string';\n`; + + // The initial config off which we run those checks. + const baseConfig = { + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'], + }; + + it('matches if no whitelist (sanity check)', () => { + const config = {...baseConfig, whitelistEntries: []}; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1, config); + }); + + it('matches if there is an empty whitelist group', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1, config); + }); + + it('respects prefix-based whitelists (matching test)', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + prefix: [tmpPrefixForWhitelist], + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(0, config); + }); + + it('respects prefix-based whitelists (non-matching test)', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + prefix: ['/nowhere in particular/'], + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1, config); + }); + + it('respects regex-based whitelists', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + regexp: [`${tmpRegexpForWhitelist}.+/file_0\\.ts`] + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(0, config); + }); + + it('accepts several regex-based whitelists', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + regexp: [ + `${tmpRegexpForWhitelist}.+/file_0\\.ts`, + `${tmpRegexpForWhitelist}.+/file_1\\.ts` + ] + }] + }; + const rule = new ConformancePatternRule(config); + // Testing two times the same file so that both regexps match. + const results = compileAndCheck(rule, source, source); + + expect(results).toHaveNFailures(0, config); + }); + + it('throws on creation of invalid regexps', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + regexp: ['(', '/tmp/', 'foo'], + }] + }; + expect(() => { + new ConformancePatternRule(config); + }).toThrowError(/Invalid regular expression/); + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 76e2d713..c8c09272 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -15,6 +15,7 @@ export enum PatternKind { */ export interface Config

    { kind: P; + /** * Values have a pattern-specific syntax. * @@ -22,8 +23,60 @@ export interface Config

    { * for examples. */ values: string[]; + /** The error message this pattern will create. */ errorMessage: string; + + /** A list of whitelist blocks. */ + whitelistEntries?: WhitelistEntry[]; +} + +/** + * A whitelist entry, corresponding to a logical whitelisting rule. Use these to + * distinguish between various logical reasons for whitelisting something: for + * instance, tie these to particular bugs that needed whitelisting, per legacy + * project, manually reviewed entries, and so on. + * + * Whitelists are based on the file paths provided by the TS compiler, with both + * regexp-based checks and prefix-based checks. + * + * + * Follows the logic in + * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/conformance.proto. + */ +export interface WhitelistEntry { + /** The category corresponding to this entry. */ + reason: WhitelistReason; + /** Why is this okay to whitelist. */ + explanation?: string; + + /** + * Regexps for the paths of files that will be ignored by the + * ConformancePattern. Beware, escaping can be tricky. + */ + regexp?: string[]; + /** + * Prefixes for the paths of files that will be ignored by the + * ConformancePattern. + */ + prefix?: string[]; +} + +/** + * The categories of whitelist entries. + */ +export enum WhitelistReason { + /** No reason. */ + UNSPECIFIED, + /** Code that has to be grandfathered in (no guarantees). */ + LEGACY, + /** + * Code that does not enter the scope of this particular check (no + * guarantees). + */ + OUT_OF_SCOPE, + /** Manually reviewed exceptions (supposedly okay). */ + MANUALLY_REVIEWED } /** Maps the type of nodes that each `PatternType` produces. */ diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index 5dbbddc1..6e014205 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -1,14 +1,85 @@ +import * as ts from 'typescript'; import {Checker} from '../../checker'; +import {Fix} from '../../failure'; import {Fixer} from '../../util/fixer'; import {Config, MatchedNodeTypes, PatternKind} from '../../util/pattern_config'; +import {shouldExamineNode} from '../ast_tools'; /** * A patternEngine is the logic that handles a specific PatternKind. */ export abstract class PatternEngine

    { + private readonly whitelistedPrefixes: string[] = []; + private readonly whitelistedRegExps: RegExp[] = []; + private readonly whitelistMemoizer: Map = new Map(); + constructor( protected readonly config: Config

    , - protected readonly fixer?: Fixer) {} + protected readonly fixer?: Fixer) { + if (config.whitelistEntries) { + for (const e of config.whitelistEntries) { + if (e.prefix) { + this.whitelistedPrefixes = + this.whitelistedPrefixes.concat(...e.prefix); + } + if (e.regexp) { + this.whitelistedRegExps = this.whitelistedRegExps.concat( + ...e.regexp.map(r => new RegExp(r))); + } + } + } + } + /** + * `register` will be called by the ConformanceRule to tell Tsetse the + * PatternEngine will handle matching. Implementations should use + *`checkAndFilterResults` as a wrapper for `check`. + **/ abstract register(checker: Checker): void; + + /** + * `check` is the PatternEngine subclass-specific matching logic. Overwrite + * with what the engine looks for, i.e., AST matching. The whitelisting logic + * and fix generation are handled in `checkAndFilterResults`. + */ + abstract check(tc: ts.TypeChecker, n: MatchedNodeTypes[P]): + MatchedNodeTypes[P]|undefined; + + /** + * A wrapper for `check` that handles aspects of the analysis that are not + * engine-specific, and which defers to the subclass-specific logic + * afterwards. + */ + checkAndFilterResults(c: Checker, n: MatchedNodeTypes[P]) { + if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { + return; + } + const matchedNode = this.check(c.typeChecker, n); + if (matchedNode && !this.isWhitelisted(matchedNode)) { + const fix: Fix|undefined = + this.fixer ? this.fixer.getFixForFlaggedNode(matchedNode) : undefined; + c.addFailureAtNode(matchedNode, this.config.errorMessage, fix); + } + } + + isWhitelisted(n: ts.Node): boolean { + const name: string = n.getSourceFile().fileName; + if (this.whitelistMemoizer.has(name)) { + return this.whitelistMemoizer.get(name)!; + } + for (const p of this.whitelistedPrefixes) { + if (name.indexOf(p) == 0) { + this.whitelistMemoizer.set(name, true); + return true; + } + } + for (const re of this.whitelistedRegExps) { + if (re.test(name)) { + this.whitelistMemoizer.set(name, true); + return true; + } + } + this.whitelistMemoizer.set(name, false); + return false; + } } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index 9e26cd77..d9d3a97f 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -1,8 +1,7 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; -import {Fix} from '../../failure'; -import {debugLog, isPropertyWriteExpression, shouldExamineNode} from '../ast_tools'; +import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; import {isLiteral} from '../is_literal'; import {PropertyMatcher} from '../match_symbol'; @@ -32,27 +31,25 @@ export class PropertyNonConstantWriteEngine extends PatternEngine { register(checker: Checker) { checker.on( - ts.SyntaxKind.BinaryExpression, this.check.bind(this), + ts.SyntaxKind.BinaryExpression, this.checkAndFilterResults.bind(this), ErrorCode.CONFORMANCE_PATTERN); } - check(c: Checker, n: ts.BinaryExpression) { - if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile || - !isPropertyWriteExpression(n)) { + check(tc: ts.TypeChecker, n: MatchedNodeTypes[BanKind]): + MatchedNodeTypes[BanKind]|undefined { + if (!isPropertyWriteExpression(n)) { return; } debugLog(`inspecting ${n.getFullText().trim()}`); - if (!this.matcher.matches(n.left, c.typeChecker)) { + if (!this.matcher.matches(n.left, tc)) { debugLog('Not an assignment to the right property'); return; } - if (isLiteral(c.typeChecker, n.right)) { + if (isLiteral(tc, n.right)) { debugLog(`Assigned value (${ n.right.getFullText()}) is a compile-time constant.`); return; } - const fix: Fix|undefined = - this.fixer ? this.fixer.getFixForFlaggedNode(n) : undefined; - c.addFailureAtNode(n, this.config.errorMessage, fix); + return n; } } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index ea90e602..3b92f2d3 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -1,22 +1,22 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; -import {Fix} from '../../failure'; -import {debugLog, isPropertyWriteExpression, shouldExamineNode} from '../ast_tools'; +import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; import {PropertyMatcher} from '../match_symbol'; import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; +// Just for conciseness. +type BanKind = PatternKind.BANNED_PROPERTY_WRITE; + /** * The engine for BANNED_PROPERTY_WRITE. */ -export class PropertyWriteEngine extends - PatternEngine { +export class PropertyWriteEngine extends PatternEngine { private readonly matcher: PropertyMatcher; constructor( - config: Config, - fixer?: Fixer) { + config: Config, fixer?: Fixer) { super(config, fixer); // TODO: Support more than one single value here, or even build a // multi-pattern engine. This would help for performance. @@ -29,22 +29,21 @@ export class PropertyWriteEngine extends register(checker: Checker) { checker.on( - ts.SyntaxKind.BinaryExpression, this.check.bind(this), + ts.SyntaxKind.BinaryExpression, this.checkAndFilterResults.bind(this), ErrorCode.CONFORMANCE_PATTERN); } - check(c: Checker, n: ts.BinaryExpression) { - if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile || - !isPropertyWriteExpression(n)) { + check(tc: ts.TypeChecker, n: MatchedNodeTypes[BanKind]): + MatchedNodeTypes[BanKind]|undefined { + if (!isPropertyWriteExpression(n)) { return; } debugLog(`inspecting ${n.getText().trim()}`); - if (this.matcher.matches(n.left, c.typeChecker)) { - const fix: Fix|undefined = - this.fixer ? this.fixer.getFixForFlaggedNode(n) : undefined; - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - c.addFailureAtNode(n, this.config.errorMessage, fix); + if (!this.matcher.matches(n.left, tc)) { + return; } + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; } } diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index 8e3d6d08..7b93b7fa 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -3,11 +3,13 @@ import 'jasmine'; import * as crypto from 'crypto'; import * as fs from 'fs'; import * as os from 'os'; +import * as path from 'path'; import * as ts from 'typescript'; import {Checker} from '../../checker'; import {Failure} from '../../failure'; import {AbstractRule} from '../../rule'; +import {Config} from '../pattern_config'; @@ -17,11 +19,11 @@ import {AbstractRule} from '../../rule'; * the `sourceCode` array. */ export function compile(...sourceCode: string[]): ts.Program { - const temporaryFolder = os.tmpdir() + - `/tslint_test_input_${crypto.randomBytes(16).toString('hex')}`; + const temporaryFolder = os.tmpdir() + path.sep + + `tslint_test_input_${crypto.randomBytes(16).toString('hex')}`; const fullPaths: string[] = []; sourceCode.forEach((s, i) => { - fullPaths.push(`${temporaryFolder}/file_${i}.ts`); + fullPaths.push(`${temporaryFolder}${path.sep}file_${i}.ts`); }); let error: Error|undefined = undefined; @@ -66,8 +68,43 @@ export function compileAndCheck( return check(rule, program); } +/** Turns a Failure to a fileName. */ +export function toFileName(f: Failure) { + const file = f.toDiagnostic().file; + return file ? file.fileName : 'unknown'; +} + +export function getTempDirForWhitelist() { + // TS uses forward slashes on Windows ¯\_(ツ)_/¯ + return os.platform() == 'win32' ? os.tmpdir().replace(/\\/g, '/') : + os.tmpdir(); +} + // Custom matcher for Jasmine, for a better experience matching fixes. export const customMatchers: jasmine.CustomMatcherFactories = { + + toHaveNFailures(): jasmine.CustomMatcher { + return { + compare: (actual: Failure[], expected: Number, config?: Config) => { + if (actual.length === expected) { + return {pass: true}; + } else { + let message = + `Expected ${expected} Failures, but found ${actual.length}.`; + if (actual.length) { + message += '\n' + actual.map(f => f.toString()).join('\n'); + } + if (config) { + message += `\nConfig: {kind:${config.kind}, values:${ + JSON.stringify(config.values)}, whitelist:${ + JSON.stringify(config.whitelistEntries)} }`; + } + return {pass: false, message}; + } + } + }; + }, + toBeFailureMatching(): jasmine.CustomMatcher { return { compare: (actualFailure: Failure, exp: { @@ -135,6 +172,8 @@ declare global { end?: number, matchedCode?: string, }): void; + + toHaveNFailures(expected: Number, config?: Config): void; } } } From 66505d1e39bc1be973ffbb1e3f83df4d7e1373ef Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Fri, 7 Jun 2019 10:50:13 -0700 Subject: [PATCH 167/316] Update to nodejs rules 0.31.1 nodejs_binary entry_point is now a label Closes #453 PiperOrigin-RevId: 252078645 --- .bazelrc | 2 +- internal/BUILD.bazel | 4 ++-- package.bzl | 4 ++-- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.bazelrc b/.bazelrc index 01852fef..6005eaac 100644 --- a/.bazelrc +++ b/.bazelrc @@ -9,7 +9,7 @@ run --nolegacy_external_runfiles test --nolegacy_external_runfiles # Enable the "Managed Directories" feature -build --experimental_allow_incremental_repository_updates +common --experimental_allow_incremental_repository_updates # Opt-in to upcoming breaking change build --incompatible_depset_is_not_iterable diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index a66f109c..973561dd 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -36,7 +36,7 @@ nodejs_binary( "@npm//source-map-support", "@npm//typescript", ], - entry_point = "typescript/lib/tsc.js", + entry_point = "@npm//node_modules/typescript:lib/tsc.js", visibility = ["//internal:__subpackages__"], ) @@ -88,7 +88,7 @@ nodejs_binary( "@npm//typescript", "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], - entry_point = "build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.js", + entry_point = ":tsc_wrapped/tsc_wrapped.ts", visibility = ["//visibility:public"], ) diff --git a/package.bzl b/package.bzl index 3b13286c..f31ab0c8 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "bc180118b9e1c7f2b74dc76a8f798d706fe9fc53470ef9296728267b4cd29441", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.30.2/rules_nodejs-0.30.2.tar.gz"], + sha256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.31.1/rules_nodejs-0.31.1.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index 5b85c2e0..c1764557 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "@bazel/bazel": "^0.26.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/jasmine": "^0.30.0", - "@bazel/typescript": "^0.30.0", + "@bazel/jasmine": "^0.31.1", + "@bazel/typescript": "^0.31.1", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", diff --git a/yarn.lock b/yarn.lock index 789b5f2a..b9870926 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,19 +49,19 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= -"@bazel/jasmine@^0.30.0": - version "0.30.2" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.30.2.tgz#113325e2f30b9dbdf7cf8cd422a22f01259705cc" - integrity sha512-cDyrKrfsga8jRsr8iOE4xCMiJSr/iDyLDS8GeZZPB9nIjBAVrcgnPyflMhvtIERJCOX1WBZ0NKQOo659dZhmig== +"@bazel/jasmine@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.31.1.tgz#da3de10760fe1e29e9fc748fabc4fcf604f4356a" + integrity sha512-heKo8qzm6DTm8eOlfL69RJJi1GLI9vJDSmBGYgol18K7oXz6JrspGWUL9/TlCYbRUUCt22kqX7f3R+QlD0KrCg== dependencies: jasmine "~3.3.1" jasmine-core "~3.3.0" v8-coverage "1.0.9" -"@bazel/typescript@^0.30.0": - version "0.30.2" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.30.2.tgz#962eb122b80d3ef4805cf0520fc0a50d069ecb21" - integrity sha512-SIYHbg05Zyh7lrB8msnRjJ9hQSAHMOOWEV8seCKmCOx0noGP1Q00zXc4VRfi3uQCyCLZSFJvI4BXxnnKDwl61g== +"@bazel/typescript@^0.31.1": + version "0.31.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.31.1.tgz#2ccf9997d97903c51e73f82e29433fe444b8d672" + integrity sha512-jUTJjwdc4JSDMt4kIj74gGtctu8xe0YZPJuPxOIS4TdrWcn+dG9Fy7Z8bJLXhePheig1JLY7NBP6BGwrtggzPQ== dependencies: protobufjs "6.8.8" semver "5.6.0" From 3b463d856de2b6d97193fa30cc22af2c6b87ae12 Mon Sep 17 00:00:00 2001 From: rjamet Date: Tue, 11 Jun 2019 03:56:36 -0700 Subject: [PATCH 168/316] Test the suggested fix generation. PiperOrigin-RevId: 252588645 --- internal/tsetse/failure.ts | 21 +++- .../ban_conformance_pattern/fixer_test.ts | 96 +++++++++++++++++++ internal/tsetse/util/fixer.ts | 8 +- internal/tsetse/util/testing/test_support.ts | 63 +++++++++++- 4 files changed, 179 insertions(+), 9 deletions(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts diff --git a/internal/tsetse/failure.ts b/internal/tsetse/failure.ts index 7db67ef6..61680acf 100644 --- a/internal/tsetse/failure.ts +++ b/internal/tsetse/failure.ts @@ -37,8 +37,8 @@ export class Failure { toString(): string { return `{ sourceFile:${ - this.sourceFile ? this.sourceFile.fileName : - 'unknown'}, start:${this.start}, end:${this.end} }`; + this.sourceFile ? this.sourceFile.fileName : 'unknown'}, start:${ + this.start}, end:${this.end}, fix:${fixToString(this.suggestedFix)} }`; } } @@ -51,6 +51,23 @@ export interface Fix { */ changes: IndividualChange[], } + export interface IndividualChange { sourceFile: ts.SourceFile, start: number, end: number, replacement: string } + +/** + * Stringifies a Fix, replacing the ts.SourceFile with the matching filename. + */ +export function fixToString(f?: Fix) { + if (!f) return 'undefined'; + return '{' + JSON.stringify(f.changes.map(ic => { + return { + start: ic.start, + end: ic.end, + replacement: ic.replacement, + fileName: ic.sourceFile.fileName + }; + })) + + '}' +} diff --git a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts new file mode 100644 index 00000000..1bf13dd8 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts @@ -0,0 +1,96 @@ +import 'jasmine'; +import * as ts from 'typescript'; +import {Fix} from '../../failure'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {buildReplacementFixer, Fixer} from '../../util/fixer'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +const uppercaseFixer: Fixer = { + getFixForFlaggedNode(node: ts.Node): Fix { + return { + changes: [{ + start: node.getStart(), + end: node.getEnd(), + replacement: node.getText().toUpperCase(), + sourceFile: node.getSourceFile(), + }] + }; + } +}; + +const uppercaseFixerBuilt: Fixer = buildReplacementFixer((node: ts.Node) => { + return {replaceWith: node.getText().toUpperCase()}; +}) + +describe('ConformancePatternRule\'s fixer', () => { + describe('Generates basic fixes', () => { + const source = `export {};\n` + + `const q = document.createElement('q');\n` + + `q.cite = 'some example string';\n`; + + // The initial config off which we run those checks. + const baseConfig = { + errorMessage: 'found citation', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'], + }; + + it('for a single match', () => { + const rule = new ConformancePatternRule(baseConfig, uppercaseFixer); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1, baseConfig); + expect(results[0]).toBeFailureMatching({ + matchedCode: `q.cite = 'some example string'`, + errorMessage: 'found citationz' + }); + expect(results[0]).toHaveFixMatching([ + {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} + ]); + }); + + + it('for a single match (alternate fixer)', () => { + const rule = new ConformancePatternRule(baseConfig, uppercaseFixerBuilt); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1, baseConfig); + expect(results[0]).toBeFailureMatching({ + matchedCode: `q.cite = 'some example string'`, + errorMessage: 'found citationz' + }); + expect(results[0]).toHaveFixMatching([ + {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} + ]); + }); + + it('for several matches', () => { + const rule = new ConformancePatternRule(baseConfig, uppercaseFixer); + const sourceTwoMatches = + source + `q.cite = 'some other example string';\n`; + const results = compileAndCheck(rule, sourceTwoMatches); + + expect(results).toHaveNFailures(2, baseConfig); + expect(results[0]).toBeFailureMatching({ + matchedCode: `q.cite = 'some example string'`, + errorMessage: 'found citationz' + }); + expect(results[1]).toBeFailureMatching({ + matchedCode: `q.cite = 'some other example string'`, + errorMessage: 'found citationz' + }); + expect(results[0]).toHaveFixMatching([ + {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} + ]); + expect(results[1]).toHaveFixMatching([{ + start: 82, + end: 118, + replacement: `Q.CITE = 'SOME OTHER EXAMPLE STRING'` + }]); + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/fixer.ts b/internal/tsetse/util/fixer.ts index f9b784e1..77fa9f84 100644 --- a/internal/tsetse/util/fixer.ts +++ b/internal/tsetse/util/fixer.ts @@ -9,7 +9,7 @@ import {debugLog} from './ast_tools'; * of implementing a Fixer. */ export interface Fixer { - getFixForFlaggedNode(node: NodeType, v?: boolean): Fix|undefined; + getFixForFlaggedNode(node: NodeType): Fix|undefined; } /** @@ -18,11 +18,11 @@ export interface Fixer { * Fixer instead. */ export function buildReplacementFixer( - potentialReplacementGenerator: (node: ts.Node, v?: boolean) => + potentialReplacementGenerator: (node: ts.Node) => ({replaceWith: string} | undefined)): Fixer { return { - getFixForFlaggedNode: (n: ts.Node, v?: boolean): Fix | undefined => { - const partialFix = potentialReplacementGenerator(n, v); + getFixForFlaggedNode: (n: ts.Node): Fix | undefined => { + const partialFix = potentialReplacementGenerator(n); if (!partialFix) { return; } diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index 7b93b7fa..b6ca582a 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import * as ts from 'typescript'; import {Checker} from '../../checker'; -import {Failure} from '../../failure'; +import {Failure, fixToString} from '../../failure'; import {AbstractRule} from '../../rule'; import {Config} from '../pattern_config'; @@ -111,7 +111,7 @@ export const customMatchers: jasmine.CustomMatcherFactories = { fileName?: string, start?: number, end?: number, - matchedCode?: string + matchedCode?: string, }) => { const actualDiagnostic = actualFailure.toDiagnostic(); let regrets = ''; @@ -151,6 +151,59 @@ export const customMatchers: jasmine.CustomMatcherFactories = { } } } + return {pass: regrets === '', message: regrets}; + } + }; + }, + + /** Checks that a Failure has the expected Fix field. */ + toHaveFixMatching(): jasmine.CustomMatcher { + return { + compare: (actualFailure: Failure, exp: [{ + fileName?: string, + start?: number, + end?: number, + replacement?: string + }]) => { + let regrets = ''; + const actualFix = actualFailure.toDiagnostic().fix; + if (!actualFix) { + regrets += `Expected ${actualFailure.toString()} to have fix ${ + JSON.stringify(exp)}. `; + } else if (actualFix.changes.length != exp.length) { + regrets += `Expected ${exp.length} individual changes, got ${ + actualFix.changes.length}. `; + if (actualFix.changes.length) { + regrets += '\n' + fixToString(actualFix); + } + } else { + for (let i = 0; i < exp.length; i++) { + const e = exp[i]; + const a = actualFix.changes[i]; + if (e.start !== undefined && e.start !== a.start) { + regrets += expectation( + `${i}th individualChange's start`, e.start, a.start); + } + if (e.end !== undefined && e.end !== a.end) { + regrets += + expectation(`${i}th individualChange's end`, e.end, a.end); + } + if (e.replacement !== undefined && + e.replacement !== a.replacement) { + regrets += expectation( + `${i}th individualChange's replacement`, e.replacement, + a.replacement); + } + if (e.fileName !== undefined && + e.fileName !== a.sourceFile.fileName) { + regrets += expectation( + `${i}th individualChange's fileName`, e.fileName, + a.sourceFile.fileName); + } + // TODO: Consider adding matchedCode as for the failure matcher. + } + } + return {pass: regrets === '', message: regrets}; } }; @@ -170,9 +223,13 @@ declare global { fileName?: string, start?: number, end?: number, - matchedCode?: string, + matchedCode?: string }): void; + toHaveFixMatching(expected: [ + {fileName?: string, start?: number, end?: number, replacement?: string} + ]): void; + toHaveNFailures(expected: Number, config?: Config): void; } } From f78e70ea4a7982c8eefb9d4086488340c65c8f59 Mon Sep 17 00:00:00 2001 From: rjamet Date: Tue, 11 Jun 2019 06:58:19 -0700 Subject: [PATCH 169/316] Add a BANNED_NAME engine to Tsetse's ConformancePatternRule. PiperOrigin-RevId: 252610371 --- .../tsetse/rules/conformance_pattern_rule.ts | 5 +++ .../ban_conformance_pattern/name_test.ts | 45 +++++++++++++++++++ internal/tsetse/util/match_symbol.ts | 4 ++ internal/tsetse/util/pattern_config.ts | 2 + .../util/pattern_engines/name_engine.ts | 43 ++++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/name_test.ts create mode 100644 internal/tsetse/util/pattern_engines/name_engine.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index b683355d..add5286e 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -3,6 +3,7 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; import {Fixer} from '../util/fixer'; import {Config, MatchedNodeTypes, PatternKind} from '../util/pattern_config'; +import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; @@ -36,6 +37,10 @@ export class ConformancePatternRule

    implements config as Config, fixer); break; + case PatternKind.BANNED_NAME: + engine = + new NameEngine(config as Config, fixer); + break; default: throw new Error('Config type not recognized, or not implemented yet.'); } diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts new file mode 100644 index 00000000..3165d380 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts @@ -0,0 +1,45 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +describe('BANNED_NAME', () => { + it('matches simple example of globals', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'no Infinity', + kind: PatternKind.BANNED_NAME, + values: ['Infinity'] + }); + const source = [ + `Infinity; 1+1;`, + ].join('\n'); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `Infinity`, + errorMessage: 'no Infinity' + }); + }); + + it('matches namespaced globals', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'no blob url', + kind: PatternKind.BANNED_NAME, + values: ['URL.createObjectURL'] + }); + const source = [ + `URL.createObjectURL({});`, + ].join('\n'); + const results = compileAndCheck(rule, source); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `createObjectURL`, + errorMessage: 'no blob url' + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index 5df53b10..c60195b2 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -11,6 +11,10 @@ const ABSOLUTE_RE = new RegExp(`^${FQN_FORMAT}$`); /** * This class matches symbols given a "foo.bar.baz" name, where none of the * steps are instances of classes. + * + * Note that this isn't smart about subclasses and types: to write a check, we + * strongly suggest finding the expected symbol in externs to find the object + * name on which the symbol was initially defined. */ export class AbsoluteMatcher { /** diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index c8c09272..9ec75f78 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -6,6 +6,7 @@ import * as ts from 'typescript'; * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework) */ export enum PatternKind { + BANNED_NAME = 'banned-name', BANNED_PROPERTY_WRITE = 'banned-property-write', BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write' } @@ -87,4 +88,5 @@ export interface MatchedNodeTypes { [PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE]: ts.BinaryExpression&{ left: ts.PropertyAccessExpression; }; + [PatternKind.BANNED_NAME]: ts.Identifier; } diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts new file mode 100644 index 00000000..332c6c6e --- /dev/null +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -0,0 +1,43 @@ +import * as ts from 'typescript'; +import {Checker} from '../../checker'; +import {ErrorCode} from '../../error_code'; +import {debugLog, shouldExamineNode} from '../ast_tools'; +import {Fixer} from '../fixer'; +import {AbsoluteMatcher} from '../match_symbol'; +import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; +import {PatternEngine} from './pattern_engine'; + +export class NameEngine extends PatternEngine { + private readonly matcher: AbsoluteMatcher; + constructor( + config: Config, + fixer?: Fixer) { + super(config, fixer); + // TODO: Support more than one single value here, or even build a + // multi-pattern engine. This would help for performance. + if (this.config.values.length !== 1) { + throw new Error(`BANNED_NAME expects one value, got(${ + this.config.values.join(',')})`); + } + this.matcher = new AbsoluteMatcher(this.config.values[0]); + } + + register(checker: Checker) { + checker.on( + ts.SyntaxKind.Identifier, this.checkAndFilterResults.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + } + + check(tc: ts.TypeChecker, n: MatchedNodeTypes[PatternKind.BANNED_NAME]): + MatchedNodeTypes[PatternKind.BANNED_NAME]|undefined { + if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { + return; + } + debugLog(`inspecting ${n.getText().trim()}`); + if (!this.matcher.matches(n, tc)) { + debugLog('Not the right global name.'); + return; + } + return n; + } +} From c30b16e278c04111f3671e428be4276b85418c24 Mon Sep 17 00:00:00 2001 From: rjamet Date: Thu, 13 Jun 2019 10:30:59 -0700 Subject: [PATCH 170/316] Fix a bug where the failure matcher didn't look at error messages. PiperOrigin-RevId: 253057737 --- .../tests/ban_conformance_pattern/fixer_test.ts | 8 ++++---- .../tests/ban_conformance_pattern/name_test.ts | 4 ++-- .../property_non_constant_write_test.ts | 2 +- .../ban_conformance_pattern/property_write_test.ts | 14 +++++++------- internal/tsetse/util/testing/test_support.ts | 10 ++++++++-- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts index 1bf13dd8..3b7c85ff 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts @@ -42,7 +42,7 @@ describe('ConformancePatternRule\'s fixer', () => { expect(results).toHaveNFailures(1, baseConfig); expect(results[0]).toBeFailureMatching({ matchedCode: `q.cite = 'some example string'`, - errorMessage: 'found citationz' + messageText: 'found citation' }); expect(results[0]).toHaveFixMatching([ {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} @@ -57,7 +57,7 @@ describe('ConformancePatternRule\'s fixer', () => { expect(results).toHaveNFailures(1, baseConfig); expect(results[0]).toBeFailureMatching({ matchedCode: `q.cite = 'some example string'`, - errorMessage: 'found citationz' + messageText: 'found citation' }); expect(results[0]).toHaveFixMatching([ {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} @@ -73,11 +73,11 @@ describe('ConformancePatternRule\'s fixer', () => { expect(results).toHaveNFailures(2, baseConfig); expect(results[0]).toBeFailureMatching({ matchedCode: `q.cite = 'some example string'`, - errorMessage: 'found citationz' + messageText: 'found citation' }); expect(results[1]).toBeFailureMatching({ matchedCode: `q.cite = 'some other example string'`, - errorMessage: 'found citationz' + messageText: 'found citation' }); expect(results[0]).toHaveFixMatching([ {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts index 3165d380..6bb06ecc 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts @@ -17,7 +17,7 @@ describe('BANNED_NAME', () => { expect(results.length).toBe(1); expect(results[0]).toBeFailureMatching({ matchedCode: `Infinity`, - errorMessage: 'no Infinity' + messageText: 'no Infinity' }); }); @@ -35,7 +35,7 @@ describe('BANNED_NAME', () => { expect(results.length).toBe(1); expect(results[0]).toBeFailureMatching({ matchedCode: `createObjectURL`, - errorMessage: 'no blob url' + messageText: 'no blob url' }); }); }); diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts index 8b517962..b545571a 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts @@ -17,7 +17,7 @@ describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { expect(results.length).toBe(1); expect(results[0]) .toBeFailureMatching( - {start: 71, end: 91, errorMessage: 'do not cite dynamically'}); + {start: 71, end: 91, messageText: 'do not cite dynamically'}); }); }); diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts index 42290f2b..e0f32540 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts @@ -19,7 +19,7 @@ describe('BANNED_PROPERTY_WRITE', () => { expect(results.length).toBe(1); expect(results[0]).toBeFailureMatching({ matchedCode: `q.cite = 'some example string'`, - errorMessage: 'do not cite' + messageText: 'do not cite' }); }); @@ -35,15 +35,15 @@ describe('BANNED_PROPERTY_WRITE', () => { expect(results.length).toBe(3); expect(results[0]).toBeFailureMatching({ matchedCode: `q.cite = 'exampleA'`, - errorMessage: 'do not cite' + messageText: 'do not cite' }); expect(results[1]).toBeFailureMatching({ matchedCode: `q.cite = 'exampleB'`, - errorMessage: 'do not cite' + messageText: 'do not cite' }); expect(results[2]).toBeFailureMatching({ matchedCode: `q.cite = /* test2 */ 'exampleC'`, - errorMessage: 'do not cite' + messageText: 'do not cite' }); }) @@ -58,7 +58,7 @@ describe('BANNED_PROPERTY_WRITE', () => { expect(results.length).toBe(1); expect(results[0]).toBeFailureMatching({ matchedCode: `q.cite = 'some example string'`, - errorMessage: 'do not cite' + messageText: 'do not cite' }); }); @@ -73,7 +73,7 @@ describe('BANNED_PROPERTY_WRITE', () => { expect(results[0]).toBeFailureMatching({ matchedCode: 'q.cite = window.name', fileName: 'file_1.ts', - errorMessage: 'do not cite', + messageText: 'do not cite', }); }); @@ -90,7 +90,7 @@ describe('BANNED_PROPERTY_WRITE', () => { // and `c` is both a Parent and a Child. const expectedFailure = { matchedCode: 'c.x = 1', - errorMessage: 'found write to x', + messageText: 'found write to x', }; it('banning Parent.x matches (instance of Child).x', () => { diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index b6ca582a..febf37a2 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -112,6 +112,7 @@ export const customMatchers: jasmine.CustomMatcherFactories = { start?: number, end?: number, matchedCode?: string, + messageText?: string, }) => { const actualDiagnostic = actualFailure.toDiagnostic(); let regrets = ''; @@ -127,6 +128,11 @@ export const customMatchers: jasmine.CustomMatcherFactories = { actualDiagnostic.file.fileName} to end with ${exp.fileName}. `; } } + if (exp.messageText !== undefined && + exp.messageText != actualDiagnostic.messageText) { + regrets += expectation( + 'errorMessage', exp.messageText, actualDiagnostic.messageText); + } if (exp.start !== undefined && actualDiagnostic.start !== exp.start) { regrets += expectation('start', exp.start, actualDiagnostic.start); } @@ -219,11 +225,11 @@ declare global { namespace jasmine { interface Matchers { toBeFailureMatching(expected: { - [i: string]: any, // the rest fileName?: string, start?: number, end?: number, - matchedCode?: string + matchedCode?: string, + messageText?: string, }): void; toHaveFixMatching(expected: [ From b1fa8ad9d15a4b46da800b33333512e538c69bd4 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Fri, 14 Jun 2019 09:40:48 -0700 Subject: [PATCH 171/316] Remove types[node] from compilation of tsc_wrapped This is needed for compatibility with new ts_library rule impl which includes typings found in deps[] as files in the program Closes #456 PiperOrigin-RevId: 253243590 --- internal/tsc_wrapped/tsconfig.json | 8 +++++++- package.bzl | 4 ++++ rules_nodejs_pr756.patch | 30 ++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 rules_nodejs_pr756.patch diff --git a/internal/tsc_wrapped/tsconfig.json b/internal/tsc_wrapped/tsconfig.json index d3f2772d..830ed186 100644 --- a/internal/tsc_wrapped/tsconfig.json +++ b/internal/tsc_wrapped/tsconfig.json @@ -2,7 +2,13 @@ "compilerOptions": { "strict": true, "types": [ - "node", + // Normally "node" should be listed here since we depend on it. + // However this library is built with vanilla tsc. + // Since the deps[] are passed into the ts.Program as files + // (starting with https://github.com/bazelbuild/rules_nodejs/pull/756) + // we cannot also list node as a types[] since vanilla tsc will load + // both into the program and get a conflict. + // Under tsc_wrapped this isn't a problem since we control the resolution. ], "lib": [ "dom", diff --git a/package.bzl b/package.bzl index f31ab0c8..e75064b5 100644 --- a/package.bzl +++ b/package.bzl @@ -30,6 +30,10 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", + # This file just copy-pasted from output of `git diff` + patches = ["//:rules_nodejs_pr756.patch"], + # According to docs, this is needed for patches generated by git + patch_args = ["-p1"], sha256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb", urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.31.1/rules_nodejs-0.31.1.tar.gz"], ) diff --git a/rules_nodejs_pr756.patch b/rules_nodejs_pr756.patch new file mode 100644 index 00000000..9db35b3d --- /dev/null +++ b/rules_nodejs_pr756.patch @@ -0,0 +1,30 @@ +--- a/internal/npm_install/node_module_library.bzl ++++ b/internal/npm_install/node_module_library.bzl +@@ -29,14 +29,20 @@ def _node_module_library_impl(ctx): + # use in rules such as ts_devserver + scripts = depset(ctx.files.scripts) + +- # declarations are a subset of sources that are decleration files +- declarations = depset([f for f in ctx.files.srcs if f.path.endswith(".d.ts")]) ++ # declarations are a subset of sources that are declaration files ++ ++ declarations = depset([ ++ f ++ for f in ctx.files.srcs ++ if f.path.endswith(".d.ts") and ++ # exclude eg. external/npm/node_modules/protobufjs/node_modules/@types/node/index.d.ts ++ # these would be duplicates of the typings provided directly in another dependency ++ len(f.path.split("/node_modules/")) < 3 ++ ]) ++ ++ # transitive_declarations are all .d.ts files in srcs plus those in direct & transitive dependencies ++ transitive_declarations = depset(transitive = [declarations]) + +- # transitive_declarations are all direct & transitive decleration files +- transitive_declarations = depset() +- for src in ctx.attr.srcs: +- if hasattr(src, "typescript"): +- transitive_declarations = depset(transitive = [transitive_declarations, src.typescript.transitive_declarations]) + for dep in ctx.attr.deps: + if hasattr(dep, "typescript"): + transitive_declarations = depset(transitive = [transitive_declarations, dep.typescript.transitive_declarations]) From 78af714217bd2b844d2f75961263be4a9e39773e Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 17 Jun 2019 09:47:39 -0700 Subject: [PATCH 172/316] Fix bug where .d.ts are not added to tsconfig when them come from coarse grained `node_modules = @npm//:node_modules` style deps Closes #457 PiperOrigin-RevId: 253599639 --- internal/common/compilation.bzl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 9cc2b88b..d173ce70 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -123,6 +123,10 @@ def _collect_dep_declarations(ctx, deps): for dep in deps_and_helpers ] + # all reachable .d.ts files from node_modules attribute (if it has a typescript provider) + if hasattr(ctx.attr, "node_modules") and hasattr(ctx.attr.node_modules, "typescript"): + transitive_deps_declarations += [ctx.attr.node_modules.typescript.transitive_declarations] + # .d.ts files whose types tsickle will not emit (used for ts_declaration(generate_externs=False). type_blacklisted_declarations = [ dep.typescript.type_blacklisted_declarations From 76b166337515f77c8ecd35754aa4f6bf7a07db96 Mon Sep 17 00:00:00 2001 From: rjamet Date: Wed, 19 Jun 2019 06:49:52 -0700 Subject: [PATCH 173/316] Be more explicit about types in the conformancePatternRule. This caused typing issues in TypeScript 3.5, due to increased scrutiny in unsound writes to indexed access types. PiperOrigin-RevId: 253987179 --- internal/tsetse/rules/conformance_pattern_rule.ts | 15 ++++++++++----- internal/tsetse/util/pattern_config.ts | 10 +++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index add5286e..707fffcc 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -15,7 +15,7 @@ import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine * This is templated, mostly to ensure the nodes that have been matched * correspond to what the Fixer expects. */ -export class ConformancePatternRule

    implements +export class ConformancePatternRule

    implements AbstractRule { readonly ruleName: string; readonly code = ErrorCode.CONFORMANCE_PATTERN; @@ -27,23 +27,28 @@ export class ConformancePatternRule

    implements // that P is Config.kind. // tslint:disable-next-line:no-any See above. let engine: PatternEngine; + // Formatter breaks the types, b/135552145 + // clang-format off switch (config.kind) { case PatternKind.BANNED_PROPERTY_WRITE: engine = new PropertyWriteEngine( - config as Config, fixer); + config as Config, + fixer as Fixer); break; case PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE: engine = new PropertyNonConstantWriteEngine( config as Config, - fixer); + fixer as Fixer); break; case PatternKind.BANNED_NAME: - engine = - new NameEngine(config as Config, fixer); + engine = new NameEngine( + config as Config, + fixer as Fixer); break; default: throw new Error('Config type not recognized, or not implemented yet.'); } + // clang-format on this.ruleName = `conformance-pattern-${config.kind}`; this.engine = engine as PatternEngine

    ; } diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 9ec75f78..e4dcc0de 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -80,13 +80,9 @@ export enum WhitelistReason { MANUALLY_REVIEWED } -/** Maps the type of nodes that each `PatternType` produces. */ +/** Maps the type of nodes that each `PatternType` consumes. */ export interface MatchedNodeTypes { - [PatternKind.BANNED_PROPERTY_WRITE]: ts.BinaryExpression&{ - left: ts.PropertyAccessExpression; - }; - [PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE]: ts.BinaryExpression&{ - left: ts.PropertyAccessExpression; - }; + [PatternKind.BANNED_PROPERTY_WRITE]: ts.BinaryExpression; + [PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE]: ts.BinaryExpression; [PatternKind.BANNED_NAME]: ts.Identifier; } From 0efe29e17efee84f722326378b7585dac4f48784 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 19 Jun 2019 12:23:05 -0700 Subject: [PATCH 174/316] Update to rules_nodejs 0.32.0 @npm//node_modules/foobar:foobar.js labels changed to @npm//:node_modules/foobar/foobar.js with fix for bazelbuild/rules_nodejs#802 See #458 PiperOrigin-RevId: 254046674 --- internal/BUILD.bazel | 2 +- package.bzl | 8 ++------ package.json | 4 ++-- rules_nodejs_pr756.patch | 30 ------------------------------ yarn.lock | 16 ++++++++-------- 5 files changed, 13 insertions(+), 47 deletions(-) delete mode 100644 rules_nodejs_pr756.patch diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 973561dd..6e10a605 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -36,7 +36,7 @@ nodejs_binary( "@npm//source-map-support", "@npm//typescript", ], - entry_point = "@npm//node_modules/typescript:lib/tsc.js", + entry_point = "@npm//:node_modules/typescript/lib/tsc.js", visibility = ["//internal:__subpackages__"], ) diff --git a/package.bzl b/package.bzl index e75064b5..be23e71c 100644 --- a/package.bzl +++ b/package.bzl @@ -30,12 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - # This file just copy-pasted from output of `git diff` - patches = ["//:rules_nodejs_pr756.patch"], - # According to docs, this is needed for patches generated by git - patch_args = ["-p1"], - sha256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.31.1/rules_nodejs-0.31.1.tar.gz"], + sha256 = "06cb04f4f745e37d542ec6883a2896029715a591c0e44c5d250a268d3752f865", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.0/rules_nodejs-0.32.0.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index c1764557..42bdbd7c 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "@bazel/bazel": "^0.26.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/jasmine": "^0.31.1", - "@bazel/typescript": "^0.31.1", + "@bazel/jasmine": "^0.32.0", + "@bazel/typescript": "^0.32.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "7.0.18", diff --git a/rules_nodejs_pr756.patch b/rules_nodejs_pr756.patch deleted file mode 100644 index 9db35b3d..00000000 --- a/rules_nodejs_pr756.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/internal/npm_install/node_module_library.bzl -+++ b/internal/npm_install/node_module_library.bzl -@@ -29,14 +29,20 @@ def _node_module_library_impl(ctx): - # use in rules such as ts_devserver - scripts = depset(ctx.files.scripts) - -- # declarations are a subset of sources that are decleration files -- declarations = depset([f for f in ctx.files.srcs if f.path.endswith(".d.ts")]) -+ # declarations are a subset of sources that are declaration files -+ -+ declarations = depset([ -+ f -+ for f in ctx.files.srcs -+ if f.path.endswith(".d.ts") and -+ # exclude eg. external/npm/node_modules/protobufjs/node_modules/@types/node/index.d.ts -+ # these would be duplicates of the typings provided directly in another dependency -+ len(f.path.split("/node_modules/")) < 3 -+ ]) -+ -+ # transitive_declarations are all .d.ts files in srcs plus those in direct & transitive dependencies -+ transitive_declarations = depset(transitive = [declarations]) - -- # transitive_declarations are all direct & transitive decleration files -- transitive_declarations = depset() -- for src in ctx.attr.srcs: -- if hasattr(src, "typescript"): -- transitive_declarations = depset(transitive = [transitive_declarations, src.typescript.transitive_declarations]) - for dep in ctx.attr.deps: - if hasattr(dep, "typescript"): - transitive_declarations = depset(transitive = [transitive_declarations, dep.typescript.transitive_declarations]) diff --git a/yarn.lock b/yarn.lock index b9870926..f14d230c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,19 +49,19 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= -"@bazel/jasmine@^0.31.1": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.31.1.tgz#da3de10760fe1e29e9fc748fabc4fcf604f4356a" - integrity sha512-heKo8qzm6DTm8eOlfL69RJJi1GLI9vJDSmBGYgol18K7oXz6JrspGWUL9/TlCYbRUUCt22kqX7f3R+QlD0KrCg== +"@bazel/jasmine@^0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.32.0.tgz#afbb3b7cb3aeabd55324962dec3253841ed617ee" + integrity sha512-yzXqa9lP+su6lqqFJbhcdvHOCgfgIm6zMt8i1doZU8O/RkefAWj2nv+8gY8dPGMMByB6herV/5QAowB88d6ZAA== dependencies: jasmine "~3.3.1" jasmine-core "~3.3.0" v8-coverage "1.0.9" -"@bazel/typescript@^0.31.1": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.31.1.tgz#2ccf9997d97903c51e73f82e29433fe444b8d672" - integrity sha512-jUTJjwdc4JSDMt4kIj74gGtctu8xe0YZPJuPxOIS4TdrWcn+dG9Fy7Z8bJLXhePheig1JLY7NBP6BGwrtggzPQ== +"@bazel/typescript@^0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.32.0.tgz#648be4c63302cac95552c74d17c708adbcc4c366" + integrity sha512-D2wlWanIDiagj50GetmbIeXN73XSG3E5eIhlDNL1atHe4ZPo7rODJGfI1Yme9xD71nbDL7WjwH15wYOfeoWNhA== dependencies: protobufjs "6.8.8" semver "5.6.0" From a390e0a4b02baa93895ea9139fa13105d11258bd Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Thu, 27 Jun 2019 11:38:35 -0700 Subject: [PATCH 175/316] -- Change 1 of 1 by Yun Peng : Upgrade to rules_nodejs 0.32.2 Closes #460 PiperOrigin-RevId: 255444994 --- package.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.bzl b/package.bzl index be23e71c..80522390 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "06cb04f4f745e37d542ec6883a2896029715a591c0e44c5d250a268d3752f865", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.0/rules_nodejs-0.32.0.tar.gz"], + sha256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.2/rules_nodejs-0.32.2.tar.gz"], ) # For protocol buffers From de84e8dc31415dd2321712b145b38642995106c1 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Mon, 1 Jul 2019 13:19:57 -0700 Subject: [PATCH 176/316] Disambiguate expected and unexpected errors for the presubmit service. PiperOrigin-RevId: 256018619 --- ts_auto_deps/analyze/analyze.go | 2 +- ts_auto_deps/analyze/analyze_test.go | 2 +- ts_auto_deps/updater/updater.go | 44 ++++++++++++++++++++-------- ts_auto_deps/updater/updater_test.go | 11 ++++--- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 9e005cce..d6f1b24e 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -16,7 +16,7 @@ import ( "github.com/golang/protobuf/proto" appb "github.com/bazelbuild/buildtools/build_proto" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + arpb "google3/devtools/bazel/proto/analyze_result_go_proto" ) var ( diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index ff529b8d..0360d4e7 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -15,7 +15,7 @@ import ( "github.com/kylelemons/godebug/pretty" appb "github.com/bazelbuild/buildtools/build_proto" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + arpb "google3/devtools/bazel/proto/analyze_result_go_proto" ) var ( diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index b5b7720c..0b339c6b 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -26,7 +26,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/mattn/go-isatty" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + arpb "google3/devtools/bazel/proto/analyze_result_go_proto" ) var bazelErrorRE = regexp.MustCompile(`ERROR: ([^:]+):(\d+):\d+:`) @@ -108,14 +108,7 @@ func (upd *Updater) runBazelAnalyze(buildFilePath string, bld *build.File, rules args = append(args, targets...) out, stderr, err := upd.bazelAnalyze(buildFilePath, args) if err != nil { - return nil, &AnalysisFailedError{ - []AnalysisFailureCause{ - AnalysisFailureCause{ - Message: fmt.Sprintf("running bazel analyze %s failed: %v", args, err), - Path: bld.Path, - }, - }, - } + return nil, err } var res arpb.AnalyzeResult @@ -217,7 +210,25 @@ func readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build } return nil, fmt.Errorf("reading %q: %s", buildFilePath, err) } - return build.ParseBuild(normalizedG3Path, data) + bld, err := build.ParseBuild(normalizedG3Path, data) + if err != nil { + if parseErr, ok := err.(build.ParseError); ok { + return nil, &AnalysisFailedError{ + []AnalysisFailureCause{ + AnalysisFailureCause{ + Message: parseErr.Error(), + Path: parseErr.Filename, + Line: parseErr.Pos.Line, + }, + }, + } + + } + + // wasn't an error we know how to parse + return nil, err + } + return bld, nil } type srcSet map[string]bool @@ -433,9 +444,16 @@ func updateDeps(bld *build.File, reports []*arpb.DependencyReport) error { } hadUnresolved := len(report.UnresolvedImport) > 0 if hadUnresolved { - return fmt.Errorf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ - "'// from ...'' comment, or the target BUILD files are incorrect?\n%s\n", - fullTarget, report.UnresolvedImport, strings.Join(report.GetFeedback(), "\n")) + return &AnalysisFailedError{ + []AnalysisFailureCause{ + AnalysisFailureCause{ + Message: fmt.Sprintf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ + "'// from ...'' comment, or the target BUILD files are incorrect?\n%s\n", + fullTarget, report.UnresolvedImport, strings.Join(report.GetFeedback(), "\n")), + Path: bld.Path, + }, + }, + } } for _, d := range report.UnnecessaryDependency { platform.Infof("Removing dependency on %s from %s\n", d, fullTarget) diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index 65dd3bb7..26c93829 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -2,17 +2,17 @@ package updater import ( "context" - "fmt" "io/ioutil" "os" "path/filepath" "reflect" + "strings" "testing" "github.com/bazelbuild/buildtools/build" "github.com/golang/protobuf/proto" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + arpb "google3/devtools/bazel/proto/analyze_result_go_proto" ) var ( @@ -238,12 +238,11 @@ func TestUnresolvedImportError(t *testing.T) { t.Fatal(err) } - expectedErr := fmt.Errorf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ - "'// from ...'' comment, or the target BUILD files are incorrect?\n\n", "//foo:bar", []string{"unresolved/import"}) + expectedErr := "'// from ...'' comment, or the target BUILD files are incorrect?" err = updateDeps(bld, []*arpb.DependencyReport{report}) - if !reflect.DeepEqual(err, expectedErr) { - t.Errorf("returned error %s: expected %s", err, expectedErr) + if !strings.Contains(err.Error(), expectedErr) { + t.Errorf("returned error %s: expected it to contain %s", err, expectedErr) } } From a2e12391d17e7ce4f55b899f6c7b6e527f234033 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 1 Jul 2019 17:43:42 -0700 Subject: [PATCH 177/316] Make ts_compile_actions callable from aspects. This adds fallbacks for cases where a certain attribute isn't present on ctx: - ctx.attr.compiler falls back to ctx.attr._compiler - ctx.attr.generate_externs defaults to True - ctx.attr.runtime defaults to "browser" - ctx.attr.module_name defaults to None It also defines an attribute dict for aspects that define a lot of the necessary attributes for compilation (similar to TS_LIB_DECL_ATTRIBUTES). Finally, it allows callers of compile_ts or ts_compile_actions to define their own tsconfig output instead o getting it from ctx.outputs (since aspects cannot have outputs). PiperOrigin-RevId: 256070225 --- internal/common/compilation.bzl | 43 +++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index d173ce70..511fcc07 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -24,6 +24,10 @@ DEPS_ASPECTS = [ module_mappings_aspect, ] +_ADDITIONAL_D_TS = attr.label_list( + allow_files = True, +) + # Attributes shared by any typescript-compatible rule (ts_library, ng_module) COMMON_ATTRIBUTES = { "data": attr.label_list( @@ -48,9 +52,12 @@ COMMON_ATTRIBUTES = { providers = ["js"], ), "deps": attr.label_list(aspects = DEPS_ASPECTS), - "_additional_d_ts": attr.label_list( - allow_files = True, - ), + "_additional_d_ts": _ADDITIONAL_D_TS, +} + +# Attributes shared by any typescript-compatible aspect. +ASPECT_ATTRIBUTES = { + "_additional_d_ts": _ADDITIONAL_D_TS, } COMMON_OUTPUTS = { @@ -145,6 +152,19 @@ def _collect_dep_declarations(ctx, deps): type_blacklisted = depset(transitive = type_blacklisted_declarations), ) +def _should_generate_externs(ctx): + """Whether externs should be generated. + + If ctx has a generate_externs attribute, the value of that is returned. + Otherwise, this is true.""" + return getattr(ctx.attr, "generate_externs", True) + +def _get_runtime(ctx): + """Gets the runtime for the rule. + + Defaults to "browser" if the runtime attr isn't present.""" + return getattr(ctx.attr, "runtime", "browser") + def _outputs(ctx, label, srcs_files = []): """Returns closure js, devmode js, and .d.ts output files. @@ -205,6 +225,7 @@ def compile_ts( devmode_compile_action = None, jsx_factory = None, tsc_wrapped_tsconfig = None, + tsconfig = None, outputs = _outputs): """Creates actions to compile TypeScript code. @@ -220,6 +241,7 @@ def compile_ts( for devmode. jsx_factory: optional string. Enables overriding jsx pragma. tsc_wrapped_tsconfig: function that produces a tsconfig object. + tsconfig: The tsconfig file to output, if other than ctx.outputs.tsconfig. outputs: function from a ctx to the expected compilation outputs. Returns: @@ -229,6 +251,7 @@ def compile_ts( ### Collect srcs and outputs. srcs = srcs if srcs != None else ctx.attr.srcs deps = deps if deps != None else ctx.attr.deps + tsconfig = tsconfig if tsconfig != None else ctx.outputs.tsconfig srcs_files = [f for t in srcs for f in t.files.to_list()] src_declarations = [] # d.ts found in inputs. tsickle_externs = [] # externs.js generated by tsickle, if any. @@ -267,14 +290,14 @@ def compile_ts( transpiled_devmode_js = outs.devmode_js gen_declarations = outs.declarations - if has_sources and ctx.attr.runtime != "nodejs": + if has_sources and _get_runtime(ctx) != "nodejs": # Note: setting this variable controls whether tsickle is run at all. tsickle_externs = [ctx.actions.declare_file(ctx.label.name + ".externs.js")] dep_declarations = _collect_dep_declarations(ctx, deps) input_declarations = depset(src_declarations, transitive = [dep_declarations.transitive]) type_blacklisted_declarations = dep_declarations.type_blacklisted - if not is_library and not ctx.attr.generate_externs: + if not is_library and not _should_generate_externs(ctx): type_blacklisted_declarations += srcs_files # The depsets of output files. These are the files that are always built @@ -339,7 +362,7 @@ def compile_ts( files_depsets.append(depset([perf_trace_file, profile_file])) ctx.actions.write( - output = ctx.outputs.tsconfig, + output = tsconfig, content = json_marshal(tsconfig_es6), ) @@ -348,12 +371,12 @@ def compile_ts( replay_params = None if has_sources: - inputs = compilation_inputs + [ctx.outputs.tsconfig] + inputs = compilation_inputs + [tsconfig] replay_params = compile_action( ctx, inputs, outputs, - ctx.outputs.tsconfig, + tsconfig, node_profile_args, ) @@ -460,7 +483,7 @@ def compile_ts( # Expose the module_name so that packaging rules can access it. # e.g. rollup_bundle under Bazel needs to convert this into a UMD global # name in the Rollup configuration. - "module_name": ctx.attr.module_name, + "module_name": getattr(ctx.attr, "module_name", None), "output_groups": { "es5_sources": es5_sources, "es6_sources": es6_sources, @@ -473,7 +496,7 @@ def compile_ts( collect_data = True, ), # Expose the tags so that a Skylark aspect can access them. - "tags": ctx.attr.tags, + "tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags, # TODO(martinprobst): Prune transitive deps, only re-export what's needed. "typescript": { "declarations": depset(transitive = declarations_depsets), From 5c49241597a5bdf79307fe3ca24c422a3b0c5cb8 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 8 Jul 2019 18:05:38 -0700 Subject: [PATCH 178/316] Print a shorter error in tsc_wrapped FileCache When the TypeScript compiler tries to read a file from the cache, but the file wasn't declared as an input, this indicates a bug in the compiler. However the result is a massive data dump to the terminal, observed in e.g. https://circleci.com/gh/angular/angular/382012 To make the output less huge, only print the first 100 keys in the cache. Note that this might make it harder to debug a failure by reasoning about all the entries that *are* present in the cache, though. PiperOrigin-RevId: 257096480 --- internal/tsc_wrapped/cache.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/tsc_wrapped/cache.ts b/internal/tsc_wrapped/cache.ts index 486bf4ee..7fa5f3e7 100644 --- a/internal/tsc_wrapped/cache.ts +++ b/internal/tsc_wrapped/cache.ts @@ -204,9 +204,15 @@ export class FileCache { getLastDigest(filePath: string): string { const digest = this.lastDigests.get(filePath); if (!digest) { - throw new Error( - `missing input digest for ${filePath}.` + - `(only have ${Array.from(this.lastDigests.keys())})`); + const errorMsg = `missing input digest for ${filePath}. `; + let entriesToPrint = Array.from(this.lastDigests.keys()); + if (entriesToPrint.length > 100) { + throw new Error( + errorMsg + + `(only have ${entriesToPrint.slice(0, 100)} and ${ + entriesToPrint.length - 100} more)`); + } + throw new Error(errorMsg + `(only have ${entriesToPrint})`); } return digest; } From 2b3cb273e87123d562c90c922d15157a6ac3e9b2 Mon Sep 17 00:00:00 2001 From: rjamet Date: Tue, 9 Jul 2019 05:11:58 -0700 Subject: [PATCH 179/316] Remove the templating layer for pattern engines. This was a misguided attempt to provide more type safety that tried to bridge templating and enums, which rarely ends well. For simplicity's sake, there's no specificity in Fixer or PatternEngine types anymore: they now use ts.Node. PiperOrigin-RevId: 257170333 --- .../tsetse/rules/conformance_pattern_rule.ts | 29 +++++-------------- internal/tsetse/util/fixer.ts | 4 +-- internal/tsetse/util/pattern_config.ts | 14 ++------- .../util/pattern_engines/name_engine.ts | 13 ++++----- .../util/pattern_engines/pattern_engine.ts | 12 ++++---- .../property_non_constant_write_engine.ts | 13 +++------ .../pattern_engines/property_write_engine.ts | 13 +++------ internal/tsetse/util/testing/test_support.ts | 4 +-- 8 files changed, 32 insertions(+), 70 deletions(-) diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index 707fffcc..677490de 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -2,7 +2,7 @@ import {Checker} from '../checker'; import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; import {Fixer} from '../util/fixer'; -import {Config, MatchedNodeTypes, PatternKind} from '../util/pattern_config'; +import {Config, PatternKind} from '../util/pattern_config'; import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; @@ -15,42 +15,27 @@ import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine * This is templated, mostly to ensure the nodes that have been matched * correspond to what the Fixer expects. */ -export class ConformancePatternRule

    implements - AbstractRule { +export class ConformancePatternRule implements AbstractRule { readonly ruleName: string; readonly code = ErrorCode.CONFORMANCE_PATTERN; - private readonly engine: PatternEngine

    ; + private readonly engine: PatternEngine; - constructor(config: Config

    , fixer?: Fixer) { - // TODO(rjamet): This cheats a bit with the typing, as TS doesn't realize - // that P is Config.kind. - // tslint:disable-next-line:no-any See above. - let engine: PatternEngine; - // Formatter breaks the types, b/135552145 - // clang-format off + constructor(config: Config, fixer?: Fixer) { switch (config.kind) { case PatternKind.BANNED_PROPERTY_WRITE: - engine = new PropertyWriteEngine( - config as Config, - fixer as Fixer); + this.engine = new PropertyWriteEngine(config, fixer); break; case PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE: - engine = new PropertyNonConstantWriteEngine( - config as Config, - fixer as Fixer); + this.engine = new PropertyNonConstantWriteEngine(config, fixer); break; case PatternKind.BANNED_NAME: - engine = new NameEngine( - config as Config, - fixer as Fixer); + this.engine = new NameEngine(config, fixer); break; default: throw new Error('Config type not recognized, or not implemented yet.'); } - // clang-format on this.ruleName = `conformance-pattern-${config.kind}`; - this.engine = engine as PatternEngine

    ; } register(checker: Checker) { diff --git a/internal/tsetse/util/fixer.ts b/internal/tsetse/util/fixer.ts index 77fa9f84..2b769832 100644 --- a/internal/tsetse/util/fixer.ts +++ b/internal/tsetse/util/fixer.ts @@ -8,8 +8,8 @@ import {debugLog} from './ast_tools'; * ban-preset-pattern users). See also `buildReplacementFixer` for a simpler way * of implementing a Fixer. */ -export interface Fixer { - getFixForFlaggedNode(node: NodeType): Fix|undefined; +export interface Fixer { + getFixForFlaggedNode(node: ts.Node): Fix|undefined; } /** diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index e4dcc0de..21e9c256 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -1,11 +1,10 @@ -import * as ts from 'typescript'; /** * The list of supported patterns useable in ConformancePatternRule. The * patterns whose name match JSConformance patterns should behave similarly (see * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework) */ -export enum PatternKind { +export const enum PatternKind { BANNED_NAME = 'banned-name', BANNED_PROPERTY_WRITE = 'banned-property-write', BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write' @@ -14,8 +13,8 @@ export enum PatternKind { /** * A config for ConformancePatternRule. */ -export interface Config

    { - kind: P; +export interface Config { + kind: PatternKind; /** * Values have a pattern-specific syntax. @@ -79,10 +78,3 @@ export enum WhitelistReason { /** Manually reviewed exceptions (supposedly okay). */ MANUALLY_REVIEWED } - -/** Maps the type of nodes that each `PatternType` consumes. */ -export interface MatchedNodeTypes { - [PatternKind.BANNED_PROPERTY_WRITE]: ts.BinaryExpression; - [PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE]: ts.BinaryExpression; - [PatternKind.BANNED_NAME]: ts.Identifier; -} diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index 332c6c6e..33126190 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -4,14 +4,12 @@ import {ErrorCode} from '../../error_code'; import {debugLog, shouldExamineNode} from '../ast_tools'; import {Fixer} from '../fixer'; import {AbsoluteMatcher} from '../match_symbol'; -import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; +import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; -export class NameEngine extends PatternEngine { +export class NameEngine extends PatternEngine { private readonly matcher: AbsoluteMatcher; - constructor( - config: Config, - fixer?: Fixer) { + constructor(config: Config, fixer?: Fixer) { super(config, fixer); // TODO: Support more than one single value here, or even build a // multi-pattern engine. This would help for performance. @@ -27,9 +25,8 @@ export class NameEngine extends PatternEngine { ts.SyntaxKind.Identifier, this.checkAndFilterResults.bind(this), ErrorCode.CONFORMANCE_PATTERN); } - - check(tc: ts.TypeChecker, n: MatchedNodeTypes[PatternKind.BANNED_NAME]): - MatchedNodeTypes[PatternKind.BANNED_NAME]|undefined { + + check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { return; } diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index 6e014205..d6b60ce8 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -2,20 +2,19 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {Fix} from '../../failure'; import {Fixer} from '../../util/fixer'; -import {Config, MatchedNodeTypes, PatternKind} from '../../util/pattern_config'; +import {Config} from '../../util/pattern_config'; import {shouldExamineNode} from '../ast_tools'; /** * A patternEngine is the logic that handles a specific PatternKind. */ -export abstract class PatternEngine

    { +export abstract class PatternEngine { private readonly whitelistedPrefixes: string[] = []; private readonly whitelistedRegExps: RegExp[] = []; private readonly whitelistMemoizer: Map = new Map(); constructor( - protected readonly config: Config

    , - protected readonly fixer?: Fixer) { + protected readonly config: Config, protected readonly fixer?: Fixer) { if (config.whitelistEntries) { for (const e of config.whitelistEntries) { if (e.prefix) { @@ -42,15 +41,14 @@ export abstract class PatternEngine

    { * with what the engine looks for, i.e., AST matching. The whitelisting logic * and fix generation are handled in `checkAndFilterResults`. */ - abstract check(tc: ts.TypeChecker, n: MatchedNodeTypes[P]): - MatchedNodeTypes[P]|undefined; + abstract check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined; /** * A wrapper for `check` that handles aspects of the analysis that are not * engine-specific, and which defers to the subclass-specific logic * afterwards. */ - checkAndFilterResults(c: Checker, n: MatchedNodeTypes[P]) { + checkAndFilterResults(c: Checker, n: ts.Node) { if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { return; } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index d9d3a97f..08b67813 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -5,19 +5,15 @@ import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; import {isLiteral} from '../is_literal'; import {PropertyMatcher} from '../match_symbol'; -import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; +import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; -// Just for conciseness. -type BanKind = PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE; - /** * The engine for BANNED_PROPERTY_NON_CONSTANT_WRITE. */ -export class PropertyNonConstantWriteEngine extends PatternEngine { +export class PropertyNonConstantWriteEngine extends PatternEngine { private readonly matcher: PropertyMatcher; - constructor( - config: Config, fixer?: Fixer) { + constructor(config: Config, fixer?: Fixer) { super(config, fixer); // TODO: Support more than one single value here, or even build a // multi-pattern engine. This would help for performance. @@ -35,8 +31,7 @@ export class PropertyNonConstantWriteEngine extends PatternEngine { ErrorCode.CONFORMANCE_PATTERN); } - check(tc: ts.TypeChecker, n: MatchedNodeTypes[BanKind]): - MatchedNodeTypes[BanKind]|undefined { + check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { if (!isPropertyWriteExpression(n)) { return; } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 3b92f2d3..640ff646 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -4,19 +4,15 @@ import {ErrorCode} from '../../error_code'; import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; import {PropertyMatcher} from '../match_symbol'; -import {Config, MatchedNodeTypes, PatternKind} from '../pattern_config'; +import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; -// Just for conciseness. -type BanKind = PatternKind.BANNED_PROPERTY_WRITE; - /** * The engine for BANNED_PROPERTY_WRITE. */ -export class PropertyWriteEngine extends PatternEngine { +export class PropertyWriteEngine extends PatternEngine { private readonly matcher: PropertyMatcher; - constructor( - config: Config, fixer?: Fixer) { + constructor(config: Config, fixer?: Fixer) { super(config, fixer); // TODO: Support more than one single value here, or even build a // multi-pattern engine. This would help for performance. @@ -33,8 +29,7 @@ export class PropertyWriteEngine extends PatternEngine { ErrorCode.CONFORMANCE_PATTERN); } - check(tc: ts.TypeChecker, n: MatchedNodeTypes[BanKind]): - MatchedNodeTypes[BanKind]|undefined { + check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { if (!isPropertyWriteExpression(n)) { return; } diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index febf37a2..c12e28a0 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -85,7 +85,7 @@ export const customMatchers: jasmine.CustomMatcherFactories = { toHaveNFailures(): jasmine.CustomMatcher { return { - compare: (actual: Failure[], expected: Number, config?: Config) => { + compare: (actual: Failure[], expected: Number, config?: Config) => { if (actual.length === expected) { return {pass: true}; } else { @@ -236,7 +236,7 @@ declare global { {fileName?: string, start?: number, end?: number, replacement?: string} ]): void; - toHaveNFailures(expected: Number, config?: Config): void; + toHaveNFailures(expected: Number, config?: Config): void; } } } From c67bba804b788f055594c12b4ddea284dba3309c Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 10 Jul 2019 13:12:54 -0700 Subject: [PATCH 180/316] Make libraries that depend on //javascript/angular2/testing/catalyst into ng_modules. Currently you need a dep on something in //third_party/javascript/angular2, so people are forced to insert dummy taze comments. PiperOrigin-RevId: 257466752 --- ts_auto_deps/updater/updater.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 0b339c6b..b3f491f0 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -968,7 +968,13 @@ func hasAngularDependency(r *build.Rule) bool { for _, li := range edit.AllLists(e) { for _, elem := range li.List { str, ok := elem.(*build.StringExpr) - if ok && strings.HasPrefix(str.Value, "//third_party/javascript/angular2") { + if !ok { + continue + } + if strings.HasPrefix(str.Value, "//third_party/javascript/angular2") { + return true + } + if str.Value == "//javascript/angular2/testing/catalyst" { return true } } From a972b6a967b63d9f4c2bbb472fd71f0fb3406708 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 10 Jul 2019 14:26:12 -0700 Subject: [PATCH 181/316] Remove code supporting blaze analyze. PiperOrigin-RevId: 257481182 --- ts_auto_deps/updater/updater.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index b3f491f0..49ca61e2 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -64,11 +64,6 @@ type Updater struct { updateFile UpdateFile } -func bazelBinary() string { - - return "bazel" -} - func attrTruthy(r *build.Rule, attr string) bool { attrVal := r.AttrLiteral(attr) return attrVal == "True" || attrVal == "1" @@ -98,15 +93,12 @@ func (g *GarbledBazelResponseError) Error() string { // function to actually run the `bazel analyze` operation, which allows // exchanging it for a different implementation in the ts_auto_deps presubmit service. func (upd *Updater) runBazelAnalyze(buildFilePath string, bld *build.File, rules []*build.Rule) ([]*arpb.DependencyReport, error) { - args := []string{} - args = append(args, "--analysis_output=PROTO", "--static_analysis_option=checkdeps=--ng_summary") var targets []string for _, r := range rules { fullTarget := AbsoluteBazelTarget(bld, r.Name()) targets = append(targets, fullTarget) } - args = append(args, targets...) - out, stderr, err := upd.bazelAnalyze(buildFilePath, args) + out, stderr, err := upd.bazelAnalyze(buildFilePath, targets) if err != nil { return nil, err } @@ -771,16 +763,12 @@ func buildHasDisableTaze(bld *build.File) bool { // QueryBasedBazelAnalyze uses bazel query to analyze targets. It is available under a flag or // an environment variable on engineer's workstations. -func QueryBasedBazelAnalyze(buildFilePath string, args []string) ([]byte, []byte, error) { - // The first 2 args are '--analysis_output=PROTO' and - // '--static_analysis_option=checkdeps=--ng_summary', which are needed for - // bazel. Remove them to get only the targets. - targets := args[2:] +func QueryBasedBazelAnalyze(buildFilePath string, targets []string) ([]byte, []byte, error) { root, err := workspace.Root(buildFilePath) if err != nil { return nil, nil, err } - reports, err := analyze.New(analyze.NewQueryBasedTargetLoader(root, bazelBinary())).Analyze(context.Background(), buildFilePath, targets) + reports, err := analyze.New(analyze.NewQueryBasedTargetLoader(root, "bazel")).Analyze(context.Background(), buildFilePath, targets) if err != nil { return nil, nil, err } From 047c021b05b639baf6239d9eee8ce2d1b2986d7a Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 15 Jul 2019 00:10:17 -0700 Subject: [PATCH 182/316] internal change PiperOrigin-RevId: 258103394 --- ts_auto_deps/analyze/analyze.go | 2 +- ts_auto_deps/analyze/analyze_test.go | 2 +- ts_auto_deps/proto/analyze_result.proto | 6 +++--- ts_auto_deps/updater/updater.go | 2 +- ts_auto_deps/updater/updater_test.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index d6f1b24e..9e005cce 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -16,7 +16,7 @@ import ( "github.com/golang/protobuf/proto" appb "github.com/bazelbuild/buildtools/build_proto" - arpb "google3/devtools/bazel/proto/analyze_result_go_proto" + arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" ) var ( diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index 0360d4e7..ff529b8d 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -15,7 +15,7 @@ import ( "github.com/kylelemons/godebug/pretty" appb "github.com/bazelbuild/buildtools/build_proto" - arpb "google3/devtools/bazel/proto/analyze_result_go_proto" + arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" ) var ( diff --git a/ts_auto_deps/proto/analyze_result.proto b/ts_auto_deps/proto/analyze_result.proto index e81d51bc..49ee5000 100644 --- a/ts_auto_deps/proto/analyze_result.proto +++ b/ts_auto_deps/proto/analyze_result.proto @@ -27,7 +27,7 @@ message DependencyGroup { // dependencies is populated in dependency field, and both import_path's are // listed here. repeated string import_path = 3; -}; +} // Represents information about arbitrary non-deps attributes. message AttributeReport { @@ -88,8 +88,8 @@ message DependencyReport { repeated string feedback = 6; // Indicates whether the dependency analysis completed without errors. - optional bool successful = 10 [default=true]; -}; + optional bool successful = 10 [default = true]; +} // Aggregate DependencyReports for multiple analysis // targets - used to support bazel analyze --analysis_output=proto diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 49ca61e2..6f2eba53 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -26,7 +26,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/mattn/go-isatty" - arpb "google3/devtools/bazel/proto/analyze_result_go_proto" + arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" ) var bazelErrorRE = regexp.MustCompile(`ERROR: ([^:]+):(\d+):\d+:`) diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index 26c93829..b62ef20a 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -12,7 +12,7 @@ import ( "github.com/bazelbuild/buildtools/build" "github.com/golang/protobuf/proto" - arpb "google3/devtools/bazel/proto/analyze_result_go_proto" + arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" ) var ( From bdedb25a40d388c8ffbe371407d15ed3246c7624 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 25 Jul 2019 11:20:52 -0700 Subject: [PATCH 183/316] Define an interface for a TypeScript compiler plugin that may only contribute diagnostics. Switch the strict deps and tsetse plugins to use this API. The only user-visible change is that diagnostics from those plugins are now tagged with [tsetse] / [strictDeps]. The string ids for tracking the performance of these plugins have also changed, and have become more granular, tracking both file by file and the total time contributed by each plugin as a whole. PiperOrigin-RevId: 259985050 --- internal/tsc_wrapped/plugin_api.ts | 31 +++++++++ internal/tsc_wrapped/strict_deps.ts | 26 ++++---- internal/tsc_wrapped/tsc_wrapped.ts | 97 ++++++++++++++++++++++++----- internal/tsetse/runner.ts | 29 ++++----- 4 files changed, 138 insertions(+), 45 deletions(-) diff --git a/internal/tsc_wrapped/plugin_api.ts b/internal/tsc_wrapped/plugin_api.ts index f778c0f8..e09954d3 100644 --- a/internal/tsc_wrapped/plugin_api.ts +++ b/internal/tsc_wrapped/plugin_api.ts @@ -96,3 +96,34 @@ export function createProxy(delegate: T): T { } return proxy; } + +/** + * A plugin that contributes additional diagnostics during compilation. + * + * This is a more limited API than Plugin, which can overwrite any features of + * the Program. A DiagnosticPlugin can't affect the output, and can only reject + * otherwise valid programs. + * + * This means that disabling a DiagnosticPlugin is always safe. It will not + * break any downstream projects, either at build time or in production. + * + * It also lets us instrument the plugin to track performance, and tag the + * diagnostics it emits with the plugin name. + */ +export interface DiagnosticPlugin { + /** + * A brief descriptive name for the plugin. + * + * Should not include 'ts', 'typescript', or 'plugin'. + */ + readonly name: string; + + /** + * Return diagnostics for the given file. + * + * Should only include new diagnostics that your plugin is contributing. + * Should not include diagnostics from program. + */ + getDiagnostics(sourceFile: ts.SourceFile): + ReadonlyArray>; +} diff --git a/internal/tsc_wrapped/strict_deps.ts b/internal/tsc_wrapped/strict_deps.ts index 7afa4d99..c2cb7238 100644 --- a/internal/tsc_wrapped/strict_deps.ts +++ b/internal/tsc_wrapped/strict_deps.ts @@ -47,21 +47,19 @@ export const TS_ERR_CANNOT_FIND_MODULE = 2307; * * strict_deps currently does not check ambient/global definitions. */ -export const PLUGIN: pluginApi.Plugin = { - wrap: (program: ts.Program, config: StrictDepsPluginConfig): ts.Program => { - const proxy = pluginApi.createProxy(program); - proxy.getSemanticDiagnostics = function(sourceFile: ts.SourceFile) { - const result = [...program.getSemanticDiagnostics(sourceFile)]; - perfTrace.wrap('checkModuleDeps', () => { - result.push(...checkModuleDeps( - sourceFile, program.getTypeChecker(), config.allowedStrictDeps, - config.rootDir)); - }); - return result; - }; - return proxy; +export class Plugin implements pluginApi.DiagnosticPlugin { + constructor( + private readonly program: ts.Program, + private readonly config: StrictDepsPluginConfig) {} + + readonly name = 'strictDeps'; + + getDiagnostics(sourceFile: ts.SourceFile) { + return checkModuleDeps( + sourceFile, this.program.getTypeChecker(), + this.config.allowedStrictDeps, this.config.rootDir); } -}; +} // Exported for testing export function checkModuleDeps( diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 02d5040c..ad7c3794 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -3,15 +3,15 @@ import * as path from 'path'; import * as tsickle from 'tsickle'; import * as ts from 'typescript'; -import {PLUGIN as bazelConformancePlugin} from '../tsetse/runner'; +import {Plugin as BazelConformancePlugin} from '../tsetse/runner'; import {CachedFileLoader, FileLoader, ProgramAndFileCache, UncachedFileLoader} from './cache'; import {CompilerHost} from './compiler_host'; import * as bazelDiagnostics from './diagnostics'; import {constructManifest} from './manifest'; import * as perfTrace from './perf_trace'; -import {PluginCompilerHost, TscPlugin} from './plugin_api'; -import {PLUGIN as strictDepsPlugin} from './strict_deps'; +import {DiagnosticPlugin, PluginCompilerHost, TscPlugin} from './plugin_api'; +import {Plugin as StrictDepsPlugin} from './strict_deps'; import {BazelOptions, parseTsconfig, resolveNormalizedPath} from './tsconfig'; import {debug, log, runAsWorker, runWorkerLoop} from './worker'; @@ -62,18 +62,11 @@ function isCompilationTarget( */ export function gatherDiagnostics( options: ts.CompilerOptions, bazelOpts: BazelOptions, program: ts.Program, - disabledTsetseRules: string[], angularPlugin?: TscPlugin): ts.Diagnostic[] { + disabledTsetseRules: string[], angularPlugin?: TscPlugin, + plugins: DiagnosticPlugin[] = []): ts.Diagnostic[] { // Install extra diagnostic plugins - if (!bazelOpts.disableStrictDeps) { - program = strictDepsPlugin.wrap(program, { - ...bazelOpts, - rootDir: options.rootDir, - }); - } - if (!bazelOpts.isJsTranspilation) { - let selectedTsetsePlugin = bazelConformancePlugin; - program = selectedTsetsePlugin.wrap(program, disabledTsetseRules); - } + plugins.push( + ...getCommonPlugins(options, bazelOpts, program, disabledTsetseRules)); if (angularPlugin) { program = angularPlugin.wrap(program); } @@ -101,11 +94,83 @@ export function gatherDiagnostics( }); perfTrace.snapshotMemoryUsage(); } + for (const plugin of plugins) { + perfTrace.wrap(`${plugin.name} diagnostics`, () => { + for (const sf of sourceFilesToCheck) { + perfTrace.wrap(`${plugin.name} checking ${sf.fileName}`, () => { + const pluginDiagnostics = plugin.getDiagnostics(sf).map((d) => { + return tagDiagnosticWithPlugin(plugin.name, d); + }); + diagnostics.push(...pluginDiagnostics); + }); + perfTrace.snapshotMemoryUsage(); + } + }); + } }); return diagnostics; } +/** + * Construct diagnostic plugins that we always want included. + * + * TODO: Call sites of getDiagnostics should initialize plugins themselves, + * including these, and the arguments to getDiagnostics should be simplified. + */ +export function* + getCommonPlugins( + options: ts.CompilerOptions, bazelOpts: BazelOptions, + program: ts.Program, + disabledTsetseRules: string[]): Iterable { + if (!bazelOpts.disableStrictDeps) { + if (options.rootDir == null) { + throw new Error(`StrictDepsPlugin requires that rootDir be specified`); + } + yield new StrictDepsPlugin(program, { + ...bazelOpts, + rootDir: options.rootDir, + }); + } + if (!bazelOpts.isJsTranspilation) { + let tsetsePluginConstructor: + {new (program: ts.Program, disabledRules: string[]): DiagnosticPlugin} = + BazelConformancePlugin; + yield new tsetsePluginConstructor(program, disabledTsetseRules); + } +} + +/** + * Returns a copy of diagnostic with one whose text has been prepended with + * an indication of what plugin contributed that diagnostic. + * + * This is slightly complicated because a diagnostic's message text can be + * split up into a chain of diagnostics, e.g. when there's supplementary info + * about a diagnostic. + */ +function tagDiagnosticWithPlugin( + pluginName: string, diagnostic: Readonly): ts.Diagnostic { + const tagMessageWithPluginName = (text: string) => `[${pluginName}] ${text}`; + + let messageText; + if (typeof diagnostic.messageText === 'string') { + // The simple case, where a diagnostic's message is just a string. + messageText = tagMessageWithPluginName(diagnostic.messageText); + } else { + // In the case of a chain of messages we only want to tag the head of the + // chain, as that's the first line of message on the CLI. + const chain: ts.DiagnosticMessageChain = diagnostic.messageText; + messageText = { + ...chain, + messageText: tagMessageWithPluginName(chain.messageText) + }; + } + return { + ...diagnostic, + messageText, + }; +} + /** * expandSourcesFromDirectories finds any directories under filePath and expands * them to their .js or .ts contents. @@ -232,6 +297,7 @@ function runFromOptions( files, options, bazelOpts, compilerHostDelegate, fileLoader, moduleResolver); let compilerHost: PluginCompilerHost = tsickleCompilerHost; + const diagnosticPlugins: DiagnosticPlugin[] = []; let angularPlugin: TscPlugin|undefined; if (bazelOpts.compileAngularTemplates) { @@ -271,7 +337,8 @@ function runFromOptions( // messages refer to the original source. After any subsequent passes // (decorator downleveling or tsickle) we do not type check. let diagnostics = gatherDiagnostics( - options, bazelOpts, program, disabledTsetseRules, angularPlugin); + options, bazelOpts, program, disabledTsetseRules, angularPlugin, + diagnosticPlugins); if (!expectDiagnosticsWhitelist.length || expectDiagnosticsWhitelist.some(p => bazelOpts.target.startsWith(p))) { diagnostics = bazelDiagnostics.filterExpected( diff --git a/internal/tsetse/runner.ts b/internal/tsetse/runner.ts index d61a7076..826131e1 100644 --- a/internal/tsetse/runner.ts +++ b/internal/tsetse/runner.ts @@ -31,22 +31,19 @@ const ENABLED_RULES: AbstractRule[] = [ * The Tsetse check plugin performs compile-time static analysis for TypeScript * code. */ -export const PLUGIN: pluginApi.Plugin = { - wrap(program: ts.Program, disabledTsetseRules: string[] = []): ts.Program { - const checker = new Checker(program); - registerRules(checker, disabledTsetseRules); - const proxy = pluginApi.createProxy(program); - proxy.getSemanticDiagnostics = (sourceFile: ts.SourceFile) => { - const result = [...program.getSemanticDiagnostics(sourceFile)]; - perfTrace.wrap('checkConformance', () => { - result.push(...checker.execute(sourceFile) - .map(failure => failure.toDiagnostic())); - }); - return result; - }; - return proxy; - }, -}; +export class Plugin implements pluginApi.DiagnosticPlugin { + readonly name = 'tsetse'; + private readonly checker: Checker; + constructor(program: ts.Program, disabledTsetseRules: string[] = []) { + this.checker = new Checker(program); + registerRules(this.checker, disabledTsetseRules); + } + + getDiagnostics(sourceFile: ts.SourceFile) { + return this.checker.execute(sourceFile) + .map(failure => failure.toDiagnostic()); + } +} export function registerRules(checker: Checker, disabledTsetseRules: string[]) { for (const rule of ENABLED_RULES) { From 3a809d6274ce50415b537eaad066cb77bfa51dd5 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 26 Jul 2019 15:47:08 -0700 Subject: [PATCH 184/316] Report whether there was no TS in the package, don't just return early. PiperOrigin-RevId: 260228506 --- ts_auto_deps/updater/updater.go | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 6f2eba53..ff3d9868 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -688,38 +688,40 @@ type UpdateBUILDOptions struct { // UpdateBUILD drives the main process of creating/updating the BUILD file // underneath path based on the available sources. Returns true if it modified -// the BUILD file, false if the BUILD file was up to date already. -// bazelAnalyze is used to run the underlying `bazel analyze` process. -func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, error) { +// the BUILD file, false if the BUILD file was up to date already. bazelAnalyze +// is used to run the underlying `bazel analyze` process. Returns another +// boolean that's true iff the package doesn't contain any TypeScript (source +// files or BUILD rules). +func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, bool, error) { g3root, buildFilePath, bld, err := getBUILDPathAndBUILDFile(ctx, path) if err != nil { - return false, err + return false, false, err } if isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld) { - return false, nil + return false, false, nil } hasSubdirSrcs, err := directoryOrAncestorHasSubdirectorySources(ctx, g3root, buildFilePath, bld) if err != nil { - return false, err + return false, false, err } if hasSubdirSrcs { - return false, &SubdirectorySourcesError{} + return false, false, &SubdirectorySourcesError{} } changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld) if err != nil { - return false, err + return false, false, err } if options.InNonWritableEnvironment && changed { - return true, &CantProgressAfterWriteError{} + return true, false, &CantProgressAfterWriteError{} } rules := allTSRules(bld) if len(rules) == 0 && !options.IsRoot { // No TypeScript rules, no need to query for dependencies etc, so just exit early. - return changed, nil + return changed, true, nil } rulesWithSrcs := []*build.Rule{} for _, r := range rules { @@ -733,19 +735,19 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update platform.Infof("analyzing...") reports, err := upd.runBazelAnalyze(buildFilePath, bld, rulesWithSrcs) if err != nil { - return false, err + return false, false, err } changedAfterBazelAnalyze, err := upd.updateBUILDAfterBazelAnalyze(ctx, options.IsRoot, g3root, buildFilePath, bld, reports) if err != nil { - return false, err + return false, false, err } changed = changed || changedAfterBazelAnalyze if options.InNonWritableEnvironment && changed { - return true, &CantProgressAfterWriteError{} + return true, false, &CantProgressAfterWriteError{} } - return changed, nil + return changed, false, nil } // buildHasDisableTaze checks if the BUILD file should be managed using ts_auto_deps. @@ -1250,7 +1252,7 @@ func Execute(host *Updater, paths []string, isRoot, recursive bool) error { ctx := context.Background() for i, p := range paths { isLastAndRoot := isRoot && i == len(paths)-1 - changed, err := host.UpdateBUILD(ctx, p, UpdateBUILDOptions{InNonWritableEnvironment: false, IsRoot: isLastAndRoot}) + changed, _, err := host.UpdateBUILD(ctx, p, UpdateBUILDOptions{InNonWritableEnvironment: false, IsRoot: isLastAndRoot}) if err != nil { if recursive { return fmt.Errorf("ts_auto_deps failed on %s/BUILD: %s", p, err) From 3ce01a7761a97bdb48914dc288e60c35f8f4616c Mon Sep 17 00:00:00 2001 From: rjamet Date: Fri, 2 Aug 2019 05:55:10 -0700 Subject: [PATCH 185/316] Add a new matcher (nth argument of a call to foo is literal) to Tsetse. This literalness constraint is useful as a proxy for "no user data should be in that argument", for instance for security purposes. PiperOrigin-RevId: 261307072 --- .../tsetse/rules/conformance_pattern_rule.ts | 5 + .../name_call_non_constant_argument_test.ts | 116 ++++++++++++++++++ internal/tsetse/util/match_symbol.ts | 10 +- internal/tsetse/util/pattern_config.ts | 20 +-- .../name_call_non_constant_argument.ts | 86 +++++++++++++ 5 files changed, 226 insertions(+), 11 deletions(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts create mode 100644 internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index 677490de..0cbfe711 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -3,11 +3,13 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; import {Fixer} from '../util/fixer'; import {Config, PatternKind} from '../util/pattern_config'; +import {CallNonConstantArgumentEngine} from '../util/pattern_engines/name_call_non_constant_argument'; import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; + /** * Builds a Rule that matches a certain pattern, given as parameter, and * that can additionally run a suggested fix generator on the matches. @@ -32,6 +34,9 @@ export class ConformancePatternRule implements AbstractRule { case PatternKind.BANNED_NAME: this.engine = new NameEngine(config, fixer); break; + case PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT: + this.engine = new CallNonConstantArgumentEngine(config, fixer); + break; default: throw new Error('Config type not recognized, or not implemented yet.'); } diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts new file mode 100644 index 00000000..44c9a319 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts @@ -0,0 +1,116 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'do not call bar.foo with non-literal 1st arg', + kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, + values: ['bar:0'] + }); + + it('matches simple examples', () => { + const sources = [ + `export function bar(x:any, y:any) {}`, + `import * as foo from './file_0'; ` + + `foo.bar(1, 1); foo.bar(window.name, 1);`, + ]; + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `foo.bar(window.name, 1)`, + messageText: 'do not call bar.foo with non-literal 1st arg' + }); + }); + + it('looks at the right position', () => { + const sources = [ + `export function bar(x:any, y:any) {}`, + `import * as foo from './file_0'; foo.bar(1, window.name);`, + ]; + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(0); + }); + + it('looks at the right position', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'non-literal arg', + kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, + values: ['aaa:1', 'bbb:0'] + }); + + const sources = [ + `export function aaa(x:any, y:any) {}; export function bbb(x:any) {}`, + `import * as foo from './file_0'; ` + + `foo.aaa(1, window.name); foo.bbb(window.name);`, + ]; + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(2); + expect(results[0]).toBeFailureMatching({ + matchedCode: `foo.aaa(1, window.name)`, + }); + expect(results[1]).toBeFailureMatching({ + matchedCode: `foo.bbb(window.name)`, + }); + }); + + it('supports static methods', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'non-literal arg', + kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, + values: ['Car.buildFromParts:0'] + }); + + const sources = [ + `export class Car { static buildFromParts(name:string):void {}; }`, + `import {Car} from './file_0';\n` + + `Car.buildFromParts(window.name);\n` + + `Car.buildFromParts('hello');`, + ]; + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `Car.buildFromParts(window.name)`, + }); + }); + + it('supports ambient global methods', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'non-literal arg', + kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, + values: ['URL.createObjectURL:0'] + }); + + const sources = [`URL.createObjectURL(window.name);\n`]; + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `URL.createObjectURL(window.name)`, + }); + }); + + it('supports ambient global methods', () => { + const rule = new ConformancePatternRule({ + errorMessage: 'non-literal arg', + kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, + values: ['eval:0'] + }); + + const sources = [`eval(window.name);\n`]; + const results = compileAndCheck(rule, ...sources); + + expect(results.length).toBe(1); + expect(results[0]).toBeFailureMatching({ + matchedCode: `eval(window.name)`, + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index c60195b2..eb588e8f 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -15,6 +15,11 @@ const ABSOLUTE_RE = new RegExp(`^${FQN_FORMAT}$`); * Note that this isn't smart about subclasses and types: to write a check, we * strongly suggest finding the expected symbol in externs to find the object * name on which the symbol was initially defined. + * + * TODO(rjamet): add a file-based optional filter, since FQNs tell you where + * your imported symbols were initially defined. That would let us be more + * specific in matches (say, you want to ban the fromLiteral in foo.ts but not + * the one from bar.ts). */ export class AbsoluteMatcher { /** @@ -32,10 +37,11 @@ export class AbsoluteMatcher { // on `foo`. To avoid any confusion, throw there if we see `prototype` in // the spec: that way, it's obvious that you're not trying to match // properties. - if (this.bannedName.includes('.prototype')) { + if (this.bannedName.match('.prototype.')) { throw new Error( 'Your pattern includes a .prototype, but the AbsoluteMatcher is ' + - 'meant for non-object matches. Use the PropertyMatcher instead.'); + 'meant for non-object matches. Use the PropertyMatcher instead, or ' + + 'the Property-based PatternKinds.'); } } diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 21e9c256..bc907b14 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -7,7 +7,9 @@ export const enum PatternKind { BANNED_NAME = 'banned-name', BANNED_PROPERTY_WRITE = 'banned-property-write', - BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write' + BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', + // Not from JSConformance. + BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT = 'banned-call-non-constant-argument' } /** @@ -19,8 +21,8 @@ export interface Config { /** * Values have a pattern-specific syntax. * - * TODO(rjamet): We'll document them, but for now see each patternKind's tests - * for examples. + * TODO(rjamet): We'll document them, but for now see each patternKind's + * tests for examples. */ values: string[]; @@ -32,13 +34,13 @@ export interface Config { } /** - * A whitelist entry, corresponding to a logical whitelisting rule. Use these to - * distinguish between various logical reasons for whitelisting something: for - * instance, tie these to particular bugs that needed whitelisting, per legacy - * project, manually reviewed entries, and so on. + * A whitelist entry, corresponding to a logical whitelisting rule. Use these + * to distinguish between various logical reasons for whitelisting something: + * for instance, tie these to particular bugs that needed whitelisting, per + * legacy project, manually reviewed entries, and so on. * - * Whitelists are based on the file paths provided by the TS compiler, with both - * regexp-based checks and prefix-based checks. + * Whitelists are based on the file paths provided by the TS compiler, with + * both regexp-based checks and prefix-based checks. * * * Follows the logic in diff --git a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts new file mode 100644 index 00000000..1af786db --- /dev/null +++ b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts @@ -0,0 +1,86 @@ +import * as ts from 'typescript'; +import {Checker} from '../../checker'; +import {ErrorCode} from '../../error_code'; +import {debugLog} from '../ast_tools'; +import {Fixer} from '../fixer'; +import {isLiteral} from '../is_literal'; +import {AbsoluteMatcher} from '../match_symbol'; +import {Config} from '../pattern_config'; +import {PatternEngine} from './pattern_engine'; + +/** + * The engine for BANNED_CALL_NON_CONSTANT_ARGUMENT. + * + * This takes any amount of (functionName, argument) position pairs, separated + * by a colon. The first part matches symbols that were defined on the global + * scope, and their fields, without going through a prototype chain. + * + * For instance, "URL.createObjectURL:0" will target any createObjectURL-named + * call on a URL-named object (like the ambient URL declared in lib.dom.d.ts), + * or "Car.buildFromParts:1" will match any buildFromParts reached from a + * Car-named symbol, including a hypothetical class with a static member + * function "buildFromParts" that lives in its own module. + */ +export class CallNonConstantArgumentEngine extends PatternEngine { + private readonly matchers: Array<[AbsoluteMatcher, number]> = []; + + constructor(config: Config, fixer?: Fixer) { + super(config, fixer); + for (const v of config.values) { + const [matcherSpec, strPosition] = v.split(':', 2); + if (!matcherSpec || !strPosition.match('^\\d+$')) { + throw new Error('Couldn\'t parse values'); + } + const position = Number(strPosition); + this.matchers.push([new AbsoluteMatcher(matcherSpec), position]); + } + } + + register(checker: Checker) { + checker.on( + ts.SyntaxKind.CallExpression, this.checkAndFilterResults.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + } + + check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { + if (!ts.isCallExpression(n)) { + debugLog(`Should not happen: node is not a CallExpression`); + return; + } + debugLog(`inspecting ${n.getText().trim()}`); + + /** + * Inspects a particular CallExpression to see if it calls the target + * function with a non-literal parameter in the target position. Returns + * that CallExpression if `n` matches the search, undefined otherwise. + */ + function checkIndividual( + n: ts.CallExpression, m: [AbsoluteMatcher, number]): ts.CallExpression| + undefined { + if (!m[0].matches(n.expression, tc)) { + debugLog(`Wrong symbol, not ${m[0].bannedName}`); + return; + } + if (n.arguments.length < m[1]) { + debugLog(`Good symbol, not enough arguments to match (got ${ + n.arguments.length}, want ${m[1]})`); + return; + } + if (isLiteral(tc, n.arguments[m[1]])) { + debugLog(`Good symbol, argument literal`); + return; + } + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + } + + for (const m of this.matchers) { + // The first matching matcher will be used. + const r = checkIndividual(n, m); + if (r) return r; + } + // No match. + return; + } +} From 58d90ccbd245f3060f683f6602555d0ba42c0dfb Mon Sep 17 00:00:00 2001 From: rjamet Date: Fri, 2 Aug 2019 15:54:30 -0700 Subject: [PATCH 186/316] Clarify tsetse's isLiteral documentation. PiperOrigin-RevId: 261407997 --- internal/tsetse/util/is_literal.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/tsetse/util/is_literal.ts b/internal/tsetse/util/is_literal.ts index 8b7209c3..2f44ce27 100644 --- a/internal/tsetse/util/is_literal.ts +++ b/internal/tsetse/util/is_literal.ts @@ -2,7 +2,21 @@ import * as ts from 'typescript'; import {findInChildren} from './ast_tools'; /** - * Determines if the given ts.Node is literal enough for security purposes. + * Determines if the given ts.Node is literal enough for security purposes. This + * is true when the value is built from compile-time constants, with a certain + * tolerance for indirection in order to make this more user-friendly. + * + * This considers a few different things. We accept + * - What TS deems literal (literal strings, literal numbers, literal booleans, + * enum literals), + * - Binary operations of two expressions that we accept (including + * concatenation), + * - Template interpolations of what we accept, + * - `x?y:z` constructions, if we accept `y` and `z` + * - Variables that are const, and initialized with an expression we accept + * + * And to prevent bypasses, expressions that include casts are not accepted, and + * this checker does not follow imports. */ export function isLiteral(typeChecker: ts.TypeChecker, node: ts.Node): boolean { if (ts.isBinaryExpression(node) && From 4a399172f320f396355e7106e2a2372099eb75b4 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 5 Aug 2019 11:00:27 -0700 Subject: [PATCH 187/316] Internal change. PiperOrigin-RevId: 261722053 --- internal/common/tsconfig.bzl | 2 ++ internal/tsc_wrapped/tsc_wrapped.ts | 1 + internal/tsc_wrapped/tsconfig.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 0fe82547..4c4427dc 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -17,6 +17,7 @@ load(":common/module_mappings.bzl", "get_module_mappings") + _DEBUG = False def create_tsconfig( @@ -161,6 +162,7 @@ def create_tsconfig( if hasattr(ctx.attr, "compile_angular_templates") and ctx.attr.compile_angular_templates: bazel_options["compileAngularTemplates"] = True + if disable_strict_deps: bazel_options["disableStrictDeps"] = disable_strict_deps bazel_options["allowedStrictDeps"] = [] diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index ad7c3794..280d7339 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -332,6 +332,7 @@ function runFromOptions( compilerHost.inputFiles, options, compilerHost, oldProgram)); cache.putProgram(bazelOpts.target, program); + if (!bazelOpts.isJsTranspilation) { // If there are any TypeScript type errors abort now, so the error // messages refer to the original source. After any subsequent passes diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index 9c2980f6..9bc0a33b 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -18,6 +18,7 @@ import * as path from 'path'; import * as ts from 'typescript'; + /** * The configuration block provided by the tsconfig "bazelOptions". * Note that all paths here are relative to the rootDir, not absolute nor @@ -182,6 +183,7 @@ export interface BazelOptions { */ compileAngularTemplates?: boolean; + /** * Override for ECMAScript target language level to use for devmode. * From ae6d6888ffb727f7d10918c2c2fee267de12aebb Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 9 Aug 2019 17:09:30 -0700 Subject: [PATCH 188/316] Name AMD module `foo` rather than `foo/module_root/index` We already had logic to name it foo rather than foo/index, introduced in https://github.com/bazelbuild/rules_typescript/commit/c7b6880767eaae44d8777a7a1b137de92b8fd4d9 If the module_root is specified as a directory on the ts_library, it means that the index file is in that subdirectory of the package. We already handled this case correctly in type-checking, but at runtime the module identifiers don't match so the require('foo/module_root/index') fails. Fixes bazelbuild/rules_nodejs#973 PiperOrigin-RevId: 262663195 --- internal/tsc_wrapped/compiler_host.ts | 11 ++-- internal/tsc_wrapped/compiler_host_test.ts | 62 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 internal/tsc_wrapped/compiler_host_test.ts diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 9008a087..9cae0182 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -333,11 +333,14 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { if (this.bazelOpts.moduleName) { const relativeFileName = path.posix.relative(this.bazelOpts.package, fileName); + // check that the fileName was actually underneath the package directory if (!relativeFileName.startsWith('..')) { - if (this.bazelOpts.moduleRoot && - this.bazelOpts.moduleRoot.replace(SOURCE_EXT, '') === - relativeFileName) { - return this.bazelOpts.moduleName; + if (this.bazelOpts.moduleRoot) { + const root = this.bazelOpts.moduleRoot.replace(SOURCE_EXT, ''); + if (root === relativeFileName || + path.posix.join(root, 'index') === relativeFileName) { + return this.bazelOpts.moduleName; + } } // Support the common case of commonjs convention that index is the // default module in a directory. diff --git a/internal/tsc_wrapped/compiler_host_test.ts b/internal/tsc_wrapped/compiler_host_test.ts new file mode 100644 index 00000000..eaa0ac4a --- /dev/null +++ b/internal/tsc_wrapped/compiler_host_test.ts @@ -0,0 +1,62 @@ +import 'jasmine'; + +import * as ts from 'typescript'; + +import {CompilerHost} from './compiler_host'; +import {BazelOptions} from './tsconfig'; + +describe('compiler host', () => { + describe('computes the amd module name of a .ts source file', () => { + const options: ts.CompilerOptions = { + rootDirs: [], + rootDir: 'base', + outDir: 'out', + }; + const bazelOptions: BazelOptions = { + package: 'path/to/package', + compilationTargetSrc: [ + 'path/to/package/index.ts', + 'path/to/package/root_dir/index.ts', + 'test.ts', + ], + workspaceName: 'my_wksp', + } as any; + + const defaultHost = + new CompilerHost([], options, bazelOptions, null as any, null as any); + // A module is a file with at least an import or export statement. + function createTsModule(filename: string) { + return ts.createSourceFile(filename, 'export {}', ts.ScriptTarget.ES2015); + } + + it('should name a module after the workspace and filename', () => { + expect(defaultHost.amdModuleName(createTsModule('test.ts'))) + .toBe('my_wksp/test'); + }); + + it('should not provide a name for files that are not in the compilation unit', + () => { + expect( + defaultHost.amdModuleName(createTsModule('some_other_file.d.ts'))) + .toBeUndefined(); + }); + + it('should name the index file with a short name', () => { + const host = new CompilerHost( + [], options, {...bazelOptions, moduleName: 'my_lib'}, null as any, + null as any); + expect(host.amdModuleName(createTsModule('path/to/package/index.ts'))) + .toBe('my_lib'); + }); + it('should name an index file under a module_root with a short name', + () => { + const host = new CompilerHost( + [], options, + {...bazelOptions, moduleName: 'my_lib', moduleRoot: 'root_dir'}, + null as any, null as any); + expect(host.amdModuleName( + createTsModule('path/to/package/root_dir/index.ts'))) + .toBe('my_lib'); + }); + }); +}); From 0cbaf66b8d5dd751085dc68cef1518bab382791e Mon Sep 17 00:00:00 2001 From: lucassloan Date: Mon, 12 Aug 2019 15:50:28 -0700 Subject: [PATCH 189/316] Make libraries that depend on //javascript/angular2/testing/catalyst into ng_modules. Currently you need a dep on something in //third_party/javascript/angular2, so people are forced to insert dummy taze comments. PiperOrigin-RevId: 263022649 --- ts_auto_deps/updater/updater.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index ff3d9868..b77acbad 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -958,13 +958,7 @@ func hasAngularDependency(r *build.Rule) bool { for _, li := range edit.AllLists(e) { for _, elem := range li.List { str, ok := elem.(*build.StringExpr) - if !ok { - continue - } - if strings.HasPrefix(str.Value, "//third_party/javascript/angular2") { - return true - } - if str.Value == "//javascript/angular2/testing/catalyst" { + if ok && strings.HasPrefix(str.Value, "//third_party/javascript/angular2") { return true } } From 73ba7764363bbf760593a205329cb676095f53f9 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 13 Aug 2019 14:31:16 -0700 Subject: [PATCH 190/316] Update to latest rules_go Closes #465 PiperOrigin-RevId: 263216442 --- WORKSPACE | 4 + package.bzl | 18 +- ...d82a001f378d0605cbbca3fb529979a1c3a6.patch | 1365 +++++++++++++++++ 3 files changed, 1384 insertions(+), 3 deletions(-) create mode 100644 revert_rules_go_commit_4442d82a001f378d0605cbbca3fb529979a1c3a6.patch diff --git a/WORKSPACE b/WORKSPACE index 00fe5027..f4157f29 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -35,6 +35,10 @@ yarn_install( load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + # Setup rules_go toolchain load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") diff --git a/package.bzl b/package.bzl index 80522390..0f4ad482 100644 --- a/package.bzl +++ b/package.bzl @@ -47,11 +47,23 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "io_bazel_rules_go", + patch_args = ["-p1"], + # Patch out a breaking change to runfiles support library + # See discussion on https://github.com/bazelbuild/rules_go/pull/2076 + patches = ["@build_bazel_rules_typescript//:revert_rules_go_commit_4442d82a001f378d0605cbbca3fb529979a1c3a6.patch"], + sha256 = "8df59f11fb697743cbb3f26cfb8750395f30471e9eabde0d174c3aebc7a1cd39", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz", + "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz", + "https://github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz", ], - sha256 = "a82a352bffae6bee4e95f68a8d80a70e87f42c4741e6a448bec11998fcc82329", + ) + + _maybe( + http_archive, + name = "com_google_protobuf", + sha256 = "98e615d592d237f94db8bf033fba78cd404d979b0b70351a9e5aaff725398357", + strip_prefix = "protobuf-3.9.1", + urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.9.1.tar.gz"], ) # go_repository is defined in bazel_gazelle diff --git a/revert_rules_go_commit_4442d82a001f378d0605cbbca3fb529979a1c3a6.patch b/revert_rules_go_commit_4442d82a001f378d0605cbbca3fb529979a1c3a6.patch new file mode 100644 index 00000000..e9235920 --- /dev/null +++ b/revert_rules_go_commit_4442d82a001f378d0605cbbca3fb529979a1c3a6.patch @@ -0,0 +1,1365 @@ +diff --git a/go/tools/bazel/BUILD.bazel b/go/tools/bazel/BUILD.bazel +index 6fbd4086..66656084 100644 +--- a/go/tools/bazel/BUILD.bazel ++++ b/go/tools/bazel/BUILD.bazel +@@ -4,6 +4,8 @@ go_library( + name = "go_default_library", + srcs = [ + "bazel.go", ++ "runfiledir.go", ++ "runfilemanifest.go", + "runfiles.go", + ], + importpath = "github.com/bazelbuild/rules_go/go/tools/bazel", +@@ -13,8 +15,13 @@ go_library( + go_test( + name = "go_default_test", + size = "small", +- srcs = ["bazel_test.go"], +- data = ["README.md"], ++ srcs = [ ++ "bazel_test.go", ++ "runfiles_test.go", ++ ], ++ data = [ ++ "README.md", ++ ], + embed = [":go_default_library"], + ) + +diff --git a/go/tools/bazel/bazel.go b/go/tools/bazel/bazel.go +index 08bf3496..37f1b8d1 100644 +--- a/go/tools/bazel/bazel.go ++++ b/go/tools/bazel/bazel.go +@@ -16,14 +16,76 @@ + package bazel + + import ( ++ "fmt" + "io/ioutil" + "os" ++ "path/filepath" ++ "sync" + ) + + const TEST_SRCDIR = "TEST_SRCDIR" + const TEST_TMPDIR = "TEST_TMPDIR" + const TEST_WORKSPACE = "TEST_WORKSPACE" + ++var ( ++ defaultTestWorkspace = "" ++ ++ runfileResolver runfilesResolver ++ runfileResolverErr error ++ runfileResolverOnce sync.Once ++) ++ ++func getRunfilesResolver() (runfilesResolver, error) { ++ runfileResolverOnce.Do(func() { ++ runfileResolver, runfileResolverErr = newRunfilesResolver() ++ }) ++ return runfileResolver, runfileResolverErr ++} ++ ++// Runfile returns an absolute path to the specified file in the runfiles directory of the running target. ++// It searches the current working directory, the runfiles path, and the workspace subdirectory of runfiles. ++// If a runfiles manifest is present, it will be used to resolve files not present in the working directory. ++// Returns an error if the file could not be found, or if an error occurs trying to find the runfiles env. ++func Runfile(path string) (string, error) { ++ // Search in working directory ++ if _, err := os.Stat(path); err == nil { ++ return path, nil ++ } ++ ++ resolver, err := getRunfilesResolver() ++ if err != nil { ++ return "", err ++ } ++ ++ // Search in runfiles. ++ searchPath := []string{path} ++ if workspace, err := TestWorkspace(); err == nil { ++ searchPath = append(searchPath, filepath.Join(workspace, path)) ++ } ++ ++ for _, path := range searchPath { ++ filename, ok := resolver.Resolve(path) ++ if !ok { ++ continue ++ } ++ ++ if _, err := os.Stat(filename); err == nil { ++ return filename, nil ++ } ++ } ++ ++ return "", fmt.Errorf("unable to find file %q", path) ++} ++ ++// RunfilesPath return the path to the run files tree for this test. ++// It returns an error if TEST_SRCDIR does not exist. ++func RunfilesPath() (string, error) { ++ if src, ok := os.LookupEnv(TEST_SRCDIR); ok { ++ return src, nil ++ } ++ return "", fmt.Errorf("environment variable %q is not defined, are you running with bazel test", TEST_SRCDIR) ++} ++ + // NewTmpDir creates a new temporary directory in TestTmpDir(). + func NewTmpDir(prefix string) (string, error) { + return ioutil.TempDir(TestTmpDir(), prefix) +@@ -37,3 +99,90 @@ func TestTmpDir() string { + } + return os.TempDir() + } ++ ++// TestWorkspace returns the name of the Bazel workspace for this test. ++// If TEST_WORKSPACE is not defined, it returns an error. ++func TestWorkspace() (string, error) { ++ if ws, ok := os.LookupEnv(TEST_WORKSPACE); ok { ++ return ws, nil ++ } ++ if defaultTestWorkspace != "" { ++ return defaultTestWorkspace, nil ++ } ++ return "", fmt.Errorf("Unable to find environment variable TEST_WORKSPACE") ++} ++ ++// SetDefaultTestWorkspace allows you to set a fake value for the ++// environment variable TEST_WORKSPACE if it is not defined. This is useful ++// when running tests on the command line and not through Bazel. ++func SetDefaultTestWorkspace(w string) { ++ defaultTestWorkspace = w ++} ++ ++// getCandidates returns the list of all possible "prefix/suffix" paths where there might be an ++// optional component in-between the two pieces. ++// ++// This function exists to cope with issues #1239 because we cannot tell where the built Go ++// binaries are located upfront. ++func getCandidates(prefix string, suffix string) []string { ++ candidates := []string{filepath.Join(prefix, suffix)} ++ if entries, err := ioutil.ReadDir(prefix); err == nil { ++ for _, entry := range entries { ++ candidate := filepath.Join(prefix, entry.Name(), suffix) ++ candidates = append(candidates, candidate) ++ } ++ } ++ return candidates ++} ++ ++// FindBinary locates the given executable within bazel-bin or the current directory. ++// ++// "pkg" indicates the relative path to the build package that contains the binary target, and ++// "binary" indicates the basename of the binary searched for. ++func FindBinary(pkg string, binary string) (string, bool) { ++ candidates := getCandidates(filepath.Join("bazel-bin", pkg), binary) ++ candidates = append(candidates, getCandidates(pkg, binary)...) ++ ++ for _, candidate := range candidates { ++ // Following symlinks here is intentional because Bazel generates symlinks in ++ // general and we don't care about that. ++ if fileInfo, err := os.Stat(candidate); err == nil { ++ if fileInfo.Mode()&os.ModeType == 0 && fileInfo.Mode()&0100 != 0 { ++ return candidate, true ++ } ++ } ++ } ++ return "", false ++} ++ ++// findRunfiles locates the directory under which a built binary can find its data dependencies ++// using relative paths. ++func findRunfiles(workspace string, pkg string, binary string, cookie string) (string, bool) { ++ candidates := getCandidates(filepath.Join("bazel-bin", pkg), filepath.Join(binary+".runfiles", workspace)) ++ candidates = append(candidates, ".") ++ ++ for _, candidate := range candidates { ++ if _, err := os.Stat(filepath.Join(candidate, cookie)); err == nil { ++ return candidate, true ++ } ++ } ++ return "", false ++} ++ ++// EnterRunfiles locates the directory under which a built binary can find its data dependencies ++// using relative paths, and enters that directory. ++// ++// "workspace" indicates the name of the current project, "pkg" indicates the relative path to the ++// build package that contains the binary target, "binary" indicates the basename of the binary ++// searched for, and "cookie" indicates an arbitrary data file that we expect to find within the ++// runfiles tree. ++func EnterRunfiles(workspace string, pkg string, binary string, cookie string) error { ++ runfiles, ok := findRunfiles(workspace, pkg, binary, cookie) ++ if !ok { ++ return fmt.Errorf("cannot find runfiles tree") ++ } ++ if err := os.Chdir(runfiles); err != nil { ++ return fmt.Errorf("cannot enter runfiles tree: %v", err) ++ } ++ return nil ++} +diff --git a/go/tools/bazel/bazel_test.go b/go/tools/bazel/bazel_test.go +index 66aa5876..41c9eed2 100644 +--- a/go/tools/bazel/bazel_test.go ++++ b/go/tools/bazel/bazel_test.go +@@ -126,6 +126,137 @@ func TestTestWorkspace(t *testing.T) { + } + } + ++func TestTestWorkspaceWithoutDefaultSet(t *testing.T) { ++ if oldVal, ok := os.LookupEnv(TEST_WORKSPACE); ok { ++ defer os.Setenv(TEST_WORKSPACE, oldVal) ++ } else { ++ t.Errorf("Terrible things are happening. You can't read env variables") ++ } ++ os.Unsetenv(TEST_WORKSPACE) ++ ++ workspace, err := TestWorkspace() ++ ++ if workspace != "" { ++ t.Errorf("Workspace should be left empty but was: %s", workspace) ++ } ++ ++ if err == nil { ++ t.Errorf("Expected error but instead passed") ++ } ++} ++ ++func TestTestWorkspaceWithDefaultSet(t *testing.T) { ++ if oldVal, ok := os.LookupEnv(TEST_WORKSPACE); ok { ++ defer os.Setenv(TEST_WORKSPACE, oldVal) ++ } else { ++ t.Errorf("Terrible things are happening. You can't read env variables") ++ } ++ os.Unsetenv(TEST_WORKSPACE) ++ ++ SetDefaultTestWorkspace("default_value") ++ workspace, err := TestWorkspace() ++ ++ if workspace == "" { ++ t.Errorf("Workspace is left empty") ++ } ++ ++ if err != nil { ++ t.Errorf("Unable to get workspace with error %s", err) ++ } ++} ++ ++func TestFindBinary(t *testing.T) { ++ testData := []struct { ++ name string ++ ++ pathsToCreate []string ++ wantBinary string ++ wantOk bool ++ }{ ++ { ++ "NoFiles", ++ []string{}, ++ "", ++ false, ++ }, ++ { ++ "CurrentDirectoryNoConfigurationInPath", ++ []string{ ++ "some/package/", ++ "some/package/bin*", ++ }, ++ "some/package/bin", ++ true, ++ }, ++ { ++ "CurrentDirectoryConfigurationInPath", ++ []string{ ++ "some/package/amd64/", ++ "some/package/arm64/", ++ "some/package/arm64/bin*", ++ "some/package/powerpc/", ++ }, ++ "some/package/arm64/bin", ++ true, ++ }, ++ { ++ "BazelBinNoConfigurationInPath", ++ []string{ ++ "bazel-bin/some/package/", ++ "bazel-bin/some/package/bin*", ++ "bin", // bazel-bin should be preferred. ++ }, ++ "bazel-bin/some/package/bin", ++ true, ++ }, ++ { ++ "BazelBinConfigurationInPath", ++ []string{ ++ "bazel-bin/some/package/amd64/", ++ "bazel-bin/some/package/arm64/", ++ "bazel-bin/some/package/arm64/bin*", ++ "bazel-bin/some/package/powerpc/", ++ "bin", // bazel-bin should be preferred. ++ "some/package/amd64/", ++ "some/package/amd64/bin", // bazel-bin should be preferred. ++ }, ++ "bazel-bin/some/package/arm64/bin", ++ true, ++ }, ++ { ++ "IgnoreNonExecutable", ++ []string{ ++ "bazel-bin/some/package/amd64/", ++ "bazel-bin/some/package/amd64/bin", ++ "bazel-bin/some/package/arm64/", ++ "bazel-bin/some/package/arm64/bin*", ++ "bazel-bin/some/package/powerpc/", ++ "bazel-bin/some/package/powerpc/bin", ++ }, ++ "bazel-bin/some/package/arm64/bin", ++ true, ++ }, ++ } ++ for _, d := range testData { ++ t.Run(d.name, func(t *testing.T) { ++ cleanup, err := makeAndEnterTempdir() ++ if err != nil { ++ t.Fatal(err) ++ } ++ defer cleanup() ++ ++ if err := createPaths(d.pathsToCreate); err != nil { ++ t.Fatal(err) ++ } ++ ++ binary, ok := FindBinary("some/package", "bin") ++ if binary != d.wantBinary || ok != d.wantOk { ++ t.Errorf("Got %s, %v; want %s, %v", binary, ok, d.wantBinary, d.wantOk) ++ } ++ }) ++ } ++} ++ + func TestFindRunfiles(t *testing.T) { + testData := []struct { + name string +diff --git a/go/tools/bazel/runfiledir.go b/go/tools/bazel/runfiledir.go +new file mode 100644 +index 00000000..255d1452 +--- /dev/null ++++ b/go/tools/bazel/runfiledir.go +@@ -0,0 +1,32 @@ ++// Copyright 2018 The Bazel Authors. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++package bazel ++ ++import ( ++ "path/filepath" ++) ++ ++type directoryResolver string ++ ++// newDirectoryRunfilesResolver creates a new runfiles resolver that uses a runfiles directory to derive ++// filenames. ++func newDirectoryRunfilesResolver(directory string) (runfilesResolver, error) { ++ return directoryResolver(directory), nil ++} ++ ++// Resolve implements the Resolver interface. ++func (r directoryResolver) Resolve(n string) (string, bool) { ++ return filepath.Join(string(r), n), true ++} +diff --git a/go/tools/bazel/runfilemanifest.go b/go/tools/bazel/runfilemanifest.go +new file mode 100644 +index 00000000..8392a4b0 +--- /dev/null ++++ b/go/tools/bazel/runfilemanifest.go +@@ -0,0 +1,53 @@ ++// Copyright 2018 The Bazel Authors. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++package bazel ++ ++import ( ++ "bufio" ++ "errors" ++ "io" ++ "path/filepath" ++ "strings" ++) ++ ++var errManifestInvalid = errors.New("runfiles manifest syntax error") ++ ++type manifestResolver map[string]string ++ ++// newManifestRunfilesResolver creates a new runfiles resolver that uses a manifest file to resolve ++// filenames. ++func newManifestRunfilesResolver(manifest io.Reader) (runfilesResolver, error) { ++ resolver := manifestResolver{} ++ scanner := bufio.NewScanner(manifest) ++ ++ for scanner.Scan() { ++ a := strings.SplitN(scanner.Text(), " ", 2) ++ if len(a) != 2 { ++ return nil, errManifestInvalid ++ } ++ resolver[filepath.Clean(a[0])] = a[1] ++ } ++ ++ return resolver, nil ++} ++ ++// Resolve implements the Resolver interface. ++func (r manifestResolver) Resolve(n string) (string, bool) { ++ if fn, ok := r[filepath.Clean(n)]; ok { ++ return fn, true ++ } ++ ++ return "", false ++} +diff --git a/go/tools/bazel/runfiles.go b/go/tools/bazel/runfiles.go +index ed053e90..16ca3e16 100644 +--- a/go/tools/bazel/runfiles.go ++++ b/go/tools/bazel/runfiles.go +@@ -15,17 +15,8 @@ + package bazel + + import ( +- "bytes" + "errors" +- "fmt" +- "io/ioutil" + "os" +- "path" +- "path/filepath" +- "runtime" +- "sort" +- "strings" +- "sync" + ) + + const ( +@@ -33,393 +24,31 @@ const ( + RUNFILES_DIR = "RUNFILES_DIR" + ) + +-// Runfile returns an absolute path to the file named by "path", which +-// should be a relative path from the workspace root to the file within +-// the bazel workspace. +-// +-// Runfile may be called from tests invoked with 'bazel test' and +-// binaries invoked with 'bazel run'. On Windows, +-// only tests invoked with 'bazel test' are supported. +-func Runfile(path string) (string, error) { +- // Search in working directory +- if _, err := os.Stat(path); err == nil { +- return filepath.Abs(path) +- } +- +- if err := ensureRunfiles(); err != nil { +- return "", err +- } +- +- // Search manifest if we have one. +- if entry, ok := runfiles.index[path]; ok { +- return entry.Path, nil +- } +- +- // Search the main workspace. +- if runfiles.workspace != "" { +- mainPath := filepath.Join(runfiles.dir, runfiles.workspace, path) +- if _, err := os.Stat(mainPath); err == nil { +- return mainPath, nil +- } +- } +- +- // Search other workspaces. +- for _, w := range runfiles.workspaces { +- workPath := filepath.Join(runfiles.dir, w, path) +- if _, err := os.Stat(workPath); err == nil { +- return workPath, nil +- } +- } +- +- return "", fmt.Errorf("Runfile %s: could not locate file", path) +-} +- +-// FindBinary returns an absolute path to the binary built from a go_binary +-// rule in the given package with the given name. FindBinary is similar to +-// Runfile, but it accounts for varying configurations and file extensions, +-// which may cause the binary to have different paths on different platforms. +-// +-// FindBinary may be called from tests invoked with 'bazel test' and +-// binaries invoked with 'bazel run'. On Windows, +-// only tests invoked with 'bazel test' are supported. +-func FindBinary(pkg, name string) (string, bool) { +- if err := ensureRunfiles(); err != nil { +- return "", false +- } +- +- // If we've gathered a list of runfiles, either by calling ListRunfiles or +- // parsing the manifest on Windows, just use that instead of searching +- // directories. Return the first match. The manifest on Windows may contain +- // multiple entries for the same file. +- if runfiles.list != nil { +- if runtime.GOOS == "windows" { +- name += ".exe" +- } +- for _, entry := range runfiles.list { +- if path.Base(entry.ShortPath) != name { +- continue +- } +- pkgDir := path.Dir(path.Dir(entry.ShortPath)) +- if pkgDir == "." { +- pkgDir = "" +- } +- if pkgDir != pkg { +- continue +- } +- return entry.Path, true +- } +- return "", false +- } +- +- dir, err := Runfile(pkg) +- if err != nil { +- return "", false +- } +- var found string +- stopErr := errors.New("stop") +- err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { +- if err != nil { +- return err +- } +- base := filepath.Base(path) +- stem := strings.TrimSuffix(base, ".exe") +- if stem != name { +- return nil +- } +- if runtime.GOOS != "windows" { +- if st, err := os.Stat(path); err != nil { +- return err +- } else if st.Mode()&0111 == 0 { +- return nil +- } +- } +- if stem == name { +- found = path +- return stopErr +- } +- return nil +- }) +- if err == stopErr { +- return found, true +- } else { +- return "", false +- } +-} +- +-// A RunfileEntry describes a runfile. +-type RunfileEntry struct { +- // Workspace is the bazel workspace the file came from. For example, +- // this would be "io_bazel_rules_go" for a file in rules_go. +- Workspace string +- +- // ShortPath is a relative, slash-separated path from the workspace root +- // to the file. For non-binary files, this may be passed to Runfile +- // to locate a file. +- ShortPath string +- +- // Path is an absolute path to the file. +- Path string +-} +- +-// ListRunfiles returns a list of available runfiles. +-func ListRunfiles() ([]RunfileEntry, error) { +- if err := ensureRunfiles(); err != nil { +- return nil, err +- } +- +- if runfiles.list == nil && runfiles.dir != "" { +- runfiles.listOnce.Do(func() { +- var list []RunfileEntry +- haveWorkspaces := strings.HasSuffix(runfiles.dir, ".runfiles") && runfiles.workspace != "" +- +- err := filepath.Walk(runfiles.dir, func(path string, info os.FileInfo, err error) error { +- if err != nil { +- return err +- } +- rel, _ := filepath.Rel(runfiles.dir, path) +- rel = filepath.ToSlash(rel) +- if rel == "." { +- return nil +- } +- +- var workspace, shortPath string +- if haveWorkspaces { +- if i := strings.IndexByte(rel, '/'); i < 0 { +- return nil +- } else { +- workspace, shortPath = rel[:i], rel[i+1:] +- } +- } else { +- workspace, shortPath = "", rel +- } +- +- list = append(list, RunfileEntry{Workspace: workspace, ShortPath: shortPath, Path: path}) +- return nil +- }) +- if err != nil { +- runfiles.err = err +- return +- } +- runfiles.list = list +- }) +- } +- return runfiles.list, runfiles.err +-} +- +-// TestWorkspace returns the name of the Bazel workspace for this test. +-// TestWorkspace returns an error if the TEST_WORKSPACE environment variable +-// was not set or SetDefaultTestWorkspace was not called. +-func TestWorkspace() (string, error) { +- if err := ensureRunfiles(); err != nil { +- return "", err +- } +- if runfiles.workspace != "" { +- return runfiles.workspace, nil +- } +- return "", errors.New("TEST_WORKSPACE not set and SetDefaultTestWorkspace not called") +-} ++var errNoRunfilesEnv = errors.New("runfiles environment missing") + +-// SetDefaultTestWorkspace allows you to set a fake value for the +-// environment variable TEST_WORKSPACE if it is not defined. This is useful +-// when running tests on the command line and not through Bazel. +-func SetDefaultTestWorkspace(w string) { +- ensureRunfiles() +- runfiles.workspace = w ++// runfilesResolver is an interface for a resolver that can take a runfiles path and resolve it to a path on ++// disk. ++type runfilesResolver interface { ++ Resolve(string) (string, bool) + } + +-// RunfilesPath return the path to the runfiles tree. +-// It will return an error if there is no runfiles tree, for example because +-// the executable is run on Windows or was not invoked with 'bazel test' +-// or 'bazel run'. +-func RunfilesPath() (string, error) { +- if err := ensureRunfiles(); err != nil { +- return "", err +- } +- if runfiles.dir == "" { +- if runtime.GOOS == "windows" { +- return "", errors.New("RunfilesPath: no runfiles directory on windows") +- } else { +- return "", errors.New("could not locate runfiles directory") +- } +- } +- if runfiles.workspace == "" { +- return "", errors.New("could not locate runfiles workspace") +- } +- return filepath.Join(runfiles.dir, runfiles.workspace), nil +-} +- +-// EnterRunfiles locates the directory under which a built binary can find its data dependencies +-// using relative paths, and enters that directory. +-// +-// "workspace" indicates the name of the current project, "pkg" indicates the relative path to the +-// build package that contains the binary target, "binary" indicates the basename of the binary +-// searched for, and "cookie" indicates an arbitrary data file that we expect to find within the +-// runfiles tree. +-// +-// DEPRECATED: use RunfilesPath instead. +-func EnterRunfiles(workspace string, pkg string, binary string, cookie string) error { +- runfiles, ok := findRunfiles(workspace, pkg, binary, cookie) +- if !ok { +- return fmt.Errorf("cannot find runfiles tree") +- } +- if err := os.Chdir(runfiles); err != nil { +- return fmt.Errorf("cannot enter runfiles tree: %v", err) +- } +- return nil +-} +- +-var runfiles = struct { +- once, listOnce sync.Once +- +- // list is a list of known runfiles, either loaded from the manifest +- // or discovered by walking the runfile directory. +- list []RunfileEntry +- +- // index maps runfile short paths to absolute paths. +- index map[string]RunfileEntry +- +- // dir is a path to the runfile directory. Typically this is a directory +- // named .runfiles, with a subdirectory for each workspace. +- dir string +- +- // workspace is workspace where the binary or test was built. +- workspace string +- +- // workspaces is a list of other workspace names. +- workspaces []string +- +- // err is set when there is an error loading runfiles, for example, +- // parsing the manifest. +- err error +-}{} +- +-func ensureRunfiles() error { +- runfiles.once.Do(initRunfiles) +- return runfiles.err +-} +- +-func initRunfiles() { +- manifest := os.Getenv("RUNFILES_MANIFEST_FILE") ++// newRunfilesResolver creates a new runfiles resolver. The type of resolver and its parameters are derived ++// from the environment. ++func newRunfilesResolver() (runfilesResolver, error) { ++ manifest := os.Getenv(RUNFILES_MANIFEST_FILE) + if manifest != "" { +- // On Windows, Bazel doesn't create a symlink tree of runfiles because +- // Windows doesn't support symbolic links by default. Instead, runfile +- // locations are written to a manifest file. +- runfiles.index = make(map[string]RunfileEntry) +- data, err := ioutil.ReadFile(manifest) ++ f, err := os.Open(manifest) + if err != nil { +- runfiles.err = err +- return ++ return nil, err + } +- lineno := 0 +- for len(data) > 0 { +- i := bytes.IndexByte(data, '\n') +- var line []byte +- if i < 0 { +- line = data +- data = nil +- } else { +- line = data[:i] +- data = data[i+1:] +- } +- lineno++ +- line = bytes.TrimSpace(line) +- if len(line) == 0 { +- continue +- } +- e := bytes.SplitN(line, []byte(" "), 2) +- if len(e) < 2 { +- runfiles.err = fmt.Errorf("error parsing runfiles manifest: %s:%d: no space", manifest, lineno) +- return +- } +- +- entry := RunfileEntry{ShortPath: string(e[0]), Path: string(e[1])} +- if i := strings.IndexByte(entry.ShortPath, '/'); i >= 0 { +- entry.Workspace = entry.ShortPath[:i] +- entry.ShortPath = entry.ShortPath[i+1:] +- } +- if strings.HasPrefix(entry.ShortPath, "external/") { +- entry.ShortPath = entry.ShortPath[len("external/"):] +- if i := strings.IndexByte(entry.ShortPath, '/'); i >= 0 { +- entry.Workspace = entry.ShortPath[:i] +- entry.ShortPath = entry.ShortPath[i+1:] +- } +- } +- +- runfiles.list = append(runfiles.list, entry) +- runfiles.index[entry.ShortPath] = entry +- } +- } +- +- runfiles.workspace = os.Getenv("TEST_WORKSPACE") +- +- if dir := os.Getenv("RUNFILES_DIR"); dir != "" { +- runfiles.dir = dir +- } else if dir = os.Getenv("TEST_SRCDIR"); dir != "" { +- runfiles.dir = dir +- } else if runtime.GOOS != "windows" { +- dir, err := os.Getwd() +- if err != nil { +- runfiles.err = fmt.Errorf("error localting runfiles dir: %v", err) +- return +- } +- +- parent := filepath.Dir(dir) +- if strings.HasSuffix(parent, ".runfiles") { +- runfiles.dir = parent +- if runfiles.workspace == "" { +- runfiles.workspace = filepath.Base(dir) +- } +- } else { +- runfiles.err = errors.New("could not locate runfiles directory") +- return +- } +- } +- +- if runfiles.dir != "" { +- fis, err := ioutil.ReadDir(runfiles.dir) +- if err != nil { +- runfiles.err = fmt.Errorf("could not open runfiles directory: %v", err) +- return +- } +- for _, fi := range fis { +- if fi.IsDir() { +- runfiles.workspaces = append(runfiles.workspaces, fi.Name()) +- } +- } +- sort.Strings(runfiles.workspaces) ++ defer f.Close() ++ return newManifestRunfilesResolver(f) + } +-} + +-// getCandidates returns the list of all possible "prefix/suffix" paths where there might be an +-// optional component in-between the two pieces. +-// +-// This function exists to cope with issues #1239 because we cannot tell where the built Go +-// binaries are located upfront. +-// +-// DEPRECATED: only used by EnterRunfiles. +-func getCandidates(prefix string, suffix string) []string { +- candidates := []string{filepath.Join(prefix, suffix)} +- if entries, err := ioutil.ReadDir(prefix); err == nil { +- for _, entry := range entries { +- candidate := filepath.Join(prefix, entry.Name(), suffix) +- candidates = append(candidates, candidate) +- } ++ directory := os.Getenv(RUNFILES_DIR) ++ if directory != "" { ++ return newDirectoryRunfilesResolver(directory) + } +- return candidates +-} +- +-// findRunfiles locates the directory under which a built binary can find its data dependencies +-// using relative paths. +-// +-// DEPRECATED: only used by EnterRunfiles. +-func findRunfiles(workspace string, pkg string, binary string, cookie string) (string, bool) { +- candidates := getCandidates(filepath.Join("bazel-bin", pkg), filepath.Join(binary+".runfiles", workspace)) +- candidates = append(candidates, ".") + +- for _, candidate := range candidates { +- if _, err := os.Stat(filepath.Join(candidate, cookie)); err == nil { +- return candidate, true +- } +- } +- return "", false ++ return nil, errNoRunfilesEnv + } +diff --git a/go/tools/bazel/runfiles_test.go b/go/tools/bazel/runfiles_test.go +new file mode 100644 +index 00000000..b7bd44f0 +--- /dev/null ++++ b/go/tools/bazel/runfiles_test.go +@@ -0,0 +1,125 @@ ++// Copyright 2018 The Bazel Authors. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++ ++package bazel ++ ++import ( ++ "io/ioutil" ++ "os" ++ "path/filepath" ++ "testing" ++) ++ ++func setenvForTest(key, value string) (cleanup func()) { ++ if old, ok := os.LookupEnv(key); ok { ++ cleanup = func() { os.Setenv(key, old) } ++ } else { ++ cleanup = func() { os.Unsetenv(key) } ++ } ++ os.Setenv(key, value) ++ return cleanup ++} ++ ++func setupResolverForTest() { ++ // Prevent initialization code from running. ++ runfileResolverOnce.Do(func() {}) ++ runfileResolver, runfileResolverErr = newRunfilesResolver() ++} ++ ++func TestManifestRunfiles(t *testing.T) { ++ dir, err := NewTmpDir("test") ++ if err != nil { ++ t.Fatal(err) ++ } ++ defer os.RemoveAll(dir) ++ ++ testStr := "This is a test" ++ mappedFilename := filepath.Join(dir, "mapped_file.txt") ++ if err := ioutil.WriteFile(mappedFilename, []byte(testStr), 0600); err != nil { ++ t.Fatal(err) ++ } ++ ++ manifestFilename := filepath.Join(dir, "MANIFEST") ++ if err := ioutil.WriteFile(manifestFilename, []byte("runfiles/test.txt "+mappedFilename), 0600); err != nil { ++ t.Fatal(err) ++ } ++ ++ cleanupManifestEnv := setenvForTest(RUNFILES_MANIFEST_FILE, manifestFilename) ++ defer cleanupManifestEnv() ++ cleanupDirEnv := setenvForTest(RUNFILES_DIR, "") ++ defer cleanupDirEnv() ++ ++ setupResolverForTest() ++ if runfileResolverErr != nil { ++ t.Fatal(runfileResolverErr) ++ } ++ if _, ok := runfileResolver.(manifestResolver); !ok { ++ t.Error("resolver should be manifest resolver") ++ } ++ ++ filename, err := Runfile("runfiles/test.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ d, err := ioutil.ReadFile(filename) ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ if string(d) != testStr { ++ t.Errorf("expected %s, got %s", testStr, string(d)) ++ } ++} ++ ++func TestDirectoryRunfiles(t *testing.T) { ++ dir, err := NewTmpDir("test") ++ if err != nil { ++ t.Fatal(err) ++ } ++ defer os.RemoveAll(dir) ++ ++ testStr := "This is a test" ++ mappedfn := filepath.Join(dir, "runfile.txt") ++ if err := ioutil.WriteFile(mappedfn, []byte(testStr), 0600); err != nil { ++ t.Fatal(err) ++ } ++ ++ cleanupManifestEnv := setenvForTest(RUNFILES_MANIFEST_FILE, "") ++ defer cleanupManifestEnv() ++ cleanupDirEnv := setenvForTest(RUNFILES_DIR, dir) ++ defer cleanupDirEnv() ++ ++ setupResolverForTest() ++ if runfileResolverErr != nil { ++ t.Fatal(runfileResolverErr) ++ } ++ if _, ok := runfileResolver.(directoryResolver); !ok { ++ t.Error("resolver should be directory resolver") ++ } ++ ++ filename, err := Runfile("runfile.txt") ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ d, err := ioutil.ReadFile(filename) ++ if err != nil { ++ t.Fatal(err) ++ } ++ ++ if string(d) != testStr { ++ t.Errorf("expected %s, got %s", testStr, string(d)) ++ } ++} +diff --git a/tests/core/runfiles/BUILD.bazel b/tests/core/runfiles/BUILD.bazel +deleted file mode 100644 +index c7db6d3d..00000000 +--- a/tests/core/runfiles/BUILD.bazel ++++ /dev/null +@@ -1,48 +0,0 @@ +-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") +- +-package(default_visibility = ["//visibility:public"]) +- +-test_suite( +- name = "runfiles_tests", +- tests = [ +- ":local_test", +- "@runfiles_remote_test//:remote_test", +- ], +-) +- +-go_test( +- name = "local_test", +- srcs = ["runfiles_test.go"], +- deps = [":check_runfiles"], +-) +- +-go_binary( +- name = "local_cmd", +- srcs = ["runfiles_cmd.go"], +- deps = [":check_runfiles"], +-) +- +-go_binary( +- name = "local_bin", +- srcs = ["empty_bin.go"], +-) +- +-go_library( +- name = "check_runfiles", +- srcs = ["check_runfiles.go"], +- data = [ +- "local_file.txt", +- ":local_bin", +- ":local_group", +- "@runfiles_remote_test//:remote_bin", +- "@runfiles_remote_test//:remote_file.txt", +- "@runfiles_remote_test//:remote_group", +- ], +- importpath = "github.com/bazelbuild/rules_go/tests/core/runfiles/check", +- deps = ["//go/tools/bazel:go_default_library"], +-) +- +-filegroup( +- name = "local_group", +- srcs = ["local_group.txt"], +-) +diff --git a/tests/core/runfiles/README.rst b/tests/core/runfiles/README.rst +deleted file mode 100644 +index ec357826..00000000 +--- a/tests/core/runfiles/README.rst ++++ /dev/null +@@ -1,23 +0,0 @@ +-Runfiles functionality +-===================== +- +-runfiles_tests +--------------- +- +-Checks that functions in ``//go/tools/bazel:go_default_library`` that +-provide access to runfiles behave correctly. In particular, this checks: +- +-* ``Runfile`` works for regular files. +-* ``FindBinary`` works for binaries. +-* ``ListRunfiles`` lists all expected files. +-* These functions work for runfiles in the local workspace and for files in +- external repositories (``@runfiles_remote_test`` is a ``local_repository`` +- that points to a subdirectory here). +-* These functions work in tests invoked with ``bazel test`` and +- binaries invoked with ``bazel run``. +-* These functions work on Windows and other platforms. Bazel doesn't +- create a symlink tree for runfiles on Windows since symbolic links +- can't be created without administrative privilege by default. +- +-TODO: Verify binary behavior in CI. The ``local_bin`` and ``remote_bin`` +-targets verify behavior for binaries, but they are not tests. +diff --git a/tests/core/runfiles/bin.go b/tests/core/runfiles/bin.go +deleted file mode 100644 +index 0ced7a9e..00000000 +--- a/tests/core/runfiles/bin.go ++++ /dev/null +@@ -1,17 +0,0 @@ +-// Copyright 2019 The Bazel Authors. All rights reserved. +-// +-// Licensed under the Apache License, Version 2.0 (the "License"); +-// you may not use this file except in compliance with the License. +-// You may obtain a copy of the License at +-// +-// http://www.apache.org/licenses/LICENSE-2.0 +-// +-// Unless required by applicable law or agreed to in writing, software +-// distributed under the License is distributed on an "AS IS" BASIS, +-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-// See the License for the specific language governing permissions and +-// limitations under the License. +- +-package main +- +-func main() {} +diff --git a/tests/core/runfiles/check_runfiles.go b/tests/core/runfiles/check_runfiles.go +deleted file mode 100644 +index 8858a573..00000000 +--- a/tests/core/runfiles/check_runfiles.go ++++ /dev/null +@@ -1,121 +0,0 @@ +-// Copyright 2019 The Bazel Authors. All rights reserved. +-// +-// Licensed under the Apache License, Version 2.0 (the "License"); +-// you may not use this file except in compliance with the License. +-// You may obtain a copy of the License at +-// +-// http://www.apache.org/licenses/LICENSE-2.0 +-// +-// Unless required by applicable law or agreed to in writing, software +-// distributed under the License is distributed on an "AS IS" BASIS, +-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-// See the License for the specific language governing permissions and +-// limitations under the License. +- +-package check +- +-import ( +- "fmt" +- "os" +- "path/filepath" +- "runtime" +- "sort" +- "strings" +- +- "github.com/bazelbuild/rules_go/go/tools/bazel" +-) +- +-type TestFile struct { +- Workspace, ShortPath, Path string +- Binary bool +-} +- +-var DefaultTestFiles = []TestFile{ +- {Workspace: "io_bazel_rules_go", Path: "tests/core/runfiles/local_file.txt"}, +- {Workspace: "io_bazel_rules_go", Path: "tests/core/runfiles/local_group.txt"}, +- {Workspace: "io_bazel_rules_go", Path: "tests/core/runfiles/local_bin", Binary: true}, +- {Workspace: "runfiles_remote_test", Path: "remote_file.txt"}, +- {Workspace: "runfiles_remote_test", Path: "remote_group.txt"}, +- {Workspace: "runfiles_remote_test", Path: "remote_bin", Binary: true}, +-} +- +-func CheckRunfiles(files []TestFile) error { +- // Check that the runfiles directory matches the current workspace. +- // There is no runfiles directory on Windows. +- if runtime.GOOS != "windows" { +- dir, err := bazel.RunfilesPath() +- if err != nil { +- return err +- } +- root, base := filepath.Dir(dir), filepath.Base(dir) +- if !strings.HasSuffix(root, ".runfiles") { +- return fmt.Errorf("RunfilesPath: %q is not a .runfiles directory", dir) +- } +- workspace := os.Getenv("TEST_WORKSPACE") +- if workspace != "" && workspace != base { +- return fmt.Errorf("RunfilesPath: %q does not match test workspace %s", dir, workspace) +- } +- if srcDir := os.Getenv("TEST_SRCDIR"); srcDir != "" && filepath.Join(srcDir, workspace) != dir { +- return fmt.Errorf("RunfilesPath: %q does not match TEST_SRCDIR %q", dir, srcDir) +- } +- } +- +- // Check that files can be found with Runfile or FindBinary. +- // Make sure the paths returned are absolute paths to actual files. +- seen := make(map[string]string) +- for _, f := range files { +- var got string +- var err error +- if !f.Binary { +- if got, err = bazel.Runfile(f.Path); err != nil { +- return err +- } +- if !filepath.IsAbs(got) { +- return fmt.Errorf("Runfile %s: got a relative path %q; want absolute", f.Path, got) +- } +- seen[f.Path] = got +- } else { +- var pkg, name string +- if i := strings.LastIndex(f.Path, "/"); i < 0 { +- name = f.Path +- } else { +- pkg = f.Path[:i] +- name = f.Path[i+1:] +- } +- var ok bool +- if got, ok = bazel.FindBinary(pkg, name); !ok { +- return fmt.Errorf("FindBinary %s %s: could not find binary", pkg, name) +- } +- if !filepath.IsAbs(got) { +- return fmt.Errorf("FindBinary %s %s: got a relative path %q; want absolute", pkg, name, got) +- } +- } +- +- if _, err := os.Stat(got); err != nil { +- return fmt.Errorf("%s: could not stat: %v", f.Path, err) +- } +- } +- +- // Check that the files can be listed. +- entries, err := bazel.ListRunfiles() +- if err != nil { +- return err +- } +- for _, e := range entries { +- if want, ok := seen[e.ShortPath]; ok && want != e.Path { +- return err +- } +- delete(seen, e.ShortPath) +- } +- +- if len(seen) > 0 { +- unseen := make([]string, 0, len(seen)) +- for short := range seen { +- unseen = append(unseen, short) +- } +- sort.Strings(unseen) +- return fmt.Errorf("ListRunfiles did not include files:\n\t%s", strings.Join(unseen, "\n\t")) +- } +- +- return nil +-} +diff --git a/tests/core/runfiles/empty_bin.go b/tests/core/runfiles/empty_bin.go +deleted file mode 100644 +index 38dd16da..00000000 +--- a/tests/core/runfiles/empty_bin.go ++++ /dev/null +@@ -1,3 +0,0 @@ +-package main +- +-func main() {} +diff --git a/tests/core/runfiles/local_file.txt b/tests/core/runfiles/local_file.txt +deleted file mode 100644 +index e69de29b..00000000 +diff --git a/tests/core/runfiles/local_group.txt b/tests/core/runfiles/local_group.txt +deleted file mode 100644 +index e69de29b..00000000 +diff --git a/tests/core/runfiles/runfiles_cmd.go b/tests/core/runfiles/runfiles_cmd.go +deleted file mode 100644 +index 0ab124b5..00000000 +--- a/tests/core/runfiles/runfiles_cmd.go ++++ /dev/null +@@ -1,28 +0,0 @@ +-// Copyright 2019 The Bazel Authors. All rights reserved. +-// +-// Licensed under the Apache License, Version 2.0 (the "License"); +-// you may not use this file except in compliance with the License. +-// You may obtain a copy of the License at +-// +-// http://www.apache.org/licenses/LICENSE-2.0 +-// +-// Unless required by applicable law or agreed to in writing, software +-// distributed under the License is distributed on an "AS IS" BASIS, +-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-// See the License for the specific language governing permissions and +-// limitations under the License. +- +-package main +- +-import ( +- "fmt" +- "os" +- +- "github.com/bazelbuild/rules_go/tests/core/runfiles/check" +-) +- +-func main() { +- if err := check.CheckRunfiles(check.DefaultTestFiles); err != nil { +- fmt.Fprintln(os.Stderr, err.Error()) +- } +-} +diff --git a/tests/core/runfiles/runfiles_remote_test/BUILD.bazel b/tests/core/runfiles/runfiles_remote_test/BUILD.bazel +deleted file mode 100644 +index 112dcd35..00000000 +--- a/tests/core/runfiles/runfiles_remote_test/BUILD.bazel ++++ /dev/null +@@ -1,27 +0,0 @@ +-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_test") +- +-package(default_visibility = ["//visibility:public"]) +- +-go_test( +- name = "remote_test", +- srcs = ["@io_bazel_rules_go//tests/core/runfiles:runfiles_test.go"], +- deps = ["@io_bazel_rules_go//tests/core/runfiles:check_runfiles"], +-) +- +-go_binary( +- name = "remote_cmd", +- srcs = ["@io_bazel_rules_go//tests/core/runfiles:runfiles_cmd.go"], +- deps = ["@io_bazel_rules_go//tests/core/runfiles:check_runfiles"], +-) +- +-go_binary( +- name = "remote_bin", +- srcs = ["@io_bazel_rules_go//tests/core/runfiles:empty_bin.go"], +-) +- +-filegroup( +- name = "remote_group", +- srcs = ["remote_group.txt"], +-) +- +-exports_files(["remote_file.txt"]) +diff --git a/tests/core/runfiles/runfiles_remote_test/WORKSPACE b/tests/core/runfiles/runfiles_remote_test/WORKSPACE +deleted file mode 100644 +index c9af3f85..00000000 +--- a/tests/core/runfiles/runfiles_remote_test/WORKSPACE ++++ /dev/null +@@ -1 +0,0 @@ +-workspace(name = "runfiles_remote_test") +diff --git a/tests/core/runfiles/runfiles_remote_test/remote_file.txt b/tests/core/runfiles/runfiles_remote_test/remote_file.txt +deleted file mode 100644 +index e69de29b..00000000 +diff --git a/tests/core/runfiles/runfiles_remote_test/remote_group.txt b/tests/core/runfiles/runfiles_remote_test/remote_group.txt +deleted file mode 100644 +index e69de29b..00000000 +diff --git a/tests/core/runfiles/runfiles_test.go b/tests/core/runfiles/runfiles_test.go +deleted file mode 100644 +index 62aab3af..00000000 +--- a/tests/core/runfiles/runfiles_test.go ++++ /dev/null +@@ -1,27 +0,0 @@ +-// Copyright 2019 The Bazel Authors. All rights reserved. +-// +-// Licensed under the Apache License, Version 2.0 (the "License"); +-// you may not use this file except in compliance with the License. +-// You may obtain a copy of the License at +-// +-// http://www.apache.org/licenses/LICENSE-2.0 +-// +-// Unless required by applicable law or agreed to in writing, software +-// distributed under the License is distributed on an "AS IS" BASIS, +-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-// See the License for the specific language governing permissions and +-// limitations under the License. +- +-package main +- +-import ( +- "testing" +- +- "github.com/bazelbuild/rules_go/tests/core/runfiles/check" +-) +- +-func Test(t *testing.T) { +- if err := check.CheckRunfiles(check.DefaultTestFiles); err != nil { +- t.Fatal(err) +- } +-} From a491eba48358bdb2f1a7b78ece965be1fb918bb8 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 16 Aug 2019 15:35:33 -0700 Subject: [PATCH 191/316] Remove unused transitive_es5_sources This is a prefactoring to simplify the "typescript" provider before migrating it to a modern Provider() PiperOrigin-RevId: 263860301 --- internal/common/compilation.bzl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 511fcc07..7e085873 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -458,19 +458,13 @@ def compile_ts( if not is_library: files_depsets.append(depset(tsickle_externs)) - transitive_es5_sources = depset() transitive_es6_sources = depset() for dep in deps: if hasattr(dep, "typescript"): - transitive_es5_sources = depset(transitive = [ - transitive_es5_sources, - dep.typescript.transitive_es5_sources, - ]) transitive_es6_sources = depset(transitive = [ transitive_es6_sources, dep.typescript.transitive_es6_sources, ]) - transitive_es5_sources = depset(transitive = [transitive_es5_sources, es5_sources]) transitive_es6_sources = depset(transitive = [transitive_es6_sources, es6_sources]) return { @@ -505,7 +499,6 @@ def compile_ts( "es6_sources": es6_sources, "replay_params": replay_params, "transitive_declarations": transitive_decls, - "transitive_es5_sources": transitive_es5_sources, "transitive_es6_sources": transitive_es6_sources, "tsickle_externs": tsickle_externs, "type_blacklisted_declarations": type_blacklisted_declarations, From 37fdd8e0b8aae386bcee7981a7650323ae1cc0ae Mon Sep 17 00:00:00 2001 From: rjamet Date: Mon, 19 Aug 2019 08:27:47 -0700 Subject: [PATCH 192/316] Fix dealiaser throwing on TypeAlias nodes. getAliasedSymbol only accepts Alias, not TypeAlias, so filter on that only. PiperOrigin-RevId: 264161077 --- .../ban_conformance_pattern/name_test.ts | 24 +++++++++++++++++++ internal/tsetse/util/ast_tools.ts | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts index 6bb06ecc..d3ffdd04 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts @@ -38,6 +38,30 @@ describe('BANNED_NAME', () => { messageText: 'no blob url' }); }); + + it('does not choke on type aliases', () => { + // This test case checks that we do not regress on the AbsoluteMatcher's + // handling of type aliases. In dealias, from utils/ast_tools.ts, the + // typechecker's getAliasedSymbol function should only be called with + // Symbols that verify ts.SymbolFlags.Alias, and ts.SymbolFlags.TypeAlias is + // not acceptable (the typechecker will throw). + + const sources = [ + `export type Foo = {bar: number, baz: (x:string)=>void}`, + `import {Foo} from './file_0'; + export const c: Foo["baz"] = (x:string)=>{};`, + `import {c} from './file_1'; c(window.name);` + ]; + const results = compileAndCheck( + new ConformancePatternRule({ + errorMessage: 'should not trigger', + kind: PatternKind.BANNED_NAME, + values: ['whatever'] + }), + ...sources); + + expect(results.length).toBe(0); + }); }); beforeEach(() => { diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index cb0f0cb9..024c0087 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -100,7 +100,8 @@ export function dealias( if (!symbol) { return undefined; } - if (symbol.getFlags() & (ts.SymbolFlags.Alias | ts.SymbolFlags.TypeAlias)) { + if (symbol.getFlags() & ts.SymbolFlags.Alias) { + // Note: something that has only TypeAlias is not acceptable here. return dealias(tc.getAliasedSymbol(symbol), tc); } return symbol; From fa891ddbf291a3e0a719d7a6771fe79d5153ec65 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 19 Aug 2019 18:29:05 -0700 Subject: [PATCH 193/316] Fix module name mangling to avoid double escaping. PiperOrigin-RevId: 264290453 --- internal/tsc_wrapped/compiler_host.ts | 3 +-- internal/tsc_wrapped/compiler_host_test.ts | 19 +++++++++++++++++++ internal/tsc_wrapped/tsc_wrapped_test.ts | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 9cae0182..4aac6858 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -292,8 +292,7 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { const escape = (c: string) => { return '$' + c.charCodeAt(0).toString(16); }; - const moduleName = importPath.replace(/^[^a-zA-Z_/]/, escape) - .replace(/[^a-zA-Z_0-9_/]/g, escape) + const moduleName = importPath.replace(/^[0-9]|[^a-zA-Z_0-9_/]/g, escape) .replace(/\//g, '.'); return moduleName; } diff --git a/internal/tsc_wrapped/compiler_host_test.ts b/internal/tsc_wrapped/compiler_host_test.ts index eaa0ac4a..6eab46ed 100644 --- a/internal/tsc_wrapped/compiler_host_test.ts +++ b/internal/tsc_wrapped/compiler_host_test.ts @@ -58,5 +58,24 @@ describe('compiler host', () => { createTsModule('path/to/package/root_dir/index.ts'))) .toBe('my_lib'); }); + + describe('#pathToModuleName', () => { + it('should escape non-identifier characters', () => { + expect(defaultHost.pathToModuleName('context', '$-!@')) + .toBe('$24$2d$21$40'); + }); + + it('should escape leading numbers', () => { + expect(defaultHost.pathToModuleName('context', '1234')).toBe('$31234'); + }); + + it('should transform slashes to dots', () => { + expect(defaultHost.pathToModuleName('context', 'a/b')).toBe('a.b'); + }); + + it('should not escape valid identifers', () => { + expect(defaultHost.pathToModuleName('context', 'a1/b2')).toBe('a1.b2'); + }); + }); }); }); diff --git a/internal/tsc_wrapped/tsc_wrapped_test.ts b/internal/tsc_wrapped/tsc_wrapped_test.ts index 3f77c07f..59d725b2 100644 --- a/internal/tsc_wrapped/tsc_wrapped_test.ts +++ b/internal/tsc_wrapped/tsc_wrapped_test.ts @@ -190,6 +190,7 @@ describe('compiler host', () => { expectPath('', 'some|123').toBe('google3.some$7c123'); expectPath('', '1some|').toBe('google3.1some$7c'); expectPath('', 'bar/foo.bam.ts').toBe('google3.bar.foo$2ebam'); + expectPath('', '-foo-').toBe('google3.$2dfoo$2d'); // Underscore is unmodified, because it is common in google3 paths. expectPath('', 'foo_bar').toBe('google3.foo_bar'); }); From d0aadae271692f3d8b807756e6c54d782347df5c Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 21 Aug 2019 14:00:15 -0700 Subject: [PATCH 194/316] Return a set of packages changed by RegisterTestRules PiperOrigin-RevId: 264686314 --- ts_auto_deps/updater/test_register.go | 46 ++++++++++++++++----------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index 130e3d1a..19529c97 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -38,11 +38,13 @@ func getAllTestLibraries(bld *build.File) []*build.Rule { // RegisterTestRules registers ts_library test targets with the project's // ts_config and ts_development_sources rules. It may also register the tests // with a testonly ts_library named "all_tests", which allows users to set up -// their own BUILD layout. It's separated from UpdateBUILD since it's non-local, -// multiple packages may all need to make writes to the same ts_config. -func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (bool, error) { +// their own BUILD layout. It's separated from UpdateBUILD since it's +// non-local, multiple packages may all need to make writes to the same +// ts_config. It returns a set of the paths for the packages that were updated. +func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (bool, map[string]bool, error) { reg := &buildRegistry{make(map[string]*build.File), make(map[*build.File]bool)} var g3root string + updatedAncestorPackages := make(map[string]bool) for _, path := range paths { // declare variables manually so that g3root doesn't get overwritten by a := // declaration @@ -50,11 +52,11 @@ func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (boo var buildPath string g3root, buildPath, err = getBUILDPath(ctx, path) if err != nil { - return false, err + return false, nil, err } bld, err := reg.readBUILD(ctx, g3root, buildPath) if err != nil { - return false, err + return false, nil, err } for _, tr := range getRules(bld, "ts_library", ruleTypeTest) { // don't register all_test libraries themselves @@ -63,14 +65,22 @@ func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (boo } platform.Infof("Registering test rule in closest ts_config & ts_development_sources") target := AbsoluteBazelTarget(bld, tr.Name()) - if err := reg.registerTestRule(ctx, bld, tsConfig, g3root, target); err != nil { - return false, err + ancestorBuild, err := reg.registerTestRule(ctx, bld, tsConfig, g3root, target) + if err != nil { + return false, nil, err + } + if ancestorBuild != "" { + updatedAncestorPackages[ancestorBuild] = true } // NodeJS rules should not be added to ts_development_sources automatically, because // they typically do not run in the browser. if tr.AttrString("runtime") != "nodejs" { - if err := reg.registerTestRule(ctx, bld, tsDevSrcs, g3root, target); err != nil { - return false, err + ancestorBuild, err := reg.registerTestRule(ctx, bld, tsDevSrcs, g3root, target) + if err != nil { + return false, nil, err + } + if ancestorBuild != "" { + updatedAncestorPackages[ancestorBuild] = true } } } @@ -81,12 +91,12 @@ func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (boo fmt.Printf("Registered test(s) in %s\n", b.Path) fileChanged, err := upd.maybeWriteBUILD(ctx, filepath.Join(g3root, b.Path), b) if err != nil { - return false, err + return false, nil, err } updated = updated || fileChanged } - return updated, nil + return updated, updatedAncestorPackages, nil } // buildRegistry buffers reads and writes done while registering ts_libraries @@ -149,16 +159,16 @@ func (rt registerTarget) ruleType() ruleType { // rule is registered with it, instead of specified register target. Prints a // warning if no rule is found, but only returns an error if adding the // dependency fails. -func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, rt registerTarget, g3root, target string) error { +func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, rt registerTarget, g3root, target string) (string, error) { if buildHasDisableTaze(bld) { - return nil + return "", nil } var ruleToRegister *build.Rule for _, r := range bld.Rules("") { if isAllTestLibrary(bld, r) { if hasDependency(bld, r, target) { - return nil + return "", nil } // an all_tests library takes presidence over a registerTarget, and there @@ -169,7 +179,7 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, } if ruleMatches(bld, r, rt.kind(), rt.ruleType()) { if hasDependency(bld, r, target) { - return nil + return "", nil } // keep overwriting ruleToRegister so the last match in the BUILD gets @@ -181,7 +191,7 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, if ruleToRegister != nil { addDep(bld, ruleToRegister, target) reg.registerForPossibleUpdate(bld) - return nil + return filepath.Dir(bld.Path), nil } parentDir := filepath.Dir(filepath.Dir(bld.Path)) @@ -190,7 +200,7 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, if _, err := platform.Stat(ctx, buildFile); err == nil { parent, err := reg.readBUILD(ctx, g3root, buildFile) if err != nil { - return err + return "", err } return reg.registerTestRule(ctx, parent, rt, g3root, target) } @@ -198,5 +208,5 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, } fmt.Printf("WARNING: no %s rule in parent packages of %s to register with.\n", rt.kind(), target) - return nil + return "", nil } From 8fa90a1af47098e76d8397a3b9b14120204ec931 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Thu, 22 Aug 2019 10:02:23 -0700 Subject: [PATCH 195/316] fix: ts_auto_deps workaround for https://github.com/bazelbuild/bazel/issues/3325 no longer needed Closes #467 PiperOrigin-RevId: 264859144 --- ts_auto_deps/main.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ts_auto_deps/main.go b/ts_auto_deps/main.go index 81542dc2..553afbc3 100644 --- a/ts_auto_deps/main.go +++ b/ts_auto_deps/main.go @@ -39,16 +39,6 @@ Flags: } func main() { - // When executed under `bazel run`, we want to run in the users workspace, not - // the runfiles directory of the go_binary. - // See https://github.com/bazelbuild/bazel/issues/3325 - if wd := os.Getenv("BUILD_WORKING_DIRECTORY"); len(wd) > 0 { - err := os.Chdir(wd) - if err != nil { - platform.Error(err) - } - } - flag.Usage = usage flag.Parse() From 9829eaab492b85ee089b36a7c8842ffa78d57746 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Thu, 22 Aug 2019 16:11:03 -0700 Subject: [PATCH 196/316] Refactor the files and runfiles fields from strings to the DefaultInfo() provider. This is the beginning of removing the legacy providers, per https://github.com/bazelbuild/bazel/issues/7347 See https://docs.bazel.build/versions/master/skylark/rules.html#migrating-from-legacy-providers: " The fields files, runfiles, data_runfiles, default_runfiles, and executable correspond to the same-named fields of DefaultInfo. It is not allowed to specify any of these fields while also returning a DefaultInfo modern provider. " PiperOrigin-RevId: 264941716 --- internal/common/compilation.bzl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 7e085873..6af26b59 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -468,7 +468,18 @@ def compile_ts( transitive_es6_sources = depset(transitive = [transitive_es6_sources, es6_sources]) return { - "files": depset(transitive = files_depsets), + "providers": [ + DefaultInfo( + runfiles = ctx.runfiles( + # Note: don't include files=... here, or they will *always* be built + # by any dependent rule, regardless of whether it needs them. + # But these attributes are needed to pass along any input runfiles: + collect_default = True, + collect_data = True, + ), + files = depset(transitive = files_depsets), + ), + ], "instrumented_files": { "dependency_attributes": ["deps", "runtime_deps"], "extensions": ["ts"], @@ -482,13 +493,6 @@ def compile_ts( "es5_sources": es5_sources, "es6_sources": es6_sources, }, - "runfiles": ctx.runfiles( - # Note: don't include files=... here, or they will *always* be built - # by any dependent rule, regardless of whether it needs them. - # But these attributes are needed to pass along any input runfiles: - collect_default = True, - collect_data = True, - ), # Expose the tags so that a Skylark aspect can access them. "tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags, # TODO(martinprobst): Prune transitive deps, only re-export what's needed. From b923f3bd03b3132838606ebe990e0923c6fa347a Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 22 Aug 2019 17:10:52 -0700 Subject: [PATCH 197/316] discourage filing issues on rules_typescript --- .github/ISSUE_TEMPLATE/bug_report.md | 75 ----------------------- .github/ISSUE_TEMPLATE/feature_request.md | 47 -------------- .github/ISSUE_TEMPLATE/no_issues_here.md | 8 +++ 3 files changed, 8 insertions(+), 122 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/no_issues_here.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index b7c861b9..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -name: "\U0001F41EBug report" -about: Report a bug in rules_typescript ---- - - - -# 🐞 bug report - -### Affected Rule - - - The issue is caused by the rule: - - -### Is this a regression? - - - Yes, the previous version in which this bug was not present was: .... - - -### Description - - A clear and concise description of the problem... - - -## 🔬 Minimal Reproduction - - - -## 🔥 Exception or Error - -

    
    -
    -
    -
    -
    - - -## 🌍 Your Environment - -**Operating System:** - -
    -  
    -
    -  
    -
    - -**Output of `bazel version`:** - -
    -  
    -
    -  
    -
    - -**Rules version (SHA):** - -
    -  
    -
    -  
    -
    - -**Anything else relevant?** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index be9fa49c..00000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -name: "\U0001F680Feature request" -about: Suggest a feature for rules_typescript - ---- - - - -# 🚀 feature request - -### Relevant Rules - - - - - -### Description - - A clear and concise description of the problem or missing capability... - - -### Describe the solution you'd like - - If you have a solution in mind, please describe it. - - -### Describe alternatives you've considered - - Have you considered any alternative solutions or workarounds? diff --git a/.github/ISSUE_TEMPLATE/no_issues_here.md b/.github/ISSUE_TEMPLATE/no_issues_here.md new file mode 100644 index 00000000..f0bc244a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/no_issues_here.md @@ -0,0 +1,8 @@ +--- +name: "Please don't file issues here" +about: All issues should be reported to rules_nodejs + +--- + +All issues are managed in rules_nodejs with the "package: typescript" label. +This issue tracker is only enabled so that history from earlier discussions is still visible. \ No newline at end of file From ada4436a6b0d4ded191ba778feaf1f37b7eedea2 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 22 Aug 2019 17:13:04 -0700 Subject: [PATCH 198/316] point to rules_nodejs to file issues --- .github/ISSUE_TEMPLATE/no_issues_here.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/no_issues_here.md b/.github/ISSUE_TEMPLATE/no_issues_here.md index f0bc244a..34cbdf64 100644 --- a/.github/ISSUE_TEMPLATE/no_issues_here.md +++ b/.github/ISSUE_TEMPLATE/no_issues_here.md @@ -4,5 +4,9 @@ about: All issues should be reported to rules_nodejs --- +# Please don't file issues in rules_typescript + +Go here instead: https://github.com/bazelbuild/rules_nodejs/issues/new/choose + All issues are managed in rules_nodejs with the "package: typescript" label. This issue tracker is only enabled so that history from earlier discussions is still visible. \ No newline at end of file From ca0c8c3c00ef35066c1543f14608d7adc838bc67 Mon Sep 17 00:00:00 2001 From: radokirov Date: Thu, 22 Aug 2019 18:16:51 -0700 Subject: [PATCH 199/316] No public change. PiperOrigin-RevId: 264963127 --- internal/tsc_wrapped/compiler_host.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 4aac6858..c05b3c32 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -97,7 +97,6 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { host: ts.ModuleResolutionHost = this; private allowActionInputReads = true; - constructor( public inputFiles: string[], options: ts.CompilerOptions, readonly bazelOpts: BazelOptions, private delegate: ts.CompilerHost, From 6617b1f93577a0490cfec5876d378d0ac5e1086e Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 23 Aug 2019 13:18:15 -0700 Subject: [PATCH 200/316] Support async worker functions in the tsc_wrapped/worker.ts helper library. PiperOrigin-RevId: 265120467 --- internal/tsc_wrapped/package.json | 2 +- internal/tsc_wrapped/tsconfig.json | 5 ++++- internal/tsc_wrapped/worker.ts | 23 ++++++++++++----------- package.json | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/internal/tsc_wrapped/package.json b/internal/tsc_wrapped/package.json index 64940e1c..1f78bd4a 100644 --- a/internal/tsc_wrapped/package.json +++ b/internal/tsc_wrapped/package.json @@ -2,7 +2,7 @@ "description": "legacy build-time dependencies to compile and run tsc_wrapped", "devDependencies": { "@types/jasmine": "2.8.2", - "@types/node": "7.0.18", + "@types/node": "10.12.20", "@types/tmp": "0.0.33", "protobufjs": "5.0.3", "tmp": "0.0.33", diff --git a/internal/tsc_wrapped/tsconfig.json b/internal/tsc_wrapped/tsconfig.json index 830ed186..8c222904 100644 --- a/internal/tsc_wrapped/tsconfig.json +++ b/internal/tsc_wrapped/tsconfig.json @@ -16,7 +16,10 @@ "es2015.core", "es2015.collection", "es2015.iterable", - "es2015.promise" + "es2015.promise", + // This will need to become es2018.asynciterable when + // bumping the version of TypeScript in rules_typescript/package.json + "esnext.asynciterable" ] } } diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index dc50055e..0bdb04ce 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -115,12 +115,15 @@ const workerpb = loadWorkerPb(); * data, and dispatches into `runOneBuild` for the actual compilation to happen. * * The compilation handler is parameterized so that this code can be used by - * different compiler entry points (currently TypeScript compilation and Angular - * compilation). + * different compiler entry points (currently TypeScript compilation, Angular + * compilation, and the contrib vulcanize worker). + * + * It's also exposed publicly as an npm package: + * https://www.npmjs.com/package/@bazel/worker */ -export function runWorkerLoop( +export async function runWorkerLoop( runOneBuild: (args: string[], inputs?: {[path: string]: string}) => - boolean) { + boolean | Promise) { // Hook all output to stderr and write it to a buffer, then include // that buffer's in the worker protcol proto's textual output. This // means you can log via console.error() and it will appear to the @@ -142,10 +145,8 @@ export function runWorkerLoop( // it exits and waits for more input. If a message has been read, it strips // its data of this buffer. let buf: Buffer = Buffer.alloc(0); - process.stdin.on('readable', () => { - const chunk = process.stdin.read() as Buffer; - if (!chunk) return; - buf = Buffer.concat([buf, chunk]); + stdinLoop: for await (const chunk of process.stdin) { + buf = Buffer.concat([buf, chunk as Buffer]); try { const reader = new protobufjs.Reader(buf); // Read all requests that have accumulated in the buffer. @@ -154,7 +155,7 @@ export function runWorkerLoop( const msgLength: number = reader.uint32(); // chunk might be an incomplete read from stdin. If there are not enough // bytes for the next full message, wait for more input. - if ((reader.len - reader.pos) < msgLength) return; + if ((reader.len - reader.pos) < msgLength) continue stdinLoop; const req = workerpb.WorkRequest.decode(reader, msgLength) as workerProto.WorkRequest; @@ -170,7 +171,7 @@ export function runWorkerLoop( inputs[input.path] = input.digest.toString('hex'); } debug('Compiling with:\n\t' + args.join('\n\t')); - const exitCode = runOneBuild(args, inputs) ? 0 : 1; + const exitCode = (await runOneBuild(args, inputs)) ? 0 : 1; process.stdout.write((workerpb.WorkResponse.encodeDelimited({ exitCode, output: consoleOutput, @@ -196,5 +197,5 @@ export function runWorkerLoop( // Clear buffer so the next build won't read an incomplete request. buf = Buffer.alloc(0); } - }); + } } diff --git a/package.json b/package.json index 42bdbd7c..9a86e265 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@bazel/typescript": "^0.32.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", - "@types/node": "7.0.18", + "@types/node": "10.12.20", "@types/source-map": "^0.5.1", "@types/tmp": "^0.0.33", "clang-format": "1.0.49", From 7ad93882c46bfb4e997b52b308c1586b700cf261 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 23 Aug 2019 16:44:22 -0700 Subject: [PATCH 201/316] Refactor the "output_groups" string to the OutputGroupInfo() provider. This is the beginning of removing the legacy providers, per https://github.com/bazelbuild/bazel/issues/7347 See https://docs.bazel.build/versions/master/skylark/rules.html#migrating-from-legacy-providers: "The field output_groups takes a struct value and corresponds to an OutputGroupInfo." PiperOrigin-RevId: 265162279 --- internal/common/compilation.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 6af26b59..70a66d72 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -479,6 +479,10 @@ def compile_ts( ), files = depset(transitive = files_depsets), ), + OutputGroupInfo( + es5_sources = es5_sources, + es6_sources = es6_sources, + ), ], "instrumented_files": { "dependency_attributes": ["deps", "runtime_deps"], @@ -489,10 +493,6 @@ def compile_ts( # e.g. rollup_bundle under Bazel needs to convert this into a UMD global # name in the Rollup configuration. "module_name": getattr(ctx.attr, "module_name", None), - "output_groups": { - "es5_sources": es5_sources, - "es6_sources": es6_sources, - }, # Expose the tags so that a Skylark aspect can access them. "tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags, # TODO(martinprobst): Prune transitive deps, only re-export what's needed. From d28150aa8d69604d33329ca1238f801f6599f415 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 23 Aug 2019 17:17:23 -0700 Subject: [PATCH 202/316] Provide DeclarationInfo that replaces two fields from "typescript" legacy provider This is the part of removing the legacy providers, per https://github.com/bazelbuild/bazel/issues/7347 Depends on https://github.com/bazelbuild/rules_nodejs/pull/1052 PiperOrigin-RevId: 265167694 --- internal/common/compilation.bzl | 9 ++++++++- package.bzl | 4 ++++ rules_nodejs_pr1052.patch | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 rules_nodejs_pr1052.patch diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 70a66d72..3155f0c2 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -17,6 +17,7 @@ load(":common/json_marshal.bzl", "json_marshal") load(":common/module_mappings.bzl", "module_mappings_aspect") +load("@build_bazel_rules_nodejs//:declaration_provider.bzl", "DeclarationInfo") _DEBUG = False @@ -483,6 +484,11 @@ def compile_ts( es5_sources = es5_sources, es6_sources = es6_sources, ), + # TODO(martinprobst): Prune transitive deps, see go/dtspruning + DeclarationInfo( + declarations = depset(transitive = declarations_depsets), + transitive_declarations = transitive_decls, + ), ], "instrumented_files": { "dependency_attributes": ["deps", "runtime_deps"], @@ -495,13 +501,14 @@ def compile_ts( "module_name": getattr(ctx.attr, "module_name", None), # Expose the tags so that a Skylark aspect can access them. "tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags, - # TODO(martinprobst): Prune transitive deps, only re-export what's needed. "typescript": { + # TODO(b/139705078): remove when consumers migrated to DeclarationInfo "declarations": depset(transitive = declarations_depsets), "devmode_manifest": devmode_manifest, "es5_sources": es5_sources, "es6_sources": es6_sources, "replay_params": replay_params, + # TODO(b/139705078): remove when consumers migrated to DeclarationInfo "transitive_declarations": transitive_decls, "transitive_es6_sources": transitive_es6_sources, "tsickle_externs": tsickle_externs, diff --git a/package.bzl b/package.bzl index 0f4ad482..b751dcbc 100644 --- a/package.bzl +++ b/package.bzl @@ -30,6 +30,10 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", + patch_args = ["-p1"], + # Patch in this PR to get the DeclarationInfo provider. + # Can remove this once it's released + patches = ["@build_bazel_rules_typescript//:rules_nodejs_pr1052.patch"], sha256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4", urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.2/rules_nodejs-0.32.2.tar.gz"], ) diff --git a/rules_nodejs_pr1052.patch b/rules_nodejs_pr1052.patch new file mode 100644 index 00000000..e50541e2 --- /dev/null +++ b/rules_nodejs_pr1052.patch @@ -0,0 +1,34 @@ +diff --git a/declaration_provider.bzl b/declaration_provider.bzl +new file mode 100644 +index 0000000..b2f89af +--- /dev/null ++++ b/declaration_provider.bzl +@@ -0,0 +1,28 @@ ++"""This module contains a provider for TypeScript typings files (.d.ts)""" ++ ++def provide_declarations(**kwargs): ++ """Factory function for creating checked declarations with externs. ++ ++ Do not directly construct DeclarationInfo() ++ """ ++ ++ # TODO: add some checking actions to ensure the declarations are well-formed ++ return DeclarationInfo(**kwargs) ++ ++DeclarationInfo = provider( ++ doc = """The DeclarationInfo provider allows JS rules to communicate typing information. ++TypeScript's .d.ts files are used as the interop format for describing types. ++ ++Do not create DeclarationInfo instances directly, instead use the provide_declarations factory function. ++ ++TODO(alexeagle): The ts_library#deps attribute should require that this provider is attached. ++ ++Note: historically this was a subset of the string-typed "typescript" provider. ++""", ++ # TODO: if we ever enable --declarationMap we will have .d.ts.map files too ++ fields = { ++ "declarations": "A depset of .d.ts files produced by this rule", ++ "transitive_declarations": """A depset of .d.ts files produced by this rule and all its transitive dependencies. ++This prevents needing an aspect in rules that consume the typings, which improves performance.""", ++ }, ++) From 94680838553a15509eb36ee73d3e3b00e846acb8 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 30 Aug 2019 17:54:16 -0700 Subject: [PATCH 203/316] Add more detailed logging of latency for requests with no TypeScript. PiperOrigin-RevId: 266489330 --- ts_auto_deps/updater/updater.go | 44 +++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index b77acbad..e6585d20 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -686,42 +686,60 @@ type UpdateBUILDOptions struct { IsRoot bool } +// LatencyReport contains timing measurements of the functions that are called +// when running the presubmit on a package without any TypeScript (since we +// return early to avoid the latency of RAS analyze). +type LatencyReport struct { + GetBUILD, TazeDisabled, SubdirSrcs, AddSrcs time.Duration +} + // UpdateBUILD drives the main process of creating/updating the BUILD file // underneath path based on the available sources. Returns true if it modified // the BUILD file, false if the BUILD file was up to date already. bazelAnalyze // is used to run the underlying `bazel analyze` process. Returns another // boolean that's true iff the package doesn't contain any TypeScript (source // files or BUILD rules). -func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, bool, error) { +func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, *LatencyReport, error) { + latencyReport := &LatencyReport{} + + start := time.Now() g3root, buildFilePath, bld, err := getBUILDPathAndBUILDFile(ctx, path) + latencyReport.GetBUILD = time.Since(start) if err != nil { - return false, false, err + return false, nil, err } - if isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld) { - return false, false, nil + start = time.Now() + ts_auto_depsDisabled := isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld) + latencyReport.TazeDisabled = time.Since(start) + if ts_auto_depsDisabled { + return false, nil, nil } + start = time.Now() hasSubdirSrcs, err := directoryOrAncestorHasSubdirectorySources(ctx, g3root, buildFilePath, bld) + latencyReport.SubdirSrcs = time.Since(start) if err != nil { - return false, false, err + return false, nil, err } if hasSubdirSrcs { - return false, false, &SubdirectorySourcesError{} + return false, nil, &SubdirectorySourcesError{} } + start = time.Now() changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld) + latencyReport.AddSrcs = time.Since(start) if err != nil { - return false, false, err + return false, nil, err } if options.InNonWritableEnvironment && changed { - return true, false, &CantProgressAfterWriteError{} + return true, nil, &CantProgressAfterWriteError{} } rules := allTSRules(bld) if len(rules) == 0 && !options.IsRoot { // No TypeScript rules, no need to query for dependencies etc, so just exit early. - return changed, true, nil + return changed, latencyReport, nil } rulesWithSrcs := []*build.Rule{} for _, r := range rules { @@ -735,19 +753,19 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update platform.Infof("analyzing...") reports, err := upd.runBazelAnalyze(buildFilePath, bld, rulesWithSrcs) if err != nil { - return false, false, err + return false, nil, err } changedAfterBazelAnalyze, err := upd.updateBUILDAfterBazelAnalyze(ctx, options.IsRoot, g3root, buildFilePath, bld, reports) if err != nil { - return false, false, err + return false, nil, err } changed = changed || changedAfterBazelAnalyze if options.InNonWritableEnvironment && changed { - return true, false, &CantProgressAfterWriteError{} + return true, nil, &CantProgressAfterWriteError{} } - return changed, false, nil + return changed, nil, nil } // buildHasDisableTaze checks if the BUILD file should be managed using ts_auto_deps. From 6a8d70ea5a7d59b0c2ddec01985b9f9bd6ee981d Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 5 Sep 2019 06:34:11 -0700 Subject: [PATCH 204/316] Upgrade rules_nodejs to 0.36.2 Closes https://github.com/bazelbuild/rules_typescript/pull/469 PiperOrigin-RevId: 267359612 --- .bazelci/presubmit.yml | 1 + package.bzl | 8 ++------ rules_nodejs_pr1052.patch | 34 ---------------------------------- 3 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 rules_nodejs_pr1052.patch diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 86727d19..adf16142 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -44,5 +44,6 @@ platforms: test_flags: - "--action_env=PATH" - "--test_env=PATH" + - "--incompatible_windows_native_test_wrapper" test_targets: - "..." diff --git a/package.bzl b/package.bzl index b751dcbc..792940d0 100644 --- a/package.bzl +++ b/package.bzl @@ -30,12 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - patch_args = ["-p1"], - # Patch in this PR to get the DeclarationInfo provider. - # Can remove this once it's released - patches = ["@build_bazel_rules_typescript//:rules_nodejs_pr1052.patch"], - sha256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.2/rules_nodejs-0.32.2.tar.gz"], + sha256 = "da72ea53fa1cb8ab5ef7781ba06b97259b7d579a431ce480476266bc81bdf21d", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.36.2/rules_nodejs-0.36.2.tar.gz"], ) # For protocol buffers diff --git a/rules_nodejs_pr1052.patch b/rules_nodejs_pr1052.patch deleted file mode 100644 index e50541e2..00000000 --- a/rules_nodejs_pr1052.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/declaration_provider.bzl b/declaration_provider.bzl -new file mode 100644 -index 0000000..b2f89af ---- /dev/null -+++ b/declaration_provider.bzl -@@ -0,0 +1,28 @@ -+"""This module contains a provider for TypeScript typings files (.d.ts)""" -+ -+def provide_declarations(**kwargs): -+ """Factory function for creating checked declarations with externs. -+ -+ Do not directly construct DeclarationInfo() -+ """ -+ -+ # TODO: add some checking actions to ensure the declarations are well-formed -+ return DeclarationInfo(**kwargs) -+ -+DeclarationInfo = provider( -+ doc = """The DeclarationInfo provider allows JS rules to communicate typing information. -+TypeScript's .d.ts files are used as the interop format for describing types. -+ -+Do not create DeclarationInfo instances directly, instead use the provide_declarations factory function. -+ -+TODO(alexeagle): The ts_library#deps attribute should require that this provider is attached. -+ -+Note: historically this was a subset of the string-typed "typescript" provider. -+""", -+ # TODO: if we ever enable --declarationMap we will have .d.ts.map files too -+ fields = { -+ "declarations": "A depset of .d.ts files produced by this rule", -+ "transitive_declarations": """A depset of .d.ts files produced by this rule and all its transitive dependencies. -+This prevents needing an aspect in rules that consume the typings, which improves performance.""", -+ }, -+) From b9ecb83af6c53b45ef1d34e46223e32d0f5e4957 Mon Sep 17 00:00:00 2001 From: evanm Date: Thu, 5 Sep 2019 16:19:59 -0700 Subject: [PATCH 205/316] Internal change. PiperOrigin-RevId: 267480203 --- internal/common/compilation.bzl | 8 ++++---- internal/tsc_wrapped/compiler_host.ts | 6 +++--- internal/tsc_wrapped/tsc_wrapped_test.ts | 4 ++-- internal/tsc_wrapped/tsconfig.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 3155f0c2..1bcf2bc4 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -194,13 +194,13 @@ def _outputs(ctx, label, srcs_files = []): if basename.endswith(ext): basename = basename[:-len(ext)] break - closure_js_files += [ctx.actions.declare_file(basename + ".closure.js")] + closure_js_files += [ctx.actions.declare_file(basename + ".mjs")] # Temporary until all imports of ngfactory/ngsummary files are removed # TODO(alexeagle): clean up after Ivy launch if getattr(ctx, "compile_angular_templates", False): - closure_js_files += [ctx.actions.declare_file(basename + ".ngfactory.closure.js")] - closure_js_files += [ctx.actions.declare_file(basename + ".ngsummary.closure.js")] + closure_js_files += [ctx.actions.declare_file(basename + ".ngfactory.mjs")] + closure_js_files += [ctx.actions.declare_file(basename + ".ngsummary.mjs")] if not is_dts: devmode_js_files += [ctx.actions.declare_file(basename + ".js")] @@ -428,7 +428,7 @@ def compile_ts( # deps (do not re-export transitive types from the transitive closure). transitive_decls = depset(src_declarations + gen_declarations, transitive = [dep_declarations.transitive]) - # both ts_library and ts_declarations generate .closure.js files: + # both ts_library and ts_declarations generate .mjs files: # - for libraries, this is the ES6/production code # - for declarations, these are generated shims es6_sources = depset(transpiled_closure_js + tsickle_externs) diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index c05b3c32..2b7113b1 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -142,7 +142,7 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { * For the given potentially absolute input file path (typically .ts), returns * the relative output path. For example, for * /path/to/root/blaze-out/k8-fastbuild/genfiles/my/file.ts, will return - * my/file.js or my/file.closure.js (depending on ES5 mode). + * my/file.js or my/file.mjs (depending on ES5 mode). */ relativeOutputPath(fileName: string) { let result = this.rootDirsRelative(fileName); @@ -506,13 +506,13 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { path.join(this.bazelOpts.transpiledJsOutputDirectory!, fileName); } } else if (!this.bazelOpts.es5Mode) { - // Write ES6 transpiled files to *.closure.js. + // Write ES6 transpiled files to *.mjs. if (this.bazelOpts.locale) { // i18n paths are required to end with __locale.js so we put // the .closure segment before the __locale fileName = fileName.replace(/(__[^\.]+)?\.js$/, '.closure$1.js'); } else { - fileName = fileName.replace(/\.js$/, '.closure.js'); + fileName = fileName.replace(/\.js$/, '.mjs'); } } diff --git a/internal/tsc_wrapped/tsc_wrapped_test.ts b/internal/tsc_wrapped/tsc_wrapped_test.ts index 59d725b2..2351cd87 100644 --- a/internal/tsc_wrapped/tsc_wrapped_test.ts +++ b/internal/tsc_wrapped/tsc_wrapped_test.ts @@ -259,12 +259,12 @@ describe('compiler host', () => { }); describe('output files', () => { - it('writes to .closure.js in ES6 mode', () => { + it('writes to .mjs in ES6 mode', () => { createFakeGoogle3Host({ es5: false, }).writeFile('a.js', 'some.code();', false, undefined, []); expect(Object.keys(writtenFiles)).toEqual([ - '/root/google3/blaze-out/k8-fastbuild/bin/a.closure.js' + '/root/google3/blaze-out/k8-fastbuild/bin/a.mjs' ]); }); diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index 9bc0a33b..a50ac1cc 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -39,7 +39,7 @@ export interface BazelOptions { /** * If true, emit devmode output into filename.js. - * If false, emit prodmode output into filename.closure.js. + * If false, emit prodmode output into filename.mjs. */ es5Mode: boolean; From 4fe0e1cb5e5cd43426eac77201ac2bc69444ca78 Mon Sep 17 00:00:00 2001 From: rjamet Date: Thu, 12 Sep 2019 04:14:08 -0700 Subject: [PATCH 206/316] Add a way to call Tsetse with fixes in the diagnostic text. This adds a way to turn diagnostics into text with an inlined fix, and the related tests. Also sneak in a few tests for imports that I seemed to have forgot about. PiperOrigin-RevId: 268656099 --- internal/tsetse/failure.ts | 92 +++++++++++- .../ban_conformance_pattern/fixer_test.ts | 131 ++++++++++++++++-- internal/tsetse/util/testing/test_support.ts | 19 +++ 3 files changed, 224 insertions(+), 18 deletions(-) diff --git a/internal/tsetse/failure.ts b/internal/tsetse/failure.ts index 61680acf..317faf40 100644 --- a/internal/tsetse/failure.ts +++ b/internal/tsetse/failure.ts @@ -19,7 +19,7 @@ export class Failure { * This returns a structure compatible with ts.Diagnostic, but with added * fields, for convenience and to support suggested fixes. */ - toDiagnostic(): ts.Diagnostic&{end: number, fix?: Fix} { + toDiagnostic(): DiagnosticWithFix { return { file: this.sourceFile, start: this.start, @@ -35,15 +35,87 @@ export class Failure { }; } + /** + * Same as toDiagnostic, but include the fix in the message, so that systems + * that don't support displaying suggested fixes can still surface that + * information. This assumes the diagnostic message is going to be presented + * within the context of the problematic code + */ + toDiagnosticWithStringifiedFix(): DiagnosticWithFix { + const diagnostic = this.toDiagnostic(); + if (this.suggestedFix) { + diagnostic.messageText += ' ' + this.fixToReadableStringInContext(); + } + return diagnostic; + } + toString(): string { return `{ sourceFile:${ this.sourceFile ? this.sourceFile.fileName : 'unknown'}, start:${ this.start}, end:${this.end}, fix:${fixToString(this.suggestedFix)} }`; } + + + /** + * Stringifies a `Fix`, in a way that makes sense when presented alongside the + * finding. This is a heuristic, obviously. + */ + fixToReadableStringInContext() { + if (!this.suggestedFix) return ''; // no changes, nothing to state. + const f: Fix = this.suggestedFix; + let fixText = ''; + + for (const c of f.changes) { + // Insertion. + if (c.start === c.end) { + // Try to see if that's an import. + if (c.replacement.indexOf('import') !== -1) { + fixText += `- Add new import: ${c.replacement}\n`; + } else { + // Insertion that's not a full import. This should rarely happen in + // our context, and we don't have a great message for these. + // For instance, this could be the addition of a new symbol in an + // existing import (`import {foo}` becoming `import {foo, bar}`). + fixText += `- Insert ${this.readableRange(c.start, c.end)}: ${ + c.replacement}\n`; + } + } else if (c.start === this.start && c.end === this.end) { + // We assume the replacement is the main part of the fix, so put that + // individual change first in `fixText`. + fixText = `- Replace the full match with: ${c.replacement}\n` + fixText; + } else { + // Fallback case: Use a numerical range to specify a replacement. In + // general, falling through in this case should be avoided, as it's not + // really readable without an IDE (the range can be outside of the + // matched code). + fixText = `- Replace ${this.readableRange(c.start, c.end)} with: ` + + `${c.replacement}\n${fixText}`; + } + } + + return 'Suggested fix:\n' + fixText.trim(); + } + + // TS indexes from 0 both ways, but tooling generally indexes from 1 for both + // lines and columns. The translation is done here. + readableRange(from: number, to: number) { + const lcf = this.sourceFile.getLineAndCharacterOfPosition(from); + const lct = this.sourceFile.getLineAndCharacterOfPosition(to); + if (lcf.line === lct.line) { + if (lcf.character === lct.character) { + return `at line ${lcf.line + 1}, char ${lcf.character + 1}`; + } + return `line ${lcf.line + 1}, from char ${lcf.character + 1} to ${ + lct.character + 1}`; + } else { + return `from line ${lcf.line + 1}, char ${lcf.character + 1} to line ${ + lct.line + 1}, char ${lct.character + 1}`; + } + } } /** - * A Fix is a potential repair to the associated Failure. + * A `Fix` is a potential repair to the associated `Failure`. */ export interface Fix { /** @@ -52,12 +124,26 @@ export interface Fix { changes: IndividualChange[], } +/** + * An individual text replacement/insertion in a source file. Used as part of a + * `Fix`. + */ export interface IndividualChange { sourceFile: ts.SourceFile, start: number, end: number, replacement: string } /** - * Stringifies a Fix, replacing the ts.SourceFile with the matching filename. + * A ts.Diagnostic that might include a `Fix`, and with an added `end` field for + * convenience. + */ +export interface DiagnosticWithFix extends ts.Diagnostic { + end: number; + fix?: Fix; +} + +/** + * Stringifies a `Fix`, replacing the `ts.SourceFile` with the matching + * filename. */ export function fixToString(f?: Fix) { if (!f) return 'undefined'; diff --git a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts index 3b7c85ff..24e53adb 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts @@ -1,9 +1,9 @@ import 'jasmine'; import * as ts from 'typescript'; -import {Fix} from '../../failure'; +import {Failure, Fix} from '../../failure'; import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {buildReplacementFixer, Fixer} from '../../util/fixer'; -import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; +import {buildReplacementFixer, Fixer, maybeAddNamedImport, maybeAddNamespaceImport} from '../../util/fixer'; +import {compile, compileAndCheck, customMatchers} from '../../util/testing/test_support'; const uppercaseFixer: Fixer = { getFixForFlaggedNode(node: ts.Node): Fix { @@ -22,19 +22,19 @@ const uppercaseFixerBuilt: Fixer = buildReplacementFixer((node: ts.Node) => { return {replaceWith: node.getText().toUpperCase()}; }) +// The initial config and source off which we run those checks. +const baseConfig = { + errorMessage: 'found citation', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'], +}; + +const source = `export {};\n` + + `const q = document.createElement('q');\n` + + `q.cite = 'some example string';\n`; + describe('ConformancePatternRule\'s fixer', () => { describe('Generates basic fixes', () => { - const source = `export {};\n` + - `const q = document.createElement('q');\n` + - `q.cite = 'some example string';\n`; - - // The initial config off which we run those checks. - const baseConfig = { - errorMessage: 'found citation', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'], - }; - it('for a single match', () => { const rule = new ConformancePatternRule(baseConfig, uppercaseFixer); const results = compileAndCheck(rule, source); @@ -49,7 +49,6 @@ describe('ConformancePatternRule\'s fixer', () => { ]); }); - it('for a single match (alternate fixer)', () => { const rule = new ConformancePatternRule(baseConfig, uppercaseFixerBuilt); const results = compileAndCheck(rule, source); @@ -82,15 +81,117 @@ describe('ConformancePatternRule\'s fixer', () => { expect(results[0]).toHaveFixMatching([ {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} ]); + expect(results[0].fixToReadableStringInContext()) + .toBe( + `Suggested fix:\n` + + `- Replace the full match with: Q.CITE = 'SOME EXAMPLE STRING'`); expect(results[1]).toHaveFixMatching([{ start: 82, end: 118, replacement: `Q.CITE = 'SOME OTHER EXAMPLE STRING'` }]); + expect(results[1].fixToReadableStringInContext()) + .toBe( + `Suggested fix:\n` + + `- Replace the full match with: Q.CITE = 'SOME OTHER EXAMPLE STRING'`); + }); + }); + + describe('adds imports', () => { + const addNamedImportFixer: Fixer = { + getFixForFlaggedNode(n: ts.Node) { + const ic = + maybeAddNamedImport(n.getSourceFile(), 'foo', './file_1', 'bar'); + if (ic) return {changes: [ic]}; + return; + } + }; + + it('maybeAddNamedImport additions', () => { + const results = compileAndCheck( + new ConformancePatternRule(baseConfig, addNamedImportFixer), source); + + expect(results[0]).toHaveFixMatching([{ + start: 0, + end: 0, + replacement: `import {foo as bar} from './file_1';\n` + }]); + expect(results[0].fixToReadableStringInContext()) + .toBe( + `Suggested fix:\n` + + `- Add new import: import {foo as bar} from './file_1';`); + }); + + it('maybeAddNamedImport already there', () => { + const results = compileAndCheck( + new ConformancePatternRule(baseConfig, addNamedImportFixer), + 'import {foo as bar} from \'./file_1\';\n' + source, + 'export const foo = 1;'); + + expect(results[0]).toHaveNoFix(); + expect(results[0].fixToReadableStringInContext()).toBe(''); + }); + + it('maybeAddNamedImport different name', () => { + const results = compileAndCheck( + new ConformancePatternRule(baseConfig, addNamedImportFixer), + 'import {foo as baz} from \'./file_1\';\n' + source, + 'export const foo = 1;'); + + expect(results[0]).toHaveFixMatching([ + {start: 8, end: 8, replacement: `foo as bar, `} + ]); + expect(results[0].fixToReadableStringInContext()) + .toBe( + `Suggested fix:\n` + + `- Insert at line 1, char 9: foo as bar,`); + }); + + it('maybeAddNamespacedImport', () => { + const addNamespacedImportFixer: Fixer = { + getFixForFlaggedNode(n: ts.Node): Fix | + undefined { + const ic = + maybeAddNamespaceImport(n.getSourceFile(), './file_1', 'foo'); + if (ic) return {changes: [ic]}; + return; + } + }; + const results = compileAndCheck( + new ConformancePatternRule(baseConfig, addNamespacedImportFixer), + source); + + expect(results[0]).toHaveFixMatching([ + {start: 0, end: 0, replacement: `import * as foo from './file_1';\n`} + ]); + }); + }); + + describe('the logic for location->text transforms', () => { + const sourceFile = compile(`let a;\nlet b;\n`) + .getSourceFiles() + .filter(f => f.fileName.indexOf('file_0') !== -1)[0]; + // let a;\nlet b;\n + // 0123456 7890123 Positions + // 1234567 1234567 Expected result in characters + + it('stringifies as expected', () => { + // Only the sourceFile matters here. + const failure = new Failure(sourceFile, NaN, NaN, 'whatever', NaN); + + expect(failure.readableRange(0, 0)).toBe('at line 1, char 1'); + expect(failure.readableRange(1, 1)).toBe('at line 1, char 2'); + expect(failure.readableRange(0, 1)).toBe('line 1, from char 1 to 2'); + expect(failure.readableRange(0, 1)).toBe('line 1, from char 1 to 2'); + expect(failure.readableRange(7, 7)).toBe('at line 2, char 1'); + expect(failure.readableRange(0, 7)) + .toBe('from line 1, char 1 to line 2, char 1'); }); }); }); + + beforeEach(() => { jasmine.addMatchers(customMatchers); }); diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index c12e28a0..fb2460e3 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -213,7 +213,22 @@ export const customMatchers: jasmine.CustomMatcherFactories = { return {pass: regrets === '', message: regrets}; } }; + }, + + /** + * Asserts that a Failure has no fix. + */ + toHaveNoFix(): jasmine.CustomMatcher { + return { + compare: (actualFailure: Failure) => { + return { + pass: actualFailure.toDiagnostic().fix === undefined, + message: 'This failure should not have a fix.' + }; + } + }; } + }; function expectation(fieldname: string, expectation: any, actual: any) { @@ -232,11 +247,15 @@ declare global { messageText?: string, }): void; + /** Checks that a Failure has the expected Fix field. */ toHaveFixMatching(expected: [ {fileName?: string, start?: number, end?: number, replacement?: string} ]): void; toHaveNFailures(expected: Number, config?: Config): void; + + /** Asserts that a Failure has no fix. */ + toHaveNoFix(): void; } } } From 8d2824b029d4b3b90f8f570c408d25c4dbed706e Mon Sep 17 00:00:00 2001 From: rjamet Date: Mon, 16 Sep 2019 02:16:12 -0700 Subject: [PATCH 207/316] Swap the Tsetse runner diagnostic generation to use toDiagnosticWithStringifiedFix. This should be a noop, as no ConformancePatternRule is enabled, and they're the only ones with fixes. PiperOrigin-RevId: 269284571 --- internal/tsetse/runner.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/tsetse/runner.ts b/internal/tsetse/runner.ts index 826131e1..a2b76d40 100644 --- a/internal/tsetse/runner.ts +++ b/internal/tsetse/runner.ts @@ -40,8 +40,12 @@ export class Plugin implements pluginApi.DiagnosticPlugin { } getDiagnostics(sourceFile: ts.SourceFile) { + // Tsetse, in its plugin form, outputs ts.Diagnostic that don't make use + // of the potential suggested fixes Tsetse generates. These diagnostics are + // however displayed in context: we can therefore stringify any potential + // suggested fixes in the error message, so they don't go to waste. return this.checker.execute(sourceFile) - .map(failure => failure.toDiagnostic()); + .map(failure => failure.toDiagnosticWithStringifiedFix()); } } From 1b1fce49b7e707dd3f54a4844b8ac3e06c29ac33 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Mon, 16 Sep 2019 10:07:36 -0700 Subject: [PATCH 208/316] Inline getBUILDPathAndBUILDFile. Also move responsibility for determining the workspace-relative BUILD path from readBUILD to getBUILDPath. PiperOrigin-RevId: 269361049 --- ts_auto_deps/updater/test_register.go | 6 +- ts_auto_deps/updater/updater.go | 90 ++++++++++++++------------- ts_auto_deps/updater/updater_test.go | 2 +- 3 files changed, 52 insertions(+), 46 deletions(-) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index 19529c97..291e564d 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -50,7 +50,7 @@ func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (boo // declaration var err error var buildPath string - g3root, buildPath, err = getBUILDPath(ctx, path) + g3root, buildPath, _, err = getBUILDPath(ctx, path) if err != nil { return false, nil, err } @@ -108,7 +108,7 @@ type buildRegistry struct { } func (reg *buildRegistry) readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build.File, error) { - normalizedG3Path, err := getAbsoluteBUILDPath(workspaceRoot, buildFilePath) + normalizedG3Path, err := getWorkspaceRelativePath(workspaceRoot, buildFilePath) if err != nil { return nil, err } @@ -117,7 +117,7 @@ func (reg *buildRegistry) readBUILD(ctx context.Context, workspaceRoot, buildFil return bld, nil } - bld, err := readBUILD(ctx, workspaceRoot, buildFilePath) + bld, err := readBUILD(ctx, buildFilePath, normalizedG3Path) if err != nil { return nil, err } diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index e6585d20..f121c442 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -173,36 +173,18 @@ func spin(prefix string) chan<- struct{} { return done } -// getAbsoluteBUILDPath relativizes the absolute build path so that buildFilePath -// is definitely below workspaceRoot. -func getAbsoluteBUILDPath(workspaceRoot, buildFilePath string) (string, error) { - absPath, err := filepath.Abs(buildFilePath) - if err != nil { - return "", err - } - g3Path, err := filepath.Rel(workspaceRoot, absPath) - if err != nil { - return "", err - } - return platform.Normalize(g3Path), nil -} - // readBUILD loads the BUILD file, if present, or returns a new empty one. -// workspaceRoot must be an absolute path and buildFilePath is interpreted as -// relative to CWD, and must be underneath workspaceRoot. -func readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build.File, error) { - normalizedG3Path, err := getAbsoluteBUILDPath(workspaceRoot, buildFilePath) - if err != nil { - return nil, fmt.Errorf("failed to resolve workspace relative path: %s", err) - } +// buildFilePath is relative to CWD, and workspaceRelativePath is relative to +// the workspace root (the directory containing the WORKSPACE file). +func readBUILD(ctx context.Context, buildFilePath, workspaceRelativePath string) (*build.File, error) { data, err := platform.ReadFile(ctx, buildFilePath) if err != nil { if os.IsNotExist(err) { - return &build.File{Path: normalizedG3Path, Type: build.TypeBuild}, nil + return &build.File{Path: workspaceRelativePath, Type: build.TypeBuild}, nil } return nil, fmt.Errorf("reading %q: %s", buildFilePath, err) } - bld, err := build.ParseBuild(normalizedG3Path, data) + bld, err := build.ParseBuild(workspaceRelativePath, data) if err != nil { if parseErr, ok := err.(build.ParseError); ok { return nil, &AnalysisFailedError{ @@ -487,33 +469,45 @@ func (upd *Updater) maybeWriteBUILD(ctx context.Context, path string, bld *build return true, nil } -func getBUILDPath(ctx context.Context, path string) (string, string, error) { - path = strings.TrimSuffix(path, "/BUILD") // Support both package paths and BUILD files - if _, err := platform.Stat(ctx, path); os.IsNotExist(err) { - return "", "", err +// getWorkspaceRelativePath takes a buildFilePath that's relative to the working +// directory, and returns a path to the BUILD file that's relative to the +// workspaceRoot (the absolute path of the directory containing the WORKSPACE +// file). +func getWorkspaceRelativePath(workspaceRoot, buildFilePath string) (string, error) { + absPath, err := filepath.Abs(buildFilePath) + if err != nil { + return "", err } - buildFilePath := filepath.Join(path, "BUILD") - g3root, err := workspace.Root(buildFilePath) + workspaceRelativePath, err := filepath.Rel(workspaceRoot, absPath) if err != nil { - return "", "", err + return "", err } + platform.Normalize(workspaceRelativePath) - return g3root, buildFilePath, nil + return workspaceRelativePath, nil } -func getBUILDPathAndBUILDFile(ctx context.Context, path string) (string, string, *build.File, error) { - g3root, buildFilePath, err := getBUILDPath(ctx, path) +// getBUILDPath takes in a package or BUILD file path, and returns the path of +// the workspace root (the absolute path of the directory containing the +// WORKSPACE file), the BUILD file path relative to the working directory, and +// the BUILD file path relative to the workspace root. +func getBUILDPath(ctx context.Context, path string) (string, string, string, error) { + path = strings.TrimSuffix(path, "/BUILD") // Support both package paths and BUILD files + if _, err := platform.Stat(ctx, path); os.IsNotExist(err) { + return "", "", "", err + } + buildFilePath := filepath.Join(path, "BUILD") + workspaceRoot, err := workspace.Root(buildFilePath) if err != nil { - return "", "", nil, err + return "", "", "", err } - bld, err := readBUILD(ctx, g3root, buildFilePath) + workspaceRelativePath, err := getWorkspaceRelativePath(workspaceRoot, buildFilePath) if err != nil { - platform.Infof("Error reading building file!") - return "", "", nil, err + return "", "", "", err } - return g3root, buildFilePath, bld, nil + return workspaceRoot, buildFilePath, workspaceRelativePath, nil } // isTazeDisabledInPackage checks the BUILD file, or if the BUILD doesn't exist, @@ -652,11 +646,17 @@ func (upd *Updater) updateBUILDAfterBazelAnalyze(ctx context.Context, isRoot boo // IsTazeDisabledForDir checks if ts_auto_deps is disabled in the BUILD file in the dir, // or if no BUILD file exists, in the closest ancestor BUILD func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { - g3root, buildFilePath, bld, err := getBUILDPathAndBUILDFile(ctx, dir) + g3root, buildFilePath, workspaceRelativePath, err := getBUILDPath(ctx, dir) if err != nil { return false, err } + bld, err := readBUILD(ctx, buildFilePath, workspaceRelativePath) + if err != nil { + platform.Infof("Error reading building file!") + return false, err + } + return isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld), nil } @@ -703,11 +703,17 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update latencyReport := &LatencyReport{} start := time.Now() - g3root, buildFilePath, bld, err := getBUILDPathAndBUILDFile(ctx, path) - latencyReport.GetBUILD = time.Since(start) + g3root, buildFilePath, workspaceRelativePath, err := getBUILDPath(ctx, path) + if err != nil { + return false, nil, err + } + + bld, err := readBUILD(ctx, buildFilePath, workspaceRelativePath) if err != nil { + platform.Infof("Error reading building file!") return false, nil, err } + latencyReport.GetBUILD = time.Since(start) start = time.Now() ts_auto_depsDisabled := isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld) @@ -1194,7 +1200,7 @@ func FindBUILDFile(ctx context.Context, pkgToBUILD map[string]*build.File, _, err := platform.Stat(ctx, buildPath) var bld *build.File if err == nil { - bld, err = readBUILD(ctx, workspaceRoot, buildPath) + bld, err = readBUILD(ctx, buildPath, filepath.Join(packagePath, "BUILD")) } else if os.IsNotExist(err) { // Recursively search parent package and cache its location below if found. bld, err = FindBUILDFile(ctx, pkgToBUILD, workspaceRoot, filepath.Dir(packagePath)) diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index b62ef20a..613b99f4 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -37,7 +37,7 @@ ts_library(name = 'a', srcs = ['b.ts']) if err != nil { t.Fatal(err) } - bld, err := readBUILD(context.Background(), filepath.Join(testTmpDir, "google3"), p) + bld, err := readBUILD(context.Background(), p, "foo/bar/BUILD") if err != nil { t.Fatal(err) } From 001102dc462e3ac43a46fbb97627ffea80ef2a66 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Mon, 16 Sep 2019 15:28:37 -0700 Subject: [PATCH 209/316] Don't re-stat the BUILD file. Previously readBUILD returned a newly created *build.File struct if it didn't find an existing BUILD file. This meant that other functions that needed to know if there was an existing BUILD file had to stat the BUILD file to check if it existed. Now, readBUILD returns a nil pointer if there isn't an existing BUILD, so the other functions can just check if the bld they're passed is nil. PiperOrigin-RevId: 269434939 --- ts_auto_deps/updater/test_register.go | 4 ++ ts_auto_deps/updater/updater.go | 56 ++++++++++++++++----------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index 291e564d..ac6c1fba 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -121,6 +121,10 @@ func (reg *buildRegistry) readBUILD(ctx context.Context, workspaceRoot, buildFil if err != nil { return nil, err } + if bld == nil { + // The BUILD file didn't exist, so create a new, empty one. + bld = &build.File{Path: normalizedG3Path, Type: build.TypeBuild} + } reg.bldFiles[normalizedG3Path] = bld diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index f121c442..2e8dc495 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -173,14 +173,14 @@ func spin(prefix string) chan<- struct{} { return done } -// readBUILD loads the BUILD file, if present, or returns a new empty one. +// readBUILD loads the BUILD file, if present, or returns a nil pointer, if not. // buildFilePath is relative to CWD, and workspaceRelativePath is relative to // the workspace root (the directory containing the WORKSPACE file). func readBUILD(ctx context.Context, buildFilePath, workspaceRelativePath string) (*build.File, error) { data, err := platform.ReadFile(ctx, buildFilePath) if err != nil { if os.IsNotExist(err) { - return &build.File{Path: workspaceRelativePath, Type: build.TypeBuild}, nil + return nil, nil } return nil, fmt.Errorf("reading %q: %s", buildFilePath, err) } @@ -512,28 +512,32 @@ func getBUILDPath(ctx context.Context, path string) (string, string, string, err // isTazeDisabledInPackage checks the BUILD file, or if the BUILD doesn't exist, // the nearest ancestor BUILD file for a disable_ts_auto_deps() rule. -func isTazeDisabledInPackage(ctx context.Context, g3root string, buildFilePath string, bld *build.File) bool { - if _, err := platform.Stat(ctx, buildFilePath); err != nil && os.IsNotExist(err) { +func isTazeDisabledInPackage(ctx context.Context, g3root, buildFilePath, workspaceRelativePath string, bld *build.File) (bool, error) { + if bld == nil { // Make sure ts_auto_deps hasn't been disabled in the next closest ancestor package. - ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(bld.Path)) - if err != nil { + ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(workspaceRelativePath)) + if _, ok := err.(*noAncestorBUILDError); ok { platform.Infof("Could not find any ancestor BUILD for %q, continuing with a new BUILD file", buildFilePath) + return false, nil + } else if err != nil { + return false, err } else if buildHasDisableTaze(ancestor) { fmt.Printf("ts_auto_deps disabled below %q\n", ancestor.Path) - return true + return true, nil } else { platform.Infof("BUILD file missing and ts_auto_deps is enabled below %q. Creating new BUILD file.", ancestor.Path) + return false, nil } } if buildHasDisableTaze(bld) { fmt.Printf("ts_auto_deps disabled on %q\n", buildFilePath) - return true + return true, nil } - return false + return false, nil } // SubdirectorySourcesError is returned when ts_auto_deps detects a BUILD file @@ -589,10 +593,10 @@ func hasSubdirectorySources(bld *build.File) bool { // directoryOrAncestorHasSubdirectorySources checks for ts_libraries referencing sources in subdirectories. // It checks the current directory's BUILD if it exists, otherwise it checks the nearest // ancestor package. -func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root string, buildFilePath string, bld *build.File) (bool, error) { - if _, err := platform.Stat(ctx, buildFilePath); err != nil && os.IsNotExist(err) { +func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root, workspaceRelativePath string, bld *build.File) (bool, error) { + if bld == nil { // Make sure the next closest ancestor package doesn't reference sources in a subdirectory. - ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(bld.Path)) + ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(workspaceRelativePath)) if _, ok := err.(*noAncestorBUILDError); ok { // couldn't find an ancestor BUILD, so there aren't an subdirectory sources return false, nil @@ -600,6 +604,9 @@ func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root strin return false, err } else if hasSubdirectorySources(ancestor) { return true, nil + } else { + // there was an ancestor BUILD, but it didn't reference subdirectory sources + return false, nil } } @@ -657,7 +664,7 @@ func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { return false, err } - return isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld), nil + return isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) } // CantProgressAfterWriteError reports that ts_auto_deps was run in an environment @@ -716,14 +723,17 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update latencyReport.GetBUILD = time.Since(start) start = time.Now() - ts_auto_depsDisabled := isTazeDisabledInPackage(ctx, g3root, buildFilePath, bld) + ts_auto_depsDisabled, err := isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) + if err != nil { + return false, nil, err + } latencyReport.TazeDisabled = time.Since(start) if ts_auto_depsDisabled { return false, nil, nil } start = time.Now() - hasSubdirSrcs, err := directoryOrAncestorHasSubdirectorySources(ctx, g3root, buildFilePath, bld) + hasSubdirSrcs, err := directoryOrAncestorHasSubdirectorySources(ctx, g3root, workspaceRelativePath, bld) latencyReport.SubdirSrcs = time.Since(start) if err != nil { return false, nil, err @@ -732,6 +742,11 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update return false, nil, &SubdirectorySourcesError{} } + if bld == nil { + // The BUILD file didn't exist, so create a new, empty one. + bld = &build.File{Path: workspaceRelativePath, Type: build.TypeBuild} + } + start = time.Now() changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld) latencyReport.AddSrcs = time.Since(start) @@ -1197,15 +1212,12 @@ func FindBUILDFile(ctx context.Context, pkgToBUILD map[string]*build.File, return bld, nil } buildPath := filepath.Join(workspaceRoot, packagePath, "BUILD") - _, err := platform.Stat(ctx, buildPath) - var bld *build.File - if err == nil { - bld, err = readBUILD(ctx, buildPath, filepath.Join(packagePath, "BUILD")) - } else if os.IsNotExist(err) { + bld, err := readBUILD(ctx, buildPath, filepath.Join(packagePath, "BUILD")) + if err != nil { + return nil, err + } else if bld == nil { // Recursively search parent package and cache its location below if found. bld, err = FindBUILDFile(ctx, pkgToBUILD, workspaceRoot, filepath.Dir(packagePath)) - } else { - return nil, err } if err == nil { // NB: The cache key is packagePath ('foo/bar/baz'), even if build file was From 5ad356d09a6d7275bfef6f9717274e7dd9cda978 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 17 Sep 2019 06:08:50 -0700 Subject: [PATCH 210/316] Remove unused load statements from .bzl files After transitive loads have been disabled in Blaze, unused load statements have no effect (besides not useful memory consumption). The CL has been created automatically by calling `buildifier --lint=fix --warnings=load` on all .bzl files. The following additional command were run on all affected files to clean them up: * buildifier -a -v --lint=fix --warnings=load-on-top Moves all load statements to the top of a file * buildifier -a -v --lint=fix --warnings=same-origin-load Compresses all load statements from the same .bzl file to one load statement PiperOrigin-RevId: 269552258 --- internal/ts_repositories.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index e37ca2f7..929db7d1 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -20,7 +20,7 @@ load("@bazel_gazelle//:deps.bzl", "go_repository") # END-DEV-ONLY -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version", "yarn_install") +load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version") def ts_setup_workspace(): """This repository rule should be called from your WORKSPACE file. From 83a89f63bdfbc43348ec4068f107bb6ede56a0ca Mon Sep 17 00:00:00 2001 From: alexeagle Date: Tue, 17 Sep 2019 09:25:59 -0700 Subject: [PATCH 211/316] Fix ts_library to produce files that rollup knows how to find. Currently we produce .closure.js files with ESModules, this naming convention was chosen arbitrarily to indicate we expected these to be inputs to closure compiler. However other bundlers don't understand this convention and cannot find their inputs. Today we work around this by copying a bunch of files around before running rollup, but this is a performance issue we can avoid just by naming our outputs in the standard way for esmodules. PiperOrigin-RevId: 269585536 --- ts_auto_deps/updater/updater.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 2e8dc495..6594d73a 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -915,7 +915,7 @@ func removeSourcesUsed(bld *build.File, ruleKind, attrName string, srcs srcSet) } const ( - tsSkylarkLabel = "@npm_bazel_typescript//:defs.bzl" + tsSkylarkLabel = "@npm_bazel_typescript//:index.bzl" ngSkylarkLabel = "@angular//:index.bzl" ) From 7f79d3c23860186fe1bc244b883642afbbfd4ecc Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 17 Sep 2019 12:54:48 -0700 Subject: [PATCH 212/316] Asynchronously glob for TypeScript sources in the package. PiperOrigin-RevId: 269634230 --- ts_auto_deps/updater/updater.go | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 6594d73a..40f3056c 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -207,6 +207,11 @@ func readBUILD(ctx context.Context, buildFilePath, workspaceRelativePath string) type srcSet map[string]bool +type globResult struct { + srcs srcSet + err error +} + // globSources finds sources in path with any of the given extensions. // It also filters out temporary files, dangling symlinks, and symlinks into bazel-bin specifically. // It returns file names relative to path. @@ -617,12 +622,7 @@ func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root, work return false, nil } -func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFilePath string, bld *build.File) (bool, error) { - platform.Infof("Globbing TS sources in %s", path) - srcs, err := globSources(ctx, path, []string{"ts", "tsx"}) - if err != nil { - return false, err - } +func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFilePath string, bld *build.File, srcs srcSet) (bool, error) { platform.Infof("Updating sources") if len(srcs) == 0 && len(allTSRules(bld)) == 0 { @@ -709,6 +709,15 @@ type LatencyReport struct { func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, *LatencyReport, error) { latencyReport := &LatencyReport{} + // asynchronously glob for TS sources in the package, since it can be slow on + // a network file system. + globChan := make(chan globResult) + go func() { + platform.Infof("Globbing TS sources in %s", path) + srcs, err := globSources(ctx, path, []string{"ts", "tsx"}) + globChan <- globResult{srcs, err} + }() + start := time.Now() g3root, buildFilePath, workspaceRelativePath, err := getBUILDPath(ctx, path) if err != nil { @@ -748,7 +757,11 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update } start = time.Now() - changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld) + globRes := <-globChan + if globRes.err != nil { + return false, nil, globRes.err + } + changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld, globRes.srcs) latencyReport.AddSrcs = time.Since(start) if err != nil { return false, nil, err From fcf33e92a60c2b0613e931d05b305e1d962648e0 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 20 Sep 2019 14:19:43 -0700 Subject: [PATCH 213/316] Switch to npm_bazel_typescript index.bzl. defs.bzl is deprecated and being removed soon. PiperOrigin-RevId: 270348923 --- internal/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 6e10a605..5eb31904 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") -load("@npm_bazel_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:index.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) From 24619055b6afcf88ded816b0b90ef64ce433e3ff Mon Sep 17 00:00:00 2001 From: martinprobst Date: Mon, 23 Sep 2019 09:03:04 -0700 Subject: [PATCH 214/316] Turn PatternKind into a non-const enum. PatternKind is later re-exported. const enums cannot be re-exported, as they are removed at compile time and don't exist at runtime. This fixes a compilation error in TS3.6: conformance_pattern_rule.ts:57:9 - error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query. PiperOrigin-RevId: 270688010 --- internal/tsetse/util/pattern_config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index bc907b14..216ce139 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -4,7 +4,7 @@ * patterns whose name match JSConformance patterns should behave similarly (see * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework) */ -export const enum PatternKind { +export enum PatternKind { BANNED_NAME = 'banned-name', BANNED_PROPERTY_WRITE = 'banned-property-write', BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', From d365867de8fa1eb05288b1b0196c8789cd6074f6 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 26 Sep 2019 16:14:11 -0700 Subject: [PATCH 215/316] Don't wrap filesystem errors. PiperOrigin-RevId: 271455249 --- ts_auto_deps/updater/updater.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index 40f3056c..f606e5bb 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -182,7 +182,7 @@ func readBUILD(ctx context.Context, buildFilePath, workspaceRelativePath string) if os.IsNotExist(err) { return nil, nil } - return nil, fmt.Errorf("reading %q: %s", buildFilePath, err) + return nil, err } bld, err := build.ParseBuild(workspaceRelativePath, data) if err != nil { From faf7244d5eb4a92cc4338143e9ab9beaf0730eb2 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 27 Sep 2019 12:47:06 -0700 Subject: [PATCH 216/316] Ensure the fake filesystem used in concatjs_test.go is thread-safe. PiperOrigin-RevId: 271627870 --- devserver/concatjs/concatjs_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/devserver/concatjs/concatjs_test.go b/devserver/concatjs/concatjs_test.go index 00793bec..ddd1a470 100644 --- a/devserver/concatjs/concatjs_test.go +++ b/devserver/concatjs/concatjs_test.go @@ -8,6 +8,7 @@ import ( "path/filepath" "reflect" "strings" + "sync" "testing" "time" ) @@ -42,20 +43,27 @@ func TestWriteJSEscaped(t *testing.T) { } type fakeFileSystem struct { + mux sync.Mutex fakeReadFile func(filename string) ([]byte, error) fakeStatMtime func(filename string) (time.Time, error) fakeResolvePath func(root string, filename string) (string, error) } func (fs *fakeFileSystem) ReadFile(filename string) ([]byte, error) { + fs.mux.Lock() + defer fs.mux.Unlock() return fs.fakeReadFile(filename) } func (fs *fakeFileSystem) StatMtime(filename string) (time.Time, error) { + fs.mux.Lock() + defer fs.mux.Unlock() return fs.fakeStatMtime(filename) } -func (fs *fakeFileSystem) ResolvePath(root string, filename string) (string, error) { +func (fs *fakeFileSystem) ResolvePath(root string, filename string) (string, error) { + fs.mux.Lock() + defer fs.mux.Unlock() return fs.fakeResolvePath(root, filename) } @@ -167,7 +175,7 @@ func TestCustomFileResolving(t *testing.T) { } }, fakeStatMtime: func(filename string) (time.Time, error) { - return time.Now(), nil + return time.Now(), nil }, fakeResolvePath: func(root string, filename string) (string, error) { // For this test, we use an absolute root. This is similar to how From a7cec6eab502cf99ffcc81d388147aa9a572849c Mon Sep 17 00:00:00 2001 From: rjamet Date: Tue, 1 Oct 2019 07:39:01 -0700 Subject: [PATCH 217/316] Add the possibility to set a rule name in a conformanceRule's config. Tsetse's error whitelisting scheme, when used with Bazel, relies on the rule name as the key to the whitelist object, but our current autogenerated rule names for ConformancePattern rules won't cut it: there could be two different BANNED_NAME rules enabled in the same codebase, who'd have colliding names with the current naming rules. With this change, the configuration of a rule lets you specify its rule name to avoid that collision. PiperOrigin-RevId: 272206672 --- internal/tsetse/rule.ts | 5 ++++ .../tsetse/rules/conformance_pattern_rule.ts | 2 +- .../rule_creation_test.ts | 28 +++++++++++++++++++ internal/tsetse/util/pattern_config.ts | 6 ++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts diff --git a/internal/tsetse/rule.ts b/internal/tsetse/rule.ts index 96d888a6..7cc07a8b 100644 --- a/internal/tsetse/rule.ts +++ b/internal/tsetse/rule.ts @@ -6,6 +6,11 @@ import {Checker} from './checker'; * files. */ export abstract class AbstractRule { + /** + * A lower-dashed-case name for that rule. This is not used by Tsetse itself, + * but the integrators might (such as the TypeScript Bazel rules, for + * instance). + */ abstract readonly ruleName: string; abstract readonly code: number; diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index 0cbfe711..feb72c26 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -40,7 +40,7 @@ export class ConformancePatternRule implements AbstractRule { default: throw new Error('Config type not recognized, or not implemented yet.'); } - this.ruleName = `conformance-pattern-${config.kind}`; + this.ruleName = config.name || `conformance-pattern-${config.kind}`; } register(checker: Checker) { diff --git a/internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts b/internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts new file mode 100644 index 00000000..46cc1563 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts @@ -0,0 +1,28 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {customMatchers} from '../../util/testing/test_support'; + +describe('ConformancePatternRule creation', () => { + describe('naming', () => { + const baseConfig = { + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'], + }; + + it('generates a name by default', () => { + const rule = new ConformancePatternRule(baseConfig); + expect(rule.ruleName).toBe('conformance-pattern-banned-property-write'); + }); + + it('accepts given names', () => { + const namedConfig = {name: 'myRuleName', ...baseConfig}; + const rule = new ConformancePatternRule(namedConfig); + expect(rule.ruleName).toBe('myRuleName'); + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 216ce139..cb35d41c 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -31,6 +31,12 @@ export interface Config { /** A list of whitelist blocks. */ whitelistEntries?: WhitelistEntry[]; + + /** + * An optional name for that rule, which will be the rule's `ruleName`. + * Should be lower-dashed-case. + */ + name?: string; } /** From 120df73a921a4db5b7dc9e13195f7afaf8929107 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 1 Oct 2019 17:01:26 -0700 Subject: [PATCH 218/316] Change the --update_comments flag to only update taze comments when blaze can't find the dep. PiperOrigin-RevId: 272327174 --- ts_auto_deps/updater/updater.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index f606e5bb..d3ecc683 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -623,7 +623,6 @@ func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root, work } func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFilePath string, bld *build.File, srcs srcSet) (bool, error) { - platform.Infof("Updating sources") if len(srcs) == 0 && len(allTSRules(bld)) == 0 { // No TypeScript rules/sources, no need to update anything From 6597eadc55058d2a968d2c8bdf8d9e8efa4a91fa Mon Sep 17 00:00:00 2001 From: rjamet Date: Thu, 10 Oct 2019 06:42:54 -0700 Subject: [PATCH 219/316] Cleanup pass on the conformance_pattern tests. This change reorders some tests, and uniformizes them in the use of "toHaveFailures", which is far more descriptive when failing than just "1 expected to be 2". PiperOrigin-RevId: 273949911 --- .../ban_conformance_pattern/fixer_test.ts | 61 ++-- .../name_call_non_constant_argument_test.ts | 33 +- .../ban_conformance_pattern/name_test.ts | 50 ++- .../property_non_constant_write_test.ts | 12 +- .../property_write_test.ts | 163 +++++----- .../ban_conformance_pattern/whitelist_test.ts | 13 +- internal/tsetse/util/testing/test_support.ts | 297 ++++++++++-------- 7 files changed, 326 insertions(+), 303 deletions(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts index 24e53adb..59843a63 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts @@ -20,7 +20,7 @@ const uppercaseFixer: Fixer = { const uppercaseFixerBuilt: Fixer = buildReplacementFixer((node: ts.Node) => { return {replaceWith: node.getText().toUpperCase()}; -}) +}); // The initial config and source off which we run those checks. const baseConfig = { @@ -39,28 +39,26 @@ describe('ConformancePatternRule\'s fixer', () => { const rule = new ConformancePatternRule(baseConfig, uppercaseFixer); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1, baseConfig); - expect(results[0]).toBeFailureMatching({ + expect(results).toHaveFailuresMatching({ matchedCode: `q.cite = 'some example string'`, - messageText: 'found citation' + messageText: 'found citation', + fix: [ + {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} + ] }); - expect(results[0]).toHaveFixMatching([ - {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} - ]); }); it('for a single match (alternate fixer)', () => { const rule = new ConformancePatternRule(baseConfig, uppercaseFixerBuilt); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1, baseConfig); - expect(results[0]).toBeFailureMatching({ + expect(results).toHaveFailuresMatching({ matchedCode: `q.cite = 'some example string'`, - messageText: 'found citation' + messageText: 'found citation', + fix: [ + {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} + ] }); - expect(results[0]).toHaveFixMatching([ - {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} - ]); }); it('for several matches', () => { @@ -69,27 +67,30 @@ describe('ConformancePatternRule\'s fixer', () => { source + `q.cite = 'some other example string';\n`; const results = compileAndCheck(rule, sourceTwoMatches); - expect(results).toHaveNFailures(2, baseConfig); - expect(results[0]).toBeFailureMatching({ - matchedCode: `q.cite = 'some example string'`, - messageText: 'found citation' - }); - expect(results[1]).toBeFailureMatching({ - matchedCode: `q.cite = 'some other example string'`, - messageText: 'found citation' - }); - expect(results[0]).toHaveFixMatching([ - {start: 50, end: 80, replacement: `Q.CITE = 'SOME EXAMPLE STRING'`} - ]); + expect(results).toHaveFailuresMatching( + { + matchedCode: `q.cite = 'some example string'`, + messageText: 'found citation', + fix: [{ + start: 50, + end: 80, + replacement: `Q.CITE = 'SOME EXAMPLE STRING'` + }] + }, + { + matchedCode: `q.cite = 'some other example string'`, + messageText: 'found citation', + fix: [{ + start: 82, + end: 118, + replacement: `Q.CITE = 'SOME OTHER EXAMPLE STRING'` + }] + }); + expect(results[0].fixToReadableStringInContext()) .toBe( `Suggested fix:\n` + `- Replace the full match with: Q.CITE = 'SOME EXAMPLE STRING'`); - expect(results[1]).toHaveFixMatching([{ - start: 82, - end: 118, - replacement: `Q.CITE = 'SOME OTHER EXAMPLE STRING'` - }]); expect(results[1].fixToReadableStringInContext()) .toBe( `Suggested fix:\n` + diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts index 44c9a319..dba2664e 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts @@ -3,11 +3,12 @@ import {ConformancePatternRule, PatternKind} from '../../rules/conformance_patte import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { - const rule = new ConformancePatternRule({ + const config = { errorMessage: 'do not call bar.foo with non-literal 1st arg', kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, values: ['bar:0'] - }); + }; + const rule = new ConformancePatternRule(config); it('matches simple examples', () => { const sources = [ @@ -17,8 +18,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { ]; const results = compileAndCheck(rule, ...sources); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ + expect(results).toHaveFailuresMatching({ matchedCode: `foo.bar(window.name, 1)`, messageText: 'do not call bar.foo with non-literal 1st arg' }); @@ -31,7 +31,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { ]; const results = compileAndCheck(rule, ...sources); - expect(results.length).toBe(0); + expect(results).toHaveNoFailures(); }); it('looks at the right position', () => { @@ -48,13 +48,13 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { ]; const results = compileAndCheck(rule, ...sources); - expect(results.length).toBe(2); - expect(results[0]).toBeFailureMatching({ - matchedCode: `foo.aaa(1, window.name)`, - }); - expect(results[1]).toBeFailureMatching({ - matchedCode: `foo.bbb(window.name)`, - }); + expect(results).toHaveFailuresMatching( + { + matchedCode: `foo.aaa(1, window.name)`, + }, + { + matchedCode: `foo.bbb(window.name)`, + }); }); it('supports static methods', () => { @@ -72,8 +72,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { ]; const results = compileAndCheck(rule, ...sources); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ + expect(results).toHaveFailuresMatching({ matchedCode: `Car.buildFromParts(window.name)`, }); }); @@ -88,8 +87,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const sources = [`URL.createObjectURL(window.name);\n`]; const results = compileAndCheck(rule, ...sources); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ + expect(results).toHaveFailuresMatching({ matchedCode: `URL.createObjectURL(window.name)`, }); }); @@ -104,8 +102,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const sources = [`eval(window.name);\n`]; const results = compileAndCheck(rule, ...sources); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ + expect(results).toHaveFailuresMatching({ matchedCode: `eval(window.name)`, }); }); diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts index d3ffdd04..4e8609ce 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts @@ -4,39 +4,29 @@ import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_NAME', () => { it('matches simple example of globals', () => { - const rule = new ConformancePatternRule({ + const config = { errorMessage: 'no Infinity', kind: PatternKind.BANNED_NAME, values: ['Infinity'] - }); - const source = [ - `Infinity; 1+1;`, - ].join('\n'); - const results = compileAndCheck(rule, source); + }; + const source = `Infinity; 1+1;`; + const results = compileAndCheck(new ConformancePatternRule(config), source); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ - matchedCode: `Infinity`, - messageText: 'no Infinity' - }); + expect(results).toHaveFailuresMatching( + {matchedCode: `Infinity`, messageText: 'no Infinity'}); }); it('matches namespaced globals', () => { - const rule = new ConformancePatternRule({ + const config = { errorMessage: 'no blob url', kind: PatternKind.BANNED_NAME, values: ['URL.createObjectURL'] - }); - const source = [ - `URL.createObjectURL({});`, - ].join('\n'); - const results = compileAndCheck(rule, source); + }; + const source = `URL.createObjectURL({});`; + const results = compileAndCheck(new ConformancePatternRule(config), source); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ - matchedCode: `createObjectURL`, - messageText: 'no blob url' - }); + expect(results).toHaveFailuresMatching( + {matchedCode: `createObjectURL`, messageText: 'no blob url'}); }); it('does not choke on type aliases', () => { @@ -46,21 +36,21 @@ describe('BANNED_NAME', () => { // Symbols that verify ts.SymbolFlags.Alias, and ts.SymbolFlags.TypeAlias is // not acceptable (the typechecker will throw). + const config = { + errorMessage: 'should not trigger', + kind: PatternKind.BANNED_NAME, + values: ['whatever'] + }; const sources = [ `export type Foo = {bar: number, baz: (x:string)=>void}`, `import {Foo} from './file_0'; export const c: Foo["baz"] = (x:string)=>{};`, `import {c} from './file_1'; c(window.name);` ]; - const results = compileAndCheck( - new ConformancePatternRule({ - errorMessage: 'should not trigger', - kind: PatternKind.BANNED_NAME, - values: ['whatever'] - }), - ...sources); + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results.length).toBe(0); + expect(results).toHaveNoFailures(); }); }); diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts index b545571a..753e08a4 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts @@ -7,17 +7,15 @@ describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { const source = `const q = document.createElement('q');\n` + `q.cite = 'some example string';\n` + // literal `q.cite = window.name;\n`; // non-literal - const rule = new ConformancePatternRule({ + const config = { errorMessage: 'do not cite dynamically', kind: PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE, values: ['HTMLQuoteElement.prototype.cite'] - }); - const results = compileAndCheck(rule, source); + }; + const results = compileAndCheck(new ConformancePatternRule(config), source); - expect(results.length).toBe(1); - expect(results[0]) - .toBeFailureMatching( - {start: 71, end: 91, messageText: 'do not cite dynamically'}); + expect(results).toHaveFailuresMatching( + {start: 71, end: 91, messageText: 'do not cite dynamically'}); }); }); diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts index e0f32540..5aa9f564 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts @@ -3,77 +3,81 @@ import {ConformancePatternRule, PatternKind} from '../../rules/conformance_patte import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_PROPERTY_WRITE', () => { - const rule = new ConformancePatternRule({ - errorMessage: 'do not cite', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'] - }); + describe('simpler matcher tests', () => { + const config = { + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'] + }; + const rule = new ConformancePatternRule(config); - it('matches simple examples', () => { - const source = [ - `const q = document.createElement('q');`, - `q.cite = 'some example string';`, - ].join('\n'); - const results = compileAndCheck(rule, source); + it('matches simple examples', () => { + const source = [ + `const q = document.createElement('q');`, + `q.cite = 'some example string';`, + ].join('\n'); + const results = compileAndCheck(rule, source); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ - matchedCode: `q.cite = 'some example string'`, - messageText: 'do not cite' + expect(results).toHaveFailuresMatching({ + matchedCode: `q.cite = 'some example string'`, + messageText: 'do not cite' + }); }); - }); - it('matches precisely, even with whitespace or comments', () => { - const source = [ - `const q = document.createElement('q');`, - ` q.cite = 'exampleA';`, - `q.cite = 'exampleB' ;`, - `/* test1 */ q.cite = /* test2 */ 'exampleC' /* test3 */;`, - ].join('\n'); - const results = compileAndCheck(rule, source); + it('matches precisely, even with whitespace or comments', () => { + const source = [ + `const q = document.createElement('q');`, + ` q.cite = 'exampleA';`, + `q.cite = 'exampleB' ;`, + `/* test1 */ q.cite = /* test2 */ 'exampleC' /* test3 */;`, + ].join('\n'); + const results = compileAndCheck(rule, source); - expect(results.length).toBe(3); - expect(results[0]).toBeFailureMatching({ - matchedCode: `q.cite = 'exampleA'`, - messageText: 'do not cite' - }); - expect(results[1]).toBeFailureMatching({ - matchedCode: `q.cite = 'exampleB'`, - messageText: 'do not cite' - }); - expect(results[2]).toBeFailureMatching({ - matchedCode: `q.cite = /* test2 */ 'exampleC'`, - messageText: 'do not cite' + expect(results).toHaveFailuresMatching( + {matchedCode: `q.cite = 'exampleA'`, messageText: 'do not cite'}, + {matchedCode: `q.cite = 'exampleB'`, messageText: 'do not cite'}, { + matchedCode: `q.cite = /* test2 */ 'exampleC'`, + messageText: 'do not cite' + }); }); - }) - it('understands function prototypes', () => { - const source = [ - `function foo(q:HTMLQuoteElement) {`, - ` q.cite = 'some example string';`, - `}`, - ].join('\n'); - const results = compileAndCheck(rule, source); + it('understands function prototypes', () => { + const source = [ + `function foo(q:HTMLQuoteElement) {`, + ` q.cite = 'some example string';`, + `}`, + ].join('\n'); + const results = compileAndCheck(rule, source); - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ - matchedCode: `q.cite = 'some example string'`, - messageText: 'do not cite' + expect(results).toHaveFailuresMatching({ + matchedCode: `q.cite = 'some example string'`, + messageText: 'do not cite' + }); }); - }); - it('understands imported symbols', () => { - const sources = [ - `const q = document.createElement('q'); export {q};`, - `import {q} from './file_0'; q.cite = window.name;` - ]; - const results = compileAndCheck(rule, ...sources); - - expect(results.length).toBe(1); - expect(results[0]).toBeFailureMatching({ - matchedCode: 'q.cite = window.name', - fileName: 'file_1.ts', - messageText: 'do not cite', + it('understands imported symbols', () => { + const sources = [ + `const q = document.createElement('q'); export {q};`, + `import {q} from './file_0'; q.cite = window.name;` + ]; + const results = compileAndCheck(rule, ...sources); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'q.cite = window.name', + fileName: 'file_1.ts', + messageText: 'do not cite', + }); + }); + + it('understands shadowing', () => { + const source = [ + `const q = document.createElement('q');`, + `const f1 = (q: {cite: string}) => { q.cite = 'example 1'; };`, + ].join('\n'); + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNoFailures(); }); }); @@ -94,42 +98,27 @@ describe('BANNED_PROPERTY_WRITE', () => { }; it('banning Parent.x matches (instance of Child).x', () => { - const ruleOnParent = new ConformancePatternRule({ + const configOnParent = { errorMessage: 'found write to x', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['Parent.prototype.x'] - }); - const r = compileAndCheck(ruleOnParent, source); - expect(r.length).toBe(1); - expect(r[0]).toBeFailureMatching(expectedFailure); + }; + const ruleOnParent = new ConformancePatternRule(configOnParent); + const results = compileAndCheck(ruleOnParent, source); + + expect(results).toHaveFailuresMatching(expectedFailure); }); it('banning Child.x matches x defined on Parent', () => { - const ruleOnChild = new ConformancePatternRule({ + const configOnChild = { errorMessage: 'found write to x', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['Child.prototype.x'] - }); - const r = compileAndCheck(ruleOnChild, source); - expect(r.length).toBe(1); - expect(r[0]).toBeFailureMatching(expectedFailure); - }); - }); - - describe('with shadowing', () => { - it('does not over-match', () => { - const source = [ - `const q = document.createElement('q');`, - `const f1 = (q: {cite: string}) => { q.cite = 'example 1'; };`, - ].join('\n'); - const rule = new ConformancePatternRule({ - errorMessage: 'do not cite', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'] - }); - const results = compileAndCheck(rule, source); + }; + const ruleOnChild = new ConformancePatternRule(configOnChild); + const results = compileAndCheck(ruleOnChild, source); - expect(results.length).toBe(0); + expect(results).toHaveFailuresMatching(expectedFailure); }); }); }); diff --git a/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts b/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts index a1c7342c..93e17bd9 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts @@ -26,7 +26,7 @@ describe('ConformancePatternRule', () => { const rule = new ConformancePatternRule(config); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1, config); + expect(results).toHaveNFailures(1); }); it('matches if there is an empty whitelist group', () => { @@ -39,7 +39,7 @@ describe('ConformancePatternRule', () => { const rule = new ConformancePatternRule(config); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1, config); + expect(results).toHaveNFailures(1); }); it('respects prefix-based whitelists (matching test)', () => { @@ -53,7 +53,7 @@ describe('ConformancePatternRule', () => { const rule = new ConformancePatternRule(config); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(0, config); + expect(results).toHaveNoFailures(); }); it('respects prefix-based whitelists (non-matching test)', () => { @@ -67,7 +67,7 @@ describe('ConformancePatternRule', () => { const rule = new ConformancePatternRule(config); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1, config); + expect(results).toHaveNFailures(1); }); it('respects regex-based whitelists', () => { @@ -81,7 +81,7 @@ describe('ConformancePatternRule', () => { const rule = new ConformancePatternRule(config); const results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(0, config); + expect(results).toHaveNoFailures(); }); it('accepts several regex-based whitelists', () => { @@ -99,7 +99,7 @@ describe('ConformancePatternRule', () => { // Testing two times the same file so that both regexps match. const results = compileAndCheck(rule, source, source); - expect(results).toHaveNFailures(0, config); + expect(results).toHaveNoFailures(); }); it('throws on creation of invalid regexps', () => { @@ -111,6 +111,7 @@ describe('ConformancePatternRule', () => { }] }; expect(() => { + // tslint:disable-next-line:no-unused-expression new ConformancePatternRule(config); }).toThrowError(/Invalid regular expression/); }); diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index fb2460e3..e474ec72 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -9,7 +9,6 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {Failure, fixToString} from '../../failure'; import {AbstractRule} from '../../rule'; -import {Config} from '../pattern_config'; @@ -74,18 +73,146 @@ export function toFileName(f: Failure) { return file ? file.fileName : 'unknown'; } +/** + * Returns the location the temp directory for that platform (with forward + * slashes). + */ export function getTempDirForWhitelist() { // TS uses forward slashes on Windows ¯\_(ツ)_/¯ - return os.platform() == 'win32' ? os.tmpdir().replace(/\\/g, '/') : - os.tmpdir(); + return os.platform() === 'win32' ? os.tmpdir().replace(/\\/g, '/') : + os.tmpdir(); +} + +interface FailureExpectations { + fileName?: string; + start?: number; + end?: number; + matchedCode?: string; + messageText?: string; + fix?: FixExpectations; +} + +type FixExpectations = [{ + fileName?: string; + start?: number; + end?: number; + replacement?: string; +}]; + + +function failureMatchesExpectation( + f1: Failure, exp: FailureExpectations): {pass: boolean, message: string} { + const diagnostic = f1.toDiagnostic(); + let regrets = ''; + if (exp === undefined) { + regrets += 'The matcher requires two arguments. '; + } + if (exp.fileName) { + if (!diagnostic.file) { + regrets += `Expected diagnostic to have a source file, but it had ${ + diagnostic.file}. `; + } else if (!diagnostic.file.fileName.endsWith(exp.fileName)) { + regrets += + `Expected ${diagnostic.file.fileName} to end with ${exp.fileName}. `; + } + } + if (exp.messageText !== undefined && + exp.messageText !== diagnostic.messageText) { + regrets += + expectation('errorMessage', exp.messageText, diagnostic.messageText); + } + if (exp.start !== undefined && diagnostic.start !== exp.start) { + regrets += expectation('start', exp.start, diagnostic.start); + } + if (exp.end !== undefined && diagnostic.end !== exp.end) { + regrets += expectation('end', exp.end, diagnostic.end); + } + if (exp.matchedCode) { + if (!diagnostic.file) { + regrets += `Expected diagnostic to have a source file, but it had ${ + diagnostic.file}. `; + } else if (diagnostic.start === undefined) { + // I don't know how this could happen, but typings say so. + regrets += `Expected diagnostic to have a starting position. `; + } else { + const foundMatchedCode = diagnostic.file.getFullText().slice( + Number(diagnostic.start), diagnostic.end); + if (foundMatchedCode !== exp.matchedCode) { + regrets += `Expected diagnostic to match ${exp.matchedCode}, but was ${ + foundMatchedCode} (from ${Number(diagnostic.start)} to ${ + diagnostic.end}). `; + } + } + } + if (exp.fix) { + const {pass, message: fixMessage} = fixMatchesExpectation(f1, exp.fix); + if (!pass) { + regrets += fixMessage; + } + } + return {pass: regrets === '', message: regrets}; } -// Custom matcher for Jasmine, for a better experience matching fixes. +function fixMatchesExpectation(failure: Failure, expected: FixExpectations): + {pass: boolean, message: string} { + let regrets = ''; + const actualFix = failure.toDiagnostic().fix; + if (!actualFix) { + regrets += `Expected ${failure.toString()} to have fix ${ + JSON.stringify(expected)}. `; + } else if (actualFix.changes.length !== expected.length) { + regrets += `Expected ${expected.length} individual changes, got ${ + actualFix.changes.length}. `; + if (actualFix.changes.length) { + regrets += '\n' + fixToString(actualFix); + } + } else { + for (let i = 0; i < expected.length; i++) { + const e = expected[i]; + const a = actualFix.changes[i]; + if (e.start !== undefined && e.start !== a.start) { + regrets += + expectation(`${i}th individualChange's start`, e.start, a.start); + } + if (e.end !== undefined && e.end !== a.end) { + regrets += expectation(`${i}th individualChange's end`, e.end, a.end); + } + if (e.replacement !== undefined && e.replacement !== a.replacement) { + regrets += expectation( + `${i}th individualChange's replacement`, e.replacement, + a.replacement); + } + if (e.fileName !== undefined && e.fileName !== a.sourceFile.fileName) { + regrets += expectation( + `${i}th individualChange's fileName`, e.fileName, + a.sourceFile.fileName); + } + // TODO: Consider adding matchedCode as for the failure matcher. + } + } + + return {pass: regrets === '', message: regrets}; +} + + +/** + * Custom matcher for Jasmine, for a better experience matching failures and + * fixes. + */ export const customMatchers: jasmine.CustomMatcherFactories = { + toBeFailureMatching(): jasmine.CustomMatcher { + return {compare: failureMatchesExpectation}; + }, + + /** Checks that a Failure has the expected Fix field. */ + toHaveFixMatching(): jasmine.CustomMatcher { + return {compare: fixMatchesExpectation}; + }, + toHaveNFailures(): jasmine.CustomMatcher { return { - compare: (actual: Failure[], expected: Number, config?: Config) => { + compare: (actual: Failure[], expected: number) => { if (actual.length === expected) { return {pass: true}; } else { @@ -94,123 +221,33 @@ export const customMatchers: jasmine.CustomMatcherFactories = { if (actual.length) { message += '\n' + actual.map(f => f.toString()).join('\n'); } - if (config) { - message += `\nConfig: {kind:${config.kind}, values:${ - JSON.stringify(config.values)}, whitelist:${ - JSON.stringify(config.whitelistEntries)} }`; - } return {pass: false, message}; } } }; }, - toBeFailureMatching(): jasmine.CustomMatcher { + toHaveFailuresMatching(): jasmine.CustomMatcher { return { - compare: (actualFailure: Failure, exp: { - fileName?: string, - start?: number, - end?: number, - matchedCode?: string, - messageText?: string, - }) => { - const actualDiagnostic = actualFailure.toDiagnostic(); - let regrets = ''; - if (exp === undefined) { - regrets += 'The matcher requires two arguments. '; - } - if (exp.fileName) { - if (!actualDiagnostic.file) { - regrets += `Expected diagnostic to have a source file, but it had ${ - actualDiagnostic.file}. `; - } else if (!actualDiagnostic.file.fileName.endsWith(exp.fileName)) { - regrets += `Expected ${ - actualDiagnostic.file.fileName} to end with ${exp.fileName}. `; - } - } - if (exp.messageText !== undefined && - exp.messageText != actualDiagnostic.messageText) { - regrets += expectation( - 'errorMessage', exp.messageText, actualDiagnostic.messageText); - } - if (exp.start !== undefined && actualDiagnostic.start !== exp.start) { - regrets += expectation('start', exp.start, actualDiagnostic.start); - } - if (exp.end !== undefined && actualDiagnostic.end !== exp.end) { - regrets += expectation('end', exp.end, actualDiagnostic.end); - } - if (exp.matchedCode) { - if (!actualDiagnostic.file) { - regrets += `Expected diagnostic to have a source file, but it had ${ - actualDiagnostic.file}. `; - } else if (actualDiagnostic.start === undefined) { - // I don't know how this could happen, but typings say so. - regrets += `Expected diagnostic to have a starting position. `; - } else { - const foundMatchedCode = actualDiagnostic.file.getFullText().slice( - Number(actualDiagnostic.start), actualDiagnostic.end); - if (foundMatchedCode != exp.matchedCode) { - regrets += `Expected diagnostic to match ${ - exp.matchedCode}, but was ${foundMatchedCode} (from ${ - Number( - actualDiagnostic.start)} to ${actualDiagnostic.end}). `; - } + compare: (actual: Failure[], ...expected: FailureExpectations[]) => { + if (actual.length !== expected.length) { + let message = + `Expected ${expected} Failures, but found ${actual.length}.`; + if (actual.length) { + message += '\n' + actual.map(f => f.toString()).join('\n'); } + return {pass: false, message}; } - return {pass: regrets === '', message: regrets}; - } - }; - }, - - /** Checks that a Failure has the expected Fix field. */ - toHaveFixMatching(): jasmine.CustomMatcher { - return { - compare: (actualFailure: Failure, exp: [{ - fileName?: string, - start?: number, - end?: number, - replacement?: string - }]) => { - let regrets = ''; - const actualFix = actualFailure.toDiagnostic().fix; - if (!actualFix) { - regrets += `Expected ${actualFailure.toString()} to have fix ${ - JSON.stringify(exp)}. `; - } else if (actualFix.changes.length != exp.length) { - regrets += `Expected ${exp.length} individual changes, got ${ - actualFix.changes.length}. `; - if (actualFix.changes.length) { - regrets += '\n' + fixToString(actualFix); - } - } else { - for (let i = 0; i < exp.length; i++) { - const e = exp[i]; - const a = actualFix.changes[i]; - if (e.start !== undefined && e.start !== a.start) { - regrets += expectation( - `${i}th individualChange's start`, e.start, a.start); - } - if (e.end !== undefined && e.end !== a.end) { - regrets += - expectation(`${i}th individualChange's end`, e.end, a.end); - } - if (e.replacement !== undefined && - e.replacement !== a.replacement) { - regrets += expectation( - `${i}th individualChange's replacement`, e.replacement, - a.replacement); - } - if (e.fileName !== undefined && - e.fileName !== a.sourceFile.fileName) { - regrets += expectation( - `${i}th individualChange's fileName`, e.fileName, - a.sourceFile.fileName); - } - // TODO: Consider adding matchedCode as for the failure matcher. + let pass = true, message = ''; + for (let i = 0; i < actual.length; i++) { + const comparison = failureMatchesExpectation(actual[i], expected[i]); + pass = pass && comparison.pass; + if (comparison.message) { + message += `For failure ${i}: ${comparison.message}\n`; } + message += comparison.message; } - - return {pass: regrets === '', message: regrets}; + return {pass, message}; } }; }, @@ -227,11 +264,23 @@ export const customMatchers: jasmine.CustomMatcherFactories = { }; } }; - } + }, + toHaveNoFailures(): jasmine.CustomMatcher { + return { + compare: (actual: Failure[]) => { + if (actual.length !== 0) { + let message = `Expected no Failures, but found ${actual.length}.`; + message += '\n' + actual.map(f => f.toString()).join('\n'); + return {pass: false, message}; + } + return {pass: true, message: ''}; + } + }; + } }; -function expectation(fieldname: string, expectation: any, actual: any) { +function expectation(fieldname: string, expectation: T, actual: T) { return `Expected .${fieldname} to be ${expectation}, was ${actual}. `; } @@ -239,23 +288,21 @@ function expectation(fieldname: string, expectation: any, actual: any) { declare global { namespace jasmine { interface Matchers { - toBeFailureMatching(expected: { - fileName?: string, - start?: number, - end?: number, - matchedCode?: string, - messageText?: string, - }): void; + toBeFailureMatching(expected: FailureExpectations): void; - /** Checks that a Failure has the expected Fix field. */ - toHaveFixMatching(expected: [ - {fileName?: string, start?: number, end?: number, replacement?: string} - ]): void; - toHaveNFailures(expected: Number, config?: Config): void; + /** Checks that a Failure has the expected Fix field. */ + toHaveFixMatching(expected: FixExpectations): void; /** Asserts that a Failure has no fix. */ toHaveNoFix(): void; + + toHaveNFailures(expected: number): void; + + toHaveFailuresMatching(...expected: FailureExpectations[]): void; + + /** Asserts that the results are empty. */ + toHaveNoFailures(): void; } } } From d82d7e645053a977400e67ee6e644e8b0ed4c9fc Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 14 Oct 2019 05:37:44 -0700 Subject: [PATCH 220/316] Merge changes from Bazel: Allow sending and receiving work requests via proxy and multiplexer in the persistent worker protocol. PiperOrigin-RevId: 274560006 --- .../src/main/protobuf/worker_protocol.proto | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto index 4706792f..c628b7eb 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto @@ -38,14 +38,25 @@ message WorkRequest { // The inputs that the worker is allowed to read during execution of this // request. repeated Input inputs = 2; + + // To support multiplex worker, each WorkRequest must have an unique ID. This + // ID should be attached unchanged to the WorkResponse. + int32 request_id = 3; } -// The worker sends this message to Blaze when it finished its work on the WorkRequest message. +// The worker sends this message to Blaze when it finished its work on the +// WorkRequest message. message WorkResponse { int32 exit_code = 1; - // This is printed to the user after the WorkResponse has been received and is supposed to contain - // compiler warnings / errors etc. - thus we'll use a string type here, which gives us UTF-8 - // encoding. + // This is printed to the user after the WorkResponse has been received and is + // supposed to contain compiler warnings / errors etc. - thus we'll use a + // string type here, which gives us UTF-8 encoding. string output = 2; + + // To support multiplex worker, each WorkResponse must have an unique ID. + // Since worker processes which support multiplex worker will handle multiple + // WorkRequests in parallel, this ID will be used to determined which + // WorkerProxy does this WorkResponse belong to. + int32 request_id = 3; } From afaacdd2b2999bfffb4140574a1969d1a4555b0d Mon Sep 17 00:00:00 2001 From: evanm Date: Fri, 18 Oct 2019 07:37:54 -0700 Subject: [PATCH 221/316] Remove dependencies on builtin TypeScript typings PiperOrigin-RevId: 275468463 --- internal/tsetse/checker.ts | 1 - internal/tsetse/rules/check_return_value_rule.ts | 2 -- internal/tsetse/tests/ban_promise_as_condition/BUILD | 4 ---- internal/tsetse/tests/must_use_promises/BUILD | 2 -- internal/tsetse/util/match_symbol.ts | 2 -- 5 files changed, 11 deletions(-) diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 9fba3b70..9eef4165 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -3,7 +3,6 @@ * file AST traversals and report errors. */ - import * as ts from 'typescript'; import {Failure, Fix} from './failure'; diff --git a/internal/tsetse/rules/check_return_value_rule.ts b/internal/tsetse/rules/check_return_value_rule.ts index 8ba125c3..d52a0f7a 100644 --- a/internal/tsetse/rules/check_return_value_rule.ts +++ b/internal/tsetse/rules/check_return_value_rule.ts @@ -1,5 +1,3 @@ - - /** * @fileoverview A Tsetse rule that checks the return value of certain functions * must be used. diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 0e7e07d5..29073e1b 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -37,8 +37,6 @@ ts_library( "\(45,34\).*" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", - deps = [ - ], ) ts_library( @@ -46,6 +44,4 @@ ts_library( testonly = 1, srcs = ["negatives.ts"], tsconfig = "//internal:tsetse/tsconfig.json", - deps = [ - ], ) diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index eb9dcde9..20372cd7 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -32,6 +32,4 @@ ts_library( "\(34,3\)" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", - deps = [ - ], ) diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index eb588e8f..f446e194 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -1,5 +1,3 @@ - - import * as ts from 'typescript'; import {dealias, debugLog, isAmbientDeclaration, isDeclaration, isInStockLibraries, isPartOfImportStatement} from './ast_tools'; From 070b0324db8b6db67626dea772dc5d1bf5f26127 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Fri, 18 Oct 2019 16:09:07 -0700 Subject: [PATCH 222/316] Add jasmine_node_test to the list of test rules that taze recognizes. PiperOrigin-RevId: 275565383 --- ts_auto_deps/updater/test_register.go | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index ac6c1fba..cc6bdc2c 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -6,6 +6,7 @@ import ( "path/filepath" "github.com/bazelbuild/buildtools/build" + "github.com/bazelbuild/buildtools/edit" "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" ) @@ -214,3 +215,37 @@ func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, rt.kind(), target) return "", nil } + +var wellKnownBuildRules = []struct { + name string + attrName string +}{ + { + name: "karma_polymer_test", + attrName: "test_ts_deps", + }, + { + name: "wct_closure_test_suite", + attrName: "js_deps", + }, + { + name: "jasmine_node_test", + attrName: "deps", + }, +} + +// isRegisteredWithAlternateTestRule returns true if the rule is already +// registered with a well known test rule, such as karma_polymer_test, +// wct_closure_test_suite or jasmine_node_test. +func isRegisteredWithAlternateTestRule(bld *build.File, r *build.Rule, dep string) bool { + pkg := filepath.Dir(bld.Path) + for _, wkbr := range wellKnownBuildRules { + if isKind(r, wkbr.name) { + testTsDeps := r.Attr(wkbr.attrName) + if edit.ListFind(testTsDeps, dep, pkg) != nil { + return true + } + } + } + return false +} From 63e9ed69a8689934fb6e2f56ff3de3f4df8e5871 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 22 Oct 2019 17:12:11 -0700 Subject: [PATCH 223/316] Add karma_web_test_suite to the list of well-known test rules. PiperOrigin-RevId: 276176210 --- ts_auto_deps/updater/test_register.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index cc6bdc2c..1c15cb9e 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -232,6 +232,10 @@ var wellKnownBuildRules = []struct { name: "jasmine_node_test", attrName: "deps", }, + { + name: "karma_web_test_suite", + attrName: "deps", + }, } // isRegisteredWithAlternateTestRule returns true if the rule is already From 956189ea76a8ed84d6e522b052f9c2827b8ecbb0 Mon Sep 17 00:00:00 2001 From: rjamet Date: Thu, 24 Oct 2019 06:52:47 -0700 Subject: [PATCH 224/316] Improve the spacing of suggested fix stringifications. Suggested fixes used to include line breaks, but that makes everything more confusing. Instead, trim each suggested fix, so that whitespace stays consistent. PiperOrigin-RevId: 276478533 --- internal/tsetse/failure.ts | 16 ++++-- .../ban_conformance_pattern/fixer_test.ts | 57 ++++++++++++++----- internal/tsetse/util/testing/test_support.ts | 8 +-- 3 files changed, 57 insertions(+), 24 deletions(-) diff --git a/internal/tsetse/failure.ts b/internal/tsetse/failure.ts index 317faf40..02ccd48e 100644 --- a/internal/tsetse/failure.ts +++ b/internal/tsetse/failure.ts @@ -66,30 +66,38 @@ export class Failure { let fixText = ''; for (const c of f.changes) { + // Remove leading/trailing whitespace from the stringified suggestions: + // since we add line breaks after each line of stringified suggestion, and + // since users will manually apply the fix, there is no need to show + // trailing whitespace. This is however just for stringification of the + // fixes: the suggested fix itself still keeps trailing whitespace. + const printableReplacement = c.replacement.trim(); + // Insertion. if (c.start === c.end) { // Try to see if that's an import. if (c.replacement.indexOf('import') !== -1) { - fixText += `- Add new import: ${c.replacement}\n`; + fixText += `- Add new import: ${printableReplacement}\n`; } else { // Insertion that's not a full import. This should rarely happen in // our context, and we don't have a great message for these. // For instance, this could be the addition of a new symbol in an // existing import (`import {foo}` becoming `import {foo, bar}`). fixText += `- Insert ${this.readableRange(c.start, c.end)}: ${ - c.replacement}\n`; + printableReplacement}\n`; } } else if (c.start === this.start && c.end === this.end) { // We assume the replacement is the main part of the fix, so put that // individual change first in `fixText`. - fixText = `- Replace the full match with: ${c.replacement}\n` + fixText; + fixText = `- Replace the full match with: ${printableReplacement}\n` + + fixText; } else { // Fallback case: Use a numerical range to specify a replacement. In // general, falling through in this case should be avoided, as it's not // really readable without an IDE (the range can be outside of the // matched code). fixText = `- Replace ${this.readableRange(c.start, c.end)} with: ` + - `${c.replacement}\n${fixText}`; + `${printableReplacement}\n${fixText}`; } } diff --git a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts index 59843a63..afd91779 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts @@ -100,11 +100,20 @@ describe('ConformancePatternRule\'s fixer', () => { describe('adds imports', () => { const addNamedImportFixer: Fixer = { - getFixForFlaggedNode(n: ts.Node) { - const ic = + getFixForFlaggedNode(n: ts.Node): Fix | + undefined { + const changes = []; + const ic1 = maybeAddNamedImport(n.getSourceFile(), 'foo', './file_1', 'bar'); - if (ic) return {changes: [ic]}; - return; + if (ic1) { + changes.push(ic1); + } + const ic2 = + maybeAddNamedImport(n.getSourceFile(), 'foo2', './file_2', 'bar2'); + if (ic2) { + changes.push(ic2); + } + return changes.length ? {changes} : undefined; } }; @@ -112,15 +121,23 @@ describe('ConformancePatternRule\'s fixer', () => { const results = compileAndCheck( new ConformancePatternRule(baseConfig, addNamedImportFixer), source); - expect(results[0]).toHaveFixMatching([{ - start: 0, - end: 0, - replacement: `import {foo as bar} from './file_1';\n` - }]); + expect(results[0]).toHaveFixMatching([ + { + start: 0, + end: 0, + replacement: `import {foo as bar} from './file_1';\n` + }, + { + start: 0, + end: 0, + replacement: `import {foo2 as bar2} from './file_2';\n` + } + ]); expect(results[0].fixToReadableStringInContext()) .toBe( `Suggested fix:\n` + - `- Add new import: import {foo as bar} from './file_1';`); + `- Add new import: import {foo as bar} from './file_1';\n` + + `- Add new import: import {foo2 as bar2} from './file_2';`); }); it('maybeAddNamedImport already there', () => { @@ -129,8 +146,15 @@ describe('ConformancePatternRule\'s fixer', () => { 'import {foo as bar} from \'./file_1\';\n' + source, 'export const foo = 1;'); - expect(results[0]).toHaveNoFix(); - expect(results[0].fixToReadableStringInContext()).toBe(''); + expect(results[0]).toHaveFixMatching([{ + start: 37, + end: 37, + replacement: `import {foo2 as bar2} from './file_2';\n` + }]); + expect(results[0].fixToReadableStringInContext()) + .toBe( + `Suggested fix:\n` + + `- Add new import: import {foo2 as bar2} from './file_2';`); }); it('maybeAddNamedImport different name', () => { @@ -140,12 +164,17 @@ describe('ConformancePatternRule\'s fixer', () => { 'export const foo = 1;'); expect(results[0]).toHaveFixMatching([ - {start: 8, end: 8, replacement: `foo as bar, `} + {start: 8, end: 8, replacement: `foo as bar, `}, { + start: 37, + end: 37, + replacement: `import {foo2 as bar2} from './file_2';\n` + } ]); expect(results[0].fixToReadableStringInContext()) .toBe( `Suggested fix:\n` + - `- Insert at line 1, char 9: foo as bar,`); + `- Insert at line 1, char 9: foo as bar,\n` + + `- Add new import: import {foo2 as bar2} from './file_2';`); }); it('maybeAddNamespacedImport', () => { diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index e474ec72..bfbc78b1 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -92,12 +92,8 @@ interface FailureExpectations { fix?: FixExpectations; } -type FixExpectations = [{ - fileName?: string; - start?: number; - end?: number; - replacement?: string; -}]; +type FixExpectations = Array< + {fileName?: string; start?: number; end?: number; replacement?: string;}>; function failureMatchesExpectation( From 253bc78ff00a93653d502ea12caf2c78c84e82a5 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Thu, 24 Oct 2019 11:38:26 -0700 Subject: [PATCH 225/316] Switch rules_nodejs load points from defs.bzl to index.bzl The former is about to be removed. PiperOrigin-RevId: 276532382 --- BUILD.bazel | 16 +++++++++------- WORKSPACE | 2 +- internal/BUILD.bazel | 4 ++-- .../tsetse/tests/ban_expect_truthy_promise/BUILD | 2 +- .../tsetse/tests/ban_promise_as_condition/BUILD | 2 +- internal/tsetse/tests/check_return_value/BUILD | 2 +- internal/tsetse/tests/equals_nan/BUILD | 2 +- internal/tsetse/tests/must_use_promises/BUILD | 2 +- package.bzl | 4 ++-- package.json | 4 ++-- yarn.lock | 8 ++++---- 11 files changed, 25 insertions(+), 23 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index d5422316..7f69e55b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,10 +19,12 @@ # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") -load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_package") -exports_files(["LICENSE", "tsconfig.json"]) +exports_files([ + "LICENSE", + "tsconfig.json", +]) gazelle( name = "gazelle", @@ -33,18 +35,18 @@ gazelle( npm_package( name = "npm_bazel_typescript_package", srcs = [ - "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", "//internal:npm_package_assets", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets", ], + visibility = ["//visibility:public"], deps = [ - "//internal:generated_BUILD", - "//internal:tsc_wrapped", "//devserver:devserver-darwin", "//devserver:devserver-linux", "//devserver:devserver-windows", + "//internal:generated_BUILD", + "//internal:tsc_wrapped", "//ts_auto_deps:ts_auto_deps-darwin", "//ts_auto_deps:ts_auto_deps-linux", "//ts_auto_deps:ts_auto_deps-windows", ], - visibility = ["//visibility:public"], ) diff --git a/WORKSPACE b/WORKSPACE index f4157f29..c03057d0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -23,7 +23,7 @@ load("//:package.bzl", "rules_typescript_dev_dependencies") rules_typescript_dev_dependencies() # Setup nodejs toolchain -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") # Download npm dependencies yarn_install( diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 5eb31904..0c70b531 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -14,7 +14,7 @@ # gazelle:exclude worker_protocol.proto -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:index.bzl", "ts_library") @@ -81,12 +81,12 @@ nodejs_binary( name = "tsc_wrapped_bin", data = [ ":tsc_wrapped", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", "@npm//protobufjs", "@npm//source-map-support", "@npm//tsickle", "@npm//tsutils", "@npm//typescript", - "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", ], entry_point = ":tsc_wrapped/tsc_wrapped.ts", visibility = ["//visibility:public"], diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index c8a7fa36..13772f98 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@npm_bazel_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 29073e1b..019903df 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@npm_bazel_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index c319f132..2afcf62e 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@npm_bazel_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index 77062536..5fb48ffd 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@npm_bazel_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index 20372cd7..8b9b2f71 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@npm_bazel_typescript//:defs.bzl", "ts_library") +load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 diff --git a/package.bzl b/package.bzl index 792940d0..2e4473d8 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "da72ea53fa1cb8ab5ef7781ba06b97259b7d579a431ce480476266bc81bdf21d", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.36.2/rules_nodejs-0.36.2.tar.gz"], + sha256 = "26c39450ce2d825abee5583a43733863098ed29d3cbaebf084ebaca59a21a1c8", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.0/rules_nodejs-0.39.0.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index 9a86e265..320fed56 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "@bazel/bazel": "^0.26.0", "@bazel/buildifier": "^0.20.0", "@bazel/ibazel": "^0.2.0", - "@bazel/jasmine": "^0.32.0", - "@bazel/typescript": "^0.32.0", + "@bazel/jasmine": "^0.39.0", + "@bazel/typescript": "^0.39.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "10.12.20", diff --git a/yarn.lock b/yarn.lock index f14d230c..41251e7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -131,10 +131,10 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q== -"@types/node@7.0.18": - version "7.0.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" - integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM= +"@types/node@10.12.20": + version "10.12.20" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.20.tgz#f79f959acd3422d0889bd1ead1664bd2d17cd367" + integrity sha512-9spv6SklidqxevvZyOUGjZVz4QRXGu2dNaLyXIFzFYZW0AGDykzPRIUFJXTlQXyfzAucddwTcGtJNim8zqSOPA== "@types/node@^10.1.0": version "10.14.6" From 36019ce195fc54ddabc75defaadf597e1139f69d Mon Sep 17 00:00:00 2001 From: alexeagle Date: Thu, 24 Oct 2019 13:42:17 -0700 Subject: [PATCH 226/316] Update one more reference to rules_nodejs defs.bzl that I missed. Now it is green when consumed downstream. PiperOrigin-RevId: 276556510 --- internal/ts_repositories.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index 929db7d1..90a1c1a9 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -20,7 +20,7 @@ load("@bazel_gazelle//:deps.bzl", "go_repository") # END-DEV-ONLY -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version") +load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "check_rules_nodejs_version") def ts_setup_workspace(): """This repository rule should be called from your WORKSPACE file. From fda81975d3f6aad7fcd97933b1e36db1f1758514 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Wed, 6 Nov 2019 12:18:40 -0800 Subject: [PATCH 227/316] Refactor tsc_wrapped's runFromOptions to be more composable. This allows other tools to reproduce tsc_wrapped's compiler configuration & plugin setup with fidelity. The refactoring moves any console printing out of the former `runFromOptions`, renames it to `createProgramAndEmit()`, and handles console emit on the caller level. It also required observing `options.noEmit` in several locations that'd previously write files unconditionally. PiperOrigin-RevId: 278914685 --- internal/tsc_wrapped/tsc_wrapped.ts | 90 +++++++++++++++++++---------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 280d7339..e73ece5f 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -118,26 +118,26 @@ export function gatherDiagnostics( * TODO: Call sites of getDiagnostics should initialize plugins themselves, * including these, and the arguments to getDiagnostics should be simplified. */ -export function* - getCommonPlugins( - options: ts.CompilerOptions, bazelOpts: BazelOptions, - program: ts.Program, - disabledTsetseRules: string[]): Iterable { +export function getCommonPlugins( + options: ts.CompilerOptions, bazelOpts: BazelOptions, program: ts.Program, + disabledTsetseRules: string[]): DiagnosticPlugin[] { + const plugins: DiagnosticPlugin[] = []; if (!bazelOpts.disableStrictDeps) { if (options.rootDir == null) { throw new Error(`StrictDepsPlugin requires that rootDir be specified`); } - yield new StrictDepsPlugin(program, { + plugins.push(new StrictDepsPlugin(program, { ...bazelOpts, rootDir: options.rootDir, - }); + })); } if (!bazelOpts.isJsTranspilation) { let tsetsePluginConstructor: {new (program: ts.Program, disabledRules: string[]): DiagnosticPlugin} = BazelConformancePlugin; - yield new tsetsePluginConstructor(program, disabledTsetseRules); + plugins.push(new tsetsePluginConstructor(program, disabledTsetseRules)); } + return plugins; } /** @@ -250,17 +250,27 @@ function runOneBuild( const perfTracePath = bazelOpts.perfTracePath; if (!perfTracePath) { - return runFromOptions( + const {diagnostics} = createProgramAndEmit( fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, angularCompilerOptions); + if (diagnostics.length > 0) { + console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); + return false; + } + return true; } log('Writing trace to', perfTracePath); - const success = perfTrace.wrap( - 'runOneBuild', - () => runFromOptions( - fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, - angularCompilerOptions)); + const success = perfTrace.wrap('runOneBuild', () => { + const {diagnostics} = createProgramAndEmit( + fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, + angularCompilerOptions); + if (diagnostics.length > 0) { + console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); + return false; + } + return true; + }); if (!success) return false; // Force a garbage collection pass. This keeps our memory usage // consistent across multiple compilations, and allows the file @@ -279,10 +289,32 @@ function runOneBuild( const expectDiagnosticsWhitelist: string[] = [ ]; -function runFromOptions( +/** errorDiag produces an error diagnostic not bound to a file or location. */ +function errorDiag(messageText: string) { + return { + category: ts.DiagnosticCategory.Error, + code: 0, + file: undefined, + start: undefined, + length: undefined, + messageText, + }; +} + +/** + * createProgramAndEmit creates a ts.Program from the given options and emits it + * according to them (e.g. including running various plugins and tsickle). It + * returns the program and any diagnostics generated. + * + * Callers should check and emit diagnostics. + */ +export function createProgramAndEmit( fileLoader: FileLoader, options: ts.CompilerOptions, bazelOpts: BazelOptions, files: string[], disabledTsetseRules: string[], - angularCompilerOptions?: {[key: string]: unknown}): boolean { + angularCompilerOptions?: {[key: string]: unknown}): + {program?: ts.Program, diagnostics: ts.Diagnostic[]} { + // Beware! createProgramAndEmit must not print to console, nor exit etc. + // Handle errors by reporting and returning diagnostics. perfTrace.snapshotMemoryUsage(); cache.resetStats(); cache.traceStats(); @@ -313,10 +345,11 @@ function runFromOptions( const ngtsc = require('@angular/compiler-cli'); angularPlugin = new ngtsc.NgTscPlugin(ngOptions); } catch (e) { - console.error(e); - throw new Error( - 'when using `ts_library(compile_angular_templates=True)`, ' + - 'you must install @angular/compiler-cli'); + return { + diagnostics: [errorDiag( + 'when using `ts_library(compile_angular_templates=True)`, ' + + `you must install @angular/compiler-cli (was: ${e})`)] + }; } // Wrap host only needed until after Ivy cleanup @@ -345,17 +378,15 @@ function runFromOptions( diagnostics = bazelDiagnostics.filterExpected( bazelOpts, diagnostics, bazelDiagnostics.uglyFormat); } else if (bazelOpts.expectedDiagnostics.length > 0) { - console.error( + diagnostics.push(errorDiag( `Only targets under ${ expectDiagnosticsWhitelist.join(', ')} can use ` + - 'expected_diagnostics, but got', - bazelOpts.target); + 'expected_diagnostics, but got ' + bazelOpts.target)); } if (diagnostics.length > 0) { - console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); debug('compilation failed at', new Error().stack!); - return false; + return {program, diagnostics}; } } @@ -383,13 +414,10 @@ function runFromOptions( } if (diagnostics.length > 0) { - console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); debug('compilation failed at', new Error().stack!); - return false; } - cache.printStats(); - return true; + return {program, diagnostics}; } function emitWithTypescript( @@ -465,7 +493,7 @@ export function emitWithTsickle( optTsickle.getGeneratedExterns(emitResult.externs, options.rootDir!); } - if (bazelOpts.tsickleExternsPath) { + if (!options.noEmit && bazelOpts.tsickleExternsPath) { // Note: when tsickleExternsPath is provided, we always write a file as a // marker that compilation succeeded, even if it's empty (just containing an // @externs). @@ -493,7 +521,7 @@ export function emitWithTsickle( } } - if (bazelOpts.manifest) { + if (!options.noEmit && bazelOpts.manifest) { perfTrace.wrap('manifest', () => { const manifest = constructManifest(emitResult.modulesManifest, compilerHost); From 6025189fb616c765ab059cdb42b3ec61e562f7a0 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 14 Nov 2019 08:46:48 -0800 Subject: [PATCH 228/316] Avoid recursively adding depth to depsets in rules_typescript PiperOrigin-RevId: 280437642 --- internal/common/compilation.bzl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 1bcf2bc4..eff18468 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -459,14 +459,11 @@ def compile_ts( if not is_library: files_depsets.append(depset(tsickle_externs)) - transitive_es6_sources = depset() + transitive_es6_sources_sets = [es6_sources] for dep in deps: if hasattr(dep, "typescript"): - transitive_es6_sources = depset(transitive = [ - transitive_es6_sources, - dep.typescript.transitive_es6_sources, - ]) - transitive_es6_sources = depset(transitive = [transitive_es6_sources, es6_sources]) + transitive_es6_sources_sets += [dep.typescript.transitive_es6_sources] + transitive_es6_sources = depset(transitive = transitive_es6_sources_sets) return { "providers": [ From 9cfd676f634e2f3e7329388e1a5392b5dec45520 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Thu, 14 Nov 2019 13:41:06 -0800 Subject: [PATCH 229/316] Add boq_jswire_test_library to the list of well known tests to ignore for ts_development_sources registration. PiperOrigin-RevId: 280501723 --- ts_auto_deps/updater/test_register.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index 1c15cb9e..0f51e63b 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -236,6 +236,10 @@ var wellKnownBuildRules = []struct { name: "karma_web_test_suite", attrName: "deps", }, + { + name: "boq_jswire_test_library", + attrName: "deps", + }, } // isRegisteredWithAlternateTestRule returns true if the rule is already From 0421847622f1afa4289f77ef0bf6589ebb5d3821 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 18 Nov 2019 17:15:11 -0800 Subject: [PATCH 230/316] Internal change. PiperOrigin-RevId: 281188652 --- internal/common/compilation.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index eff18468..3b10700b 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -517,6 +517,7 @@ def compile_ts( # This allows users of compile_ts to modify or augment the returned dict before # converting it to an immutable struct. def ts_providers_dict_to_struct(d): + for key, value in d.items(): if key != "output_groups" and type(value) == type({}): d[key] = struct(**value) From 09d88673f43b0fece798fdc424160c646a27a83b Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 19 Nov 2019 13:19:16 -0800 Subject: [PATCH 231/316] Revert the behavior of taze --update_comments. PiperOrigin-RevId: 281364300 --- ts_auto_deps/updater/updater.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index d3ecc683..f606e5bb 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -623,6 +623,7 @@ func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root, work } func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFilePath string, bld *build.File, srcs srcSet) (bool, error) { + platform.Infof("Updating sources") if len(srcs) == 0 && len(allTSRules(bld)) == 0 { // No TypeScript rules/sources, no need to update anything From fdc1e3829de2bbb37e40085606ec4da3501d79b5 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 22 Nov 2019 10:44:42 -0800 Subject: [PATCH 232/316] Internal change. PiperOrigin-RevId: 281998457 --- internal/common/compilation.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 3b10700b..72a81d34 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -50,7 +50,7 @@ COMMON_ATTRIBUTES = { # any closure JS code. "runtime_deps": attr.label_list( default = [], - providers = ["js"], + providers = [JsInfo], ), "deps": attr.label_list(aspects = DEPS_ASPECTS), "_additional_d_ts": _ADDITIONAL_D_TS, @@ -72,7 +72,7 @@ def assert_js_or_typescript_deps(ctx, deps = None): # Fallback to `ctx.attr.deps`. deps = deps if deps != None else ctx.attr.deps for dep in deps: - if not hasattr(dep, "typescript") and not hasattr(dep, "js"): + if not hasattr(dep, "typescript") and not JsInfo in dep: allowed_deps_msg = "Dependencies must be ts_library" fail("%s is neither a TypeScript nor a JS producing rule.\n%s\n" % (dep.label, allowed_deps_msg)) From 62bbdc8b3b4f9a8222b135648e8e425e23cad056 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 22 Nov 2019 16:51:56 -0800 Subject: [PATCH 233/316] Fix breakage shown in downstream build when adopting new version See https://github.com/bazelbuild/rules_nodejs/pull/1386 PiperOrigin-RevId: 282069060 --- internal/common/compilation.bzl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 72a81d34..6d1aa9f7 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -29,6 +29,9 @@ _ADDITIONAL_D_TS = attr.label_list( allow_files = True, ) +# Mock out the JsInfo blaze-only provider +JsInfo = provider() + # Attributes shared by any typescript-compatible rule (ts_library, ng_module) COMMON_ATTRIBUTES = { "data": attr.label_list( From c91cf13ab47bccbc05ef30a347f994b20142b79c Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 25 Nov 2019 12:41:38 -0800 Subject: [PATCH 234/316] Fix generic comparisons on protobuf messages Generated protobuf messages contain internal data structures that general purpose comparison functions (e.g., reflect.DeepEqual, pretty.Compare, etc) do not properly compare. It is already the case today that these functions may report a difference when two messages are actually semantically equivalent. Fix all usages by either calling proto.Equal directly if the top-level types are themselves proto.Message, or by calling cmp.Equal with the cmp.Comparer(proto.Equal) option specified. This option teaches cmp to use proto.Equal anytime it encounters proto.Message types. PiperOrigin-RevId: 282412693 --- internal/ts_repositories.bzl | 6 + ts_auto_deps/analyze/BUILD.bazel | 37 ---- ts_auto_deps/analyze/analyze.go | 34 +-- ts_auto_deps/analyze/analyze_test.go | 16 +- ts_auto_deps/analyze/imports.go | 38 ++-- ts_auto_deps/analyze/imports_test.go | 6 +- ts_auto_deps/analyze/loader.go | 36 +-- ts_auto_deps/analyze/loader_test.go | 5 +- ts_auto_deps/main.go | 2 +- ts_auto_deps/platform/BUILD.bazel | 12 - ts_auto_deps/platform/file.go | 41 ++-- ts_auto_deps/platform/file.go.oss | 54 +++++ ts_auto_deps/platform/log.go | 12 +- ts_auto_deps/platform/log.go.oss | 22 ++ ts_auto_deps/platform/walk.go | 19 +- ts_auto_deps/platform/walk.go.oss | 15 ++ ts_auto_deps/proto/BUILD.bazel | 22 -- ts_auto_deps/proto/analyze_result.proto | 6 +- ts_auto_deps/updater/BUILD.bazel | 32 --- ts_auto_deps/updater/comments.go | 208 ++++++++++++++++++ ts_auto_deps/updater/comments_test.go | 184 ++++++++++++++++ ts_auto_deps/updater/internal_rules.go | 125 +++++++++++ ts_auto_deps/updater/internal_updater_test.go | 86 ++++++++ ts_auto_deps/updater/test_register.go | 20 +- ts_auto_deps/updater/updater.go | 176 ++++++++------- ts_auto_deps/updater/updater_test.go | 23 +- ts_auto_deps/workspace/BUILD.bazel | 9 - ts_auto_deps/workspace/workspace.go | 21 +- ts_auto_deps/workspace/workspace.go.oss | 13 ++ 29 files changed, 958 insertions(+), 322 deletions(-) delete mode 100644 ts_auto_deps/analyze/BUILD.bazel delete mode 100644 ts_auto_deps/platform/BUILD.bazel create mode 100644 ts_auto_deps/platform/file.go.oss create mode 100644 ts_auto_deps/platform/log.go.oss create mode 100644 ts_auto_deps/platform/walk.go.oss delete mode 100644 ts_auto_deps/proto/BUILD.bazel delete mode 100644 ts_auto_deps/updater/BUILD.bazel create mode 100644 ts_auto_deps/updater/comments.go create mode 100644 ts_auto_deps/updater/comments_test.go create mode 100644 ts_auto_deps/updater/internal_rules.go create mode 100644 ts_auto_deps/updater/internal_updater_test.go delete mode 100644 ts_auto_deps/workspace/BUILD.bazel create mode 100644 ts_auto_deps/workspace/workspace.go.oss diff --git a/internal/ts_repositories.bzl b/internal/ts_repositories.bzl index 90a1c1a9..30cb4053 100644 --- a/internal/ts_repositories.bzl +++ b/internal/ts_repositories.bzl @@ -46,6 +46,12 @@ def ts_setup_dev_workspace(): ts_setup_workspace() + go_repository( + name = "com_github_google_go_cmp", + commit = "2d0692c2e9617365a95b295612ac0d4415ba4627", + importpath = "github.com/google/go-cmp", + ) + go_repository( name = "com_github_kylelemons_godebug", commit = "d65d576e9348f5982d7f6d83682b694e731a45c6", diff --git a/ts_auto_deps/analyze/BUILD.bazel b/ts_auto_deps/analyze/BUILD.bazel deleted file mode 100644 index 29213ce8..00000000 --- a/ts_auto_deps/analyze/BUILD.bazel +++ /dev/null @@ -1,37 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "analyze.go", - "imports.go", - "loader.go", - ], - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/analyze", - visibility = ["//visibility:public"], - deps = [ - "//ts_auto_deps/platform:go_default_library", - "//ts_auto_deps/proto:go_default_library", - "//ts_auto_deps/workspace:go_default_library", - "@com_github_bazelbuild_buildtools//build_proto:go_default_library", - "@com_github_bazelbuild_buildtools//edit:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "analyze_test.go", - "imports_test.go", - "loader_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//ts_auto_deps/platform:go_default_library", - "//ts_auto_deps/proto:go_default_library", - "@com_github_bazelbuild_buildtools//build_proto:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_kylelemons_godebug//pretty:go_default_library", - ], -) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go index 9e005cce..00bb81ac 100644 --- a/ts_auto_deps/analyze/analyze.go +++ b/ts_auto_deps/analyze/analyze.go @@ -1,4 +1,4 @@ -// Package analyze uses bazel query to determine and locate missing imports +// Package analyze uses blaze query to determine and locate missing imports // in TypeScript source files. package analyze @@ -10,13 +10,13 @@ import ( "regexp" "strings" - "github.com/bazelbuild/buildtools/edit" + "google3/net/proto2/go/proto" + "google3/third_party/bazel_buildifier/edit/edit" "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - "github.com/golang/protobuf/proto" - appb "github.com/bazelbuild/buildtools/build_proto" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" + arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" ) var ( @@ -97,7 +97,7 @@ func New(loader TargetLoader) *Analyzer { // Analyze generates a dependency report for each target label in labels. // -// dir is the directory that ts_auto_deps should execute in. Must be a sub-directory +// dir is the directory that taze should execute in. Must be a sub-directory // of the workspace root. func (a *Analyzer) Analyze(ctx context.Context, dir string, labels []string) ([]*arpb.DependencyReport, error) { if len(labels) == 0 { @@ -124,14 +124,14 @@ func (a *Analyzer) Analyze(ctx context.Context, dir string, labels []string) ([] return a.generateReports(labels, resolved) } -// resolvedTarget represents a Bazel target and all resolved information. +// resolvedTarget represents a Blaze target and all resolved information. type resolvedTarget struct { label string // A map of all existing dependencies on a target at the time of analysis. // The keys are labels and the values are thes loaded target. dependencies map[string]*appb.Rule // A map of source file paths to their imports. - imports map[string][]*ts_auto_depsImport + imports map[string][]*tazeImport // rule is the original rule the target was constructed from. rule *appb.Rule // missingSources are source files which could not be opened on disk. @@ -147,7 +147,7 @@ type resolvedTarget struct { // setSources sets the sources on t. It returns an error if one of the srcs of // t's rule isn't in loadedSrcs. It also sorts the sources into literal and // generated sources, setting literalSourcePaths and generatedSourcePaths. -// Returns an error if all the sources are generated - ts_auto_deps can't read the +// Returns an error if all the sources are generated - taze can't read the // import statements to determine deps. func (t *resolvedTarget) setSources(loadedSrcs map[string]*appb.Target) error { for _, label := range listAttribute(t.rule, "srcs") { @@ -220,7 +220,7 @@ func newResolvedTarget(r *appb.Rule) *resolvedTarget { return &resolvedTarget{ label: r.GetName(), dependencies: make(map[string]*appb.Rule), - imports: make(map[string][]*ts_auto_depsImport), + imports: make(map[string][]*tazeImport), rule: r, sources: make(map[string]*appb.Target), } @@ -264,7 +264,7 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo return nil, err } } - // only extract the imports out of the literal sources, since ts_auto_deps can't + // only extract the imports out of the literal sources, since taze can't // see the contents of generated files allLiteralSrcPaths, err := getAllLiteralSrcPaths(targets) if err != nil { @@ -302,7 +302,7 @@ func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, roo func (a *Analyzer) resolveImports(ctx context.Context, currentPkg, root string, targets map[string]*resolvedTarget) error { for _, target := range targets { var paths []string - needingResolution := make(map[string][]*ts_auto_depsImport) + needingResolution := make(map[string][]*tazeImport) for _, imports := range target.imports { handlingImports: for _, imp := range imports { @@ -363,7 +363,7 @@ var ambientModuleDeclRE = regexp.MustCompile("(?m)^\\s*declare\\s+module\\s+['\" // // If the import already has a knownTarget, findRuleProvidingImport will // return the knownTarget. -func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, root string, rt *resolvedTarget, i *ts_auto_depsImport) (string, error) { +func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, root string, rt *resolvedTarget, i *tazeImport) (string, error) { if i.knownTarget != "" { return i.knownTarget, nil } @@ -545,17 +545,17 @@ func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyRepor // TypeScript declarations might declare arbitrary global symbols, so it // is impossible to detect reliably if the import is being used (without // compiling, at least). Report that the rule has no explicit import as a - // warning, so that ts_auto_deps can decide to import remove or not based on a + // warning, so that taze can decide to import remove or not based on a // flag. warning := fmt.Sprintf("WARNING: %s: keeping possibly used %s '%s'", rule.GetLocation(), class, label) report.Feedback = append(report.Feedback, warning) case "css_library": - // Similar to ts_declaration, ts_auto_deps can't reliably detect if css_library - // imports are being used, since ts_auto_deps can't currently parse @requirecss + // Similar to ts_declaration, taze can't reliably detect if css_library + // imports are being used, since taze can't currently parse @requirecss // annotations. Unlike ts_declaration, there's no flag to remove them, so // there's no need to report a warning. default: - // The contents of generated files aren't visible, so ts_auto_deps can't discover + // The contents of generated files aren't visible, so taze can't discover // the import statements/deps that they contain. To be safe, don't remove // any unused deps, since they might be used by the generated file(s). if len(target.generatedSourcePaths) == 0 { diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go index ff529b8d..a1cb550a 100644 --- a/ts_auto_deps/analyze/analyze_test.go +++ b/ts_auto_deps/analyze/analyze_test.go @@ -10,12 +10,14 @@ import ( "strings" "testing" + "google3/net/proto2/go/proto" "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "github.com/golang/protobuf/proto" - "github.com/kylelemons/godebug/pretty" + "google3/third_party/golang/cmp/cmp" + "google3/third_party/golang/cmp/cmpopts/cmpopts" + "google3/third_party/golang/godebug/pretty/pretty" - appb "github.com/bazelbuild/buildtools/build_proto" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" + arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" ) var ( @@ -204,7 +206,7 @@ func TestUnnecessaryDependencies(t *testing.T) { func TestNecessaryDependencies(t *testing.T) { tests := [][]string{ []string{"import x from 'b/target';"}, - []string{"// ts_auto_deps: x from //b:b_lib"}, + []string{"// taze: x from //b:b_lib"}, []string{"export x from 'b/target';"}, } for _, test := range tests { @@ -616,7 +618,7 @@ func TestSetSources(t *testing.T) { t.Errorf("got err %q, expected %q", err, test.err) } - if diff := pretty.Compare(rt.sources, test.expected); err == nil && diff != "" { + if diff := cmp.Diff(rt.sources, test.expected, cmpopts.EquateEmpty(), cmp.Comparer(proto.Equal)); err == nil && diff != "" { t.Errorf("failed to set correct sources: (-got, +want)\n%s", diff) } }) @@ -646,7 +648,7 @@ func createFile(path string, content ...string) error { return ioutil.WriteFile(path, []byte(strings.Join(content, "\n")), 0666) } -// This method creates a WORKSPACE file in the root of the Bazel test +// This method creates a WORKSPACE file in the root of the Blaze test // directory. This allows the tests to resolve the root path of the // workspace by looking for the WORKSPACE file on disk. func createWorkspaceFile() error { diff --git a/ts_auto_deps/analyze/imports.go b/ts_auto_deps/analyze/imports.go index 28f65019..909e6452 100644 --- a/ts_auto_deps/analyze/imports.go +++ b/ts_auto_deps/analyze/imports.go @@ -11,13 +11,13 @@ import ( "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" ) -// ts_auto_depsImport represents a single import in a TypeScript source. -type ts_auto_depsImport struct { +// tazeImport represents a single import in a TypeScript source. +type tazeImport struct { // importPath can be an ES6 path ('./foo/bar'), but also a namespace ('goog:...'). // This is the import path as it appears in the TypeScript source. importPath string - // knownTarget is the (fully qualified) bazel target providing importPath. - // It's either found by locateMissingTargets or taken from a ts_auto_deps comment. + // knownTarget is the (fully qualified) blaze target providing importPath. + // It's either found by locateMissingTargets or taken from a taze comment. knownTarget string location sourceLocation } @@ -30,7 +30,7 @@ type ts_auto_depsImport struct { // these imports depends on the dependencies of the target the source // location is a member of. For example, an import of 'foo/bar' would have // no resolvedPath. -func (i *ts_auto_depsImport) resolvedPath() string { +func (i *tazeImport) resolvedPath() string { if strings.HasPrefix(i.importPath, "./") || strings.HasPrefix(i.importPath, "../") { // If the import is relative to the source location, use the source // location to form a "canonical" path from the root. @@ -55,9 +55,9 @@ type sourceLocation struct { // // paths should be relative to root. The root will be joined to each path // to construct a physical path to each file. -func extractAllImports(root string, paths []string) (map[string][]*ts_auto_depsImport, []error) { +func extractAllImports(root string, paths []string) (map[string][]*tazeImport, []error) { debugf("extracting imports from TypeScript files relative to %q: %q", root, paths) - allImports := make(map[string][]*ts_auto_depsImport) + allImports := make(map[string][]*tazeImport) var ( errors []error mutex sync.Mutex @@ -84,7 +84,7 @@ func extractAllImports(root string, paths []string) (map[string][]*ts_auto_depsI // extractImports extracts the TypeScript imports from a single file. path // should be a path from the root to the file. -func extractImports(root, path string) ([]*ts_auto_depsImport, error) { +func extractImports(root, path string) ([]*tazeImport, error) { d, err := ioutil.ReadFile(filepath.Join(root, path)) if err != nil { return nil, err @@ -93,7 +93,7 @@ func extractImports(root, path string) ([]*ts_auto_depsImport, error) { } const ( - ts_auto_depsFrom = `^[ \t]*//[ \t]+ts_auto_deps:[^\n]*?from[ \t]+(?P//\S+)$` + tazeFrom = `^[ \t]*//[ \t]+taze:[^\n]*?from[ \t]+(?P//\S+)$` importPreface = `^[ \t]*(?:import|export)\b\s*` wildcardTerm = `\*(?:\s*as\s+\S+)?` // "as..." is optional to match exports. identifiersClause = `(?:\{[^}]*\}|\S+|` + wildcardTerm + `)` @@ -103,26 +103,26 @@ const ( ) var importRE = regexp.MustCompile("(?ms)" + - "(?:" + ts_auto_depsFrom + ")|" + + "(?:" + tazeFrom + ")|" + "(?:" + importPreface + symbolsTerm + url + namespaceComment + ")") -// parseImports scans contents for imports (ES6 modules, ts_auto_deps comments), and -// returns a list of ts_auto_depsImports. knownTarget is already filled in for imports -// that have ts_auto_deps comments. -func parseImports(sourcePath string, contents []byte) []*ts_auto_depsImport { - var imports []*ts_auto_depsImport +// parseImports scans contents for imports (ES6 modules, taze comments), and +// returns a list of tazeImports. knownTarget is already filled in for imports +// that have taze comments. +func parseImports(sourcePath string, contents []byte) []*tazeImport { + var imports []*tazeImport lastOffset := 0 line := 1 column := 1 for _, matchIndices := range importRE.FindAllSubmatchIndex(contents, -1) { - imp := &ts_auto_depsImport{} + imp := &tazeImport{} imports = append(imports, imp) // matchIndices[0, 1]: full RE match imp.location.sourcePath = sourcePath for lastOffset < matchIndices[1] { // Iterate to the *end* of the import statement. - // The ts_auto_deps comment must be placed at the end of the "import" statement. - // This offset has to be exactly the end of the import for ts_auto_deps later on + // The taze comment must be placed at the end of the "import" statement. + // This offset has to be exactly the end of the import for taze later on // to insert the '// from' comment in the correct line. column++ if contents[lastOffset] == '\n' { @@ -135,7 +135,7 @@ func parseImports(sourcePath string, contents []byte) []*ts_auto_depsImport { imp.location.length = matchIndices[1] - matchIndices[0] imp.location.line = line if matchIndices[2] >= 0 { - // matchIndices[2, 3]: Target for a // ts_auto_deps: ... from ... comment. + // matchIndices[2, 3]: Target for a // taze: ... from ... comment. imp.knownTarget = string(contents[matchIndices[2]:matchIndices[3]]) } else { // matchIndices[4, 5]: URL in import x from 'url'; diff --git a/ts_auto_deps/analyze/imports_test.go b/ts_auto_deps/analyze/imports_test.go index 029df0ea..65d13d55 100644 --- a/ts_auto_deps/analyze/imports_test.go +++ b/ts_auto_deps/analyze/imports_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/kylelemons/godebug/pretty" + "google3/third_party/golang/godebug/pretty/pretty" ) func TestParseImports(t *testing.T) { @@ -41,8 +41,8 @@ func TestParseImports(t *testing.T) { {"export*from'no whitespace';", "no whitespace", ""}, {"export{}from'no whitespace';", "no whitespace", ""}, // Comments - {"x;\n// ts_auto_deps: ng from //some/global:rule\ny;", "", "//some/global:rule"}, - {"// ts_auto_deps: ng from //foo/bar from //some/global:rule", "", "//some/global:rule"}, + {"x;\n// taze: ng from //some/global:rule\ny;", "", "//some/global:rule"}, + {"// taze: ng from //foo/bar from //some/global:rule", "", "//some/global:rule"}, } for i, tst := range tests { diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go index 4a98600f..bd4b0a55 100644 --- a/ts_auto_deps/analyze/loader.go +++ b/ts_auto_deps/analyze/loader.go @@ -1,6 +1,7 @@ package analyze import ( + "bytes" "context" "fmt" @@ -9,12 +10,12 @@ import ( "strings" "time" - "github.com/bazelbuild/buildtools/edit" + "google3/net/proto2/go/proto" + "google3/third_party/bazel_buildifier/edit/edit" "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - "github.com/golang/protobuf/proto" - appb "github.com/bazelbuild/buildtools/build_proto" + appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" ) // pkgCacheEntry represents a set of loaded rules and a mapping from alias @@ -26,10 +27,10 @@ type pkgCacheEntry struct { aliases map[string]*appb.Rule } -// QueryBasedTargetLoader uses Bazel query to load targets from BUILD files. +// QueryBasedTargetLoader uses Blaze query to load targets from BUILD files. type QueryBasedTargetLoader struct { workdir string - bazelBinary string + blazeBinary string // pkgCache is a mapping from a package to all of the rules in said // package along with a map from aliases to actual rules. @@ -51,17 +52,17 @@ type QueryBasedTargetLoader struct { // NewQueryBasedTargetLoader constructs a new QueryBasedTargetLoader rooted // in workdir. -func NewQueryBasedTargetLoader(workdir, bazelBinary string) *QueryBasedTargetLoader { +func NewQueryBasedTargetLoader(workdir, blazeBinary string) *QueryBasedTargetLoader { return &QueryBasedTargetLoader{ workdir: workdir, - bazelBinary: bazelBinary, + blazeBinary: blazeBinary, pkgCache: make(map[string]*pkgCacheEntry), labelCache: make(map[string]*appb.Target), } } -// LoadRules uses Bazel query to load rules associated with labels from BUILD +// LoadRules uses Blaze query to load rules associated with labels from BUILD // files. func (q *QueryBasedTargetLoader) LoadRules(pkg string, labels []string) (map[string]*appb.Rule, error) { labelToTarget, err := q.LoadTargets(pkg, labels) @@ -81,7 +82,7 @@ func (q *QueryBasedTargetLoader) LoadRules(pkg string, labels []string) (map[str return labelToRule, nil } -// LoadTargets uses Bazel query to load targets associated with labels from BUILD +// LoadTargets uses Blaze query to load targets associated with labels from BUILD // files. func (q *QueryBasedTargetLoader) LoadTargets(pkg string, labels []string) (map[string]*appb.Target, error) { var labelCacheMisses []string @@ -151,7 +152,7 @@ func possibleFilepaths(importPath string) []string { return possiblePaths } -// LoadImportPaths uses Bazel Query to load targets associated with import +// LoadImportPaths uses Blaze Query to load targets associated with import // paths from BUILD files. func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, targetToAnalyze *appb.Rule, currentPkg, workspaceRoot string, paths []string) (map[string]*appb.Rule, error) { debugf("loading imports visible to %q relative to %q: %q", currentPkg, workspaceRoot, paths) @@ -279,6 +280,7 @@ func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, targetToAn } } + return results, nil } @@ -412,10 +414,11 @@ func (q *QueryBasedTargetLoader) targetLabel(target *appb.Target) (string, error } } -// batchQuery runs a set of queries with a single call to Bazel query and the + +// batchQuery runs a set of queries with a single call to Blaze query and the // '--keep_going' flag. func (q *QueryBasedTargetLoader) batchQuery(queries []string) (*appb.QueryResult, error) { - // Join all of the queries with a '+' character according to Bazel's + // Join all of the queries with a '+' character according to Blaze's // syntax for running multiple queries. return q.query("--keep_going", strings.Join(queries, "+")) } @@ -428,14 +431,14 @@ func (q *QueryBasedTargetLoader) query(args ...string) (*appb.QueryResult, error query := args[n-1] if query == "" { // An empty query was provided so return an empty result without - // making a call to Bazel. + // making a call to Blaze. return &appb.QueryResult{}, nil } var stdout, stderr bytes.Buffer args = append([]string{"query", "--output=proto"}, args...) q.queryCount++ - debugf("executing query #%d in %q: %s %s %q", q.queryCount, q.workdir, q.bazelBinary, strings.Join(args[:len(args)-1], " "), query) - cmd := exec.Command(q.bazelBinary, args...) + debugf("executing query #%d in %q: %s %s %q", q.queryCount, q.workdir, q.blazeBinary, strings.Join(args[:len(args)-1], " "), query) + cmd := exec.Command(q.blazeBinary, args...) cmd.Dir = q.workdir cmd.Stdout = &stdout cmd.Stderr = &stderr @@ -446,7 +449,7 @@ func (q *QueryBasedTargetLoader) query(args ...string) (*appb.QueryResult, error // flag. Since one query failing to return a result does not hinder the // other queries from returning a result, ignore these errors. // - // Herb prints "printing partial results" to indicate the same as bazel's + // Herb prints "printing partial results" to indicate the same as blaze's // exit status 3 if err.Error() != "exit status 3" && !strings.Contains(stderr.String(), "printing partial results") { // The error provided as a result is less useful than the contents of @@ -462,6 +465,7 @@ func (q *QueryBasedTargetLoader) query(args ...string) (*appb.QueryResult, error return &result, nil } + // ruleProvidesImports checks if the rule directly provides the import, or if // it's a reexporting lib, if one of its deps does. func (q *QueryBasedTargetLoader) ruleProvidesImports(rule *appb.Rule, srcMatcher func(rule *appb.Rule) bool) (bool, error) { diff --git a/ts_auto_deps/analyze/loader_test.go b/ts_auto_deps/analyze/loader_test.go index 57651290..f6b909e7 100644 --- a/ts_auto_deps/analyze/loader_test.go +++ b/ts_auto_deps/analyze/loader_test.go @@ -3,11 +3,12 @@ package analyze import ( "testing" - "github.com/golang/protobuf/proto" + "google3/net/proto2/go/proto" - appb "github.com/bazelbuild/buildtools/build_proto" + appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" ) + func TestResolveAgainstModuleRoot(t *testing.T) { tests := []struct { ruleLiteral string diff --git a/ts_auto_deps/main.go b/ts_auto_deps/main.go index 553afbc3..8410149f 100644 --- a/ts_auto_deps/main.go +++ b/ts_auto_deps/main.go @@ -47,7 +47,7 @@ func main() { platform.Error(err) } - host := updater.New(false, false, updater.QueryBasedBazelAnalyze, updater.LocalUpdateFile) + host := updater.New(false, false, updater.QueryBasedBlazeAnalyze, updater.LocalUpdateFile) if err := updater.Execute(host, paths, *isRoot, *recursive); err != nil { platform.Error(err) } diff --git a/ts_auto_deps/platform/BUILD.bazel b/ts_auto_deps/platform/BUILD.bazel deleted file mode 100644 index d3e9253b..00000000 --- a/ts_auto_deps/platform/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "file.go", - "log.go", - "walk.go", - ], - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform", - visibility = ["//visibility:public"], -) diff --git a/ts_auto_deps/platform/file.go b/ts_auto_deps/platform/file.go index 7df93d03..175a8de6 100644 --- a/ts_auto_deps/platform/file.go +++ b/ts_auto_deps/platform/file.go @@ -1,53 +1,58 @@ +// Package platform handles differences between google3 and open source for taze. package platform import ( "context" - "io/ioutil" - "os" - "path/filepath" - "strings" -) -const ( - filePerms = 0666 + "google3/file/base/go/file" ) -var pathReplacer = strings.NewReplacer("\\", "/") - // ReadFile reads the contents of name. func ReadFile(ctx context.Context, name string) ([]byte, error) { - return ioutil.ReadFile(name) + return file.ReadFile(ctx, name) } // ReadBytesFromFile reads bytes into the buffer provided, stopping when the // buffer is full. func ReadBytesFromFile(ctx context.Context, name string, buffer []byte) (int, error) { - f, err := os.Open(name) + f, err := file.OpenRead(ctx, name) if err != nil { return 0, err } - defer f.Close() + defer f.IO(ctx).Close() - n, err := f.Read(buffer) + n, err := f.IO(ctx).Read(buffer) return n, err } // WriteFile writes data to filename. func WriteFile(ctx context.Context, filename string, data []byte) error { - return ioutil.WriteFile(filename, data, filePerms) + return file.WriteFile(ctx, filename, data) } // Stat reads the file system information of name. +// NOTE: The result of Stat, FileStat or FileInfo for internal and external +// respectively, is never used. Since the two results are mostly incompatible +// structures, return an interface in both the open-source and internal version. func Stat(ctx context.Context, name string) (interface{}, error) { - return os.Stat(name) + return file.Stat(ctx, name) } // Glob returns all paths matching pattern. func Glob(ctx context.Context, pattern string) ([]string, error) { - return filepath.Glob(pattern) + stats, err := file.Match(ctx, pattern, file.StatNone) + if err != nil { + return nil, err + } + paths := make([]string, 0, len(stats)) + for _, stat := range stats { + paths = append(paths, stat.Path) + } + return paths, nil } -// Normalize converts Windows path separators into POSIX +// Normalize is a no-op in google3. Note that file.go.oss has an implementation +// which fixes Windows paths. func Normalize(path string) string { - return pathReplacer.Replace(path) + return path } diff --git a/ts_auto_deps/platform/file.go.oss b/ts_auto_deps/platform/file.go.oss new file mode 100644 index 00000000..bf87a03c --- /dev/null +++ b/ts_auto_deps/platform/file.go.oss @@ -0,0 +1,54 @@ +package platform + +import ( + "context" + "io/ioutil" + "os" + "path/filepath" + "strings" +) + +const ( + filePerms = 0666 +) + +var pathReplacer = strings.NewReplacer("\\", "/") + +// ReadFile reads the contents of name. +func ReadFile(ctx context.Context, name string) ([]byte, error) { + return ioutil.ReadFile(name) +} + +// ReadBytesFromFile reads bytes into the buffer provided, stopping when the +// buffer is full. +func ReadBytesFromFile(ctx context.Context, name string, buffer []byte) (int, error) { + f, err := os.Open(name) + if err != nil { + return 0, err + } + defer f.Close() + + n, err := f.Read(buffer) + return n, err +} + + +// WriteFile writes data to filename. +func WriteFile(ctx context.Context, filename string, data []byte) error { + return ioutil.WriteFile(filename, data, filePerms) +} + +// Stat reads the file system information of name. +func Stat(ctx context.Context, name string) (interface{}, error) { + return os.Stat(name) +} + +// Glob returns all paths matching pattern. +func Glob(ctx context.Context, pattern string) ([]string, error) { + return filepath.Glob(pattern) +} + +// Normalize converts Windows path separators into POSIX +func Normalize(path string) (string) { + return pathReplacer.Replace(path) +} diff --git a/ts_auto_deps/platform/log.go b/ts_auto_deps/platform/log.go index 4fb889ee..1486945c 100644 --- a/ts_auto_deps/platform/log.go +++ b/ts_auto_deps/platform/log.go @@ -1,19 +1,15 @@ package platform -import ( - "fmt" - "log" - "os" -) +import "google3/base/go/log" // Infof prints a formatted message to stdout. -func Infof(format string, args ...interface{}) { - fmt.Printf(format+"\n", args...) +func Infof(format string, v ...interface{}) { + log.Infof(format, v...) } // Error prints a series of args to stderr. func Error(args ...interface{}) { - fmt.Fprintln(os.Stderr, args...) + log.Error(args...) } // Fatalf prints a formatted message to stderr. Panics after printing. diff --git a/ts_auto_deps/platform/log.go.oss b/ts_auto_deps/platform/log.go.oss new file mode 100644 index 00000000..4fb889ee --- /dev/null +++ b/ts_auto_deps/platform/log.go.oss @@ -0,0 +1,22 @@ +package platform + +import ( + "fmt" + "log" + "os" +) + +// Infof prints a formatted message to stdout. +func Infof(format string, args ...interface{}) { + fmt.Printf(format+"\n", args...) +} + +// Error prints a series of args to stderr. +func Error(args ...interface{}) { + fmt.Fprintln(os.Stderr, args...) +} + +// Fatalf prints a formatted message to stderr. Panics after printing. +func Fatalf(format string, v ...interface{}) { + log.Fatalf(format, v...) +} diff --git a/ts_auto_deps/platform/walk.go b/ts_auto_deps/platform/walk.go index 05dd3661..ee35020d 100644 --- a/ts_auto_deps/platform/walk.go +++ b/ts_auto_deps/platform/walk.go @@ -2,14 +2,19 @@ package platform import ( "os" - "path/filepath" + + "google3/third_party/golang/go_tools/internal/fastwalk/fastwalk" ) +// Walk does a faster filesystem walk than filepath.Walk by wrapping +// fastwalk.Walk. +// Performance was measured by timing updater.Paths when running taze +//--recursive on the cloud directory, both after a clearing the srcfs cache, and +// on subsequent runs. +// fastwalk, without cache: 2m35.950528503s +// fastwalk, with cache: 940.908936ms +// filepath.Walk without cache: 34m55.55114913s +// filepath.Walk with cache: 26.917530244s func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - return walkFn(path, info.Mode()) - }) + return fastwalk.Walk(root, walkFn) } diff --git a/ts_auto_deps/platform/walk.go.oss b/ts_auto_deps/platform/walk.go.oss new file mode 100644 index 00000000..05dd3661 --- /dev/null +++ b/ts_auto_deps/platform/walk.go.oss @@ -0,0 +1,15 @@ +package platform + +import ( + "os" + "path/filepath" +) + +func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { + return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + return walkFn(path, info.Mode()) + }) +} diff --git a/ts_auto_deps/proto/BUILD.bazel b/ts_auto_deps/proto/BUILD.bazel deleted file mode 100644 index e7e793a3..00000000 --- a/ts_auto_deps/proto/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -proto_library( - name = "bazel_analyze_proto", - srcs = ["analyze_result.proto"], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "bazel_analyze_go_proto", - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto", - proto = ":bazel_analyze_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - embed = [":bazel_analyze_go_proto"], - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto", - visibility = ["//visibility:public"], -) diff --git a/ts_auto_deps/proto/analyze_result.proto b/ts_auto_deps/proto/analyze_result.proto index 49ee5000..f94855f9 100644 --- a/ts_auto_deps/proto/analyze_result.proto +++ b/ts_auto_deps/proto/analyze_result.proto @@ -1,6 +1,6 @@ syntax = "proto2"; -package bazel_analyze; +package blaze_analyze; // A DependencyGroup represents a list of alternatives for satisfying // a missing dependency. @@ -42,7 +42,7 @@ message AttributeReport { // The result of checking a single build rule (called X in comments // below) for missing or unnecessary dependencies. Produced by // java/com/google/devtools/build/checkbuilddeps (which for external -// users means it's produced by bazel analyze). +// users means it's produced by blaze analyze). message DependencyReport { required string rule = 1; // Name of rule X, in canonical google3 format. @@ -92,7 +92,7 @@ message DependencyReport { } // Aggregate DependencyReports for multiple analysis -// targets - used to support bazel analyze --analysis_output=proto +// targets - used to support blaze analyze --analysis_output=proto message AnalyzeResult { repeated DependencyReport dependency_report = 1; } diff --git a/ts_auto_deps/updater/BUILD.bazel b/ts_auto_deps/updater/BUILD.bazel deleted file mode 100644 index ea67ff6e..00000000 --- a/ts_auto_deps/updater/BUILD.bazel +++ /dev/null @@ -1,32 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = [ - "test_register.go", - "updater.go", - ], - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/updater", - visibility = ["//visibility:public"], - deps = [ - "//ts_auto_deps/analyze:go_default_library", - "//ts_auto_deps/platform:go_default_library", - "//ts_auto_deps/proto:go_default_library", - "//ts_auto_deps/workspace:go_default_library", - "@com_github_bazelbuild_buildtools//build:go_default_library", - "@com_github_bazelbuild_buildtools//edit:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_mattn_go_isatty//:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = ["updater_test.go"], - embed = [":go_default_library"], - deps = [ - "//ts_auto_deps/proto:go_default_library", - "@com_github_bazelbuild_buildtools//build:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - ], -) diff --git a/ts_auto_deps/updater/comments.go b/ts_auto_deps/updater/comments.go new file mode 100644 index 00000000..17060aff --- /dev/null +++ b/ts_auto_deps/updater/comments.go @@ -0,0 +1,208 @@ +// Excluded from the open-source version since there are no taze comments. Also +// because the sstable is not available. + +package updater + +import ( + "bytes" + "context" + "fmt" + "path/filepath" + "regexp" + "strconv" + "sync" + + "google3/base/go/log" + "google3/file/base/go/file" + "google3/sstable/go/sstable" + "google3/third_party/bazel_buildifier/edit/edit" + + arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" +) + +var missingCommentRE = regexp.MustCompile( + `(?s)ERROR: ([^:]+):(\d+):(\d+): missing comment for 'goog:' import.*?'goog:([^']+)'`) + +// fixMissingTazeComments adds taze `// from ...` comments to source files. +// It scans the given feedback reports for "missing taze comment" errors, looks up the missing namespaces +// in an sstable stored on x20, and then appends comments to the lines missing them. +// fixMissingTazeComments returns true if it fixed any missing comments. +func (upd *Updater) fixMissingTazeComments(ctx context.Context, g3root string, reports []*arpb.DependencyReport) (bool, error) { + type location struct { + file string + line int + } + type missingComment struct { + target string + locations []location + } + + // Group reports and locations by namespace. + nsToComment := make(map[string]*missingComment) + for _, report := range reports { + for _, fb := range report.GetFeedback() { + log.Infof("fix taze comments: checking feedback:\n%s", fb) + // Sadly, there is no way to return more structured feedback from blaze analyze. + m := missingCommentRE.FindStringSubmatch(fb) + if m == nil { + continue + } + file := m[1] + line, err := strconv.Atoi(m[2]) + if err != nil { + return false, err + } + namespace := m[4] + + mc := nsToComment[namespace] + if mc == nil { + mc = &missingComment{} + nsToComment[namespace] = mc + } + mc.locations = append(mc.locations, location{file: file, line: line}) + } + } + + if len(nsToComment) == 0 { + return false, nil + } + + table, err := GetNamespaceToTargetTable() + if err != nil { + return false, err + } + + tableLookupSpinner := spin(fmt.Sprintf("Searching %d namespaces for taze comments", len(nsToComment))) + // Look up targets for missing namespaces + // Group locations to add a specific target to by file. + fileToLocs := make(map[string][]*missingComment) + for namespace, mc := range nsToComment { + log.Infof("Looking for namespace %s", namespace) + it := table.Lookup(ctx, []byte(namespace)) + if it.Done() { + log.Warningf("Couldn't find namespace %q", namespace) + continue + } + target := string(it.Value()) + mc.target = target + for _, l := range mc.locations { + mc := &missingComment{target: mc.target, locations: []location{l}} + fileToLocs[l.file] = append(fileToLocs[l.file], mc) + } + } + close(tableLookupSpinner) + + // Add taze comments to files. + fixedSomething := false + for srcFile, mcs := range fileToLocs { + p := filepath.Join(g3root, srcFile) + content, err := file.ReadFile(ctx, p) + if err != nil { + log.Errorf("fix taze comments: failed to read %q: %v", p, err) + continue + } + + lines := bytes.Split(content, []byte("\n")) + + for _, mc := range mcs { + loc := mc.locations[0] + lineOffset := loc.line - 1 + if len(lines) < lineOffset { + log.Errorf("fix taze comments: no line %d in %q", loc.line, p) + continue + } + // Contains("//") is a bit overly broad here, but import URLs should not contain double + // slashes either. + if bytes.Contains(lines[lineOffset], []byte("//")) { + return fixedSomething, + &AnalysisFailedError{ + []AnalysisFailureCause{ + AnalysisFailureCause{ + Message: fmt.Sprintf("cannot add taze comment to %s:%d, it already has a (malformed?) comment."+ + " Please remove or fix the comment.", + srcFile, loc.line), + Path: srcFile, + Line: loc.line, + }, + }, + } + } + var line bytes.Buffer + target := edit.ShortenLabel(mc.target, "") // pass "" as pkg to always get absolute package references. + fmt.Fprintf(&line, "%s // from %s", lines[lineOffset], target) + lines[lineOffset] = line.Bytes() + } + newContent := string(bytes.Join(lines, []byte("\n"))) + if err := upd.updateFile(ctx, p, newContent); err != nil { + log.Errorf("fix taze comments: failed to write %q: %v", p, err) + continue + } + fmt.Printf("Added taze comments to %s\n", srcFile) + fixedSomething = true + } + + return fixedSomething, nil +} + +var namespaceToTarget sstable.Table +var tableOnce sync.Once + +// GetNamespaceToTargetTable opens and returns the taze table from x20. +// It is a variable so it can be overridden for testing. +var GetNamespaceToTargetTable = func() (sstable.Table, error) { + tableOnce.Do(func() { + ctx := context.Background() + // This keeps the same sstable open for the entire (short) lifetime of the taze run. + // That is by design: during one run, the table should not change from under us. + t, err := sstable.Open(ctx, *namespaceLookupTable, &sstable.Options{}) + if err != nil { + log.Errorf("Failed to open namespace to target sstable: %v", err) + return + } + namespaceToTarget = t + }) + if namespaceToTarget == nil { + return nil, fmt.Errorf("fix taze comments: failed to open namespace sstable") + } + return namespaceToTarget, nil +} + +// Matches the Closure namespace for an import inside a .ts file. +var googImportNamespace = regexp.MustCompile(`^import .* from 'goog:(.*)';.*`) + +// Matches import lines that have a trailing taze comment. +// Capturing group 1 will be kept and the lookedup namespace will be appended. +// Based on a regex from +// java/com/google/devtools/ruleanalysis/service/checkbuilddeps/typescript/TypeScriptRuleChecker.java +var tazeCommentAfterStatement = regexp.MustCompile(`^(import .*;\s*//[ \t]*from[ \t]+)//.*$`) + +func updateTazeCommentsOnImports(ctx context.Context, path string, namespaceToTargetTable sstable.Table) error { + log.Infof("Updating taze import comments from %s\n", path) + content, err := file.ReadFile(ctx, path) + if err != nil { + return fmt.Errorf("reading %q: %v", path, err) + } + lines := bytes.Split(content, []byte("\n")) + for i, line := range lines { + match := googImportNamespace.FindSubmatch(line) + if match == nil { + continue + } + namespace := match[1] + it := namespaceToTargetTable.Lookup(ctx, namespace) + if it.Done() { + log.Infof("Attempted to update taze comment for %q but it is not in the index.\n", namespace) + continue + } + newLine := tazeCommentAfterStatement.ReplaceAll(line, append([]byte("$1"), it.Value()...)) + if bytes.Compare(newLine, lines[i]) != 0 { + log.Infof("Updated comment for %q in %q\n", namespace, path) + lines[i] = newLine + } + } + err = file.WriteFile(ctx, path, bytes.Join(lines, []byte("\n"))) + if err != nil { + return fmt.Errorf("failed to write %q: %v", path, err) + } + return nil +} diff --git a/ts_auto_deps/updater/comments_test.go b/ts_auto_deps/updater/comments_test.go new file mode 100644 index 00000000..921cf44c --- /dev/null +++ b/ts_auto_deps/updater/comments_test.go @@ -0,0 +1,184 @@ +// Excluded from the open-source version since there are no taze comments. Also +// because the sstable is not available. + +package updater + +import ( + "bytes" + "context" + "io/ioutil" + "testing" + + "google3/sstable/go/sstable" + "google3/sstable/go/sstabletest" + "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" + + arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" +) + +func TestFixMissingTazeComments(t *testing.T) { + sstableContent := []sstabletest.Entry{ + {[]byte("goog.string"), []byte("//javascript/closure/string:string")}, + {[]byte("goog.array"), []byte("//javascript/closure/array:nondefault")}, + } + sstabletest.Sort(sstableContent) + table := sstabletest.NewTable(sstableContent) + + GetNamespaceToTargetTable = func() (sstable.Table, error) { + return table, nil + } + + p, err := mktmp("google3/foo/a.ts", []byte(` + import {firstUsage} from 'goog:goog.string'; + import {x} from 'x'; + import {secondUsage} from 'goog:goog.string'; + import {hasComment} from 'goog:goog.string'; // from //javascript/closure/string + import {otherNamespace} from 'goog:goog.array';`)) + if err != nil { + t.Error(err) + } + g3root, err := workspace.Root(p) + if err != nil { + t.Error(err) + } + p2, err := mktmp("google3/foo/b.ts", []byte(`import {anotherUser} from 'goog:goog.string';`)) + if err != nil { + t.Error(err) + } + + report := parseReport(t, ` + rule: "//foo:bar" + unresolved_import: "goog:goog.string" + unresolved_import: "goog:goog.array" + feedback: "ERROR: foo/a.ts:2:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" + " import Bar from 'goog:goog.string'; // from //foo:bar\n" + feedback: "ERROR: foo/a.ts:4:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" + " import Bar from 'goog:goog.string'; // from //foo:bar\n" + feedback: "ERROR: foo/a.ts:6:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" + " import Bar from 'goog:goog.array'; // from //foo:bar\n"`) + report2 := parseReport(t, ` + rule: "//foo:baz" + unresolved_import: "goog:goog.string" + feedback: "ERROR: foo/b.ts:1:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" + " import Bar from 'goog:goog.string'; // from //foo:bar\n"`) + + ctx := context.Background() + updater := New(false, false, nil, LocalUpdateFile) + changed, err := updater.fixMissingTazeComments(ctx, g3root, []*arpb.DependencyReport{report, report2}) + if err != nil { + t.Error(err) + } + if !changed { + t.Error("fixMissingTazeComments: expected change") + } + + content, err := ioutil.ReadFile(p) + if err != nil { + t.Error(err) + } + expected := ` + import {firstUsage} from 'goog:goog.string'; // from //javascript/closure/string + import {x} from 'x'; + import {secondUsage} from 'goog:goog.string'; // from //javascript/closure/string + import {hasComment} from 'goog:goog.string'; // from //javascript/closure/string + import {otherNamespace} from 'goog:goog.array'; // from //javascript/closure/array:nondefault` + if string(content) != expected { + t.Errorf("fixMissingTazeComments(%q): got:\n%s, expected:\n%s", p, content, expected) + } + + content, err = ioutil.ReadFile(p2) + if err != nil { + t.Error(err) + } + expected = `import {anotherUser} from 'goog:goog.string'; // from //javascript/closure/string` + if string(content) != expected { + t.Errorf("fixMissingTazeComments(%q): got:\n%s, expected:\n%s", p2, content, expected) + } +} + +func TestFixMissingTazeCommentsBadCommentFormat(t *testing.T) { + sstableContent := []sstabletest.Entry{{[]byte("goog.string"), []byte("//javascript/closure/string:string")}} + sstabletest.Sort(sstableContent) + table := sstabletest.NewTable(sstableContent) + + GetNamespaceToTargetTable = func() (sstable.Table, error) { + return table, nil + } + + fileContents := []byte(` + import {hasIncorrectComment} from 'goog:goog.string'; // from some:place + `) + p, err := mktmp("google3/foo/a.ts", fileContents) + if err != nil { + t.Error(err) + } + g3root, err := workspace.Root(p) + if err != nil { + t.Error(err) + } + + report := parseReport(t, ` + rule: "//foo:bar" + unresolved_import: "goog:goog.string" + feedback: "ERROR: foo/a.ts:2:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" + " import Bar from 'goog:goog.string'; // from //foo:bar\n"`) + ctx := context.Background() + updater := New(false, false, nil, LocalUpdateFile) + _, err = updater.fixMissingTazeComments(ctx, g3root, []*arpb.DependencyReport{report}) + expErr := "cannot add taze comment to foo/a.ts:2, it already has a (malformed?) comment. Please remove or fix the comment." + if err == nil || err.Error() != expErr { + t.Errorf("fixMissingTazeComments(%q): got error %q, expected %q", p, err, expErr) + } + + if analysisErr, ok := err.(*AnalysisFailedError); ok { + if len(analysisErr.Causes) != 1 { + t.Errorf("fixMissingTazeComments(%q): got error causes %q, expected only one", p, analysisErr.Causes) + } + cause := analysisErr.Causes[0] + expFile := "foo/a.ts" + if cause.Path != expFile { + t.Errorf("fixMissingTazeComments(%q): got error file %q, expected %q", p, expFile, cause.Path) + } + expLine := 2 + if cause.Line != expLine { + t.Errorf("fixMissingTazeComments(%q): got error line %q, expected %q", p, expLine, cause.Line) + } + } else { + t.Errorf("fixMissingTazeComments(%q): got error %q, expected it to be an AnalysisFailedError", p, err) + } + + newContents, err := ioutil.ReadFile(p) + if err != nil { + t.Error(err) + } + if !bytes.Equal(newContents, fileContents) { + t.Errorf("fixMissingTazeComments(%q): got:\n%s, expected unchanged:\n%s", p, newContents, fileContents) + } +} + +func TestUpdateTazeCommentsOnImports(t *testing.T) { + sstableContent := []sstabletest.Entry{{[]byte("rapid.model.json"), []byte("//java/com/google/releasetools/rapid/static/js/model:model")}} + sstabletest.Sort(sstableContent) + table := sstabletest.NewTable(sstableContent) + + fileContents := []byte(`import {ProcessTypeEnum} from 'goog:rapid.model.json'; // from //java/com/google/releasetools/rapid/static/js/model:json_js`) + p, err := mktmp("google3/foo/a.ts", fileContents) + if err != nil { + t.Fatal(err) + } + + ctx := context.Background() + err = updateTazeCommentsOnImports(ctx, p, table) + if err != nil { + t.Error(err) + } + + content, err := ioutil.ReadFile(p) + if err != nil { + t.Error(err) + } + expected := `import {ProcessTypeEnum} from 'goog:rapid.model.json'; // from //java/com/google/releasetools/rapid/static/js/model:model` + if string(content) != expected { + t.Errorf("updateTazeCommentsOnImports(%q): got:\n%s, expected:\n%s", p, content, expected) + } +} diff --git a/ts_auto_deps/updater/internal_rules.go b/ts_auto_deps/updater/internal_rules.go new file mode 100644 index 00000000..bf912284 --- /dev/null +++ b/ts_auto_deps/updater/internal_rules.go @@ -0,0 +1,125 @@ +// Excluded from the open-source version since there are no equivalent rules +// to ts_config and ts_development_sources. + +package updater + +import ( + "path/filepath" + "strings" + + "google3/third_party/bazel_buildifier/build/build" + "google3/third_party/bazel_buildifier/edit/edit" + "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" +) + +// updateTSConfig creates new ts_config rules, as well as registers non-test ts +// rules with the ts_config. Test ts rules are handled in test_register.go. +func updateTSConfig(bld *build.File, add bool) { + if add && getLastRule(bld, "ts_config", ruleTypeAny) == nil { + r := getOrCreateRule(bld, "tsconfig", "ts_config", ruleTypeAny) + r.SetAttr("deps", &build.ListExpr{}) + } + + // register any non-test rules + r := getLastRule(bld, "ts_config", ruleTypeAny) + if r == nil { + return // No ts_config rule that needs updating. + } + targets := allTSRules(bld) + for _, t := range targets { + isTest := attrTruthy(t, "testonly") + if isTest { + // registering test rules with ts_config is done in test_register.go + continue + } + addDep(bld, r, t.Name()) + } +} + +// updateTSDevelopmentSources creates new ts_development_sources rules, as well +// as registers non-test ts rules with the ts_development_sources. Test ts +// rules are handled in test_register.go. +func updateTSDevelopmentSources(bld *build.File, add bool) { + if add { + ruleName := "devsrcs" + if getLastRule(bld, "ts_development_sources", ruleTypeRegular) == nil { + r := getOrCreateRule(bld, ruleName, "ts_development_sources", ruleTypeRegular) + r.SetAttr("deps", &build.ListExpr{}) + } + if getLastRule(bld, "ts_development_sources", ruleTypeTest) == nil { + r := getOrCreateRule(bld, ruleName, "ts_development_sources", ruleTypeTest) + r.SetAttr("deps", &build.ListExpr{}) + } + } + + // register any non-test rules + for _, t := range allTSRules(bld) { + // NodeJS rules should not be added to ts_development_sources automatically + // because they typically do not run in the browser. + if t.AttrString("runtime") == "nodejs" { + continue + } + isTest := attrTruthy(t, "testonly") + if isTest { + // registering test rules with ts_dev_srcs is done in test_register.go + continue + } + depName := ":" + t.Name() + if targetRegisteredInRule(bld, "ts_development_sources", ruleTypeRegular, depName) { + continue + } + r := getLastRule(bld, "ts_development_sources", ruleTypeRegular) + if r == nil { + continue // No devsources rule that needs updating. + } + addDep(bld, r, depName) + } +} + +// updateGenWizTS updates the sources of gen_wiz_ts() build rules referenced +// from ts_library()s. +func updateGenWizTS(bld *build.File) { + // For each ts_library, check if it references a gen_wiz_ts() rule in its srcs + for _, r := range buildRules(bld, "ts_library") { + srcs := r.AttrStrings("srcs") + var genWizRule *build.Rule + for _, src := range srcs { + if !strings.HasPrefix(src, ":") { + continue + } + candidate := edit.FindRuleByName(bld, strings.TrimPrefix(src, ":")) + if candidate != nil && candidate.Kind() == "gen_wiz_ts" { + genWizRule = candidate + break + } + } + // If so, add each source file ending with a wiz suffix to its srcs. + if genWizRule != nil { + addWizSrcsToTarget(bld, genWizRule, srcs) + } + } +} + +var wizSuffixes = []string{ + "controller.ts", + "model.ts", + "renderer.ts", + "processor.ts", + "service.ts", + "interface.ts", +} + +// addWizSrcsToTarget adds any entry from srcs to the sources of the given rule +// if it is a Wiz source (matches one of the suffixes). +func addWizSrcsToTarget(bld *build.File, rule *build.Rule, srcs []string) { + platform.Infof("Adding wiz sources to target %s:%s: %q", filepath.Dir(bld.Path), rule.Name(), srcs) +srcLoop: + for _, src := range srcs { + for _, suffix := range wizSuffixes { + if strings.HasSuffix(src, suffix) { + addToSrcsClobbering(bld, rule, src) + continue srcLoop + } + } + } +} diff --git a/ts_auto_deps/updater/internal_updater_test.go b/ts_auto_deps/updater/internal_updater_test.go new file mode 100644 index 00000000..4dbc9c87 --- /dev/null +++ b/ts_auto_deps/updater/internal_updater_test.go @@ -0,0 +1,86 @@ +package updater + +import ( + "context" + "os" + "path/filepath" + "reflect" + "testing" + + "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" +) + +func TestGoogle3Root(t *testing.T) { + r, err := workspace.Root("a/google3/b/c") + if err != nil { + t.Error(err) + } + // Expect an absolute, resolved path. + exp, err := filepath.Abs("a/google3") + if r != exp { + t.Errorf("got %s, expected %s", r, exp) + } +} + +func TestRegisterTestRule(t *testing.T) { + ctx := context.Background() + p, err := mktmp("google3/foo/BUILD", []byte(`ts_config(name = "tsconfig", deps = ["//foo/bar:bar_test"])`)) + if err != nil { + t.Fatal(err) + } + barPath, err := mktmp("google3/foo/bar/BUILD", []byte(`ts_library(name = "bar_test", testonly=True)`)) + if err != nil { + t.Fatal(err) + } + bazPath, err := mktmp("google3/foo/baz/BUILD", []byte(`ts_library(name = "baz_test", testonly=True)`)) + if err != nil { + t.Fatal(err) + } + + g3root := filepath.Dir(filepath.Dir(p)) + var updatedFile string + testUpdateFile := UpdateFile(func(ctx context.Context, filePath string, _ string) error { + var err error + updatedFile, err = filepath.Rel(g3root, filePath) + return err + }) + + updater := New(false, false, nil, testUpdateFile) + _, _, err = updater.RegisterTestRules(ctx, barPath) + if err != nil { + t.Fatal(err) + } + if updatedFile != "" { + t.Errorf("expected no update, got a write to %q", updatedFile) + } + + _, _, err = updater.RegisterTestRules(ctx, bazPath) + if err != nil { + t.Fatal(err) + } + if updatedFile != "foo/BUILD" { + t.Errorf("got an update to %q, expected foo/BUILD", updatedFile) + } +} + +func TestResolvePackages(t *testing.T) { + p, err := mktmp("google3/sub/pkg/file", []byte("")) + if err != nil { + t.Fatal(err) + } + if err := os.Chdir(filepath.Dir(p)); err != nil { + t.Fatal(err) + } + g3root := filepath.Dir(filepath.Dir(filepath.Dir(p))) + if filepath.Base(g3root) != "google3" { + t.Errorf("g3root should be called google3, got %q", g3root) + } + paths := []string{"//foo", "/bar"} + if err := ResolvePackages(paths); err != nil { + t.Fatal(err) + } + expected := []string{filepath.Join(g3root, "foo"), "/bar"} + if !reflect.DeepEqual(paths, expected) { + t.Errorf("ResolvePackages: got %s, expected %s", paths, expected) + } +} diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go index 0f51e63b..1960226c 100644 --- a/ts_auto_deps/updater/test_register.go +++ b/ts_auto_deps/updater/test_register.go @@ -5,8 +5,8 @@ import ( "fmt" "path/filepath" - "github.com/bazelbuild/buildtools/build" - "github.com/bazelbuild/buildtools/edit" + "google3/third_party/bazel_buildifier/build/build" + "google3/third_party/bazel_buildifier/edit/edit" "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" ) @@ -65,7 +65,7 @@ func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (boo continue } platform.Infof("Registering test rule in closest ts_config & ts_development_sources") - target := AbsoluteBazelTarget(bld, tr.Name()) + target := AbsoluteBlazeTarget(bld, tr.Name()) ancestorBuild, err := reg.registerTestRule(ctx, bld, tsConfig, g3root, target) if err != nil { return false, nil, err @@ -221,23 +221,23 @@ var wellKnownBuildRules = []struct { attrName string }{ { - name: "karma_polymer_test", + name: "karma_polymer_test", attrName: "test_ts_deps", }, { - name: "wct_closure_test_suite", + name: "wct_closure_test_suite", attrName: "js_deps", }, { - name: "jasmine_node_test", + name: "jasmine_node_test", attrName: "deps", }, { - name: "karma_web_test_suite", + name: "karma_web_test_suite", attrName: "deps", }, { - name: "boq_jswire_test_library", + name: "boq_jswire_test_library", attrName: "deps", }, } @@ -247,13 +247,13 @@ var wellKnownBuildRules = []struct { // wct_closure_test_suite or jasmine_node_test. func isRegisteredWithAlternateTestRule(bld *build.File, r *build.Rule, dep string) bool { pkg := filepath.Dir(bld.Path) - for _, wkbr := range wellKnownBuildRules { + for _, wkbr := range wellKnownBuildRules{ if isKind(r, wkbr.name) { testTsDeps := r.Attr(wkbr.attrName) if edit.ListFind(testTsDeps, dep, pkg) != nil { return true } - } + } } return false } diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go index f606e5bb..60ff54e5 100644 --- a/ts_auto_deps/updater/updater.go +++ b/ts_auto_deps/updater/updater.go @@ -1,5 +1,5 @@ -// Package updater implements the main logic of the ts_auto_deps command. It reads BUILD files, -// discovers TypeScript sources, uses `bazel analyze` to update import/dependency information, +// Package updater implements the main logic of the taze command. It reads BUILD files, +// discovers TypeScript sources, uses `blaze analyze` to update import/dependency information, // and then modifies the BUILD file accordingly. package updater @@ -17,26 +17,27 @@ import ( "sync" "time" - "flag" - "github.com/bazelbuild/buildtools/build" - "github.com/bazelbuild/buildtools/edit" + "google3/base/go/flag" + "google3/net/proto2/go/proto" + "google3/third_party/bazel_buildifier/build/build" + "google3/third_party/bazel_buildifier/edit/edit" "github.com/bazelbuild/rules_typescript/ts_auto_deps/analyze" "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - "github.com/golang/protobuf/proto" - "github.com/mattn/go-isatty" + "google3/third_party/golang/isatty/isatty" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" ) -var bazelErrorRE = regexp.MustCompile(`ERROR: ([^:]+):(\d+):\d+:`) + +var blazeErrorRE = regexp.MustCompile(`ERROR: ([^:]+):(\d+):\d+:`) // New creates a new updater from the given arguments. One updater can be used // to update many packages, repeatedly, but not concurrently. -// bazelAnalyze and updateFile can be passed in to handle ts_auto_deps operation in +// blazeAnalyze and updateFile can be passed in to handle taze operation in // different environments and for fakes in tests. -func New(removeUnusedDeclarations bool, updateComments bool, bazelAnalyze BazelAnalyzer, updateFile UpdateFile) *Updater { - return &Updater{removeUnusedDeclarations, updateComments, bazelAnalyze, updateFile} +func New(removeUnusedDeclarations bool, updateComments bool, blazeAnalyze BlazeAnalyzer, updateFile UpdateFile) *Updater { + return &Updater{removeUnusedDeclarations, updateComments, blazeAnalyze, updateFile} } // UpdateFile updates the contents of filePath. Implementations may postpone or batch actually writing the given file, i.e. @@ -48,19 +49,19 @@ func LocalUpdateFile(ctx context.Context, filePath string, contents string) erro return platform.WriteFile(ctx, filePath, []byte(contents)) } -// BazelAnalyzer is a function that executes bazel analyze for the given -// absolute build file path and bazel targets, and returns the raw analysis +// BlazeAnalyzer is a function that executes blaze analyze for the given +// absolute build file path and blaze targets, and returns the raw analysis // result proto, or an error if the analyze call failed. // It's used to abstract over execution using rabbit vs local execution. // Returns the main output (serialized AnalysisResult proto), any error // messages, or an error. -type BazelAnalyzer func(buildFilePath string, targets []string) ([]byte, []byte, error) +type BlazeAnalyzer func(buildFilePath string, targets []string) ([]byte, []byte, error) -// Updater encapsulates configuration for the ts_auto_deps process. +// Updater encapsulates configuration for the taze process. type Updater struct { removeUnusedDeclarations bool updateComments bool - bazelAnalyze BazelAnalyzer + blazeAnalyze BlazeAnalyzer updateFile UpdateFile } @@ -74,31 +75,31 @@ func attrTruthy(r *build.Rule, attr string) bool { var unusedDeclarationRE = regexp.MustCompile( `WARNING: [^:]+:\d+:(?:\d+:)? keeping possibly used ts_declaration '([^']+)'`) -// GarbledBazelResponseError signals to callers that the proto returned by bazel +// GarbledBlazeResponseError signals to callers that the proto returned by blaze // analyze was garbled, and couldn't be unmarshalled. // TODO(lucassloan): remove when b/112891536 is fixed -// Build Rabbit rewrites paths produced by bazel, which garbles the error -// messages from bazel analyze, since they're encoded in protobufs. -type GarbledBazelResponseError struct { +// Build Rabbit rewrites paths produced by blaze, which garbles the error +// messages from blaze analyze, since they're encoded in protobufs. +type GarbledBlazeResponseError struct { Message string } -func (g *GarbledBazelResponseError) Error() string { +func (g *GarbledBlazeResponseError) Error() string { return g.Message } -// runBazelAnalyze executes the `bazel analyze` command and extracts reports. +// runBlazeAnalyze executes the `blaze analyze` command and extracts reports. // It returns the dependency report with rule names referring to rules *before* -// macro expansion, or an error. runBazelAnalyze uses the given `analyze` -// function to actually run the `bazel analyze` operation, which allows -// exchanging it for a different implementation in the ts_auto_deps presubmit service. -func (upd *Updater) runBazelAnalyze(buildFilePath string, bld *build.File, rules []*build.Rule) ([]*arpb.DependencyReport, error) { +// macro expansion, or an error. runBlazeAnalyze uses the given `analyze` +// function to actually run the `blaze analyze` operation, which allows +// exchanging it for a different implementation in the taze presubmit service. +func (upd *Updater) runBlazeAnalyze(buildFilePath string, bld *build.File, rules []*build.Rule) ([]*arpb.DependencyReport, error) { var targets []string for _, r := range rules { - fullTarget := AbsoluteBazelTarget(bld, r.Name()) + fullTarget := AbsoluteBlazeTarget(bld, r.Name()) targets = append(targets, fullTarget) } - out, stderr, err := upd.bazelAnalyze(buildFilePath, targets) + out, stderr, err := upd.blazeAnalyze(buildFilePath, targets) if err != nil { return nil, err } @@ -106,15 +107,15 @@ func (upd *Updater) runBazelAnalyze(buildFilePath string, bld *build.File, rules var res arpb.AnalyzeResult if err := proto.Unmarshal(out, &res); err != nil { // TODO(lucassloan): remove when b/112891536 is fixed - // Build Rabbit rewrites paths produced by bazel, which garbles the error - // messages from bazel analyze, since they're encoded in protobufs. - return nil, &GarbledBazelResponseError{fmt.Sprintf("failed to unmarshal analysis result: %v\nin: %q", err, string(out))} + // Build Rabbit rewrites paths produced by blaze, which garbles the error + // messages from blaze analyze, since they're encoded in protobufs. + return nil, &GarbledBlazeResponseError{fmt.Sprintf("failed to unmarshal analysis result: %v\nin: %q", err, string(out))} } platform.Infof("analyze result %v", res) reports := res.GetDependencyReport() if len(targets) != len(reports) { if len(stderr) > 0 { - // TODO(b/73321854): pretend second rule has a syntactical error, so bazel analyze produces no + // TODO(b/73321854): pretend second rule has a syntactical error, so blaze analyze produces no // report for it, but also doesn't return an error code. Remove workaround once fixed. return nil, fmt.Errorf("parsing reports failed (%d reports for %s):\n%s", len(reports), targets, stderr) @@ -135,6 +136,7 @@ func (upd *Updater) runBazelAnalyze(buildFilePath string, bld *build.File, rules // Once existing code is fixed, this constitutes normal operation, and the logging below should be dropped. fmt.Fprintf(os.Stderr, "WARNING: removing apparently unused ts_declaration() dependency from %q.\n", report.GetRule()) + report.UnnecessaryDependency = append(report.UnnecessaryDependency, target) } } @@ -213,7 +215,7 @@ type globResult struct { } // globSources finds sources in path with any of the given extensions. -// It also filters out temporary files, dangling symlinks, and symlinks into bazel-bin specifically. +// It also filters out temporary files, dangling symlinks, and symlinks into blaze-bin specifically. // It returns file names relative to path. func globSources(ctx context.Context, path string, extensions []string) (srcSet, error) { var allSourcePaths []string @@ -315,9 +317,9 @@ func addToSrcsClobbering(bld *build.File, r *build.Rule, s string) { case nil, *build.ListExpr: // expected - a list of files (labels) or absent. default: - // Remove any glob calls, variables, etc. ts_auto_deps uses explicit source lists. + // Remove any glob calls, variables, etc. taze uses explicit source lists. fmt.Fprintf(os.Stderr, "WARNING: clobbering non-list srcs attribute on %s\n", - AbsoluteBazelTarget(bld, r.Name())) + AbsoluteBlazeTarget(bld, r.Name())) r.DelAttr("srcs") } val := &build.StringExpr{Value: s} @@ -331,10 +333,11 @@ func determineRuleType(path, s string) ruleType { return ruleTypeTest } + return ruleTypeRegular } -// AnalysisFailedError is returned by ts_auto_deps when the underlying analyze operation +// AnalysisFailedError is returned by taze when the underlying analyze operation // fails, e.g. because the BUILD files have syntactical errors. type AnalysisFailedError struct { Causes []AnalysisFailureCause @@ -371,7 +374,7 @@ func updateDeps(bld *build.File, reports []*arpb.DependencyReport) error { msg := fmt.Sprintf("dependency analysis failed for %s:\n%s", report.GetRule(), fb) - m := bazelErrorRE.FindStringSubmatch(fb) + m := blazeErrorRE.FindStringSubmatch(fb) if m == nil { // error message didn't contain file and line number, so just use the // path of the BUILD file that was analyzed @@ -404,7 +407,7 @@ func updateDeps(bld *build.File, reports []*arpb.DependencyReport) error { } for _, md := range report.MissingDependencyGroup { for _, d := range md.Dependency { - d = AbsoluteBazelTarget(bld, d) + d = AbsoluteBlazeTarget(bld, d) if d == fullTarget { return &AnalysisFailedError{ []AnalysisFailureCause{ @@ -446,6 +449,7 @@ func updateDeps(bld *build.File, reports []*arpb.DependencyReport) error { return nil } + // maybeWriteBUILD checks if the given file needs updating, i.e. whether the // canonical serialized form of bld has changed from the file contents on disk. // If so, writes the file and returns true, returns false otherwise. @@ -516,10 +520,10 @@ func getBUILDPath(ctx context.Context, path string) (string, string, string, err } // isTazeDisabledInPackage checks the BUILD file, or if the BUILD doesn't exist, -// the nearest ancestor BUILD file for a disable_ts_auto_deps() rule. +// the nearest ancestor BUILD file for a disable_taze() rule. func isTazeDisabledInPackage(ctx context.Context, g3root, buildFilePath, workspaceRelativePath string, bld *build.File) (bool, error) { if bld == nil { - // Make sure ts_auto_deps hasn't been disabled in the next closest ancestor package. + // Make sure taze hasn't been disabled in the next closest ancestor package. ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(workspaceRelativePath)) if _, ok := err.(*noAncestorBUILDError); ok { platform.Infof("Could not find any ancestor BUILD for %q, continuing with a new BUILD file", @@ -528,32 +532,32 @@ func isTazeDisabledInPackage(ctx context.Context, g3root, buildFilePath, workspa } else if err != nil { return false, err } else if buildHasDisableTaze(ancestor) { - fmt.Printf("ts_auto_deps disabled below %q\n", ancestor.Path) + fmt.Printf("taze disabled below %q\n", ancestor.Path) return true, nil } else { - platform.Infof("BUILD file missing and ts_auto_deps is enabled below %q. Creating new BUILD file.", + platform.Infof("BUILD file missing and taze is enabled below %q. Creating new BUILD file.", ancestor.Path) return false, nil } } if buildHasDisableTaze(bld) { - fmt.Printf("ts_auto_deps disabled on %q\n", buildFilePath) + fmt.Printf("taze disabled on %q\n", buildFilePath) return true, nil } return false, nil } -// SubdirectorySourcesError is returned when ts_auto_deps detects a BUILD file +// SubdirectorySourcesError is returned when taze detects a BUILD file // that references sources in another directory, either in the directory -// being ts_auto_depsd, or in a super directory. +// being tazed, or in a super directory. type SubdirectorySourcesError struct{} func (a *SubdirectorySourcesError) Error() string { - return "ts_auto_deps doesn't handle referencing sources in another directory " + - "- to use ts_auto_deps, migrate to having a BUILD file in every directory. " + - "For more details, see go/ts_auto_deps#subdirectory-sources" + return "taze doesn't handle referencing sources in another directory " + + "- to use taze, migrate to having a BUILD file in every directory. " + + "For more details, see go/taze#subdirectory-sources" } // hasSubdirectorySources checks if the BUILD file has ts_libraries that contain @@ -631,18 +635,20 @@ func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFil } updateSources(bld, srcs) + return upd.maybeWriteBUILD(ctx, buildFilePath, bld) } -// updateBUILDAfterBazelAnalyze applies the BUILD file updates that depend on bazel +// updateBUILDAfterBlazeAnalyze applies the BUILD file updates that depend on blaze // analyze's DependencyReports, most notably updating any rules' deps. -func (upd *Updater) updateBUILDAfterBazelAnalyze(ctx context.Context, isRoot bool, +func (upd *Updater) updateBUILDAfterBlazeAnalyze(ctx context.Context, isRoot bool, g3root string, buildFilePath string, bld *build.File, reports []*arpb.DependencyReport) (bool, error) { platform.Infof("Updating deps") if err := updateDeps(bld, reports); err != nil { return false, err } + platform.Infof("Setting library rule kinds") if err := setLibraryRuleKinds(ctx, buildFilePath, bld); err != nil { return false, err @@ -650,7 +656,7 @@ func (upd *Updater) updateBUILDAfterBazelAnalyze(ctx context.Context, isRoot boo return upd.maybeWriteBUILD(ctx, buildFilePath, bld) } -// IsTazeDisabledForDir checks if ts_auto_deps is disabled in the BUILD file in the dir, +// IsTazeDisabledForDir checks if taze is disabled in the BUILD file in the dir, // or if no BUILD file exists, in the closest ancestor BUILD func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { g3root, buildFilePath, workspaceRelativePath, err := getBUILDPath(ctx, dir) @@ -667,23 +673,23 @@ func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { return isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) } -// CantProgressAfterWriteError reports that ts_auto_deps was run in an environment -// where it can't make writes to the file system (such as when ts_auto_deps is running -// as a service for cider) and the writes it made need to be visible to bazel analyze, +// CantProgressAfterWriteError reports that taze was run in an environment +// where it can't make writes to the file system (such as when taze is running +// as a service for cider) and the writes it made need to be visible to blaze analyze, // so it can continue updating the BUILD file(s). In such a case, the caller should -// collect the writes using a custom UpdateFile function, and re-call ts_auto_deps after +// collect the writes using a custom UpdateFile function, and re-call taze after // applying the writes. type CantProgressAfterWriteError struct{} func (a *CantProgressAfterWriteError) Error() string { - return "running ts_auto_deps in a non-writable environment, can't continue until writes are applied" + return "running taze in a non-writable environment, can't continue until writes are applied" } // UpdateBUILDOptions bundles options for the UpdateBUILD function. type UpdateBUILDOptions struct { - // InNonWritableEnvironment boolean indicates to ts_auto_deps that the writes it makes - // won't be immediately visible to bazel analyze, so it cannot proceed normally. - // In this case, if it makes a write that needs to be visible to bazel analyze, it + // InNonWritableEnvironment boolean indicates to taze that the writes it makes + // won't be immediately visible to blaze analyze, so it cannot proceed normally. + // In this case, if it makes a write that needs to be visible to blaze analyze, it // will return a CantProgressAfterWriteError, which indicates that the caller // should apply the writes made to its UpdateFile function, and re-call UpdateBUILD // after the writes have been applied. @@ -702,8 +708,8 @@ type LatencyReport struct { // UpdateBUILD drives the main process of creating/updating the BUILD file // underneath path based on the available sources. Returns true if it modified -// the BUILD file, false if the BUILD file was up to date already. bazelAnalyze -// is used to run the underlying `bazel analyze` process. Returns another +// the BUILD file, false if the BUILD file was up to date already. blazeAnalyze +// is used to run the underlying `blaze analyze` process. Returns another // boolean that's true iff the package doesn't contain any TypeScript (source // files or BUILD rules). func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, *LatencyReport, error) { @@ -732,12 +738,12 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update latencyReport.GetBUILD = time.Since(start) start = time.Now() - ts_auto_depsDisabled, err := isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) + tazeDisabled, err := isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) if err != nil { return false, nil, err } latencyReport.TazeDisabled = time.Since(start) - if ts_auto_depsDisabled { + if tazeDisabled { return false, nil, nil } @@ -785,16 +791,17 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update } } platform.Infof("analyzing...") - reports, err := upd.runBazelAnalyze(buildFilePath, bld, rulesWithSrcs) + reports, err := upd.runBlazeAnalyze(buildFilePath, bld, rulesWithSrcs) if err != nil { return false, nil, err } - changedAfterBazelAnalyze, err := upd.updateBUILDAfterBazelAnalyze(ctx, options.IsRoot, g3root, buildFilePath, bld, reports) + + changedAfterBlazeAnalyze, err := upd.updateBUILDAfterBlazeAnalyze(ctx, options.IsRoot, g3root, buildFilePath, bld, reports) if err != nil { return false, nil, err } - changed = changed || changedAfterBazelAnalyze + changed = changed || changedAfterBlazeAnalyze if options.InNonWritableEnvironment && changed { return true, nil, &CantProgressAfterWriteError{} } @@ -802,12 +809,12 @@ func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options Update return changed, nil, nil } -// buildHasDisableTaze checks if the BUILD file should be managed using ts_auto_deps. -// Users can disable ts_auto_deps by adding a "disable_ts_auto_deps()" (or "dont_ts_auto_deps_me()") statement. +// buildHasDisableTaze checks if the BUILD file should be managed using taze. +// Users can disable taze by adding a "disable_taze()" (or "dont_taze_me()") statement. func buildHasDisableTaze(bld *build.File) bool { for _, stmt := range bld.Stmt { if call, ok := stmt.(*build.CallExpr); ok { - if fnName, ok := call.X.(*build.Ident); ok && (fnName.Name == "disable_ts_auto_deps" || fnName.Name == "dont_ts_auto_deps_me") { + if fnName, ok := call.X.(*build.Ident); ok && (fnName.Name == "disable_taze" || fnName.Name == "dont_taze_me") { return true } } @@ -815,14 +822,14 @@ func buildHasDisableTaze(bld *build.File) bool { return false } -// QueryBasedBazelAnalyze uses bazel query to analyze targets. It is available under a flag or +// QueryBasedBlazeAnalyze uses blaze query to analyze targets. It is available under a flag or // an environment variable on engineer's workstations. -func QueryBasedBazelAnalyze(buildFilePath string, targets []string) ([]byte, []byte, error) { +func QueryBasedBlazeAnalyze(buildFilePath string, targets []string) ([]byte, []byte, error) { root, err := workspace.Root(buildFilePath) if err != nil { return nil, nil, err } - reports, err := analyze.New(analyze.NewQueryBasedTargetLoader(root, "bazel")).Analyze(context.Background(), buildFilePath, targets) + reports, err := analyze.New(analyze.NewQueryBasedTargetLoader(root, "blaze")).Analyze(context.Background(), buildFilePath, targets) if err != nil { return nil, nil, err } @@ -853,7 +860,7 @@ func buildRules(bld *build.File, kind string) []*build.Rule { // Find all rules, then filter by kind. // This is nearly the same as just calling bld.Rules(kind), but allows to // retrieve ng_module and ts_library intermixed, in the order in which they - // appear in the BUILD file. That allows ts_auto_deps to consistently always pick the + // appear in the BUILD file. That allows taze to consistently always pick the // last build rule in the file in case multiple match, regardless of kind. allRules := bld.Rules("") var res []*build.Rule @@ -886,12 +893,12 @@ func addDep(bld *build.File, r *build.Rule, dep string) { edit.AddValueToListAttribute(r, "deps", pkg, &build.StringExpr{Value: dep}, nil) } -// AbsoluteBazelTarget converts a ruleName to an absolute target string (//foo/bar:bar). +// AbsoluteBlazeTarget converts a ruleName to an absolute target string (//foo/bar:bar). // It interprets ruleName relative to the given build file's package. It // supports plain names, names starting with colons, absolute paths, and // absolute paths with shorthand target syntax (i.e. "bar", ":bar", "//foo/bar", // "//foo/bar:bar"). -func AbsoluteBazelTarget(bld *build.File, ruleName string) string { +func AbsoluteBlazeTarget(bld *build.File, ruleName string) string { if strings.HasPrefix(ruleName, "//") { // already absolute if colonIdx := strings.LastIndex(ruleName, ":"); colonIdx == -1 { @@ -928,8 +935,8 @@ func removeSourcesUsed(bld *build.File, ruleKind, attrName string, srcs srcSet) } const ( - tsSkylarkLabel = "@npm_bazel_typescript//:index.bzl" - ngSkylarkLabel = "@angular//:index.bzl" + tsSkylarkLabel = "//javascript/typescript:build_defs.bzl" + ngSkylarkLabel = "//javascript/angular2:build_defs.bzl" ) func removeUnusedLoad(bld *build.File, kind string) { @@ -948,6 +955,7 @@ func removeUnusedLoad(bld *build.File, kind string) { continue } + var from, to []*build.Ident for i, ca := range load.To { if ca.Name != kind { @@ -1036,7 +1044,7 @@ func updateWebAssets(ctx context.Context, buildFilePath string, bld *build.File) for _, r := range bld.Rules("ng_module") { srcs := r.Attr("assets") if call, ok := srcs.(*build.CallExpr); ok && call.X.(*build.Ident).Name == "glob" { - // Remove any glob calls, ts_auto_deps uses explicit source lists. + // Remove any glob calls, taze uses explicit source lists. r.DelAttr("assets") } @@ -1241,7 +1249,7 @@ func FindBUILDFile(ctx context.Context, pkgToBUILD map[string]*build.File, return bld, err } -// Paths gets the list of paths for the current execution of ts_auto_deps. +// Paths gets the list of paths for the current execution of taze. func Paths(isRoot bool, files bool, recursive bool) ([]string, error) { paths := flag.Args() if len(paths) == 0 { @@ -1280,7 +1288,7 @@ func Paths(isRoot bool, files bool, recursive bool) ([]string, error) { return nil }) if err != nil { - return nil, fmt.Errorf("ts_auto_deps -recursive failed: %s", err) + return nil, fmt.Errorf("taze -recursive failed: %s", err) } } sort.Sort(byLengthInverted(allPaths)) @@ -1290,7 +1298,7 @@ func Paths(isRoot bool, files bool, recursive bool) ([]string, error) { return paths, nil } -// Execute runs ts_auto_deps on paths using host. +// Execute runs taze on paths using host. func Execute(host *Updater, paths []string, isRoot, recursive bool) error { ctx := context.Background() for i, p := range paths { @@ -1298,9 +1306,9 @@ func Execute(host *Updater, paths []string, isRoot, recursive bool) error { changed, _, err := host.UpdateBUILD(ctx, p, UpdateBUILDOptions{InNonWritableEnvironment: false, IsRoot: isLastAndRoot}) if err != nil { if recursive { - return fmt.Errorf("ts_auto_deps failed on %s/BUILD: %s", p, err) + return fmt.Errorf("taze failed on %s/BUILD: %s", p, err) } - return fmt.Errorf("ts_auto_deps failed: %s", err) + return fmt.Errorf("taze failed: %s", err) } if changed { if filepath.Base(p) == "BUILD" { diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go index 613b99f4..38c97401 100644 --- a/ts_auto_deps/updater/updater_test.go +++ b/ts_auto_deps/updater/updater_test.go @@ -9,10 +9,10 @@ import ( "strings" "testing" - "github.com/bazelbuild/buildtools/build" - "github.com/golang/protobuf/proto" + "google3/net/proto2/go/proto" + "google3/third_party/bazel_buildifier/build/build" - arpb "github.com/bazelbuild/rules_typescript/ts_auto_deps/proto" + arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" ) var ( @@ -52,7 +52,7 @@ func TestGlobSources(t *testing.T) { t.Fatal(err) } } - if err := os.Symlink("../bazel-bin/symlink.d.ts", filepath.Join(testTmpDir, "symlink.d.ts")); err != nil { + if err := os.Symlink("../blaze-bin/symlink.d.ts", filepath.Join(testTmpDir, "symlink.d.ts")); err != nil { t.Fatal(err) } if err := os.Symlink("whatever", filepath.Join(testTmpDir, "whatever.d.ts")); err != nil { @@ -83,6 +83,7 @@ func TestDetermineRuleType(t *testing.T) { {"java/com/google/myapp/BUILD", "foo_test.ts", ruleTypeTest}, {"java/com/google/myapp/BUILD", "foo_test.tsx", ruleTypeTest}, + {"java/com/google/testing/mytesttool/BUILD", "foo.ts", ruleTypeRegular}, {"testing/mytesttool/BUILD", "foo.ts", ruleTypeRegular}, {"testing/mytesttool/BUILD", "foo_test.ts", ruleTypeTest}, @@ -104,7 +105,7 @@ func parseReport(t *testing.T, input string) *arpb.DependencyReport { return report } -func TestBazelAnalyzeError(t *testing.T) { +func TestBlazeAnalyzeError(t *testing.T) { bld, err := build.ParseBuild("rules/BUILD", []byte(` ts_library( name = "firstrule", @@ -127,15 +128,15 @@ ts_library( return data, []byte(`Here's the actual error`), err } upd := &Updater{} - upd.bazelAnalyze = mockAnalyze - report, err := upd.runBazelAnalyze("firstrule/BUILD", bld, bld.Rules("ts_library")) + upd.blazeAnalyze = mockAnalyze + report, err := upd.runBlazeAnalyze("firstrule/BUILD", bld, bld.Rules("ts_library")) if err == nil { t.Fatalf("expected an error, got a report: %v", report) } expected := `parsing reports failed (1 reports for [//rules:firstrule //rules:secondrule]): Here's the actual error` if err.Error() != expected { - t.Errorf("runBazelAnalyze: got %q, expected %q", err.Error(), expected) + t.Errorf("runBlazeAnalyze: got %q, expected %q", err.Error(), expected) } } @@ -472,7 +473,7 @@ func TestWebAssetReferredByColon(t *testing.T) { } } -func TestAbsoluteBazelTarget(t *testing.T) { +func TestAbsoluteBlazeTarget(t *testing.T) { bld := &build.File{Path: "foo/bar/BUILD", Type: build.TypeBuild} tests := []struct{ target, expected string }{ {"//foo/bar:bar", "//foo/bar:bar"}, @@ -481,9 +482,9 @@ func TestAbsoluteBazelTarget(t *testing.T) { {"//foo/bar", "//foo/bar:bar"}, } for _, tst := range tests { - abs := AbsoluteBazelTarget(bld, tst.target) + abs := AbsoluteBlazeTarget(bld, tst.target) if abs != tst.expected { - t.Errorf("AbsoluteBazelTarget(%q): got %q, expected %q", tst.target, abs, tst.expected) + t.Errorf("AbsoluteBlazeTarget(%q): got %q, expected %q", tst.target, abs, tst.expected) } } } diff --git a/ts_auto_deps/workspace/BUILD.bazel b/ts_auto_deps/workspace/BUILD.bazel deleted file mode 100644 index 38f81231..00000000 --- a/ts_auto_deps/workspace/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["workspace.go"], - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace", - visibility = ["//visibility:public"], - deps = ["@com_github_bazelbuild_buildtools//wspace:go_default_library"], -) diff --git a/ts_auto_deps/workspace/workspace.go b/ts_auto_deps/workspace/workspace.go index c7f1ac26..db4d4fde 100644 --- a/ts_auto_deps/workspace/workspace.go +++ b/ts_auto_deps/workspace/workspace.go @@ -1,13 +1,26 @@ package workspace -import "github.com/bazelbuild/buildtools/wspace" +import ( + "fmt" + "path/filepath" +) -// Root finds the closest directory containing a WORKSPACE file from p. +// Root finds the closest google3 root from p. func Root(p string) (string, error) { - return wspace.Find(p) + p, err := filepath.Abs(p) + if err != nil { + return "", fmt.Errorf("unable to determine google3 root from %s: %v", p, err) + } + + for step := p; step != "/" && step != "."; step = filepath.Dir(step) { + if filepath.Base(step) == "google3" { + return step, nil + } + } + return "", fmt.Errorf("unable to determine google3 root, no 'google3' in %s", p) } // Name returns the name of the workspace. func Name() string { - return "TODO" + return "google3" } diff --git a/ts_auto_deps/workspace/workspace.go.oss b/ts_auto_deps/workspace/workspace.go.oss new file mode 100644 index 00000000..c7f1ac26 --- /dev/null +++ b/ts_auto_deps/workspace/workspace.go.oss @@ -0,0 +1,13 @@ +package workspace + +import "github.com/bazelbuild/buildtools/wspace" + +// Root finds the closest directory containing a WORKSPACE file from p. +func Root(p string) (string, error) { + return wspace.Find(p) +} + +// Name returns the name of the workspace. +func Name() string { + return "TODO" +} From dbdcb1c4f56c455f6df6229c49e31451972f57e5 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 26 Nov 2019 09:59:57 -0800 Subject: [PATCH 235/316] Properly handle negative error codes in typescript diagnostic identifiers for tsc_wrapped diagnostics extensions Since diagnostic identifier code's are of type `number`, both positive and negative numbers should be valid. PiperOrigin-RevId: 282587002 --- internal/tsc_wrapped/diagnostics.ts | 4 ++-- internal/tsc_wrapped/diagnostics_test.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/diagnostics.ts b/internal/tsc_wrapped/diagnostics.ts index 89c26806..32fbfe0f 100644 --- a/internal/tsc_wrapped/diagnostics.ts +++ b/internal/tsc_wrapped/diagnostics.ts @@ -22,7 +22,7 @@ export function filterExpected( // 2. Required TS error: 'TS2000: message text.' // Need triple escapes because the expected diagnostics that we're matching // here are regexes, too. - const ERROR_RE = /^(?:\\\((\d*),(\d*)\\\).*)?TS(\d+):(.*)/; + const ERROR_RE = /^(?:\\\((\d*),(\d*)\\\).*)?TS(-?\d+):(.*)/; const incorrectErrors = bazelOpts.expectedDiagnostics.filter(e => !e.match(ERROR_RE)); if (incorrectErrors.length) { @@ -52,7 +52,7 @@ export function filterExpected( const expectedDiags: ExpectedDiagnostics[] = bazelOpts.expectedDiagnostics.map(expected => { - const m = expected.match(/^(?:\\\((\d*),(\d*)\\\).*)?TS(\d+):(.*)$/); + const m = expected.match(/^(?:\\\((\d*),(\d*)\\\).*)?TS(-?\d+):(.*)$/); if (!m) { throw new Error( 'Incorrect expected error, did you forget character escapes in ' + diff --git a/internal/tsc_wrapped/diagnostics_test.ts b/internal/tsc_wrapped/diagnostics_test.ts index fceece44..8acf2120 100644 --- a/internal/tsc_wrapped/diagnostics_test.ts +++ b/internal/tsc_wrapped/diagnostics_test.ts @@ -58,5 +58,10 @@ describe('diagnostics', () => { 'Incorrect expected error, did you forget character escapes in ' + 'TS1234:unescaped \n newline'); }); + + it('handle negative diagnostic codes', () => { + expect(filter(['TS-999:custom error'], [diag(-999, 'custom error')])) + .toEqual([]); + }); }); }); From 0f225045df02b598faf01d76951fc669618b475e Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 26 Nov 2019 13:29:17 -0800 Subject: [PATCH 236/316] Avoid depset union operators Depset operators `+`, `+=`, `|` and the depset.union() method are deprecated. They were error-prone and led to build performance problems. Instead, creating a new depset should be done with the depset constructor. Also, the 'items' argument of depset is deprecated. PiperOrigin-RevId: 282628656 --- internal/common/compilation.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 6d1aa9f7..e815f372 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -302,7 +302,7 @@ def compile_ts( input_declarations = depset(src_declarations, transitive = [dep_declarations.transitive]) type_blacklisted_declarations = dep_declarations.type_blacklisted if not is_library and not _should_generate_externs(ctx): - type_blacklisted_declarations += srcs_files + type_blacklisted_declarations = depset(srcs_files, transitive = [type_blacklisted_declarations]) # The depsets of output files. These are the files that are always built # (including e.g. if you "blaze build :the_target" directly). From 09f0469fe9b90b0f031994019e7e104f1ca1ce43 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 27 Nov 2019 11:39:08 -0800 Subject: [PATCH 237/316] Unpublish ts_auto_deps. PiperOrigin-RevId: 282807385 --- BUILD.bazel | 3 - README.md | 1 - package.bzl | 11 +- ts_auto_deps/BUILD.bazel | 48 - ts_auto_deps/analyze/analyze.go | 603 -------- ts_auto_deps/analyze/analyze_test.go | 657 -------- ts_auto_deps/analyze/imports.go | 150 -- ts_auto_deps/analyze/imports_test.go | 85 -- ts_auto_deps/analyze/loader.go | 741 --------- ts_auto_deps/analyze/loader_test.go | 97 -- ts_auto_deps/main.go | 54 - ts_auto_deps/platform/file.go | 58 - ts_auto_deps/platform/file.go.oss | 54 - ts_auto_deps/platform/log.go | 18 - ts_auto_deps/platform/log.go.oss | 22 - ts_auto_deps/platform/walk.go | 20 - ts_auto_deps/platform/walk.go.oss | 15 - ts_auto_deps/proto/analyze_result.proto | 98 -- ts_auto_deps/updater/comments.go | 208 --- ts_auto_deps/updater/comments_test.go | 184 --- ts_auto_deps/updater/internal_rules.go | 125 -- ts_auto_deps/updater/internal_updater_test.go | 86 -- ts_auto_deps/updater/test_register.go | 259 ---- ts_auto_deps/updater/updater.go | 1348 ----------------- ts_auto_deps/updater/updater_test.go | 564 ------- ts_auto_deps/workspace/workspace.go | 26 - ts_auto_deps/workspace/workspace.go.oss | 13 - 27 files changed, 1 insertion(+), 5547 deletions(-) delete mode 100644 ts_auto_deps/BUILD.bazel delete mode 100644 ts_auto_deps/analyze/analyze.go delete mode 100644 ts_auto_deps/analyze/analyze_test.go delete mode 100644 ts_auto_deps/analyze/imports.go delete mode 100644 ts_auto_deps/analyze/imports_test.go delete mode 100644 ts_auto_deps/analyze/loader.go delete mode 100644 ts_auto_deps/analyze/loader_test.go delete mode 100644 ts_auto_deps/main.go delete mode 100644 ts_auto_deps/platform/file.go delete mode 100644 ts_auto_deps/platform/file.go.oss delete mode 100644 ts_auto_deps/platform/log.go delete mode 100644 ts_auto_deps/platform/log.go.oss delete mode 100644 ts_auto_deps/platform/walk.go delete mode 100644 ts_auto_deps/platform/walk.go.oss delete mode 100644 ts_auto_deps/proto/analyze_result.proto delete mode 100644 ts_auto_deps/updater/comments.go delete mode 100644 ts_auto_deps/updater/comments_test.go delete mode 100644 ts_auto_deps/updater/internal_rules.go delete mode 100644 ts_auto_deps/updater/internal_updater_test.go delete mode 100644 ts_auto_deps/updater/test_register.go delete mode 100644 ts_auto_deps/updater/updater.go delete mode 100644 ts_auto_deps/updater/updater_test.go delete mode 100644 ts_auto_deps/workspace/workspace.go delete mode 100644 ts_auto_deps/workspace/workspace.go.oss diff --git a/BUILD.bazel b/BUILD.bazel index 7f69e55b..b0a00518 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -45,8 +45,5 @@ npm_package( "//devserver:devserver-windows", "//internal:generated_BUILD", "//internal:tsc_wrapped", - "//ts_auto_deps:ts_auto_deps-darwin", - "//ts_auto_deps:ts_auto_deps-linux", - "//ts_auto_deps:ts_auto_deps-windows", ], ) diff --git a/README.md b/README.md index 41028ada..8b1aceba 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ This repo contains a mirror of some Google-internal bits that support TypeScript It contains these utilities: - `ts_devserver`: a Go library and binary that runs a fast local web server which concatenates JavaScript on-the-fly. It requires inputs in a named module format (module ids must be contained in the file, not inferred from the file's path). -- `ts_auto_deps`: a Go library and binary which generates `BUILD.bazel` files from TypeScript sources. - `tsc_wrapped`: a TypeScript program which wraps the TypeScript compiler, hosting it under a Bazel worker. - `tsetse`: a collection of third-party "strictness" checks which we add to the TypeScript compiler. - `internal/common/*.bzl`: some Starlark utility code for running the `ts_library` rule. diff --git a/package.bzl b/package.bzl index 2e4473d8..e1c4bb3e 100644 --- a/package.bzl +++ b/package.bzl @@ -42,7 +42,7 @@ def rules_typescript_dev_dependencies(): sha256 = "f624fe9ca8d51de192655369ac538c420afb7cde16e1ad052554b582fff09287", ) - # For building ts_devserver and ts_auto_deps binaries + # For building ts_devserver binary # See https://github.com/bazelbuild/rules_go#setup for the latest version. _maybe( http_archive, @@ -77,15 +77,6 @@ def rules_typescript_dev_dependencies(): sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687", ) - # ts_auto_deps depends on com_github_bazelbuild_buildtools - _maybe( - http_archive, - name = "com_github_bazelbuild_buildtools", - url = "https://github.com/bazelbuild/buildtools/archive/0.19.2.1.zip", - strip_prefix = "buildtools-0.19.2.1", - sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79", - ) - def _maybe(repo_rule, name, **kwargs): if not native.existing_rule(name): repo_rule(name = name, **kwargs) diff --git a/ts_auto_deps/BUILD.bazel b/ts_auto_deps/BUILD.bazel deleted file mode 100644 index b71e8a14..00000000 --- a/ts_auto_deps/BUILD.bazel +++ /dev/null @@ -1,48 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") - -go_library( - name = "go_default_library", - srcs = ["main.go"], - importpath = "github.com/bazelbuild/rules_typescript/ts_auto_deps", - visibility = ["//visibility:private"], - deps = [ - "//ts_auto_deps/platform:go_default_library", - "//ts_auto_deps/updater:go_default_library", - ], -) - -go_binary( - name = "ts_auto_deps_bin", - embed = [":go_default_library"], - visibility = ["//visibility:public"], -) - -go_binary( - name = "ts_auto_deps-darwin", - out = "ts_auto_deps-darwin_x64", - embed = [":go_default_library"], - goarch = "amd64", - goos = "darwin", - pure = "on", - visibility = ["//visibility:public"], -) - -go_binary( - name = "ts_auto_deps-linux", - out = "ts_auto_deps-linux_x64", - embed = [":go_default_library"], - goarch = "amd64", - goos = "linux", - pure = "on", - visibility = ["//visibility:public"], -) - -go_binary( - name = "ts_auto_deps-windows", - out = "ts_auto_deps-win32_x64.exe", - embed = [":go_default_library"], - goarch = "amd64", - goos = "windows", - pure = "on", - visibility = ["//visibility:public"], -) diff --git a/ts_auto_deps/analyze/analyze.go b/ts_auto_deps/analyze/analyze.go deleted file mode 100644 index 00bb81ac..00000000 --- a/ts_auto_deps/analyze/analyze.go +++ /dev/null @@ -1,603 +0,0 @@ -// Package analyze uses blaze query to determine and locate missing imports -// in TypeScript source files. -package analyze - -import ( - "context" - "fmt" - "os" - "path/filepath" - "regexp" - "strings" - - "google3/net/proto2/go/proto" - "google3/third_party/bazel_buildifier/edit/edit" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - - appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" - arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" -) - -var ( - extensions = []string{ - // '.d.ts' must come before '.ts' to completely remove the '.d.ts' - // extension. - ".d.ts", - ".ts", - ".tsx", - } -) - -const ( - // debug enables/disables debug logging. Set to true to have debug statements - // print to stdout, set to false to disable debug statements. - debug = false -) - -// debugf prints a formatted message prefixed with "DEBUG:" if the debug -// flag is enabled. -func debugf(format string, v ...interface{}) { - if debug { - fmt.Printf(fmt.Sprintf("DEBUG: %s\n", format), v...) - } -} - -// TargetLoader provides methods for loading targets from BUILD files. -type TargetLoader interface { - // LoadTargets loads targets from BUILD files associated with labels. A target - // is a rule, source file, generated file, package group or environment group. - // It returns a mapping from labels to targets or an error, if any occurred. - // - // A label must be the absolute label associated with a target. For example, - // '//foo/bar:baz' is acceptable whereas 'bar:baz' or '//foo/bar' will result - // in undefined behavior. TODO(lucassloan): make this an error - // - // Only returns targets visible to currentPkg. If currentPkg is an empty - // string returns all targets regardless of visibility. - LoadTargets(currentPkg string, labels []string) (map[string]*appb.Target, error) - // LoadRules loads rules from BUILD files associated with labels. - // It returns a mapping from labels to rules or an error, if any - // occurred. - // - // A label must be the absolute label associated with a rule. For - // example, '//foo/bar:baz' is acceptable whereas 'bar:baz' or '//foo/bar' - // will result in undefined behavior. - // TODO(lucassloan): make this an error. - // - // Only returns rules visible to currentPkg. If currentPkg is an empty string - // returns all rules regardless of visibility. - LoadRules(currentPkg string, labels []string) (map[string]*appb.Rule, error) - // LoadImportPaths loads targets from BUILD files associated with import - // paths relative to a root directory. It returns a mapping from import - // paths to targets or an error, if any occurred. - // - // An import path is the path present in a TypeScript import statement - // resolved relative to the workspace root. For example, an import - // statement 'import baz from "../baz.ts"' declared in the TypeScript - // source file '//foo/bar.ts' would have the import path of 'baz.ts'. If - // no target is found associated with a provided import path, the import - // path should be excluded from the returned mapping but an error should - // not be returned. - // - // Only returns rules visible to currentPkg. If currentPkg is an empty string - // returns all targets regardless of visibility. - LoadImportPaths(ctx context.Context, targetToAnalyze *appb.Rule, currentPkg, root string, paths []string) (map[string]*appb.Rule, error) -} - -// Analyzer uses a BuildLoader to generate dependency reports. -type Analyzer struct { - loader TargetLoader -} - -// New returns a new Analyzer which can be used to generate dependency reports. -func New(loader TargetLoader) *Analyzer { - return &Analyzer{loader: loader} -} - -// Analyze generates a dependency report for each target label in labels. -// -// dir is the directory that taze should execute in. Must be a sub-directory -// of the workspace root. -func (a *Analyzer) Analyze(ctx context.Context, dir string, labels []string) ([]*arpb.DependencyReport, error) { - if len(labels) == 0 { - return nil, nil - } - _, currentPkg, _ := edit.ParseLabel(labels[0]) - for _, label := range labels { - if _, pkg, _ := edit.ParseLabel(label); pkg != currentPkg { - return nil, fmt.Errorf("can't analyze targets in different packages") - } - } - root, err := workspace.Root(dir) - if err != nil { - return nil, err - } - rules, err := a.loader.LoadRules(currentPkg, labels) - if err != nil { - return nil, err - } - resolved, err := a.resolveImportsForTargets(ctx, currentPkg, root, rules) - if err != nil { - return nil, err - } - return a.generateReports(labels, resolved) -} - -// resolvedTarget represents a Blaze target and all resolved information. -type resolvedTarget struct { - label string - // A map of all existing dependencies on a target at the time of analysis. - // The keys are labels and the values are thes loaded target. - dependencies map[string]*appb.Rule - // A map of source file paths to their imports. - imports map[string][]*tazeImport - // rule is the original rule the target was constructed from. - rule *appb.Rule - // missingSources are source files which could not be opened on disk. - // These are added to the dependency reports and MissingSources. - missingSources []string - // A map from the labels in the target's srcs to the Targets those - // labels refer. - sources map[string]*appb.Target - literalSourcePaths []string - generatedSourcePaths []string -} - -// setSources sets the sources on t. It returns an error if one of the srcs of -// t's rule isn't in loadedSrcs. It also sorts the sources into literal and -// generated sources, setting literalSourcePaths and generatedSourcePaths. -// Returns an error if all the sources are generated - taze can't read the -// import statements to determine deps. -func (t *resolvedTarget) setSources(loadedSrcs map[string]*appb.Target) error { - for _, label := range listAttribute(t.rule, "srcs") { - src := loadedSrcs[label] - if src == nil { - return fmt.Errorf("no source found for label %s", label) - } - t.sources[label] = src - if src.GetType() == appb.Target_SOURCE_FILE { - t.literalSourcePaths = append(t.literalSourcePaths, labelToPath(label)) - } else { - t.generatedSourcePaths = append(t.generatedSourcePaths, labelToPath(label)) - } - } - if len(t.literalSourcePaths) == 0 && len(t.generatedSourcePaths) > 0 { - return fmt.Errorf("rule has generated sources - cannot determine dependencies") - } - return nil -} - -// srcs returns the labels of the sources of t. -func (t *resolvedTarget) srcs() ([]string, error) { - srcs := listAttribute(t.rule, "srcs") - if srcs == nil { - return nil, fmt.Errorf("target %q missing \"srcs\" attribute", t.label) - } - - return srcs, nil -} - -// getAllLiteralSrcPaths returns the file paths of all the non-generated sources -// of the targets. -func getAllLiteralSrcPaths(targets map[string]*resolvedTarget) ([]string, error) { - var allLiteralSrcPaths []string - for _, t := range targets { - allLiteralSrcPaths = append(allLiteralSrcPaths, t.literalSourcePaths...) - } - - return allLiteralSrcPaths, nil -} - -func (t *resolvedTarget) deps() []string { - return listAttribute(t.rule, "deps") -} - -// provides returns whether the resolved target can provide the path provided. -func (t *resolvedTarget) provides(path string) bool { - for _, label := range listAttribute(t.rule, "srcs") { - src := t.sources[label] - if src.GetType() == appb.Target_SOURCE_FILE { - // For literal sources, check the path of the source - if labelToPath(label) == path { - return true - } - } else if src.GetType() == appb.Target_RULE { - // For generated souces, check against the paths of rule's - // outputs - for _, genSrc := range src.GetRule().GetRuleOutput() { - if labelToPath(genSrc) == path { - return true - } - } - } - } - return false -} - -// newTarget constructs a new target instance from a loaded rule. -func newResolvedTarget(r *appb.Rule) *resolvedTarget { - return &resolvedTarget{ - label: r.GetName(), - dependencies: make(map[string]*appb.Rule), - imports: make(map[string][]*tazeImport), - rule: r, - sources: make(map[string]*appb.Target), - } -} - -// resolveImportsForTargets attempts to resolve the imports in the sources of -// each target in targets. -func (a *Analyzer) resolveImportsForTargets(ctx context.Context, currentPkg, root string, allTargets map[string]*appb.Rule) (map[string]*resolvedTarget, error) { - targets := make(map[string]*resolvedTarget) - var allDeps, allSrcs []string - for _, t := range allTargets { - target := newResolvedTarget(t) - targets[target.label] = target - srcs, err := target.srcs() - if err != nil { - return nil, err - } - allDeps = append(allDeps, target.deps()...) - allSrcs = append(allSrcs, srcs...) - } - deps, err := a.loader.LoadRules(currentPkg, allDeps) - if err != nil { - return nil, err - } - // Associate the loaded existing deps with the target or targets which - // contained them. - for _, t := range targets { - for _, dep := range t.deps() { - t.dependencies[dep] = deps[dep] - } - } - // load all the sources in the targets, so that literal and generated - // targets can be distinguished - srcs, err := a.loader.LoadTargets(currentPkg, allSrcs) - if err != nil { - return nil, err - } - for _, t := range targets { - err := t.setSources(srcs) - if err != nil { - return nil, err - } - } - // only extract the imports out of the literal sources, since taze can't - // see the contents of generated files - allLiteralSrcPaths, err := getAllLiteralSrcPaths(targets) - if err != nil { - return nil, err - } - imports, errs := extractAllImports(root, allLiteralSrcPaths) - for _, err := range errs { - // NotExist errors are caught and added to the generated dependency - // reports as missing source files. Only errors which are not NotExist - // errors should be reported. - if !os.IsNotExist(err) { - return nil, err - } - } - for _, t := range targets { - srcs := t.literalSourcePaths - for _, src := range srcs { - v, ok := imports[src] - if ok { - t.imports[src] = v - } else { - // The source was not found on disk during import extraction. - t.missingSources = append(t.missingSources, relativePathLabel(t.label, src)) - } - } - } - if err := a.resolveImports(ctx, currentPkg, root, targets); err != nil { - return nil, err - } - return targets, nil -} - -// resolveImports finds targets which provide the imported file or library -// for imports without known targets. -func (a *Analyzer) resolveImports(ctx context.Context, currentPkg, root string, targets map[string]*resolvedTarget) error { - for _, target := range targets { - var paths []string - needingResolution := make(map[string][]*tazeImport) - for _, imports := range target.imports { - handlingImports: - for _, imp := range imports { - resolvedPath := imp.resolvedPath() - for _, path := range pathWithExtensions(resolvedPath) { - if target.provides(path) { - imp.knownTarget = target.label - continue handlingImports - } - } - d, err := a.findExistingDepProvidingImport(ctx, root, target, imp) - if err != nil { - return err - } - if d == "" { - // A target providing the import was not found on the - // existing dependencies or in a comment. Use other - // heuristics. - paths = append(paths, resolvedPath) - needingResolution[resolvedPath] = append(needingResolution[resolvedPath], imp) - continue - } - imp.knownTarget = d - } - } - if len(needingResolution) == 0 { - continue - } - res, err := a.loader.LoadImportPaths(ctx, target.rule, currentPkg, root, paths) - if err != nil { - return err - } - for path, imports := range needingResolution { - if target, ok := res[path]; ok { - for _, imp := range imports { - imp.knownTarget = redirectedLabel(target) - } - } - } - } - return nil -} - -func pathWithExtensions(basename string) []string { - var paths []string - for _, ext := range extensions { - paths = append(paths, basename+ext) - } - return paths -} - -var ambientModuleDeclRE = regexp.MustCompile("(?m)^\\s*declare\\s+module\\s+['\"]([^'\"]+)['\"]\\s+\\{") - -// findExistingDepProvidingImport looks through a map of the existing deps to -// see if any of them provide the import in a way that can't be queried -// for. E.g. if the build rule has a "module_name" attribute or if one -// of the .d.ts sources has an ambient module declaration. -// -// If the import already has a knownTarget, findRuleProvidingImport will -// return the knownTarget. -func (a *Analyzer) findExistingDepProvidingImport(ctx context.Context, root string, rt *resolvedTarget, i *tazeImport) (string, error) { - if i.knownTarget != "" { - return i.knownTarget, nil - } - - // check if any of the existing deps declare a module_name that matches the import - for _, r := range rt.dependencies { - resolvedImportPath := resolveAgainstModuleRoot(r, i.importPath) - if resolvedImportPath == i.importPath { - continue - } - - // enumerate all the possible filepaths for the resolved import path, and - // compare against all the srcs - possibleImportPaths := possibleFilepaths(resolvedImportPath) - for _, src := range listAttribute(r, "srcs") { - for _, mi := range possibleImportPaths { - if mi == labelToPath(src) { - return r.GetName(), nil - } - } - } - } - - // check if any of the other sources or the souces of any of the deps are .d.ts - // files which have ambient module declarations - var allRules []*appb.Rule - for _, r := range rt.dependencies { - allRules = append(allRules, r) - } - allRules = append(allRules, rt.rule) - for _, r := range allRules { - for _, src := range listAttribute(r, "srcs") { - fp := filepath.Join(root, labelToPath(src)) - if !strings.HasSuffix(fp, ".d.ts") { - continue - } - - contents, err := platform.ReadFile(ctx, fp) - if err != nil { - return "", fmt.Errorf("error reading file looking for ambient module decls: %s", err) - } - - matches := ambientModuleDeclRE.FindAllStringSubmatch(string(contents), -1) - - // put all the ambient modules into a set - declaredModules := make(map[string]bool) - for _, match := range matches { - declaredModules[match[1]] = true - } - - // remove all the modules that were imported (ie all the modules that - // were being augmented/re-opened) - for _, mi := range parseImports(fp, contents) { - delete(declaredModules, mi.importPath) - } - - if declaredModules[i.importPath] { - debugf("found import %s in ambient module declaration in %s", i.importPath, r.GetName()) - return r.GetName(), nil - } - } - } - return "", nil -} - -// stripTSExtension removes TypeScript extensions from a file path. If no -// TypeScript extensions are present, the filepath is returned unaltered. -func stripTSExtension(path string) string { - for _, ext := range extensions { - if strings.HasSuffix(path, ext) { - return strings.TrimSuffix(path, ext) - } - } - return path -} - -// redirectedLabel looks in the target's tags for a tag starting with -// 'alt_dep=' followed by a label. If such a tag is found, the label is -// returned. Otherwise, the target's own label is returned. -func redirectedLabel(target *appb.Rule) string { - for _, tag := range listAttribute(target, "tags") { - if trimmedTag := strings.TrimPrefix(tag, "alt_dep="); trimmedTag != tag { - return trimmedTag - } - } - // No 'alt_dep=' tag was present on the target so no redirects need to occur. - return target.GetName() -} - -func labelToPath(label string) string { - _, pkg, file := edit.ParseLabel(label) - return platform.Normalize(filepath.Clean(filepath.Join(pkg, file))) -} - -// generateReports generates reports for each label in labels. -func (a *Analyzer) generateReports(labels []string, labelToTarget map[string]*resolvedTarget) ([]*arpb.DependencyReport, error) { - reports := make([]*arpb.DependencyReport, 0, len(labels)) - for _, label := range labels { - target, ok := labelToTarget[label] - if !ok { - // This case should never happen. - platform.Fatalf("target %s no longer loaded", label) - } - report, err := a.generateReport(target) - if err != nil { - return nil, err - } - reports = append(reports, report) - } - return reports, nil -} - -// generateReport generates a dependency report for a target. -// -// It adds imports for which no target could be found to unresolved imports. -// Imports which had locatable targets are added to the necessary dependency -// or missing dependency properties if the import was already present on target -// or the import was not already present respectively. -// -// Missing source files detected during import resolution are added to the -// reports. Dependencies which were present on the initial target but are not -// required are added to the unnecessary dependency array. -func (a *Analyzer) generateReport(target *resolvedTarget) (*arpb.DependencyReport, error) { - usedDeps := make(map[string]bool) - report := &arpb.DependencyReport{ - Rule: proto.String(target.label), - MissingSourceFile: target.missingSources, - } - for _, imports := range target.imports { - handlingImports: - for _, imp := range imports { - if imp.knownTarget == target.label { - continue - } - if imp.knownTarget == "" { - if strings.HasPrefix(imp.importPath, "goog:") { - // This feedback needs to be phrased this way since the - // updater.go relies on parsing the feedback strings to - // determine which 'goog:' imports to add. - report.Feedback = append(report.Feedback, - fmt.Sprintf( - "ERROR: %s:%d:%d: missing comment for 'goog:' import, "+ - "please add a trailing comment to the import. E.g.\n "+ - "import Bar from '%s'; // from //foo:bar", - imp.location.sourcePath, imp.location.line, imp.location.offset, imp.importPath)) - } - report.UnresolvedImport = append(report.UnresolvedImport, imp.resolvedPath()) - continue - } - - for _, dep := range target.deps() { - if edit.LabelsEqual(dep, imp.knownTarget, "") { - // fmt.Printf("%s provides %s\n", dep, imp.importPath) - usedDeps[dep] = true - report.NecessaryDependency = append(report.NecessaryDependency, imp.knownTarget) - continue handlingImports - } - } - report.MissingDependencyGroup = append(report.MissingDependencyGroup, &arpb.DependencyGroup{ - Dependency: []string{edit.ShortenLabel(imp.knownTarget, "")}, - ImportPath: []string{imp.importPath}, - }) - } - } - - var unusedDeps []string - for _, dep := range target.deps() { - if _, ok := usedDeps[dep]; !ok { - unusedDeps = append(unusedDeps, dep) - } - } - labelToRule, err := a.loader.LoadRules("", unusedDeps) - if err != nil { - return nil, err - } - for label, rule := range labelToRule { - switch class := rule.GetRuleClass(); class { - case "ts_declaration": - // TypeScript declarations might declare arbitrary global symbols, so it - // is impossible to detect reliably if the import is being used (without - // compiling, at least). Report that the rule has no explicit import as a - // warning, so that taze can decide to import remove or not based on a - // flag. - warning := fmt.Sprintf("WARNING: %s: keeping possibly used %s '%s'", rule.GetLocation(), class, label) - report.Feedback = append(report.Feedback, warning) - case "css_library": - // Similar to ts_declaration, taze can't reliably detect if css_library - // imports are being used, since taze can't currently parse @requirecss - // annotations. Unlike ts_declaration, there's no flag to remove them, so - // there's no need to report a warning. - default: - // The contents of generated files aren't visible, so taze can't discover - // the import statements/deps that they contain. To be safe, don't remove - // any unused deps, since they might be used by the generated file(s). - if len(target.generatedSourcePaths) == 0 { - report.UnnecessaryDependency = append(report.UnnecessaryDependency, label) - } - } - } - return report, nil -} - -// relativePathLabel converts src to a label for a path relative to the -// provided target. For example, a target '//foo/bar' and a src 'foo/bar/baz.ts' -// would result in a relative path label of '//foo/bar:baz.ts'. -func relativePathLabel(label, src string) string { - _, pkg, _ := edit.ParseLabel(label) - return fmt.Sprintf("//%s:%s", pkg, strings.TrimPrefix(src, pkg+"/")) -} - -// listAttribute retrieves the attribute from target with name. -func listAttribute(target *appb.Rule, name string) []string { - if a := attribute(target, name); a != nil { - return a.GetStringListValue() - } - return nil -} - -func stringAttribute(target *appb.Rule, name string) string { - if a := attribute(target, name); a != nil { - return a.GetStringValue() - } - return "" -} - -func attribute(target *appb.Rule, name string) *appb.Attribute { - for _, a := range target.GetAttribute() { - if a.GetName() == name { - return a - } - } - return nil -} - -func isGenerated(rule *appb.Rule) bool { - return stringAttribute(rule, "generator_name") != "" -} diff --git a/ts_auto_deps/analyze/analyze_test.go b/ts_auto_deps/analyze/analyze_test.go deleted file mode 100644 index a1cb550a..00000000 --- a/ts_auto_deps/analyze/analyze_test.go +++ /dev/null @@ -1,657 +0,0 @@ -package analyze - -import ( - "context" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "reflect" - "strings" - "testing" - - "google3/net/proto2/go/proto" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "google3/third_party/golang/cmp/cmp" - "google3/third_party/golang/cmp/cmpopts/cmpopts" - "google3/third_party/golang/godebug/pretty/pretty" - - appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" - arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" -) - -var ( - testTmpDir = os.Getenv("TEST_TMPDIR") -) - -func TestMain(m *testing.M) { - if err := createWorkspaceFile(); err != nil { - platform.Fatalf("failed to create WORKSPACE file: %q", err) - } - os.Exit(m.Run()) -} - -const ( - testDirectory = "a" -) - -type fakeTargetLoader struct { - targetsByLabels map[string]string - targetsByImportPaths map[string]string -} - -func newFakeTargetLoader() *fakeTargetLoader { - return &fakeTargetLoader{ - targetsByLabels: make(map[string]string), - targetsByImportPaths: make(map[string]string), - } -} - -func (bl *fakeTargetLoader) LoadRules(_ string, labels []string) (map[string]*appb.Rule, error) { - return bl.loadRules(bl.targetsByLabels, labels) -} - -func (bl *fakeTargetLoader) LoadTargets(_ string, labels []string) (map[string]*appb.Target, error) { - targets := make(map[string]*appb.Target) - for _, l := range labels { - if strings.Contains(l, ".") { - targets[l] = &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()} - } else { - targets[l] = &appb.Target{Type: appb.Target_RULE.Enum()} - } - } - return targets, nil -} - -func (bl *fakeTargetLoader) byLabel(label, value string) { - bl.targetsByLabels[label] = value -} - -func (bl *fakeTargetLoader) LoadImportPaths(_ context.Context, _ *appb.Rule, _, _ string, paths []string) (map[string]*appb.Rule, error) { - return bl.loadRules(bl.targetsByImportPaths, paths) -} - -func (bl *fakeTargetLoader) byImportPath(importPath, value string) { - bl.targetsByImportPaths[importPath] = value -} - -func (bl *fakeTargetLoader) loadRules(source map[string]string, keys []string) (map[string]*appb.Rule, error) { - targets := make(map[string]*appb.Rule) - for _, key := range keys { - value, ok := source[key] - if !ok { - return nil, nil - } - var target appb.Rule - if err := proto.UnmarshalText(strings.Trim(value, " \n\r\t"), &target); err != nil { - return nil, err - } - targets[key] = &target - } - return targets, nil -} - -type file struct { - path string - contents []string -} - -// testTarget represents a target with a label, a proto literal, and any import -// paths that should resolve to the target. -type testTarget struct { - label, protoLiteral string - importPaths []string -} - -func analyzeTargets(t *testing.T, labels []string, targets []*testTarget, files []*file) []*arpb.DependencyReport { - t.Helper() - for _, file := range files { - path := filepath.Join(testDirectory, file.path) - if err := createFile(path, file.contents...); err != nil { - t.Errorf("failed to create file %q: %q", file.path, err) - return nil - } - defer os.Remove(path) - } - for i, label := range labels { - labels[i] = fmt.Sprintf("//%s:%s", testDirectory, label) - } - loader := newFakeTargetLoader() - for _, t := range targets { - label := t.label - if !strings.HasPrefix(label, "//") { - label = fmt.Sprintf("//%s:%s", testDirectory, label) - } - r := fmt.Sprintf("name: %q\n%s", label, t.protoLiteral) - loader.byLabel(label, r) - for _, i := range t.importPaths { - loader.byImportPath(i, r) - } - } - r, err := New(loader).Analyze(context.Background(), testTmpDir, labels) - if err != nil { - t.Errorf("Analyze(%q): failed to generate reports: %q", labels, err) - return nil - } - if len(r) != len(labels) { - t.Errorf("Analyze(%q): got %d reports, wanted %d", labels, len(r), len(labels)) - return nil - } - return r -} - -func TestUnresolvedImports(t *testing.T) { - tests := []struct { - filepath, fileContents string - expectedImports []string - }{ - {"b/importer.ts", "import X from './path';", []string{"a/b/path"}}, - {"b/importer.ts", "import X from 'absolute/path';", []string{"absolute/path"}}, - {"b/importer.ts", "import X from '../../root';", []string{"root"}}, - {"b/importer.ts", "import X from './multi/subpath';", []string{"a/b/multi/subpath"}}, - {"b/importer.ts", "import X from '/rooted';", []string{"/rooted"}}, - {"b/importer.ts", "import X from 'absolute/path';\nimport Y from './path';", []string{"absolute/path", "a/b/path"}}, - {"b/importer.ts", "import X from 'some/path'; // from //target:location", nil}, - {"importer.d.ts", "import y from 'some/thing/missing';", []string{"some/thing/missing"}}, - } - for _, test := range tests { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", fmt.Sprintf(` - rule_class: "ts_library" - attribute: < - name: "srcs" - string_list_value: "//a:%s" - type: 5 - >`, test.filepath), nil}, - }, []*file{{test.filepath, []string{test.fileContents}}}) - if r == nil { - continue - } - if diff := pretty.Compare(r[0].GetUnresolvedImport(), test.expectedImports); diff != "" { - t.Errorf("Analyze(%q): failed to detect unresolved imports: (-got, +want)\n%s", test.fileContents, diff) - } - } -} - -func TestUnnecessaryDependencies(t *testing.T) { - tests := [][]string{ - []string{"/* nothing */"}, - } - for _, test := range tests { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - name: "srcs" - string_list_value: "//a:importer.ts" - type: 5 - > - attribute: < - name: "deps" - string_list_value: "//a:b_lib" - type: 5 - >`, nil}, - {"b_lib", ` - rule_class: "ts_library"`, nil}, - }, []*file{{"t/importer.ts", test}}) - if r == nil { - continue - } - if diff := pretty.Compare(r[0].GetUnnecessaryDependency(), []string{"//a:b_lib"}); diff != "" { - t.Errorf("Analyze(%q): failed to detect unnecessary dependencies: (-got, +want)\n%s", test, diff) - } - } -} - -func TestNecessaryDependencies(t *testing.T) { - tests := [][]string{ - []string{"import x from 'b/target';"}, - []string{"// taze: x from //b:b_lib"}, - []string{"export x from 'b/target';"}, - } - for _, test := range tests { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:importer.ts" - > - attribute: < - type: 5 - name: "deps" - string_list_value: "//b:b_lib" - >`, nil}, - {"//b:b_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//b:target.ts" - >`, []string{"b/target"}}, - }, []*file{{"importer.ts", test}}) - if r == nil { - continue - } - if diff := pretty.Compare(r[0].GetNecessaryDependency(), []string{"//b:b_lib"}); diff != "" { - t.Errorf("Analyze(%q): failed to detect necessary deps: (-got, +want)\n%s", test, diff) - } - } -} - -func TestMissingDependencies(t *testing.T) { - tests := []struct { - fileContents string - missingDeps []string - }{ - {"import x from 'b/c';\nimport y from 'angular';", []string{"//b/c:b_lib", "//third_party/javascript/typings/angular"}}, - {"import * as angular from 'angular';\ndeclare module 'angular' { /* reopen */ }", []string{"//third_party/javascript/typings/angular"}}, - } - for _, test := range tests { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:x.ts" - >`, nil}, - {"//b/c:b_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//b/c:index.ts" - >`, []string{"b/c"}}, - {"//third_party/javascript/typings/angular:angular", ` - rule_class: "ts_declaration" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//third_party/javascript/typings/angular:index.d.ts" - >`, []string{"angular"}}, - }, []*file{{"x.ts", []string{test.fileContents}}}) - if r == nil { - continue - } - if diff := pretty.Compare(missingDeps(r[0]), test.missingDeps); diff != "" { - t.Errorf("Analyze(%q): failed to detect missing dependencies: (-got, +want)\n%s", test.fileContents, diff) - } - } -} - -func TestMissingSourceFile(t *testing.T) { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:f1.ts" - string_list_value: "//a:f2.ts" - string_list_value: "//a:p/f3.ts" - >`, nil}, - }, []*file{{"f1.ts", []string{"/* nothing */"}}}) - if r == nil { - t.FailNow() - } - if diff := pretty.Compare(r[0].GetMissingSourceFile(), []string{"//a:f2.ts", "//a:p/f3.ts"}); diff != "" { - t.Fatalf("Analyze: failed to detect missing source files: (-got, +want)\n%s", diff) - } -} - -func TestMultipleLabels(t *testing.T) { - r := analyzeTargets(t, []string{"a_lib", "b_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:a/importer.ts" - >`, nil}, - {"b_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:b/importer.ts" - >`, nil}, - }, []*file{ - {"a/importer.ts", []string{"import X from './path';"}}, - {"b/importer.ts", []string{"import X from './path';"}}, - }) - if r == nil { - t.FailNow() - } - tests := []struct { - label string - unresolvedImports []string - }{ - {"a_lib", []string{"a/a/path"}}, - {"b_lib", []string{"a/b/path"}}, - } - for i, test := range tests { - report := r[i] - if diff := pretty.Compare(report.GetUnresolvedImport(), test.unresolvedImports); diff != "" { - t.Errorf("Analyze(%q): failed to detect unresolved imports: (-got, +want)\n%s", test.label, diff) - } - } -} - -func TestMultipleSourceFiles(t *testing.T) { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:importer.ts" - string_list_value: "//a:exporter.ts" - >`, nil}, - }, []*file{ - {"importer.ts", []string{"import {x} from 'a/exporter';"}}, - {"exporter.ts", []string{"export let x = 12;"}}, - }) - if r == nil { - t.FailNow() - } - if diff := pretty.Compare(missingDeps(r[0]), []string{}); diff != "" { - t.Fatalf("Analyze: failed to detect missing dependencies: (-got, +want)\n%s", diff) - } -} - -func TestRedirectTag(t *testing.T) { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//a:x.ts" - >`, nil}, - {"dlib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "deps" - string_list_value: "//b:clib" - >`, nil}, - {"clib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "//clib:c.ts" - > - attribute: < - type: 5 - name: "tags" - string_list_value: "alt_dep=//d:dlib" - >`, []string{"b/c"}}, - }, []*file{{"x.ts", []string{"import x from 'b/c';"}}}) - if r == nil { - t.FailNow() - } - if diff := pretty.Compare(missingDeps(r[0]), []string{"//d:dlib"}); diff != "" { - t.Fatalf("Analyze: failed to detect missing dependencies: (-got, +want)\n%s", diff) - } -} - -func TestCircularImport(t *testing.T) { - r := analyzeTargets(t, []string{"a_lib"}, []*testTarget{ - {"a_lib", ` - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "f1.ts" - string_list_value: "f2.ts" - >`, []string{"a/f1", "a/f2"}}, - }, []*file{ - {"f1.ts", []string{"import {x} from 'a/f1';", "export let y = x + 1;"}}, - {"f2.ts", []string{"import {y} from 'a/f2';", "export let x = y + 0;"}}, - }) - if r == nil { - t.FailNow() - } - if diff := pretty.Compare(missingDeps(r[0]), []string{}); diff != "" { - t.Fatalf("Analyze: failed to detect missing dependencies: (-got, +want)\n%s", diff) - } -} - -func TestListAttribute(t *testing.T) { - tests := []struct { - name string - value []string - }{ - {"srcs", []string{"a.ts", "b.ts"}}, - {"deps", []string{":core"}}, - } - result, err := createResult(` - target: < - type: 1 - rule: < - name: "//tmp:tmp" - rule_class: "ts_library" - attribute: < - type: 5 - name: "srcs" - string_list_value: "a.ts" - string_list_value: "b.ts" - > - attribute: < - type: 5 - name: "deps" - string_list_value: ":core" - > - > - >`) - if err != nil { - t.Fatalf("failed to create result: %q", err) - } - for _, test := range tests { - attrValue := listAttribute(result.GetTarget()[0].GetRule(), test.name) - if attrValue == nil { - t.Errorf("listAttribute(%q): failed to find attribute", test.name) - continue - } - if diff := pretty.Compare(attrValue, test.value); diff != "" { - t.Errorf("listAttribute(%q): failed to get correct attribute values: (-got, +want)\n%s", test.name, diff) - } - } -} - -func TestStringAttribute(t *testing.T) { - tests := []struct { - name, value string - }{ - {"module_name", "@angular/core"}, - {"module_root", ""}, - } - result, err := createResult(` - target: < - type: 1 - rule: < - name: "//tmp:tmp" - rule_class: "ts_library" - attribute: < - type: 5 - name: "module_name" - string_value: "@angular/core" - > - > - >`) - if err != nil { - t.Fatalf("failed to create result: %q", err) - } - for _, test := range tests { - attrValue := stringAttribute(result.GetTarget()[0].GetRule(), test.name) - if diff := pretty.Compare(attrValue, test.value); diff != "" { - t.Errorf("stringAttribute(%q): failed to get correct attribute values: (-got, +want)\n%s", test.name, diff) - } - } -} - -func TestSetSources(t *testing.T) { - tests := []struct { - name string - srcs []string - loadedSrcs map[string]*appb.Target - err error - expected map[string]*appb.Target - expectedLiteralPaths []string - expectedGeneratedPaths []string - }{ - { - "NoSources", - nil, - nil, - nil, - nil, - nil, - nil, - }, - { - "OneSource", - []string{"//a:file.ts"}, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - }, - nil, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - }, - []string{"a/file.ts"}, - nil, - }, - { - "ExtraSources", - []string{"//a:file.ts"}, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, - "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, - }, - nil, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - }, - []string{"a/file.ts"}, - nil, - }, - { - "MultipleLiteralSources", - []string{"//a:file.ts", "//b:file.ts"}, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - }, - nil, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - }, - []string{"a/file.ts", "b/file.ts"}, - nil, - }, - { - "MultipleGeneratedSources", - []string{"//b:generator", "//b:wiz"}, - map[string]*appb.Target{ - "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, - "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, - }, - fmt.Errorf("rule has generated sources - cannot determine dependencies"), - nil, - nil, - nil, - }, - { - "MixedSources", - []string{"//a:file.ts", "//b:file.ts", "//b:generator", "//b:wiz"}, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, - "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, - }, - nil, - map[string]*appb.Target{ - "//a:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:file.ts": &appb.Target{Type: appb.Target_SOURCE_FILE.Enum()}, - "//b:generator": &appb.Target{Type: appb.Target_RULE.Enum()}, - "//b:wiz": &appb.Target{Type: appb.Target_RULE.Enum()}, - }, - []string{"a/file.ts", "b/file.ts"}, - []string{"//b:generator", "//b:wiz"}, - }, - { - "MissingSources", - []string{"//a:file.ts"}, - nil, - fmt.Errorf("no source found for label %s", "//a:file.ts"), - nil, - nil, - nil, - }, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - rt := &resolvedTarget{ - rule: &appb.Rule{ - Attribute: []*appb.Attribute{ - &appb.Attribute{ - Name: proto.String("srcs"), - Type: appb.Attribute_STRING_LIST.Enum(), - StringListValue: test.srcs, - }, - }, - }, - sources: make(map[string]*appb.Target), - } - - err := rt.setSources(test.loadedSrcs) - if !reflect.DeepEqual(err, test.err) { - t.Errorf("got err %q, expected %q", err, test.err) - } - - if diff := cmp.Diff(rt.sources, test.expected, cmpopts.EquateEmpty(), cmp.Comparer(proto.Equal)); err == nil && diff != "" { - t.Errorf("failed to set correct sources: (-got, +want)\n%s", diff) - } - }) - } -} - -func missingDeps(report *arpb.DependencyReport) []string { - var deps []string - for _, group := range report.GetMissingDependencyGroup() { - deps = append(deps, group.GetDependency()...) - } - return deps -} - -func createResult(str string) (*appb.QueryResult, error) { - var result appb.QueryResult - return &result, proto.UnmarshalText(strings.Trim(str, " \n\r\t"), &result) -} - -func createFile(path string, content ...string) error { - if !filepath.IsAbs(path) { - path = filepath.Join(filepath.Dir(testTmpDir), path) - } - if err := os.MkdirAll(filepath.Dir(path), 0777); err != nil { - return err - } - return ioutil.WriteFile(path, []byte(strings.Join(content, "\n")), 0666) -} - -// This method creates a WORKSPACE file in the root of the Blaze test -// directory. This allows the tests to resolve the root path of the -// workspace by looking for the WORKSPACE file on disk. -func createWorkspaceFile() error { - path := filepath.Join(filepath.Dir(testTmpDir), "WORKSPACE") - return ioutil.WriteFile(path, []byte("workspace(name = 'foo')"), 0666) -} diff --git a/ts_auto_deps/analyze/imports.go b/ts_auto_deps/analyze/imports.go deleted file mode 100644 index 909e6452..00000000 --- a/ts_auto_deps/analyze/imports.go +++ /dev/null @@ -1,150 +0,0 @@ -package analyze - -import ( - "io/ioutil" - "path/filepath" - "regexp" - "strings" - "sync" - - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" -) - -// tazeImport represents a single import in a TypeScript source. -type tazeImport struct { - // importPath can be an ES6 path ('./foo/bar'), but also a namespace ('goog:...'). - // This is the import path as it appears in the TypeScript source. - importPath string - // knownTarget is the (fully qualified) blaze target providing importPath. - // It's either found by locateMissingTargets or taken from a taze comment. - knownTarget string - location sourceLocation -} - -// resolvedPath is the path to the import relative to the root of the -// workspace. For example, an import of './foo' in the 'bar/baz' directory -// would have a path from root of 'bar/baz/foo'. -// -// Absolute imports have no resolvedPath since the physical location of -// these imports depends on the dependencies of the target the source -// location is a member of. For example, an import of 'foo/bar' would have -// no resolvedPath. -func (i *tazeImport) resolvedPath() string { - if strings.HasPrefix(i.importPath, "./") || strings.HasPrefix(i.importPath, "../") { - // If the import is relative to the source location, use the source - // location to form a "canonical" path from the root. - return platform.Normalize(filepath.Clean(filepath.Join(filepath.Dir(i.location.sourcePath), i.importPath))) - } else if trim := strings.TrimPrefix(i.importPath, workspace.Name()+"/"); trim != i.importPath { - return trim - } - // The import is an absolute import and therefore does not have a definite - // resolved path. - return i.importPath -} - -// sourceLocation points to a position in a source file. -type sourceLocation struct { - // Workspace root relative source path. - sourcePath string - // offset and length are byte offsets, line is the 1-indexed source line (considering only \n as breaks). - offset, length, line int -} - -// extractAllImports extracts the TypeScript imports from paths. -// -// paths should be relative to root. The root will be joined to each path -// to construct a physical path to each file. -func extractAllImports(root string, paths []string) (map[string][]*tazeImport, []error) { - debugf("extracting imports from TypeScript files relative to %q: %q", root, paths) - allImports := make(map[string][]*tazeImport) - var ( - errors []error - mutex sync.Mutex - group sync.WaitGroup - ) - for _, path := range paths { - group.Add(1) - go func(path string) { - defer group.Done() - imports, err := extractImports(root, path) - // Lock the mutex to prevent concurrent writes. - mutex.Lock() - defer mutex.Unlock() - if err != nil { - errors = append(errors, err) - return - } - allImports[path] = imports - }(path) - } - group.Wait() - return allImports, errors -} - -// extractImports extracts the TypeScript imports from a single file. path -// should be a path from the root to the file. -func extractImports(root, path string) ([]*tazeImport, error) { - d, err := ioutil.ReadFile(filepath.Join(root, path)) - if err != nil { - return nil, err - } - return parseImports(path, d), nil -} - -const ( - tazeFrom = `^[ \t]*//[ \t]+taze:[^\n]*?from[ \t]+(?P//\S+)$` - importPreface = `^[ \t]*(?:import|export)\b\s*` - wildcardTerm = `\*(?:\s*as\s+\S+)?` // "as..." is optional to match exports. - identifiersClause = `(?:\{[^}]*\}|\S+|` + wildcardTerm + `)` - symbolsTerm = `(?:` + identifiersClause + `(?:,\s*` + identifiersClause + `)?\s*\bfrom\b\s*)?` - url = `['"](?P[^'";]+)['"]\s*;?` - namespaceComment = `(?:\s*//[ \t]*from[ \t]+(?P//\S+)$)?` -) - -var importRE = regexp.MustCompile("(?ms)" + - "(?:" + tazeFrom + ")|" + - "(?:" + importPreface + symbolsTerm + url + namespaceComment + ")") - -// parseImports scans contents for imports (ES6 modules, taze comments), and -// returns a list of tazeImports. knownTarget is already filled in for imports -// that have taze comments. -func parseImports(sourcePath string, contents []byte) []*tazeImport { - var imports []*tazeImport - lastOffset := 0 - line := 1 - column := 1 - for _, matchIndices := range importRE.FindAllSubmatchIndex(contents, -1) { - imp := &tazeImport{} - imports = append(imports, imp) - // matchIndices[0, 1]: full RE match - imp.location.sourcePath = sourcePath - for lastOffset < matchIndices[1] { - // Iterate to the *end* of the import statement. - // The taze comment must be placed at the end of the "import" statement. - // This offset has to be exactly the end of the import for taze later on - // to insert the '// from' comment in the correct line. - column++ - if contents[lastOffset] == '\n' { - line++ - column = 1 - } - lastOffset++ - } - imp.location.offset = matchIndices[0] - imp.location.length = matchIndices[1] - matchIndices[0] - imp.location.line = line - if matchIndices[2] >= 0 { - // matchIndices[2, 3]: Target for a // taze: ... from ... comment. - imp.knownTarget = string(contents[matchIndices[2]:matchIndices[3]]) - } else { - // matchIndices[4, 5]: URL in import x from 'url'; - imp.importPath = string(contents[matchIndices[4]:matchIndices[5]]) - } - if matchIndices[6] >= 0 { - // matchIndices[6, 7]: Target for a // from comment - imp.knownTarget = string(contents[matchIndices[6]:matchIndices[7]]) - } - } - return imports -} diff --git a/ts_auto_deps/analyze/imports_test.go b/ts_auto_deps/analyze/imports_test.go deleted file mode 100644 index 65d13d55..00000000 --- a/ts_auto_deps/analyze/imports_test.go +++ /dev/null @@ -1,85 +0,0 @@ -package analyze - -import ( - "fmt" - "testing" - - "google3/third_party/golang/godebug/pretty/pretty" -) - -func TestParseImports(t *testing.T) { - tests := []struct{ text, importPath, knownTarget string }{ - // Imports - {"import {a} from 'named';", "named", ""}, - {"code before;\n import {a} from 'before after'; code after", - "before after", ""}, - {"import A from 'default';", "default", ""}, - {"import A$X from 'default';", "default", ""}, - {"import {x as $} from 'default';", "default", ""}, - {"import ü from 'default';", "default", ""}, - {"import * as prefix from 'wildcard prefixed';", "wildcard prefixed", ""}, - {" \t import {A, B as C} from 'renamed';", "renamed", ""}, - {"import 'sideeffect import';", "sideeffect import", ""}, - {"import\n {A\n, B} from 'newlines';", "newlines", ""}, - {"import*as prefix from'no whitespace';", "no whitespace", ""}, - {"import Symbol from 'goog:some.Symbol'; // from //target:location", - "goog:some.Symbol", "//target:location"}, - {"import Symbol from 'goog:some.Symbol';//from //target:location", - "goog:some.Symbol", "//target:location"}, - {"import {a} from 'missing semi'", "missing semi", ""}, - {"import {a} from 'missing semi' // from //target:location", - "missing semi", "//target:location"}, - {"import A, {B, C} from 'mixed';", "mixed", ""}, - {"import A, * as B from 'mixed';", "mixed", ""}, - {"import * as B, A from 'inverted mixed';", "inverted mixed", ""}, - // Exports - {"export * from 'wildcard';", "wildcard", ""}, - {"export {a, b} from 'named';", "named", ""}, - {"export {} from 'empty import';", "empty import", ""}, - {"export {a as b} from 'renamed';", "renamed", ""}, - {"export\n {A\n, B} from 'newlines';", "newlines", ""}, - {"export*from'no whitespace';", "no whitespace", ""}, - {"export{}from'no whitespace';", "no whitespace", ""}, - // Comments - {"x;\n// taze: ng from //some/global:rule\ny;", "", "//some/global:rule"}, - {"// taze: ng from //foo/bar from //some/global:rule", "", "//some/global:rule"}, - } - - for i, tst := range tests { - imports := parseImports(fmt.Sprintf("test%d.ts", i), []byte(tst.text)) - if len(imports) != 1 { - t.Errorf("parseImports(%q): got %d import(s), want 1", tst.text, len(imports)) - continue - } - imp := imports[0] - if imp.importPath != tst.importPath { - t.Errorf("parseImports(%q): got %q, want %q", tst.text, imp.importPath, tst.importPath) - } - if imp.knownTarget != tst.knownTarget { - t.Errorf("parseImports(%q): got %q, want %q", tst.text, imp.knownTarget, tst.knownTarget) - } - } -} - -func TestParseImportsSourceLocation(t *testing.T) { - tests := []struct { - text string - expectedSourceLocation sourceLocation - }{ - {"import {a} from 'named';", sourceLocation{line: 1, offset: 0, length: 24}}, - {"\n\timport {a} from 'named';", sourceLocation{line: 2, offset: 1, length: 25}}, - } - for i, tst := range tests { - sourcePath := fmt.Sprintf("test%d.ts", i) - imports := parseImports(sourcePath, []byte(tst.text)) - if len(imports) != 1 { - t.Errorf("parseImports(%q): got %d import(s), want 1", tst.text, len(imports)) - continue - } - imp := imports[0] - tst.expectedSourceLocation.sourcePath = sourcePath - if diff := pretty.Compare(imp.location, tst.expectedSourceLocation); diff != "" { - t.Errorf("parseImports(%q): expected different source location: (-got, +want)\n%s", tst.text, diff) - } - } -} diff --git a/ts_auto_deps/analyze/loader.go b/ts_auto_deps/analyze/loader.go deleted file mode 100644 index bd4b0a55..00000000 --- a/ts_auto_deps/analyze/loader.go +++ /dev/null @@ -1,741 +0,0 @@ -package analyze - -import ( - - "bytes" - "context" - "fmt" - "os/exec" - "path/filepath" - "strings" - "time" - - "google3/net/proto2/go/proto" - "google3/third_party/bazel_buildifier/edit/edit" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - - appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" -) - -// pkgCacheEntry represents a set of loaded rules and a mapping from alias -// to rules from a package. -type pkgCacheEntry struct { - // rules is all rules in a package. - rules []*appb.Rule - // aliases is a map from an alias label to the actual rule of the alias. - aliases map[string]*appb.Rule -} - -// QueryBasedTargetLoader uses Blaze query to load targets from BUILD files. -type QueryBasedTargetLoader struct { - workdir string - blazeBinary string - - // pkgCache is a mapping from a package to all of the rules in said - // package along with a map from aliases to actual rules. - // - // Keys are of the form of "|" where visibility - // is the package that rules in package must be visible to and package - // is the actual package that has been loaded and cached. - // - // Since a new target loader is constructed for each directory being - // analyzed in the "-recursive" case, these caches will be garbage - // collected between directories. - pkgCache map[string]*pkgCacheEntry - // labelCache is a mapping from a label to its loaded target. - labelCache map[string]*appb.Target - - // queryCount is the total number of queries executed by the target loader. - queryCount int -} - -// NewQueryBasedTargetLoader constructs a new QueryBasedTargetLoader rooted -// in workdir. -func NewQueryBasedTargetLoader(workdir, blazeBinary string) *QueryBasedTargetLoader { - return &QueryBasedTargetLoader{ - workdir: workdir, - blazeBinary: blazeBinary, - - pkgCache: make(map[string]*pkgCacheEntry), - labelCache: make(map[string]*appb.Target), - } -} - -// LoadRules uses Blaze query to load rules associated with labels from BUILD -// files. -func (q *QueryBasedTargetLoader) LoadRules(pkg string, labels []string) (map[string]*appb.Rule, error) { - labelToTarget, err := q.LoadTargets(pkg, labels) - if err != nil { - return nil, err - } - - labelToRule := make(map[string]*appb.Rule) - for _, label := range labels { - target := labelToTarget[label] - if target.GetType() == appb.Target_RULE { - labelToRule[label] = target.GetRule() - } else { - return nil, fmt.Errorf("target %s contains object of type %q instead of type %q", label, target.GetType(), appb.Target_RULE) - } - } - return labelToRule, nil -} - -// LoadTargets uses Blaze query to load targets associated with labels from BUILD -// files. -func (q *QueryBasedTargetLoader) LoadTargets(pkg string, labels []string) (map[string]*appb.Target, error) { - var labelCacheMisses []string - for _, label := range labels { - if _, ok := q.labelCache[labelCacheKey(pkg, label)]; !ok { - labelCacheMisses = append(labelCacheMisses, label) - } - } - if len(labelCacheMisses) > 0 { - var queries []string - if pkg == "" { - queries = labelCacheMisses - } else { - for _, label := range labelCacheMisses { - queries = append(queries, fmt.Sprintf("visible(%s:*, %s)", pkg, label)) - } - } - r, err := q.batchQuery(queries) - if err != nil { - return nil, err - } - for _, target := range r.GetTarget() { - label, err := q.targetLabel(target) - if err != nil { - return nil, err - } - q.labelCache[labelCacheKey(pkg, label)] = target - } - for _, label := range labelCacheMisses { - key := labelCacheKey(pkg, label) - if _, ok := q.labelCache[key]; !ok { - // Set to nil so the result exists in the cache and is not - // loaded again. If the nil is not added at the appropriate - // cache key, LoadLabels will attempt to load it again when - // next requested instead of getting a cache hit. - q.labelCache[key] = nil - } - } - } - labelToTarget := make(map[string]*appb.Target) - for _, label := range labels { - labelToTarget[label] = q.labelCache[labelCacheKey(pkg, label)] - } - return labelToTarget, nil -} - -func labelCacheKey(currentPkg, label string) string { - return currentPkg + "^" + label -} - -// possibleFilepaths generates the possible filepaths for the ts import path. -// e.g. google3/foo/bar could be foo/bar.ts or foo/bar.d.ts or foo/bar/index.ts, etc. -// Also handles special angular import paths (.ngfactory and .ngsummary). -func possibleFilepaths(importPath string) []string { - // If the path has a suffix of ".ngfactory" or ".ngsummary", it might - // be an Angular AOT generated file. We can infer the target as we - // infer its corresponding ngmodule target by simply stripping the - // ".ngfactory" / ".ngsummary" suffix - importPath = strings.TrimSuffix(strings.TrimSuffix(importPath, ".ngsummary"), ".ngfactory") - importPath = strings.TrimPrefix(importPath, workspace.Name()+"/") - - var possiblePaths []string - - possiblePaths = append(possiblePaths, pathWithExtensions(importPath)...) - possiblePaths = append(possiblePaths, pathWithExtensions(filepath.Join(importPath, "index"))...) - - return possiblePaths -} - -// LoadImportPaths uses Blaze Query to load targets associated with import -// paths from BUILD files. -func (q *QueryBasedTargetLoader) LoadImportPaths(ctx context.Context, targetToAnalyze *appb.Rule, currentPkg, workspaceRoot string, paths []string) (map[string]*appb.Rule, error) { - debugf("loading imports visible to %q relative to %q: %q", currentPkg, workspaceRoot, paths) - results := make(map[string]*appb.Rule) - - addedPaths := make(map[string]bool) - var possibleFilePaths []string - possiblePathToPaths := make(map[string][]string) - // for all the normalized typescript import paths, generate all the possible - // corresponding file paths - for _, path := range paths { - if strings.HasPrefix(path, "goog:") { - // 'goog:' imports are resolved using an sstable. - results[path] = nil - continue - } - if strings.HasPrefix(path, "@") { - continue - } - - if _, ok := addedPaths[path]; !ok { - addedPaths[path] = true - - // there isn't a one to one mapping from ts import paths to file - // paths, so look for all the possible file paths - pfs := possibleFilepaths(path) - possibleFilePaths = append(possibleFilePaths, pfs...) - // map the file paths back to the import paths so we can map the file - // labels back to the import paths - for _, pf := range pfs { - possiblePathToPaths[pf] = append(possiblePathToPaths[pf], path) - } - } - } - - // query for all the possible filepaths, to determine which ones are real - r, err := q.batchQuery(possibleFilePaths) - if err != nil { - return nil, err - } - var fileLabels, packages []string - fileToGeneratorLabel := make(map[string]string) - pathToLabels := make(map[string][]string) - // get the labels for all the files which exist - for _, target := range r.GetTarget() { - label, err := q.fileLabel(target) - if err != nil { - return nil, err - } - switch target.GetType() { - case appb.Target_GENERATED_FILE: - file := target.GetGeneratedFile() - generator := file.GetGeneratingRule() - label = file.GetName() - - fileLabels = append(fileLabels, label) - _, pkg, _ := edit.ParseLabel(label) - packages = append(packages, pkg) - // a generated file can be included as a source by referencing the label - // of the generated file, or the label of the generating rule, so check - // for both - fileToGeneratorLabel[labelToPath(label)] = labelToPath(generator) - // map file label back to the import paths so that they can be looked for - // in the srcs of the rules - for _, path := range possiblePathToPaths[labelToPath(label)] { - pathToLabels[path] = append(pathToLabels[path], label) - } - case appb.Target_SOURCE_FILE: - fileLabels = append(fileLabels, label) - _, pkg, _ := edit.ParseLabel(label) - packages = append(packages, pkg) - // map file label back to the import paths so that they can be looked for - // in the srcs of the rules - for _, path := range possiblePathToPaths[labelToPath(label)] { - pathToLabels[path] = append(pathToLabels[path], label) - } - } - } - - // load all the rules in all the packages files were found in, so we can look - // for aliases and reexporting libraries in the same package - pkgToAllRules, pkgToActualToAlias, err := q.loadAllRulesInPackages("", packages) - if err != nil { - return nil, err - } - - for _, path := range paths { - // look up the corresponding file label(s) for the normalized typescript - // import path - for _, label := range pathToLabels[path] { - _, pkg, _ := edit.ParseLabel(label) - // get the file path that corresponds to the normalized typescript import - // path - filePath := labelToPath(label) - allRules := pkgToAllRules[pkg] - actualToAlias := pkgToActualToAlias[pkg] - var matchingDeps []*appb.Rule - for _, candidate := range typeScriptRules(allRules) { - // check if the rule has the file or the generator of the file in its - // srcs - possibleSources := []string{filePath} - if gl, ok := fileToGeneratorLabel[filePath]; ok { - possibleSources = append(possibleSources, gl) - } - provides, err := q.ruleProvidesImports(candidate, srcsContainsAnyFilePath(possibleSources)) - if err != nil { - return nil, err - } - if !provides { - continue - } - - if alias, ok := actualToAlias[candidate.GetName()]; ok { - candidate = alias - } - matchingDeps = append(matchingDeps, candidate) - } - if len(matchingDeps) > 0 { - canonicalRule, err := q.chooseCanonicalDep(currentPkg, targetToAnalyze, matchingDeps) - if err != nil { - return nil, err - } - results[path] = canonicalRule - } - } - } - - - return results, nil -} - -// chooseCanonicalDep chooses between rules which include the imported file as -// a source (ie the rule that includes the file as a src, and any reexporting -// libraries). -// -// It filters the rules in a 3 stage process: -// -// 1. If only one of the rules is visible, choose that one, since the rule -// creator intended it to be imported. -// -// 2. If all or none of the rules are visible, choose the rule that directly -// includes the file as a src, since that reduces the chance of introducing -// circular dependencies. -// -// 3. Choose the rule that is already included as a dep. -func (q *QueryBasedTargetLoader) chooseCanonicalDep(currentPkg string, targetToAnalyze *appb.Rule, deps []*appb.Rule) (*appb.Rule, error) { - // check for visibility - filterForVisibility := func(deps []*appb.Rule) ([]*appb.Rule, error) { - var labels []string - for _, d := range deps { - labels = append(labels, d.GetName()) - } - visibleDepsMap, err := q.LoadRules(currentPkg, labels) - if err != nil { - return nil, err - } - - var visibleDeps []*appb.Rule - for _, d := range visibleDepsMap { - if d != nil { - visibleDeps = append(visibleDeps, d) - } - } - - return visibleDeps, nil - } - - // if there's a visible reexporting lib and a visible lib with the src, favor - // the lib with the src, to reduce the chance of introducing a circular - // dependency - filterForBaseLibs := func(deps []*appb.Rule) ([]*appb.Rule, error) { - var baseDeps []*appb.Rule - for _, d := range deps { - if !isReexportingLib(d) { - baseDeps = append(baseDeps, d) - } - } - - return baseDeps, nil - } - - // favor the dep that's already on the rule - filterForExistingDeps := func(deps []*appb.Rule) ([]*appb.Rule, error) { - var existingDeps []*appb.Rule - for _, d := range deps { - for _, existing := range listAttribute(targetToAnalyze, "deps") { - if d.GetName() == existing { - existingDeps = append(existingDeps, d) - } - } - } - - return existingDeps, nil - } - - filters := []func(deps []*appb.Rule) ([]*appb.Rule, error){ - filterForVisibility, - filterForBaseLibs, - filterForExistingDeps, - } - - // for each filter, return if it returned a single rule, narrow the set of deps if - // it discarded some, but not all, and try the full set with the next filter if it - // discarded them all - for _, filter := range filters { - filteredDeps, err := filter(deps) - if err != nil { - return nil, err - } - if len(filteredDeps) == 1 { - return filteredDeps[0], nil - } else if len(filteredDeps) > 0 { - deps = filteredDeps - } - } - - // no filter got down to a single rule, just return the first - return deps[0], nil -} - -// ruleLabel returns the label for a target which is a rule. Returns an error if -// target is not a rule. -func (q *QueryBasedTargetLoader) ruleLabel(target *appb.Target) (string, error) { - if t := target.GetType(); t != appb.Target_RULE { - return "", fmt.Errorf("target contains object of type %q instead of type %q", t, appb.Target_RULE) - } - return target.GetRule().GetName(), nil -} - -// fileLabel returns the label for a target which is a file. Returns an error if -// target is not a source file or a generated file. -func (q *QueryBasedTargetLoader) fileLabel(target *appb.Target) (string, error) { - switch t := target.GetType(); t { - case appb.Target_GENERATED_FILE: - return target.GetGeneratedFile().GetName(), nil - case appb.Target_SOURCE_FILE: - return target.GetSourceFile().GetName(), nil - default: - return "", fmt.Errorf("target contains object of type %q instead of type %q or %q", t, appb.Target_SOURCE_FILE, appb.Target_GENERATED_FILE) - } -} - -// targetLabel returns the label for a target. Returns an error if target is an -// unknown type. -func (q *QueryBasedTargetLoader) targetLabel(target *appb.Target) (string, error) { - switch t := target.GetType(); t { - case appb.Target_GENERATED_FILE: - return target.GetGeneratedFile().GetName(), nil - case appb.Target_SOURCE_FILE: - return target.GetSourceFile().GetName(), nil - case appb.Target_RULE: - return target.GetRule().GetName(), nil - case appb.Target_PACKAGE_GROUP: - return target.GetPackageGroup().GetName(), nil - case appb.Target_ENVIRONMENT_GROUP: - return target.GetEnvironmentGroup().GetName(), nil - default: - return "", fmt.Errorf("target contains object of unknown type %q", t) - } -} - - -// batchQuery runs a set of queries with a single call to Blaze query and the -// '--keep_going' flag. -func (q *QueryBasedTargetLoader) batchQuery(queries []string) (*appb.QueryResult, error) { - // Join all of the queries with a '+' character according to Blaze's - // syntax for running multiple queries. - return q.query("--keep_going", strings.Join(queries, "+")) -} - -func (q *QueryBasedTargetLoader) query(args ...string) (*appb.QueryResult, error) { - n := len(args) - if n < 1 { - return nil, fmt.Errorf("expected at least one argument") - } - query := args[n-1] - if query == "" { - // An empty query was provided so return an empty result without - // making a call to Blaze. - return &appb.QueryResult{}, nil - } - var stdout, stderr bytes.Buffer - args = append([]string{"query", "--output=proto"}, args...) - q.queryCount++ - debugf("executing query #%d in %q: %s %s %q", q.queryCount, q.workdir, q.blazeBinary, strings.Join(args[:len(args)-1], " "), query) - cmd := exec.Command(q.blazeBinary, args...) - cmd.Dir = q.workdir - cmd.Stdout = &stdout - cmd.Stderr = &stderr - startTime := time.Now() - if err := cmd.Run(); err != nil { - // Exit status 3 is a direct result of one or more queries in a set of - // queries not returning a result while running with the '--keep_going' - // flag. Since one query failing to return a result does not hinder the - // other queries from returning a result, ignore these errors. - // - // Herb prints "printing partial results" to indicate the same as blaze's - // exit status 3 - if err.Error() != "exit status 3" && !strings.Contains(stderr.String(), "printing partial results") { - // The error provided as a result is less useful than the contents of - // stderr for debugging. - return nil, fmt.Errorf(stderr.String()) - } - } - debugf("query #%d took %v", q.queryCount, time.Since(startTime)) - var result appb.QueryResult - if err := proto.Unmarshal(stdout.Bytes(), &result); err != nil { - return nil, err - } - return &result, nil -} - - -// ruleProvidesImports checks if the rule directly provides the import, or if -// it's a reexporting lib, if one of its deps does. -func (q *QueryBasedTargetLoader) ruleProvidesImports(rule *appb.Rule, srcMatcher func(rule *appb.Rule) bool) (bool, error) { - if srcMatcher(rule) { - return true, nil - } - - if !isReexportingLib(rule) { - return false, nil - } - - // if the rule is a reexporting library, load all the rules that the rule - // reexports, and check if they provide the imported paths. This only handles - // one level of reexport. - _, pkg, _ := edit.ParseLabel(rule.GetName()) - // TODO(alexeagle): Batch calls to LoadLabels. Batching calls to ruleProvidesImport - // would also be required. - exportedRules, err := q.LoadRules(pkg, exportedLabels(rule)) - if err != nil { - return false, err - } - for _, exportedRule := range exportedRules { - if srcMatcher(exportedRule) { - return true, nil - } - } - - return false, nil -} - -// exportedLabels returns the labels exported by rule. Exported labels are the -// deps of a rule if the rule is an alias. -func exportedLabels(rule *appb.Rule) []string { - var exported []string - if isReexportingLib(rule) { - exported = append(exported, listAttribute(rule, "deps")...) - } - return exported -} - -// isReexportingLib checks if a library has no sources, which the TS rules use a -// way to mark a library as an alias. -func isReexportingLib(rule *appb.Rule) bool { - return len(listAttribute(rule, "srcs")) == 0 -} - -// srcsContainsPath returns a function, which takes a rule, which returns true -// if the rule has a src which matches one of the possible filepaths for the -// provided typescript import path. -func srcsContainsPath(path string) func(rule *appb.Rule) bool { - return func(rule *appb.Rule) bool { - resolvedImportPath := resolveAgainstModuleRoot(rule, path) - - // enumerate all the possible filepaths for the resolved import path, and - // compare against all the srcs - possibleImportPaths := possibleFilepaths(resolvedImportPath) - for _, src := range listAttribute(rule, "srcs") { - for _, mi := range possibleImportPaths { - if mi == labelToPath(src) { - return true - } - } - } - - return false - } -} - -// srcsContainsFilePath returns a function which takes a rule, which returns -// true if the rule has a src which, if pathified, equals one of the filePaths. -func srcsContainsAnyFilePath(filePaths []string) func(rule *appb.Rule) bool { - return func(rule *appb.Rule) bool { - for _, filePath := range filePaths { - for _, src := range listAttribute(rule, "srcs") { - if filePath == labelToPath(src) { - return true - } - } - } - - return false - } -} - -// loadAllRulesInPackages loads all rules in all packages. -// -// If an alias or aliases are present in the package, the rules for each alias' -// 'actual' attribute are loaded and a map from each 'actual' rule to its alias -// rule is constructed. -// -// loadAllRulesInPackages returns two maps. The first map is a map from a package -// label to all of the rules in the package. The second map is a map from a -// package to the map of 'actual' rules to alias rules for that package. -func (q *QueryBasedTargetLoader) loadAllRulesInPackages(currentPkg string, packages []string) (map[string][]*appb.Rule, map[string]map[string]*appb.Rule, error) { - var missingPackages []string - for _, pkg := range packages { - if _, ok := q.pkgCache[pkgCacheKey(currentPkg, pkg)]; !ok { - missingPackages = append(missingPackages, pkg) - } - } - if len(missingPackages) > 0 { - // Load any packages not already available in the cache. - var queries []string - pkgToRules := make(map[string][]*appb.Rule) - pkgToAliasToRule := make(map[string]map[string]*appb.Rule) - for _, pkg := range missingPackages { - if currentPkg != "" { - queries = append(queries, fmt.Sprintf("visible(%s:*, %s:*)", currentPkg, pkg)) - } else { - queries = append(queries, fmt.Sprintf("%s:*", pkg)) - } - pkgToAliasToRule[pkg] = make(map[string]*appb.Rule) - } - r, err := q.batchQuery(queries) - if err != nil { - return nil, nil, err - } - actualToAlias := make(map[string]*appb.Rule) - pkgToActuals := make(map[string][]string) - for _, target := range r.GetTarget() { - if target.GetType() == appb.Target_RULE { - rule := target.GetRule() - _, pkg, _ := edit.ParseLabel(rule.GetName()) - if rule.GetRuleClass() == "alias" { - // if the package contains an alias, derefence it (but only one layer - // of aliases) - actual := stringAttribute(rule, "actual") - if actual == "" { - // probably an alias with a select statement as the value for - // 'actual' - just ignore - platform.Infof(`alias %q has non-string "actual" attribute`, rule.GetName()) - continue - } - actualToAlias[actual] = rule - pkgToActuals[pkg] = append(pkgToActuals[pkg], actual) - } else { - pkgToRules[pkg] = append(pkgToRules[pkg], rule) - } - } - } - for pkg, actuals := range pkgToActuals { - // Load all the aliased targets, checking if they're visible from the - // package where they're aliased from - resolvedActuals, err := q.LoadTargets(pkg, actuals) - if err != nil { - return nil, nil, err - } - for actual, target := range resolvedActuals { - // aliases can be for anything, but deps can only be rules, so ignore - // other aliased targets - if target.GetType() != appb.Target_RULE { - continue - } - - rule := target.GetRule() - alias := actualToAlias[actual] - _, pkg, _ := edit.ParseLabel(alias.GetName()) - pkgToAliasToRule[pkg][rule.GetName()] = alias - pkgToRules[pkg] = append(pkgToRules[pkg], rule) - } - } - for _, pkg := range missingPackages { - q.pkgCache[pkgCacheKey(currentPkg, pkg)] = &pkgCacheEntry{ - rules: pkgToRules[pkg], - aliases: pkgToAliasToRule[pkg], - } - } - } - - pkgToRules := make(map[string][]*appb.Rule) - pkgToRuleToAlias := make(map[string]map[string]*appb.Rule) - for _, pkg := range packages { - cacheEntry := q.pkgCache[pkgCacheKey(currentPkg, pkg)] - pkgToRules[pkg] = cacheEntry.rules - pkgToRuleToAlias[pkg] = cacheEntry.aliases - } - - return pkgToRules, pkgToRuleToAlias, nil -} - -func pkgCacheKey(currentPkg, pkg string) string { - return currentPkg + "|" + pkg -} - -// dedupeLabels returns a new set of labels with no duplicates. -func dedupeLabels(labels []string) []string { - addedLabels := make(map[string]bool) - var uniqueLabels []string - for _, label := range labels { - if _, added := addedLabels[label]; !added { - addedLabels[label] = true - uniqueLabels = append(uniqueLabels, label) - } - } - return uniqueLabels -} - -// typeScriptRules returns all TypeScript rules in rules. -func typeScriptRules(rules []*appb.Rule) []*appb.Rule { - var tsRules []*appb.Rule - for _, rule := range rules { - for _, supportedRuleClass := range []string{ - "ts_library", - "ts_declaration", - "ng_module", - } { - if rule.GetRuleClass() == supportedRuleClass { - tsRules = append(tsRules, rule) - break - } - } - } - return tsRules -} - -// resolveAgainstModuleRoot resolves imported against moduleRoot and moduleName. -func resolveAgainstModuleRoot(rule *appb.Rule, imported string) string { - moduleName := stringAttribute(rule, "module_name") - if moduleName == "" { - return imported - } - if !pathStartsWith(imported, moduleName) { - return imported - } - // if module root is a file, remove the file extension, since it'll be added - // by possibleFilepaths below - moduleRoot := stripTSExtension(stringAttribute(rule, "module_root")) - _, pkg, _ := edit.ParseLabel(rule.GetName()) - - // resolve the import path against the module name and module root, ie if - // the import path is @foo/bar and there's a moduleName of @foo the resolved - // import path is location/of/foo/bar, or if there's also a moduleRoot of - // baz, the resolved import path is location/of/foo/baz/bar - // - // using strings.TrimPrefix for trimming the path is ok, since - // pathStartsWith already checked that moduleName is a proper prefix of - // i.importPath - return platform.Normalize(filepath.Join(pkg, moduleRoot, strings.TrimPrefix(imported, moduleName))) -} - -// pathStartsWith checks if path starts with prefix, checking each path segment, -// so that @angular/core starts with @angular/core, but @angular/core-bananas -// does not -func pathStartsWith(path, prefix string) bool { - pathParts := strings.Split(path, "/") - prefixParts := strings.Split(prefix, "/") - - if len(prefixParts) > len(pathParts) { - return false - } - - for i, prefixPart := range prefixParts { - if prefixPart != pathParts[i] { - return false - } - } - - return true -} - -// parsePackageName parses and returns the scope and package of imported. For -// example, "@foo/bar" would have a scope of "@foo" and a package of "bar". -func parsePackageName(imported string) (string, string) { - firstSlash := strings.Index(imported, "/") - if firstSlash == -1 { - return imported, "" - } - afterSlash := imported[firstSlash+1:] - if secondSlash := strings.Index(afterSlash, "/"); secondSlash > -1 { - return imported[:firstSlash], afterSlash[:secondSlash] - } - return imported[:firstSlash], afterSlash -} diff --git a/ts_auto_deps/analyze/loader_test.go b/ts_auto_deps/analyze/loader_test.go deleted file mode 100644 index f6b909e7..00000000 --- a/ts_auto_deps/analyze/loader_test.go +++ /dev/null @@ -1,97 +0,0 @@ -package analyze - -import ( - "testing" - - "google3/net/proto2/go/proto" - - appb "google3/third_party/bazel/src/main/protobuf/build_go_proto" -) - - -func TestResolveAgainstModuleRoot(t *testing.T) { - tests := []struct { - ruleLiteral string - imported string - expected string - }{ - { - ruleLiteral: `name: "//a" - rule_class: "ts_library"`, - imported: "foo", - expected: "foo", - }, - { - ruleLiteral: `name: "//b" - rule_class: "ts_library" - attribute: < - type: 4 - name: "module_name" - string_value: "foo" - >`, - imported: "bar", - expected: "bar", - }, - { - ruleLiteral: `name: "//c" - rule_class: "ts_library" - attribute: < - type: 4 - name: "module_name" - string_value: "foo" - >`, - imported: "foo/bar", - expected: "c/bar", - }, - { - ruleLiteral: `name: "//actual/loc:target" - rule_class: "ts_library" - attribute: < - type: 4 - name: "module_name" - string_value: "foo/bar" - > - attribute: < - type: 4 - name: "module_root" - string_value: "mod/root" - >`, - imported: "foo/bar/baz/bam", - expected: "actual/loc/mod/root/baz/bam", - }, - } - for _, test := range tests { - rule, err := parseRuleLiteral(test.ruleLiteral) - if err != nil { - t.Errorf("isRuleAnAlias(%q): failed to parse literal: %s", test.ruleLiteral, err) - continue - } - if actual := resolveAgainstModuleRoot(rule, test.imported); actual != test.expected { - t.Errorf("resolveAgainstModuleRoot(%q): got %q, want %q", rule.GetName(), actual, test.expected) - } - } -} - -func TestParsePackageName(t *testing.T) { - tests := []struct { - input, scope, pkg string - }{ - {"foo/bar", "foo", "bar"}, - {"foo/bar/baz", "foo", "bar"}, - {"foo", "foo", ""}, - {"", "", ""}, - } - for _, test := range tests { - if scope, pkg := parsePackageName(test.input); scope != test.scope || pkg != test.pkg { - t.Errorf("moduleName(%q): got %q, %q, want %q, %q", test.input, scope, pkg, test.scope, test.pkg) - } - } -} - -func parseRuleLiteral(literal string) (*appb.Rule, error) { - var rule appb.Rule - if err := proto.UnmarshalText(literal, &rule); err != nil { - return nil, err - } - return &rule, nil -} diff --git a/ts_auto_deps/main.go b/ts_auto_deps/main.go deleted file mode 100644 index 8410149f..00000000 --- a/ts_auto_deps/main.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/updater" -) - -var ( - isRoot = flag.Bool("root", false, "the given path is the root of a TypeScript project "+ - "(generates ts_config and ts_development_sources targets).") - recursive = flag.Bool("recursive", false, "recursively update all packages under the given root.") - files = flag.Bool("files", false, "treats arguments as file names. Filters .ts files, then runs on their dirnames.") -) - -func usage() { - fmt.Fprintf(os.Stderr, `ts_auto_deps: generate BUILD rules for TypeScript sources. - -usage: %s [flags] [path...] - -ts_auto_deps generates and updates BUILD rules for each of the given package paths. -Paths are expected to reside underneath the workspace root. If none is given, -ts_auto_deps runs on the current working directory. - -For each of the given package paths, ts_auto_deps finds all TypeScript sources in the -package and adds sources that are not currently built to the appropriate -BUILD rule (ts_library or ts_declaration). - -If there is no matching BUILD rule, or no BUILD file, ts_auto_deps will create either. - -ts_auto_deps also updates BUILD rule dependencies ('deps') based on the source imports. - -Flags: -`, os.Args[0]) - flag.PrintDefaults() -} - -func main() { - flag.Usage = usage - flag.Parse() - - paths, err := updater.Paths(*isRoot, *files, *recursive) - if err != nil { - platform.Error(err) - } - - host := updater.New(false, false, updater.QueryBasedBlazeAnalyze, updater.LocalUpdateFile) - if err := updater.Execute(host, paths, *isRoot, *recursive); err != nil { - platform.Error(err) - } -} diff --git a/ts_auto_deps/platform/file.go b/ts_auto_deps/platform/file.go deleted file mode 100644 index 175a8de6..00000000 --- a/ts_auto_deps/platform/file.go +++ /dev/null @@ -1,58 +0,0 @@ -// Package platform handles differences between google3 and open source for taze. -package platform - -import ( - "context" - - "google3/file/base/go/file" -) - -// ReadFile reads the contents of name. -func ReadFile(ctx context.Context, name string) ([]byte, error) { - return file.ReadFile(ctx, name) -} - -// ReadBytesFromFile reads bytes into the buffer provided, stopping when the -// buffer is full. -func ReadBytesFromFile(ctx context.Context, name string, buffer []byte) (int, error) { - f, err := file.OpenRead(ctx, name) - if err != nil { - return 0, err - } - defer f.IO(ctx).Close() - - n, err := f.IO(ctx).Read(buffer) - return n, err -} - -// WriteFile writes data to filename. -func WriteFile(ctx context.Context, filename string, data []byte) error { - return file.WriteFile(ctx, filename, data) -} - -// Stat reads the file system information of name. -// NOTE: The result of Stat, FileStat or FileInfo for internal and external -// respectively, is never used. Since the two results are mostly incompatible -// structures, return an interface in both the open-source and internal version. -func Stat(ctx context.Context, name string) (interface{}, error) { - return file.Stat(ctx, name) -} - -// Glob returns all paths matching pattern. -func Glob(ctx context.Context, pattern string) ([]string, error) { - stats, err := file.Match(ctx, pattern, file.StatNone) - if err != nil { - return nil, err - } - paths := make([]string, 0, len(stats)) - for _, stat := range stats { - paths = append(paths, stat.Path) - } - return paths, nil -} - -// Normalize is a no-op in google3. Note that file.go.oss has an implementation -// which fixes Windows paths. -func Normalize(path string) string { - return path -} diff --git a/ts_auto_deps/platform/file.go.oss b/ts_auto_deps/platform/file.go.oss deleted file mode 100644 index bf87a03c..00000000 --- a/ts_auto_deps/platform/file.go.oss +++ /dev/null @@ -1,54 +0,0 @@ -package platform - -import ( - "context" - "io/ioutil" - "os" - "path/filepath" - "strings" -) - -const ( - filePerms = 0666 -) - -var pathReplacer = strings.NewReplacer("\\", "/") - -// ReadFile reads the contents of name. -func ReadFile(ctx context.Context, name string) ([]byte, error) { - return ioutil.ReadFile(name) -} - -// ReadBytesFromFile reads bytes into the buffer provided, stopping when the -// buffer is full. -func ReadBytesFromFile(ctx context.Context, name string, buffer []byte) (int, error) { - f, err := os.Open(name) - if err != nil { - return 0, err - } - defer f.Close() - - n, err := f.Read(buffer) - return n, err -} - - -// WriteFile writes data to filename. -func WriteFile(ctx context.Context, filename string, data []byte) error { - return ioutil.WriteFile(filename, data, filePerms) -} - -// Stat reads the file system information of name. -func Stat(ctx context.Context, name string) (interface{}, error) { - return os.Stat(name) -} - -// Glob returns all paths matching pattern. -func Glob(ctx context.Context, pattern string) ([]string, error) { - return filepath.Glob(pattern) -} - -// Normalize converts Windows path separators into POSIX -func Normalize(path string) (string) { - return pathReplacer.Replace(path) -} diff --git a/ts_auto_deps/platform/log.go b/ts_auto_deps/platform/log.go deleted file mode 100644 index 1486945c..00000000 --- a/ts_auto_deps/platform/log.go +++ /dev/null @@ -1,18 +0,0 @@ -package platform - -import "google3/base/go/log" - -// Infof prints a formatted message to stdout. -func Infof(format string, v ...interface{}) { - log.Infof(format, v...) -} - -// Error prints a series of args to stderr. -func Error(args ...interface{}) { - log.Error(args...) -} - -// Fatalf prints a formatted message to stderr. Panics after printing. -func Fatalf(format string, v ...interface{}) { - log.Fatalf(format, v...) -} diff --git a/ts_auto_deps/platform/log.go.oss b/ts_auto_deps/platform/log.go.oss deleted file mode 100644 index 4fb889ee..00000000 --- a/ts_auto_deps/platform/log.go.oss +++ /dev/null @@ -1,22 +0,0 @@ -package platform - -import ( - "fmt" - "log" - "os" -) - -// Infof prints a formatted message to stdout. -func Infof(format string, args ...interface{}) { - fmt.Printf(format+"\n", args...) -} - -// Error prints a series of args to stderr. -func Error(args ...interface{}) { - fmt.Fprintln(os.Stderr, args...) -} - -// Fatalf prints a formatted message to stderr. Panics after printing. -func Fatalf(format string, v ...interface{}) { - log.Fatalf(format, v...) -} diff --git a/ts_auto_deps/platform/walk.go b/ts_auto_deps/platform/walk.go deleted file mode 100644 index ee35020d..00000000 --- a/ts_auto_deps/platform/walk.go +++ /dev/null @@ -1,20 +0,0 @@ -package platform - -import ( - "os" - - "google3/third_party/golang/go_tools/internal/fastwalk/fastwalk" -) - -// Walk does a faster filesystem walk than filepath.Walk by wrapping -// fastwalk.Walk. -// Performance was measured by timing updater.Paths when running taze -//--recursive on the cloud directory, both after a clearing the srcfs cache, and -// on subsequent runs. -// fastwalk, without cache: 2m35.950528503s -// fastwalk, with cache: 940.908936ms -// filepath.Walk without cache: 34m55.55114913s -// filepath.Walk with cache: 26.917530244s -func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - return fastwalk.Walk(root, walkFn) -} diff --git a/ts_auto_deps/platform/walk.go.oss b/ts_auto_deps/platform/walk.go.oss deleted file mode 100644 index 05dd3661..00000000 --- a/ts_auto_deps/platform/walk.go.oss +++ /dev/null @@ -1,15 +0,0 @@ -package platform - -import ( - "os" - "path/filepath" -) - -func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - return walkFn(path, info.Mode()) - }) -} diff --git a/ts_auto_deps/proto/analyze_result.proto b/ts_auto_deps/proto/analyze_result.proto deleted file mode 100644 index f94855f9..00000000 --- a/ts_auto_deps/proto/analyze_result.proto +++ /dev/null @@ -1,98 +0,0 @@ -syntax = "proto2"; - -package blaze_analyze; - -// A DependencyGroup represents a list of alternatives for satisfying -// a missing dependency. -message DependencyGroup { - // Represents the visibility status of this dependency group. All the - // dependencies have the same visibility status indicated by the visibility - // field. Producers of this message (i.e. checkdeps) will ensure that - // the invariant is true. - enum Visibility { - // Visibility was not considered. (Default) - UNKNOWN = 0; - // All the alternatives are visible - ALL_VISIBLE = 1; - // All the alternatives are invisible - ALL_INVISIBLE = 2; - } - - repeated string dependency = 1; - optional Visibility visibility = 2 [default = UNKNOWN]; - // The set of import paths for which any of these dependencies can provide. - // It is legal for there to be multiple entries there (in practice it is - // not very common). This happens if the dependencies required by one - // import_path is a subset of the other. In that case, the smaller set of - // dependencies is populated in dependency field, and both import_path's are - // listed here. - repeated string import_path = 3; -} - -// Represents information about arbitrary non-deps attributes. -message AttributeReport { - // Name of the attribute (e.g. "runtime_deps"). - optional string attribute = 1; - // Attribute value that is required but missing. - repeated string missing_value = 2; - // Attribute value that is declared but not needed. - repeated string unnecessary_value = 3; -} - -// The result of checking a single build rule (called X in comments -// below) for missing or unnecessary dependencies. Produced by -// java/com/google/devtools/build/checkbuilddeps (which for external -// users means it's produced by blaze analyze). -message DependencyReport { - required string rule = 1; // Name of rule X, in canonical google3 format. - - // Names of targets that are, or should be, declared as dependencies - // by rule X. Some need to be declared and some don't; in some - // cases it is impossible to tell by static analysis. Each is the - // full canonical name of the target, i.e. //x/y:z, or the shorthand - // form if the target name equals the package name, i.e. //x/y - // (shorthand for //x/y:y). - - // Declared and needed. Removing these dependencies should break the build. - repeated string necessary_dependency = 2; - - // Declared but not needed. Removing these dependencies should not break - // the build. - repeated string unnecessary_dependency = 3; - - // Can't tell. These may be dependencies where no corresponding imports - // were found, but alwayslink=1. - repeated string ambiguous_dependency = 4; - - // Needed but not declared. If there are imports which can be satisfied - // by more than one dependency declared in a best-matching package, list - // all of them. If this list is not empty, we expect the build to break. - repeated DependencyGroup missing_dependency_group = 8; - - // Files/classes that a source file imports, but for which no - // appropriate dependency could be found. We expect the build to break - // if this list is not empty. - // NOTE: If there are unreseolved imports, it may indicate that - // analysis failed to connect a declared dependency with a - // corresponding import statement, and so you may want to have less - // faith in the unnecessary_dependency field (though, in general, - // rules in unnecessary_dependency are still PROBABLY unnecessary). - repeated string unresolved_import = 7; - - // Source files that are inputs to the rule but cannot be found. - // Values are absolute labels, e.g. '//foo:bar/baz.c'. - repeated string missing_source_file = 13; - - // General-purpose feedback messages from the dependency checker - // (errors, warnings, any kind of info). - repeated string feedback = 6; - - // Indicates whether the dependency analysis completed without errors. - optional bool successful = 10 [default = true]; -} - -// Aggregate DependencyReports for multiple analysis -// targets - used to support blaze analyze --analysis_output=proto -message AnalyzeResult { - repeated DependencyReport dependency_report = 1; -} diff --git a/ts_auto_deps/updater/comments.go b/ts_auto_deps/updater/comments.go deleted file mode 100644 index 17060aff..00000000 --- a/ts_auto_deps/updater/comments.go +++ /dev/null @@ -1,208 +0,0 @@ -// Excluded from the open-source version since there are no taze comments. Also -// because the sstable is not available. - -package updater - -import ( - "bytes" - "context" - "fmt" - "path/filepath" - "regexp" - "strconv" - "sync" - - "google3/base/go/log" - "google3/file/base/go/file" - "google3/sstable/go/sstable" - "google3/third_party/bazel_buildifier/edit/edit" - - arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" -) - -var missingCommentRE = regexp.MustCompile( - `(?s)ERROR: ([^:]+):(\d+):(\d+): missing comment for 'goog:' import.*?'goog:([^']+)'`) - -// fixMissingTazeComments adds taze `// from ...` comments to source files. -// It scans the given feedback reports for "missing taze comment" errors, looks up the missing namespaces -// in an sstable stored on x20, and then appends comments to the lines missing them. -// fixMissingTazeComments returns true if it fixed any missing comments. -func (upd *Updater) fixMissingTazeComments(ctx context.Context, g3root string, reports []*arpb.DependencyReport) (bool, error) { - type location struct { - file string - line int - } - type missingComment struct { - target string - locations []location - } - - // Group reports and locations by namespace. - nsToComment := make(map[string]*missingComment) - for _, report := range reports { - for _, fb := range report.GetFeedback() { - log.Infof("fix taze comments: checking feedback:\n%s", fb) - // Sadly, there is no way to return more structured feedback from blaze analyze. - m := missingCommentRE.FindStringSubmatch(fb) - if m == nil { - continue - } - file := m[1] - line, err := strconv.Atoi(m[2]) - if err != nil { - return false, err - } - namespace := m[4] - - mc := nsToComment[namespace] - if mc == nil { - mc = &missingComment{} - nsToComment[namespace] = mc - } - mc.locations = append(mc.locations, location{file: file, line: line}) - } - } - - if len(nsToComment) == 0 { - return false, nil - } - - table, err := GetNamespaceToTargetTable() - if err != nil { - return false, err - } - - tableLookupSpinner := spin(fmt.Sprintf("Searching %d namespaces for taze comments", len(nsToComment))) - // Look up targets for missing namespaces - // Group locations to add a specific target to by file. - fileToLocs := make(map[string][]*missingComment) - for namespace, mc := range nsToComment { - log.Infof("Looking for namespace %s", namespace) - it := table.Lookup(ctx, []byte(namespace)) - if it.Done() { - log.Warningf("Couldn't find namespace %q", namespace) - continue - } - target := string(it.Value()) - mc.target = target - for _, l := range mc.locations { - mc := &missingComment{target: mc.target, locations: []location{l}} - fileToLocs[l.file] = append(fileToLocs[l.file], mc) - } - } - close(tableLookupSpinner) - - // Add taze comments to files. - fixedSomething := false - for srcFile, mcs := range fileToLocs { - p := filepath.Join(g3root, srcFile) - content, err := file.ReadFile(ctx, p) - if err != nil { - log.Errorf("fix taze comments: failed to read %q: %v", p, err) - continue - } - - lines := bytes.Split(content, []byte("\n")) - - for _, mc := range mcs { - loc := mc.locations[0] - lineOffset := loc.line - 1 - if len(lines) < lineOffset { - log.Errorf("fix taze comments: no line %d in %q", loc.line, p) - continue - } - // Contains("//") is a bit overly broad here, but import URLs should not contain double - // slashes either. - if bytes.Contains(lines[lineOffset], []byte("//")) { - return fixedSomething, - &AnalysisFailedError{ - []AnalysisFailureCause{ - AnalysisFailureCause{ - Message: fmt.Sprintf("cannot add taze comment to %s:%d, it already has a (malformed?) comment."+ - " Please remove or fix the comment.", - srcFile, loc.line), - Path: srcFile, - Line: loc.line, - }, - }, - } - } - var line bytes.Buffer - target := edit.ShortenLabel(mc.target, "") // pass "" as pkg to always get absolute package references. - fmt.Fprintf(&line, "%s // from %s", lines[lineOffset], target) - lines[lineOffset] = line.Bytes() - } - newContent := string(bytes.Join(lines, []byte("\n"))) - if err := upd.updateFile(ctx, p, newContent); err != nil { - log.Errorf("fix taze comments: failed to write %q: %v", p, err) - continue - } - fmt.Printf("Added taze comments to %s\n", srcFile) - fixedSomething = true - } - - return fixedSomething, nil -} - -var namespaceToTarget sstable.Table -var tableOnce sync.Once - -// GetNamespaceToTargetTable opens and returns the taze table from x20. -// It is a variable so it can be overridden for testing. -var GetNamespaceToTargetTable = func() (sstable.Table, error) { - tableOnce.Do(func() { - ctx := context.Background() - // This keeps the same sstable open for the entire (short) lifetime of the taze run. - // That is by design: during one run, the table should not change from under us. - t, err := sstable.Open(ctx, *namespaceLookupTable, &sstable.Options{}) - if err != nil { - log.Errorf("Failed to open namespace to target sstable: %v", err) - return - } - namespaceToTarget = t - }) - if namespaceToTarget == nil { - return nil, fmt.Errorf("fix taze comments: failed to open namespace sstable") - } - return namespaceToTarget, nil -} - -// Matches the Closure namespace for an import inside a .ts file. -var googImportNamespace = regexp.MustCompile(`^import .* from 'goog:(.*)';.*`) - -// Matches import lines that have a trailing taze comment. -// Capturing group 1 will be kept and the lookedup namespace will be appended. -// Based on a regex from -// java/com/google/devtools/ruleanalysis/service/checkbuilddeps/typescript/TypeScriptRuleChecker.java -var tazeCommentAfterStatement = regexp.MustCompile(`^(import .*;\s*//[ \t]*from[ \t]+)//.*$`) - -func updateTazeCommentsOnImports(ctx context.Context, path string, namespaceToTargetTable sstable.Table) error { - log.Infof("Updating taze import comments from %s\n", path) - content, err := file.ReadFile(ctx, path) - if err != nil { - return fmt.Errorf("reading %q: %v", path, err) - } - lines := bytes.Split(content, []byte("\n")) - for i, line := range lines { - match := googImportNamespace.FindSubmatch(line) - if match == nil { - continue - } - namespace := match[1] - it := namespaceToTargetTable.Lookup(ctx, namespace) - if it.Done() { - log.Infof("Attempted to update taze comment for %q but it is not in the index.\n", namespace) - continue - } - newLine := tazeCommentAfterStatement.ReplaceAll(line, append([]byte("$1"), it.Value()...)) - if bytes.Compare(newLine, lines[i]) != 0 { - log.Infof("Updated comment for %q in %q\n", namespace, path) - lines[i] = newLine - } - } - err = file.WriteFile(ctx, path, bytes.Join(lines, []byte("\n"))) - if err != nil { - return fmt.Errorf("failed to write %q: %v", path, err) - } - return nil -} diff --git a/ts_auto_deps/updater/comments_test.go b/ts_auto_deps/updater/comments_test.go deleted file mode 100644 index 921cf44c..00000000 --- a/ts_auto_deps/updater/comments_test.go +++ /dev/null @@ -1,184 +0,0 @@ -// Excluded from the open-source version since there are no taze comments. Also -// because the sstable is not available. - -package updater - -import ( - "bytes" - "context" - "io/ioutil" - "testing" - - "google3/sstable/go/sstable" - "google3/sstable/go/sstabletest" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - - arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" -) - -func TestFixMissingTazeComments(t *testing.T) { - sstableContent := []sstabletest.Entry{ - {[]byte("goog.string"), []byte("//javascript/closure/string:string")}, - {[]byte("goog.array"), []byte("//javascript/closure/array:nondefault")}, - } - sstabletest.Sort(sstableContent) - table := sstabletest.NewTable(sstableContent) - - GetNamespaceToTargetTable = func() (sstable.Table, error) { - return table, nil - } - - p, err := mktmp("google3/foo/a.ts", []byte(` - import {firstUsage} from 'goog:goog.string'; - import {x} from 'x'; - import {secondUsage} from 'goog:goog.string'; - import {hasComment} from 'goog:goog.string'; // from //javascript/closure/string - import {otherNamespace} from 'goog:goog.array';`)) - if err != nil { - t.Error(err) - } - g3root, err := workspace.Root(p) - if err != nil { - t.Error(err) - } - p2, err := mktmp("google3/foo/b.ts", []byte(`import {anotherUser} from 'goog:goog.string';`)) - if err != nil { - t.Error(err) - } - - report := parseReport(t, ` - rule: "//foo:bar" - unresolved_import: "goog:goog.string" - unresolved_import: "goog:goog.array" - feedback: "ERROR: foo/a.ts:2:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" - " import Bar from 'goog:goog.string'; // from //foo:bar\n" - feedback: "ERROR: foo/a.ts:4:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" - " import Bar from 'goog:goog.string'; // from //foo:bar\n" - feedback: "ERROR: foo/a.ts:6:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" - " import Bar from 'goog:goog.array'; // from //foo:bar\n"`) - report2 := parseReport(t, ` - rule: "//foo:baz" - unresolved_import: "goog:goog.string" - feedback: "ERROR: foo/b.ts:1:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" - " import Bar from 'goog:goog.string'; // from //foo:bar\n"`) - - ctx := context.Background() - updater := New(false, false, nil, LocalUpdateFile) - changed, err := updater.fixMissingTazeComments(ctx, g3root, []*arpb.DependencyReport{report, report2}) - if err != nil { - t.Error(err) - } - if !changed { - t.Error("fixMissingTazeComments: expected change") - } - - content, err := ioutil.ReadFile(p) - if err != nil { - t.Error(err) - } - expected := ` - import {firstUsage} from 'goog:goog.string'; // from //javascript/closure/string - import {x} from 'x'; - import {secondUsage} from 'goog:goog.string'; // from //javascript/closure/string - import {hasComment} from 'goog:goog.string'; // from //javascript/closure/string - import {otherNamespace} from 'goog:goog.array'; // from //javascript/closure/array:nondefault` - if string(content) != expected { - t.Errorf("fixMissingTazeComments(%q): got:\n%s, expected:\n%s", p, content, expected) - } - - content, err = ioutil.ReadFile(p2) - if err != nil { - t.Error(err) - } - expected = `import {anotherUser} from 'goog:goog.string'; // from //javascript/closure/string` - if string(content) != expected { - t.Errorf("fixMissingTazeComments(%q): got:\n%s, expected:\n%s", p2, content, expected) - } -} - -func TestFixMissingTazeCommentsBadCommentFormat(t *testing.T) { - sstableContent := []sstabletest.Entry{{[]byte("goog.string"), []byte("//javascript/closure/string:string")}} - sstabletest.Sort(sstableContent) - table := sstabletest.NewTable(sstableContent) - - GetNamespaceToTargetTable = func() (sstable.Table, error) { - return table, nil - } - - fileContents := []byte(` - import {hasIncorrectComment} from 'goog:goog.string'; // from some:place - `) - p, err := mktmp("google3/foo/a.ts", fileContents) - if err != nil { - t.Error(err) - } - g3root, err := workspace.Root(p) - if err != nil { - t.Error(err) - } - - report := parseReport(t, ` - rule: "//foo:bar" - unresolved_import: "goog:goog.string" - feedback: "ERROR: foo/a.ts:2:1: missing comment for 'goog:' import, please add a trailing comment to the import. E.g.\n" - " import Bar from 'goog:goog.string'; // from //foo:bar\n"`) - ctx := context.Background() - updater := New(false, false, nil, LocalUpdateFile) - _, err = updater.fixMissingTazeComments(ctx, g3root, []*arpb.DependencyReport{report}) - expErr := "cannot add taze comment to foo/a.ts:2, it already has a (malformed?) comment. Please remove or fix the comment." - if err == nil || err.Error() != expErr { - t.Errorf("fixMissingTazeComments(%q): got error %q, expected %q", p, err, expErr) - } - - if analysisErr, ok := err.(*AnalysisFailedError); ok { - if len(analysisErr.Causes) != 1 { - t.Errorf("fixMissingTazeComments(%q): got error causes %q, expected only one", p, analysisErr.Causes) - } - cause := analysisErr.Causes[0] - expFile := "foo/a.ts" - if cause.Path != expFile { - t.Errorf("fixMissingTazeComments(%q): got error file %q, expected %q", p, expFile, cause.Path) - } - expLine := 2 - if cause.Line != expLine { - t.Errorf("fixMissingTazeComments(%q): got error line %q, expected %q", p, expLine, cause.Line) - } - } else { - t.Errorf("fixMissingTazeComments(%q): got error %q, expected it to be an AnalysisFailedError", p, err) - } - - newContents, err := ioutil.ReadFile(p) - if err != nil { - t.Error(err) - } - if !bytes.Equal(newContents, fileContents) { - t.Errorf("fixMissingTazeComments(%q): got:\n%s, expected unchanged:\n%s", p, newContents, fileContents) - } -} - -func TestUpdateTazeCommentsOnImports(t *testing.T) { - sstableContent := []sstabletest.Entry{{[]byte("rapid.model.json"), []byte("//java/com/google/releasetools/rapid/static/js/model:model")}} - sstabletest.Sort(sstableContent) - table := sstabletest.NewTable(sstableContent) - - fileContents := []byte(`import {ProcessTypeEnum} from 'goog:rapid.model.json'; // from //java/com/google/releasetools/rapid/static/js/model:json_js`) - p, err := mktmp("google3/foo/a.ts", fileContents) - if err != nil { - t.Fatal(err) - } - - ctx := context.Background() - err = updateTazeCommentsOnImports(ctx, p, table) - if err != nil { - t.Error(err) - } - - content, err := ioutil.ReadFile(p) - if err != nil { - t.Error(err) - } - expected := `import {ProcessTypeEnum} from 'goog:rapid.model.json'; // from //java/com/google/releasetools/rapid/static/js/model:model` - if string(content) != expected { - t.Errorf("updateTazeCommentsOnImports(%q): got:\n%s, expected:\n%s", p, content, expected) - } -} diff --git a/ts_auto_deps/updater/internal_rules.go b/ts_auto_deps/updater/internal_rules.go deleted file mode 100644 index bf912284..00000000 --- a/ts_auto_deps/updater/internal_rules.go +++ /dev/null @@ -1,125 +0,0 @@ -// Excluded from the open-source version since there are no equivalent rules -// to ts_config and ts_development_sources. - -package updater - -import ( - "path/filepath" - "strings" - - "google3/third_party/bazel_buildifier/build/build" - "google3/third_party/bazel_buildifier/edit/edit" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" -) - -// updateTSConfig creates new ts_config rules, as well as registers non-test ts -// rules with the ts_config. Test ts rules are handled in test_register.go. -func updateTSConfig(bld *build.File, add bool) { - if add && getLastRule(bld, "ts_config", ruleTypeAny) == nil { - r := getOrCreateRule(bld, "tsconfig", "ts_config", ruleTypeAny) - r.SetAttr("deps", &build.ListExpr{}) - } - - // register any non-test rules - r := getLastRule(bld, "ts_config", ruleTypeAny) - if r == nil { - return // No ts_config rule that needs updating. - } - targets := allTSRules(bld) - for _, t := range targets { - isTest := attrTruthy(t, "testonly") - if isTest { - // registering test rules with ts_config is done in test_register.go - continue - } - addDep(bld, r, t.Name()) - } -} - -// updateTSDevelopmentSources creates new ts_development_sources rules, as well -// as registers non-test ts rules with the ts_development_sources. Test ts -// rules are handled in test_register.go. -func updateTSDevelopmentSources(bld *build.File, add bool) { - if add { - ruleName := "devsrcs" - if getLastRule(bld, "ts_development_sources", ruleTypeRegular) == nil { - r := getOrCreateRule(bld, ruleName, "ts_development_sources", ruleTypeRegular) - r.SetAttr("deps", &build.ListExpr{}) - } - if getLastRule(bld, "ts_development_sources", ruleTypeTest) == nil { - r := getOrCreateRule(bld, ruleName, "ts_development_sources", ruleTypeTest) - r.SetAttr("deps", &build.ListExpr{}) - } - } - - // register any non-test rules - for _, t := range allTSRules(bld) { - // NodeJS rules should not be added to ts_development_sources automatically - // because they typically do not run in the browser. - if t.AttrString("runtime") == "nodejs" { - continue - } - isTest := attrTruthy(t, "testonly") - if isTest { - // registering test rules with ts_dev_srcs is done in test_register.go - continue - } - depName := ":" + t.Name() - if targetRegisteredInRule(bld, "ts_development_sources", ruleTypeRegular, depName) { - continue - } - r := getLastRule(bld, "ts_development_sources", ruleTypeRegular) - if r == nil { - continue // No devsources rule that needs updating. - } - addDep(bld, r, depName) - } -} - -// updateGenWizTS updates the sources of gen_wiz_ts() build rules referenced -// from ts_library()s. -func updateGenWizTS(bld *build.File) { - // For each ts_library, check if it references a gen_wiz_ts() rule in its srcs - for _, r := range buildRules(bld, "ts_library") { - srcs := r.AttrStrings("srcs") - var genWizRule *build.Rule - for _, src := range srcs { - if !strings.HasPrefix(src, ":") { - continue - } - candidate := edit.FindRuleByName(bld, strings.TrimPrefix(src, ":")) - if candidate != nil && candidate.Kind() == "gen_wiz_ts" { - genWizRule = candidate - break - } - } - // If so, add each source file ending with a wiz suffix to its srcs. - if genWizRule != nil { - addWizSrcsToTarget(bld, genWizRule, srcs) - } - } -} - -var wizSuffixes = []string{ - "controller.ts", - "model.ts", - "renderer.ts", - "processor.ts", - "service.ts", - "interface.ts", -} - -// addWizSrcsToTarget adds any entry from srcs to the sources of the given rule -// if it is a Wiz source (matches one of the suffixes). -func addWizSrcsToTarget(bld *build.File, rule *build.Rule, srcs []string) { - platform.Infof("Adding wiz sources to target %s:%s: %q", filepath.Dir(bld.Path), rule.Name(), srcs) -srcLoop: - for _, src := range srcs { - for _, suffix := range wizSuffixes { - if strings.HasSuffix(src, suffix) { - addToSrcsClobbering(bld, rule, src) - continue srcLoop - } - } - } -} diff --git a/ts_auto_deps/updater/internal_updater_test.go b/ts_auto_deps/updater/internal_updater_test.go deleted file mode 100644 index 4dbc9c87..00000000 --- a/ts_auto_deps/updater/internal_updater_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package updater - -import ( - "context" - "os" - "path/filepath" - "reflect" - "testing" - - "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" -) - -func TestGoogle3Root(t *testing.T) { - r, err := workspace.Root("a/google3/b/c") - if err != nil { - t.Error(err) - } - // Expect an absolute, resolved path. - exp, err := filepath.Abs("a/google3") - if r != exp { - t.Errorf("got %s, expected %s", r, exp) - } -} - -func TestRegisterTestRule(t *testing.T) { - ctx := context.Background() - p, err := mktmp("google3/foo/BUILD", []byte(`ts_config(name = "tsconfig", deps = ["//foo/bar:bar_test"])`)) - if err != nil { - t.Fatal(err) - } - barPath, err := mktmp("google3/foo/bar/BUILD", []byte(`ts_library(name = "bar_test", testonly=True)`)) - if err != nil { - t.Fatal(err) - } - bazPath, err := mktmp("google3/foo/baz/BUILD", []byte(`ts_library(name = "baz_test", testonly=True)`)) - if err != nil { - t.Fatal(err) - } - - g3root := filepath.Dir(filepath.Dir(p)) - var updatedFile string - testUpdateFile := UpdateFile(func(ctx context.Context, filePath string, _ string) error { - var err error - updatedFile, err = filepath.Rel(g3root, filePath) - return err - }) - - updater := New(false, false, nil, testUpdateFile) - _, _, err = updater.RegisterTestRules(ctx, barPath) - if err != nil { - t.Fatal(err) - } - if updatedFile != "" { - t.Errorf("expected no update, got a write to %q", updatedFile) - } - - _, _, err = updater.RegisterTestRules(ctx, bazPath) - if err != nil { - t.Fatal(err) - } - if updatedFile != "foo/BUILD" { - t.Errorf("got an update to %q, expected foo/BUILD", updatedFile) - } -} - -func TestResolvePackages(t *testing.T) { - p, err := mktmp("google3/sub/pkg/file", []byte("")) - if err != nil { - t.Fatal(err) - } - if err := os.Chdir(filepath.Dir(p)); err != nil { - t.Fatal(err) - } - g3root := filepath.Dir(filepath.Dir(filepath.Dir(p))) - if filepath.Base(g3root) != "google3" { - t.Errorf("g3root should be called google3, got %q", g3root) - } - paths := []string{"//foo", "/bar"} - if err := ResolvePackages(paths); err != nil { - t.Fatal(err) - } - expected := []string{filepath.Join(g3root, "foo"), "/bar"} - if !reflect.DeepEqual(paths, expected) { - t.Errorf("ResolvePackages: got %s, expected %s", paths, expected) - } -} diff --git a/ts_auto_deps/updater/test_register.go b/ts_auto_deps/updater/test_register.go deleted file mode 100644 index 1960226c..00000000 --- a/ts_auto_deps/updater/test_register.go +++ /dev/null @@ -1,259 +0,0 @@ -package updater - -import ( - "context" - "fmt" - "path/filepath" - - "google3/third_party/bazel_buildifier/build/build" - "google3/third_party/bazel_buildifier/edit/edit" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" -) - -// isAllTestLibrary identifies testonly ts_libraries named "all_tests". Taze -// will register tests with these rules instead of -// ts_config/ts_development_sources rules to allow users to set up their builds -// differently. -func isAllTestLibrary(bld *build.File, r *build.Rule) bool { - if !ruleMatches(bld, r, "ts_library", ruleTypeTest) { - return false - } - - if r.Name() != "all_tests" { - return false - } - - return true -} - -func getAllTestLibraries(bld *build.File) []*build.Rule { - var allTestRules []*build.Rule - for _, r := range buildRules(bld, "ts_library") { - if isAllTestLibrary(bld, r) { - allTestRules = append(allTestRules, r) - } - } - return allTestRules -} - -// RegisterTestRules registers ts_library test targets with the project's -// ts_config and ts_development_sources rules. It may also register the tests -// with a testonly ts_library named "all_tests", which allows users to set up -// their own BUILD layout. It's separated from UpdateBUILD since it's -// non-local, multiple packages may all need to make writes to the same -// ts_config. It returns a set of the paths for the packages that were updated. -func (upd *Updater) RegisterTestRules(ctx context.Context, paths ...string) (bool, map[string]bool, error) { - reg := &buildRegistry{make(map[string]*build.File), make(map[*build.File]bool)} - var g3root string - updatedAncestorPackages := make(map[string]bool) - for _, path := range paths { - // declare variables manually so that g3root doesn't get overwritten by a := - // declaration - var err error - var buildPath string - g3root, buildPath, _, err = getBUILDPath(ctx, path) - if err != nil { - return false, nil, err - } - bld, err := reg.readBUILD(ctx, g3root, buildPath) - if err != nil { - return false, nil, err - } - for _, tr := range getRules(bld, "ts_library", ruleTypeTest) { - // don't register all_test libraries themselves - if isAllTestLibrary(bld, tr) { - continue - } - platform.Infof("Registering test rule in closest ts_config & ts_development_sources") - target := AbsoluteBlazeTarget(bld, tr.Name()) - ancestorBuild, err := reg.registerTestRule(ctx, bld, tsConfig, g3root, target) - if err != nil { - return false, nil, err - } - if ancestorBuild != "" { - updatedAncestorPackages[ancestorBuild] = true - } - // NodeJS rules should not be added to ts_development_sources automatically, because - // they typically do not run in the browser. - if tr.AttrString("runtime") != "nodejs" { - ancestorBuild, err := reg.registerTestRule(ctx, bld, tsDevSrcs, g3root, target) - if err != nil { - return false, nil, err - } - if ancestorBuild != "" { - updatedAncestorPackages[ancestorBuild] = true - } - } - } - } - - updated := false - for b := range reg.filesToUpdate { - fmt.Printf("Registered test(s) in %s\n", b.Path) - fileChanged, err := upd.maybeWriteBUILD(ctx, filepath.Join(g3root, b.Path), b) - if err != nil { - return false, nil, err - } - updated = updated || fileChanged - } - - return updated, updatedAncestorPackages, nil -} - -// buildRegistry buffers reads and writes done while registering ts_libraries -// with ts_config and ts_development_sources rules, so that registers from -// multiple packages all get applied at once. -type buildRegistry struct { - bldFiles map[string]*build.File - filesToUpdate map[*build.File]bool -} - -func (reg *buildRegistry) readBUILD(ctx context.Context, workspaceRoot, buildFilePath string) (*build.File, error) { - normalizedG3Path, err := getWorkspaceRelativePath(workspaceRoot, buildFilePath) - if err != nil { - return nil, err - } - - if bld, ok := reg.bldFiles[normalizedG3Path]; ok { - return bld, nil - } - - bld, err := readBUILD(ctx, buildFilePath, normalizedG3Path) - if err != nil { - return nil, err - } - if bld == nil { - // The BUILD file didn't exist, so create a new, empty one. - bld = &build.File{Path: normalizedG3Path, Type: build.TypeBuild} - } - - reg.bldFiles[normalizedG3Path] = bld - - return bld, nil -} - -func (reg *buildRegistry) registerForPossibleUpdate(bld *build.File) { - reg.filesToUpdate[bld] = true -} - -type registerTarget int - -const ( - tsConfig registerTarget = iota - tsDevSrcs -) - -func (rt registerTarget) kind() string { - if rt == tsConfig { - return "ts_config" - } - - return "ts_development_sources" -} - -func (rt registerTarget) ruleType() ruleType { - if rt == tsConfig { - return ruleTypeAny - } - - return ruleTypeTest -} - -// registerTestRule searches ancestor packages for a rule matching the register -// target and adds the given target to it. If an all_tests library is found, the -// rule is registered with it, instead of specified register target. Prints a -// warning if no rule is found, but only returns an error if adding the -// dependency fails. -func (reg *buildRegistry) registerTestRule(ctx context.Context, bld *build.File, rt registerTarget, g3root, target string) (string, error) { - if buildHasDisableTaze(bld) { - return "", nil - } - - var ruleToRegister *build.Rule - for _, r := range bld.Rules("") { - if isAllTestLibrary(bld, r) { - if hasDependency(bld, r, target) { - return "", nil - } - - // an all_tests library takes presidence over a registerTarget, and there - // can only be one, since there can only be one rule with a given name, so - // can just break after finding - ruleToRegister = r - break - } - if ruleMatches(bld, r, rt.kind(), rt.ruleType()) { - if hasDependency(bld, r, target) { - return "", nil - } - - // keep overwriting ruleToRegister so the last match in the BUILD gets - // used - ruleToRegister = r - } - } - - if ruleToRegister != nil { - addDep(bld, ruleToRegister, target) - reg.registerForPossibleUpdate(bld) - return filepath.Dir(bld.Path), nil - } - - parentDir := filepath.Dir(filepath.Dir(bld.Path)) - for parentDir != "." && parentDir != "/" { - buildFile := filepath.Join(g3root, parentDir, "BUILD") - if _, err := platform.Stat(ctx, buildFile); err == nil { - parent, err := reg.readBUILD(ctx, g3root, buildFile) - if err != nil { - return "", err - } - return reg.registerTestRule(ctx, parent, rt, g3root, target) - } - parentDir = filepath.Dir(parentDir) - } - fmt.Printf("WARNING: no %s rule in parent packages of %s to register with.\n", - rt.kind(), target) - return "", nil -} - -var wellKnownBuildRules = []struct { - name string - attrName string -}{ - { - name: "karma_polymer_test", - attrName: "test_ts_deps", - }, - { - name: "wct_closure_test_suite", - attrName: "js_deps", - }, - { - name: "jasmine_node_test", - attrName: "deps", - }, - { - name: "karma_web_test_suite", - attrName: "deps", - }, - { - name: "boq_jswire_test_library", - attrName: "deps", - }, -} - -// isRegisteredWithAlternateTestRule returns true if the rule is already -// registered with a well known test rule, such as karma_polymer_test, -// wct_closure_test_suite or jasmine_node_test. -func isRegisteredWithAlternateTestRule(bld *build.File, r *build.Rule, dep string) bool { - pkg := filepath.Dir(bld.Path) - for _, wkbr := range wellKnownBuildRules{ - if isKind(r, wkbr.name) { - testTsDeps := r.Attr(wkbr.attrName) - if edit.ListFind(testTsDeps, dep, pkg) != nil { - return true - } - } - } - return false -} diff --git a/ts_auto_deps/updater/updater.go b/ts_auto_deps/updater/updater.go deleted file mode 100644 index 60ff54e5..00000000 --- a/ts_auto_deps/updater/updater.go +++ /dev/null @@ -1,1348 +0,0 @@ -// Package updater implements the main logic of the taze command. It reads BUILD files, -// discovers TypeScript sources, uses `blaze analyze` to update import/dependency information, -// and then modifies the BUILD file accordingly. -package updater - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "path/filepath" - "regexp" - "sort" - "strconv" - "strings" - "sync" - "time" - - "google3/base/go/flag" - "google3/net/proto2/go/proto" - "google3/third_party/bazel_buildifier/build/build" - "google3/third_party/bazel_buildifier/edit/edit" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/analyze" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/platform" - "github.com/bazelbuild/rules_typescript/ts_auto_deps/workspace" - "google3/third_party/golang/isatty/isatty" - - arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" -) - - -var blazeErrorRE = regexp.MustCompile(`ERROR: ([^:]+):(\d+):\d+:`) - -// New creates a new updater from the given arguments. One updater can be used -// to update many packages, repeatedly, but not concurrently. -// blazeAnalyze and updateFile can be passed in to handle taze operation in -// different environments and for fakes in tests. -func New(removeUnusedDeclarations bool, updateComments bool, blazeAnalyze BlazeAnalyzer, updateFile UpdateFile) *Updater { - return &Updater{removeUnusedDeclarations, updateComments, blazeAnalyze, updateFile} -} - -// UpdateFile updates the contents of filePath. Implementations may postpone or batch actually writing the given file, i.e. -// a subsequent read may return stale contents. -type UpdateFile func(ctx context.Context, filePath string, contents string) error - -// LocalUpdateFile simply writes to the given file. -func LocalUpdateFile(ctx context.Context, filePath string, contents string) error { - return platform.WriteFile(ctx, filePath, []byte(contents)) -} - -// BlazeAnalyzer is a function that executes blaze analyze for the given -// absolute build file path and blaze targets, and returns the raw analysis -// result proto, or an error if the analyze call failed. -// It's used to abstract over execution using rabbit vs local execution. -// Returns the main output (serialized AnalysisResult proto), any error -// messages, or an error. -type BlazeAnalyzer func(buildFilePath string, targets []string) ([]byte, []byte, error) - -// Updater encapsulates configuration for the taze process. -type Updater struct { - removeUnusedDeclarations bool - updateComments bool - blazeAnalyze BlazeAnalyzer - updateFile UpdateFile -} - -func attrTruthy(r *build.Rule, attr string) bool { - attrVal := r.AttrLiteral(attr) - return attrVal == "True" || attrVal == "1" -} - -// Matches the warning TypeScriptRuleChecker prints for unused ts_declarations. -// TODO(martinprobst): in the long term, this should become the default and TypeScriptRuleChecker should no longer special case ts_declaration. -var unusedDeclarationRE = regexp.MustCompile( - `WARNING: [^:]+:\d+:(?:\d+:)? keeping possibly used ts_declaration '([^']+)'`) - -// GarbledBlazeResponseError signals to callers that the proto returned by blaze -// analyze was garbled, and couldn't be unmarshalled. -// TODO(lucassloan): remove when b/112891536 is fixed -// Build Rabbit rewrites paths produced by blaze, which garbles the error -// messages from blaze analyze, since they're encoded in protobufs. -type GarbledBlazeResponseError struct { - Message string -} - -func (g *GarbledBlazeResponseError) Error() string { - return g.Message -} - -// runBlazeAnalyze executes the `blaze analyze` command and extracts reports. -// It returns the dependency report with rule names referring to rules *before* -// macro expansion, or an error. runBlazeAnalyze uses the given `analyze` -// function to actually run the `blaze analyze` operation, which allows -// exchanging it for a different implementation in the taze presubmit service. -func (upd *Updater) runBlazeAnalyze(buildFilePath string, bld *build.File, rules []*build.Rule) ([]*arpb.DependencyReport, error) { - var targets []string - for _, r := range rules { - fullTarget := AbsoluteBlazeTarget(bld, r.Name()) - targets = append(targets, fullTarget) - } - out, stderr, err := upd.blazeAnalyze(buildFilePath, targets) - if err != nil { - return nil, err - } - - var res arpb.AnalyzeResult - if err := proto.Unmarshal(out, &res); err != nil { - // TODO(lucassloan): remove when b/112891536 is fixed - // Build Rabbit rewrites paths produced by blaze, which garbles the error - // messages from blaze analyze, since they're encoded in protobufs. - return nil, &GarbledBlazeResponseError{fmt.Sprintf("failed to unmarshal analysis result: %v\nin: %q", err, string(out))} - } - platform.Infof("analyze result %v", res) - reports := res.GetDependencyReport() - if len(targets) != len(reports) { - if len(stderr) > 0 { - // TODO(b/73321854): pretend second rule has a syntactical error, so blaze analyze produces no - // report for it, but also doesn't return an error code. Remove workaround once fixed. - return nil, fmt.Errorf("parsing reports failed (%d reports for %s):\n%s", - len(reports), targets, stderr) - } - return nil, fmt.Errorf("parsing reports failed (%d reports for %s) in output: %s", - len(reports), targets, out) - } - if upd.removeUnusedDeclarations { - for _, report := range reports { - for _, fb := range report.GetFeedback() { - m := unusedDeclarationRE.FindStringSubmatch(fb) - if m == nil { - continue - } - target := m[1] - platform.Infof("Removing (possibly) unused ts_declaration dependency %q", target) - // TODO(martinprobst): this warning is to educate users after changing removeUnusedDeclarations to true by default. - // Once existing code is fixed, this constitutes normal operation, and the logging below should be dropped. - fmt.Fprintf(os.Stderr, "WARNING: removing apparently unused ts_declaration() dependency from %q.\n", report.GetRule()) - - - report.UnnecessaryDependency = append(report.UnnecessaryDependency, target) - } - } - } - return reports, nil -} - -func spin(prefix string) chan<- struct{} { - done := make(chan struct{}) - // Check for cygwin, important for Windows compatibility - if !isatty.IsTerminal(os.Stderr.Fd()) || !isatty.IsCygwinTerminal(os.Stdout.Fd()) { - return done - } - go func() { - // Wait a bit before starting to print to avoid flashing a spinner unnecessarily. - time.Sleep(100 * time.Millisecond) - ticker := time.NewTicker(100 * time.Millisecond) - defer ticker.Stop() - i := 0 - str := []rune(`⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`) - for { - select { - case <-done: - fmt.Fprint(os.Stderr, "\r") - for i := 0; i < len(prefix)+2; i++ { - fmt.Fprint(os.Stderr, " ") - } - fmt.Fprint(os.Stderr, "\r") - return - case <-ticker.C: - fmt.Fprintf(os.Stderr, "\r%s %s", prefix, string(str[i])) - i = (i + 1) % len(str) - } - } - }() - return done -} - -// readBUILD loads the BUILD file, if present, or returns a nil pointer, if not. -// buildFilePath is relative to CWD, and workspaceRelativePath is relative to -// the workspace root (the directory containing the WORKSPACE file). -func readBUILD(ctx context.Context, buildFilePath, workspaceRelativePath string) (*build.File, error) { - data, err := platform.ReadFile(ctx, buildFilePath) - if err != nil { - if os.IsNotExist(err) { - return nil, nil - } - return nil, err - } - bld, err := build.ParseBuild(workspaceRelativePath, data) - if err != nil { - if parseErr, ok := err.(build.ParseError); ok { - return nil, &AnalysisFailedError{ - []AnalysisFailureCause{ - AnalysisFailureCause{ - Message: parseErr.Error(), - Path: parseErr.Filename, - Line: parseErr.Pos.Line, - }, - }, - } - - } - - // wasn't an error we know how to parse - return nil, err - } - return bld, nil -} - -type srcSet map[string]bool - -type globResult struct { - srcs srcSet - err error -} - -// globSources finds sources in path with any of the given extensions. -// It also filters out temporary files, dangling symlinks, and symlinks into blaze-bin specifically. -// It returns file names relative to path. -func globSources(ctx context.Context, path string, extensions []string) (srcSet, error) { - var allSourcePaths []string - for _, extension := range extensions { - pattern := "*." + extension - matched, err := platform.Glob(ctx, filepath.Join(path, pattern)) - if err != nil { - return nil, fmt.Errorf("glob(%s): %s", pattern, err) - } - allSourcePaths = append(allSourcePaths, matched...) - } - srcs := make(srcSet) - for _, p := range allSourcePaths { - fileName := filepath.Base(p) - if isTempFile(fileName) { - continue // Ignore editor swap/backup files. - } - // Try platform.Stat as a fallback, for Google file systems. - _, err := platform.Stat(ctx, p) - if os.IsNotExist(err) { - platform.Infof("platform.Glob returned non-existent file (dangling symlink?). Ignoring %q.", p) - continue - } - if err != nil { - return nil, fmt.Errorf("cannot stat platform.Glob result %q: %v", p, err) - } - isMpeg, err := IsMpegTS(ctx, p) - if err != nil { - return nil, err - } - if isMpeg { - continue - } - p, err := filepath.Rel(path, p) - if err != nil { - return nil, fmt.Errorf("filepath.Rel(%s, %s): %v", path, p, err) - } - srcs[p] = true - } - return srcs, nil -} - -// IsMpegTS checks if a ".ts" file is an MPEG transport stream. Taze shouldn't -// treat them as TypeScript files. -func IsMpegTS(ctx context.Context, path string) (bool, error) { - var content [200]byte - n, err := platform.ReadBytesFromFile(ctx, path, content[:]) - if err != nil && err != io.EOF { - return false, err - } - - // MPEG TS' frame format starts with 0x47 every 189 bytes - detect that and return. - isMpeg := n > 188 && content[0] == 0x47 && content[188] == 0x47 - return isMpeg, nil -} - -func isTempFile(fileName string) bool { - return strings.HasPrefix(fileName, ".") || strings.HasSuffix(fileName, ".swp") || - strings.HasSuffix(fileName, "~") -} - -// updateSources adds any srcs that are not in some rule to the last ts_* rule -// in the package, or create a new rule for them. -func updateSources(bld *build.File, srcs srcSet) { - removeSourcesUsed(bld, "ts_library", "srcs", srcs) - removeSourcesUsed(bld, "ts_declaration", "srcs", srcs) - - if len(srcs) == 0 { - return - } - - // Sort the remaining sources for reproducibility (sadly Go has no LinkedHashSet) - var srcSlice []string - for s := range srcs { - srcSlice = append(srcSlice, s) - } - sort.Strings(srcSlice) - - pkgName := filepath.Base(filepath.Dir(bld.Path)) - platform.Infof("Adding new sources to targets in %q: %q", pkgName, srcSlice) - for _, s := range srcSlice { - var r *build.Rule - ruleName := pkgName - if strings.HasSuffix(s, ".d.ts") { - r = getOrCreateRule(bld, ruleName+"_dts", "ts_declaration", ruleTypeRegular) - } else { - rt := determineRuleType(bld.Path, s) - r = getOrCreateRule(bld, ruleName, "ts_library", rt) - } - addToSrcsClobbering(bld, r, s) - } -} - -// Adds the given value to the srcs attribute on the build rule. Clobbers any -// existing values for srcs that are not a list. -func addToSrcsClobbering(bld *build.File, r *build.Rule, s string) { - value := r.Attr("srcs") - switch value.(type) { - case nil, *build.ListExpr: - // expected - a list of files (labels) or absent. - default: - // Remove any glob calls, variables, etc. taze uses explicit source lists. - fmt.Fprintf(os.Stderr, "WARNING: clobbering non-list srcs attribute on %s\n", - AbsoluteBlazeTarget(bld, r.Name())) - r.DelAttr("srcs") - } - val := &build.StringExpr{Value: s} - edit.AddValueToListAttribute(r, "srcs", "", val, nil) -} - -var testingRegexp = regexp.MustCompile(`\btesting\b`) - -func determineRuleType(path, s string) ruleType { - if strings.HasSuffix(s, "_test.ts") || strings.HasSuffix(s, "_test.tsx") { - return ruleTypeTest - } - - - return ruleTypeRegular -} - -// AnalysisFailedError is returned by taze when the underlying analyze operation -// fails, e.g. because the BUILD files have syntactical errors. -type AnalysisFailedError struct { - Causes []AnalysisFailureCause -} - -// AnalysisFailureCause gives (one of) the reasons analysis failed, along with -// the path and line that caused the failure (if available). -type AnalysisFailureCause struct { - Message string - // workspace path of the file on which analysis failed ie foo/bar/baz.ts, not - // starting with google3/ - Path string - // 1-based line on which analysis failed - Line int -} - -func (a *AnalysisFailedError) Error() string { - var messages []string - for _, c := range a.Causes { - messages = append(messages, c.Message) - } - return strings.Join(messages, "\n") -} - -// updateDeps adds missing dependencies and removes unnecessary dependencies -// for the targets in the given DependencyReports to the build rules in bld. -func updateDeps(bld *build.File, reports []*arpb.DependencyReport) error { - // First, check *all* reports on whether they were successful, so that users - // get the complete set of errors at once. - var errors []AnalysisFailureCause - for _, report := range reports { - if !report.GetSuccessful() { - for _, fb := range report.GetFeedback() { - msg := fmt.Sprintf("dependency analysis failed for %s:\n%s", - report.GetRule(), fb) - - m := blazeErrorRE.FindStringSubmatch(fb) - if m == nil { - // error message didn't contain file and line number, so just use the - // path of the BUILD file that was analyzed - errors = append(errors, AnalysisFailureCause{Message: msg, Path: bld.Path}) - continue - } - - file := m[1] - line, err := strconv.Atoi(m[2]) - if err != nil { - return err - } - - errors = append(errors, AnalysisFailureCause{msg, file, line}) - } - } - } - if len(errors) > 0 { - return &AnalysisFailedError{errors} - } - - pkg := filepath.Dir(bld.Path) - for _, report := range reports { - platform.Infof("Applying report: %s", report.String()) - fullTarget := report.GetRule() - targetName := fullTarget[strings.LastIndex(fullTarget, ":")+1:] - r := edit.FindRuleByName(bld, targetName) - if r == nil { - return fmt.Errorf("could not find rule from report %v", targetName) - } - for _, md := range report.MissingDependencyGroup { - for _, d := range md.Dependency { - d = AbsoluteBlazeTarget(bld, d) - if d == fullTarget { - return &AnalysisFailedError{ - []AnalysisFailureCause{ - AnalysisFailureCause{ - Message: fmt.Sprintf("target %s depends on itself. "+ - "Maybe you have an incorrect `// from %s` comment, or need to split application "+ - "entry point (main.ts) and ng_module() rule?", d, d), - Path: bld.Path, - }, - }, - } - } - platform.Infof("Adding dependency on %s to %s\n", d, fullTarget) - addDep(bld, r, d) - } - } - hadUnresolved := len(report.UnresolvedImport) > 0 - if hadUnresolved { - return &AnalysisFailedError{ - []AnalysisFailureCause{ - AnalysisFailureCause{ - Message: fmt.Sprintf("ERROR in %s: unresolved imports %s.\nMaybe you are missing a "+ - "'// from ...'' comment, or the target BUILD files are incorrect?\n%s\n", - fullTarget, report.UnresolvedImport, strings.Join(report.GetFeedback(), "\n")), - Path: bld.Path, - }, - }, - } - } - for _, d := range report.UnnecessaryDependency { - platform.Infof("Removing dependency on %s from %s\n", d, fullTarget) - edit.ListAttributeDelete(r, "deps", d, pkg) - } - for _, s := range report.MissingSourceFile { - platform.Infof("Removing missing source %s from %s\n", s, fullTarget) - edit.ListAttributeDelete(r, "srcs", s, pkg) - } - } - return nil -} - - -// maybeWriteBUILD checks if the given file needs updating, i.e. whether the -// canonical serialized form of bld has changed from the file contents on disk. -// If so, writes the file and returns true, returns false otherwise. -func (upd *Updater) maybeWriteBUILD(ctx context.Context, path string, bld *build.File) (bool, error) { - ri := &build.RewriteInfo{} - build.Rewrite(bld, ri) - platform.Infof("Formatted %s: %s\n", path, ri) - newContent := build.Format(bld) - oldContent, err := platform.ReadFile(ctx, path) - if err != nil { - if !os.IsNotExist(err) { - return false, err - } else if len(newContent) == 0 { - // The BUILD file does not exist, and the newly created file has no content. - // Treat this as equivalent, and do not create a new BUILD file. - return false, nil - } - // Fall through to write a new file. - } else if bytes.Equal(oldContent, newContent) { - // Compare contents, only update if changed. - return false, nil - } - if err := upd.updateFile(ctx, path, string(newContent)); err != nil { - return false, fmt.Errorf("failed to update %q: %v", path, err) - } - return true, nil -} - -// getWorkspaceRelativePath takes a buildFilePath that's relative to the working -// directory, and returns a path to the BUILD file that's relative to the -// workspaceRoot (the absolute path of the directory containing the WORKSPACE -// file). -func getWorkspaceRelativePath(workspaceRoot, buildFilePath string) (string, error) { - absPath, err := filepath.Abs(buildFilePath) - if err != nil { - return "", err - } - workspaceRelativePath, err := filepath.Rel(workspaceRoot, absPath) - if err != nil { - return "", err - } - platform.Normalize(workspaceRelativePath) - - return workspaceRelativePath, nil -} - -// getBUILDPath takes in a package or BUILD file path, and returns the path of -// the workspace root (the absolute path of the directory containing the -// WORKSPACE file), the BUILD file path relative to the working directory, and -// the BUILD file path relative to the workspace root. -func getBUILDPath(ctx context.Context, path string) (string, string, string, error) { - path = strings.TrimSuffix(path, "/BUILD") // Support both package paths and BUILD files - if _, err := platform.Stat(ctx, path); os.IsNotExist(err) { - return "", "", "", err - } - buildFilePath := filepath.Join(path, "BUILD") - workspaceRoot, err := workspace.Root(buildFilePath) - if err != nil { - return "", "", "", err - } - - workspaceRelativePath, err := getWorkspaceRelativePath(workspaceRoot, buildFilePath) - if err != nil { - return "", "", "", err - } - - return workspaceRoot, buildFilePath, workspaceRelativePath, nil -} - -// isTazeDisabledInPackage checks the BUILD file, or if the BUILD doesn't exist, -// the nearest ancestor BUILD file for a disable_taze() rule. -func isTazeDisabledInPackage(ctx context.Context, g3root, buildFilePath, workspaceRelativePath string, bld *build.File) (bool, error) { - if bld == nil { - // Make sure taze hasn't been disabled in the next closest ancestor package. - ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(workspaceRelativePath)) - if _, ok := err.(*noAncestorBUILDError); ok { - platform.Infof("Could not find any ancestor BUILD for %q, continuing with a new BUILD file", - buildFilePath) - return false, nil - } else if err != nil { - return false, err - } else if buildHasDisableTaze(ancestor) { - fmt.Printf("taze disabled below %q\n", ancestor.Path) - return true, nil - } else { - platform.Infof("BUILD file missing and taze is enabled below %q. Creating new BUILD file.", - ancestor.Path) - return false, nil - } - } - - if buildHasDisableTaze(bld) { - fmt.Printf("taze disabled on %q\n", buildFilePath) - return true, nil - } - - return false, nil -} - -// SubdirectorySourcesError is returned when taze detects a BUILD file -// that references sources in another directory, either in the directory -// being tazed, or in a super directory. -type SubdirectorySourcesError struct{} - -func (a *SubdirectorySourcesError) Error() string { - return "taze doesn't handle referencing sources in another directory " + - "- to use taze, migrate to having a BUILD file in every directory. " + - "For more details, see go/taze#subdirectory-sources" -} - -// hasSubdirectorySources checks if the BUILD file has ts_libraries that contain -// source files from subdirectories of the directory with the BUILD. ie foo/BUILD -// has a src foo/bar/baz.ts, in the subdirectory foo/bar. -func hasSubdirectorySources(bld *build.File) bool { - for _, rule := range buildRules(bld, "ts_library") { - srcs := rule.AttrStrings("srcs") - if srcs != nil { - for _, s := range srcs { - if strings.Contains(s, "/") { - return true - } - } - } else { - // srcs wasn't a list, check for a glob over subdirectory soruces - srcExp := rule.Attr("srcs") - call, ok := srcExp.(*build.CallExpr) - if ok { - callName, ok := call.X.(*build.Ident) - if ok { - if callName.Name == "glob" { - for _, arg := range call.List { - strArg, ok := arg.(*build.StringExpr) - if ok && strings.Contains(strArg.Value, "/") { - return true - } - } - } - } - } - } - // TODO(b/120783741): - // This only handles a lists of files, and a single glob, there are other - // cases such as a glob + a list of files that it doesn't handle, but that's - // ok since, this is only meant as a caution to the user. - } - - return false -} - -// directoryOrAncestorHasSubdirectorySources checks for ts_libraries referencing sources in subdirectories. -// It checks the current directory's BUILD if it exists, otherwise it checks the nearest -// ancestor package. -func directoryOrAncestorHasSubdirectorySources(ctx context.Context, g3root, workspaceRelativePath string, bld *build.File) (bool, error) { - if bld == nil { - // Make sure the next closest ancestor package doesn't reference sources in a subdirectory. - ancestor, err := FindBUILDFile(ctx, make(map[string]*build.File), g3root, filepath.Dir(workspaceRelativePath)) - if _, ok := err.(*noAncestorBUILDError); ok { - // couldn't find an ancestor BUILD, so there aren't an subdirectory sources - return false, nil - } else if err != nil { - return false, err - } else if hasSubdirectorySources(ancestor) { - return true, nil - } else { - // there was an ancestor BUILD, but it didn't reference subdirectory sources - return false, nil - } - } - - if hasSubdirectorySources(bld) { - return true, nil - } - - return false, nil -} - -func (upd *Updater) addSourcesToBUILD(ctx context.Context, path string, buildFilePath string, bld *build.File, srcs srcSet) (bool, error) { - - platform.Infof("Updating sources") - if len(srcs) == 0 && len(allTSRules(bld)) == 0 { - // No TypeScript rules/sources, no need to update anything - return false, nil - } - updateSources(bld, srcs) - - - return upd.maybeWriteBUILD(ctx, buildFilePath, bld) -} - -// updateBUILDAfterBlazeAnalyze applies the BUILD file updates that depend on blaze -// analyze's DependencyReports, most notably updating any rules' deps. -func (upd *Updater) updateBUILDAfterBlazeAnalyze(ctx context.Context, isRoot bool, - g3root string, buildFilePath string, bld *build.File, reports []*arpb.DependencyReport) (bool, error) { - platform.Infof("Updating deps") - if err := updateDeps(bld, reports); err != nil { - return false, err - } - - - platform.Infof("Setting library rule kinds") - if err := setLibraryRuleKinds(ctx, buildFilePath, bld); err != nil { - return false, err - } - return upd.maybeWriteBUILD(ctx, buildFilePath, bld) -} - -// IsTazeDisabledForDir checks if taze is disabled in the BUILD file in the dir, -// or if no BUILD file exists, in the closest ancestor BUILD -func IsTazeDisabledForDir(ctx context.Context, dir string) (bool, error) { - g3root, buildFilePath, workspaceRelativePath, err := getBUILDPath(ctx, dir) - if err != nil { - return false, err - } - - bld, err := readBUILD(ctx, buildFilePath, workspaceRelativePath) - if err != nil { - platform.Infof("Error reading building file!") - return false, err - } - - return isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) -} - -// CantProgressAfterWriteError reports that taze was run in an environment -// where it can't make writes to the file system (such as when taze is running -// as a service for cider) and the writes it made need to be visible to blaze analyze, -// so it can continue updating the BUILD file(s). In such a case, the caller should -// collect the writes using a custom UpdateFile function, and re-call taze after -// applying the writes. -type CantProgressAfterWriteError struct{} - -func (a *CantProgressAfterWriteError) Error() string { - return "running taze in a non-writable environment, can't continue until writes are applied" -} - -// UpdateBUILDOptions bundles options for the UpdateBUILD function. -type UpdateBUILDOptions struct { - // InNonWritableEnvironment boolean indicates to taze that the writes it makes - // won't be immediately visible to blaze analyze, so it cannot proceed normally. - // In this case, if it makes a write that needs to be visible to blaze analyze, it - // will return a CantProgressAfterWriteError, which indicates that the caller - // should apply the writes made to its UpdateFile function, and re-call UpdateBUILD - // after the writes have been applied. - InNonWritableEnvironment bool - // IsRoot indicates that the directory is a project's root directory, so a tsconfig - // rule should be created. - IsRoot bool -} - -// LatencyReport contains timing measurements of the functions that are called -// when running the presubmit on a package without any TypeScript (since we -// return early to avoid the latency of RAS analyze). -type LatencyReport struct { - GetBUILD, TazeDisabled, SubdirSrcs, AddSrcs time.Duration -} - -// UpdateBUILD drives the main process of creating/updating the BUILD file -// underneath path based on the available sources. Returns true if it modified -// the BUILD file, false if the BUILD file was up to date already. blazeAnalyze -// is used to run the underlying `blaze analyze` process. Returns another -// boolean that's true iff the package doesn't contain any TypeScript (source -// files or BUILD rules). -func (upd *Updater) UpdateBUILD(ctx context.Context, path string, options UpdateBUILDOptions) (bool, *LatencyReport, error) { - latencyReport := &LatencyReport{} - - // asynchronously glob for TS sources in the package, since it can be slow on - // a network file system. - globChan := make(chan globResult) - go func() { - platform.Infof("Globbing TS sources in %s", path) - srcs, err := globSources(ctx, path, []string{"ts", "tsx"}) - globChan <- globResult{srcs, err} - }() - - start := time.Now() - g3root, buildFilePath, workspaceRelativePath, err := getBUILDPath(ctx, path) - if err != nil { - return false, nil, err - } - - bld, err := readBUILD(ctx, buildFilePath, workspaceRelativePath) - if err != nil { - platform.Infof("Error reading building file!") - return false, nil, err - } - latencyReport.GetBUILD = time.Since(start) - - start = time.Now() - tazeDisabled, err := isTazeDisabledInPackage(ctx, g3root, buildFilePath, workspaceRelativePath, bld) - if err != nil { - return false, nil, err - } - latencyReport.TazeDisabled = time.Since(start) - if tazeDisabled { - return false, nil, nil - } - - start = time.Now() - hasSubdirSrcs, err := directoryOrAncestorHasSubdirectorySources(ctx, g3root, workspaceRelativePath, bld) - latencyReport.SubdirSrcs = time.Since(start) - if err != nil { - return false, nil, err - } - if hasSubdirSrcs { - return false, nil, &SubdirectorySourcesError{} - } - - if bld == nil { - // The BUILD file didn't exist, so create a new, empty one. - bld = &build.File{Path: workspaceRelativePath, Type: build.TypeBuild} - } - - start = time.Now() - globRes := <-globChan - if globRes.err != nil { - return false, nil, globRes.err - } - changed, err := upd.addSourcesToBUILD(ctx, path, buildFilePath, bld, globRes.srcs) - latencyReport.AddSrcs = time.Since(start) - if err != nil { - return false, nil, err - } - if options.InNonWritableEnvironment && changed { - return true, nil, &CantProgressAfterWriteError{} - } - - rules := allTSRules(bld) - if len(rules) == 0 && !options.IsRoot { - // No TypeScript rules, no need to query for dependencies etc, so just exit early. - return changed, latencyReport, nil - } - rulesWithSrcs := []*build.Rule{} - for _, r := range rules { - srcs := r.Attr("srcs") - if srcs != nil { - if l, ok := srcs.(*build.ListExpr); ok && len(l.List) > 0 { - rulesWithSrcs = append(rulesWithSrcs, r) - } - } - } - platform.Infof("analyzing...") - reports, err := upd.runBlazeAnalyze(buildFilePath, bld, rulesWithSrcs) - if err != nil { - return false, nil, err - } - - - changedAfterBlazeAnalyze, err := upd.updateBUILDAfterBlazeAnalyze(ctx, options.IsRoot, g3root, buildFilePath, bld, reports) - if err != nil { - return false, nil, err - } - changed = changed || changedAfterBlazeAnalyze - if options.InNonWritableEnvironment && changed { - return true, nil, &CantProgressAfterWriteError{} - } - - return changed, nil, nil -} - -// buildHasDisableTaze checks if the BUILD file should be managed using taze. -// Users can disable taze by adding a "disable_taze()" (or "dont_taze_me()") statement. -func buildHasDisableTaze(bld *build.File) bool { - for _, stmt := range bld.Stmt { - if call, ok := stmt.(*build.CallExpr); ok { - if fnName, ok := call.X.(*build.Ident); ok && (fnName.Name == "disable_taze" || fnName.Name == "dont_taze_me") { - return true - } - } - } - return false -} - -// QueryBasedBlazeAnalyze uses blaze query to analyze targets. It is available under a flag or -// an environment variable on engineer's workstations. -func QueryBasedBlazeAnalyze(buildFilePath string, targets []string) ([]byte, []byte, error) { - root, err := workspace.Root(buildFilePath) - if err != nil { - return nil, nil, err - } - reports, err := analyze.New(analyze.NewQueryBasedTargetLoader(root, "blaze")).Analyze(context.Background(), buildFilePath, targets) - if err != nil { - return nil, nil, err - } - s, err := proto.Marshal(&arpb.AnalyzeResult{ - DependencyReport: reports, - }) - return s, nil, err -} - -type ruleType int - -const ( - ruleTypeAny ruleType = iota - ruleTypeRegular - ruleTypeTest - ruleTypeTestSupport -) - -// isKind returns true if the rule has given kind. It also accepts "ng_modules" -// as "ts_library" kind. -func isKind(r *build.Rule, kind string) bool { - acceptNgModule := kind == "ts_library" - - return r.Kind() == kind || (acceptNgModule && r.Kind() == "ng_module") -} - -func buildRules(bld *build.File, kind string) []*build.Rule { - // Find all rules, then filter by kind. - // This is nearly the same as just calling bld.Rules(kind), but allows to - // retrieve ng_module and ts_library intermixed, in the order in which they - // appear in the BUILD file. That allows taze to consistently always pick the - // last build rule in the file in case multiple match, regardless of kind. - allRules := bld.Rules("") - var res []*build.Rule - for _, r := range allRules { - if isKind(r, kind) { - res = append(res, r) - } - } - return res -} - -// hasDependency returns whether a build rule contains the specified dependency. -func hasDependency(bld *build.File, r *build.Rule, dep string) bool { - pkg := filepath.Dir(bld.Path) - oldDeps := r.Attr("deps") - if edit.ListFind(oldDeps, dep, pkg) != nil { - return true - } - runtimeDeps := r.Attr("runtime_deps") - return edit.ListFind(runtimeDeps, dep, pkg) != nil -} - -// addDep adds a dependency to the specified build rule -func addDep(bld *build.File, r *build.Rule, dep string) { - pkg := filepath.Dir(bld.Path) - dep = edit.ShortenLabel(dep, pkg) - if dep[0] != '/' && dep[0] != ':' { - dep = ":" + dep // ShortenLabel doesn't add the ':' - } - edit.AddValueToListAttribute(r, "deps", pkg, &build.StringExpr{Value: dep}, nil) -} - -// AbsoluteBlazeTarget converts a ruleName to an absolute target string (//foo/bar:bar). -// It interprets ruleName relative to the given build file's package. It -// supports plain names, names starting with colons, absolute paths, and -// absolute paths with shorthand target syntax (i.e. "bar", ":bar", "//foo/bar", -// "//foo/bar:bar"). -func AbsoluteBlazeTarget(bld *build.File, ruleName string) string { - if strings.HasPrefix(ruleName, "//") { - // already absolute - if colonIdx := strings.LastIndex(ruleName, ":"); colonIdx == -1 { - // expand shorthand syntax - return ruleName + ":" + ruleName[strings.LastIndex(ruleName, "/")+1:] - } - return ruleName - } - pkg := platform.Normalize(filepath.Dir(bld.Path)) - return fmt.Sprintf("//%s:%s", pkg, strings.TrimPrefix(ruleName, ":")) -} - -// Finds all ts_library and ts_declaration targets in the given BUILD file. -func allTSRules(bld *build.File) []*build.Rule { - var res []*build.Rule - res = append(res, buildRules(bld, "ts_library")...) - res = append(res, buildRules(bld, "ts_declaration")...) - return res -} - -// removeSourcesUsed removes sources used by rules of kind ruleKind in attribute -// attrName from the given set of sources. -func removeSourcesUsed(bld *build.File, ruleKind, attrName string, srcs srcSet) { - for _, rule := range buildRules(bld, ruleKind) { - for s := range srcs { - pkg := filepath.Dir(bld.Path) - // Handles ":foo.ts" references, and concatenated lists [foo.ts] + [bar.ts] - // TODO(martinprobst): What to do about sources that don't seem to exist? - if edit.ListFind(rule.Attr(attrName), s, pkg) != nil { - delete(srcs, s) - } - } - } -} - -const ( - tsSkylarkLabel = "//javascript/typescript:build_defs.bzl" - ngSkylarkLabel = "//javascript/angular2:build_defs.bzl" -) - -func removeUnusedLoad(bld *build.File, kind string) { - if len(bld.Rules(kind)) > 0 { - return // kind is still used somewhere. - } - var stmt []build.Expr - for _, s := range bld.Stmt { - load, ok := s.(*build.LoadStmt) - if !ok { - stmt = append(stmt, s) - continue - } - if len(load.To) == 0 { - // a load statement without actually loaded symbols, skip - continue - } - - - var from, to []*build.Ident - for i, ca := range load.To { - if ca.Name != kind { - from = append(from, load.From[i]) - to = append(to, ca) - } - } - load.From = from - load.To = to - if len(to) > 0 { - stmt = append(stmt, load) - continue - } - } - bld.Stmt = stmt -} - -// setLibraryRuleKinds sets the kinds for recognized library rules. That is, it -// determines if a rule should be an ng_module, and sets the -// rule kind if so. It also takes care of having the appropriate load calls. -func setLibraryRuleKinds(ctx context.Context, buildFilePath string, bld *build.File) error { - hasNgModule := false - changed := false - for _, r := range buildRules(bld, "ts_library") { - shouldBeNgModule := false - isNgModule := r.Call.X.(*build.Ident).Name == "ng_module" - if hasAngularDependency(r) { - shouldBeNgModule = true - hasNgModule = true - } - if isNgModule && !shouldBeNgModule { - platform.Infof("Changing rule %s to ts_library()", r.AttrString("name")) - r.Call.X.(*build.Ident).Name = "ts_library" - r.DelAttr("assets") - changed = true - } else if !isNgModule && shouldBeNgModule { - platform.Infof("Changing rule %s to ng_module()", r.AttrString("name")) - r.Call.X.(*build.Ident).Name = "ng_module" - changed = true - } - } - if changed { - bld.Stmt = edit.InsertLoad(bld.Stmt, ngSkylarkLabel, - []string{"ng_module"}, []string{"ng_module"}) - bld.Stmt = edit.InsertLoad(bld.Stmt, tsSkylarkLabel, - []string{"ts_library"}, []string{"ts_library"}) - removeUnusedLoad(bld, "ts_library") - removeUnusedLoad(bld, "ng_module") - } - if !hasNgModule { - return nil - } - return updateWebAssets(ctx, buildFilePath, bld) -} - -// hasAngularDependency returns true if the given rule depends on a Angular -// build rule. -func hasAngularDependency(r *build.Rule) bool { - e := r.Attr("deps") - for _, li := range edit.AllLists(e) { - for _, elem := range li.List { - str, ok := elem.(*build.StringExpr) - if ok && strings.HasPrefix(str.Value, "//third_party/javascript/angular2") { - return true - } - } - } - return false -} - -// updateWebAssets finds web assets in the package of the BUILD file and adds -// them to the "assets" attribute of the ng_module rules. -func updateWebAssets(ctx context.Context, buildFilePath string, bld *build.File) error { - // TODO(martinprobst): should this be merged with updateSources above? Difference is that - // creates new rules, this just distributes assets across them. - // This must use buildFilePath, the absolute path to the directory, as our cwd - // might not be the workspace root. - absolutePkgPath := filepath.Dir(buildFilePath) - assetFiles, err := globSources(ctx, absolutePkgPath, []string{"html", "css"}) - if err != nil { - return err - } - platform.Infof("Found asset files in %s: %v", absolutePkgPath, assetFiles) - - pkg := filepath.Dir(bld.Path) - for _, r := range bld.Rules("ng_module") { - srcs := r.Attr("assets") - if call, ok := srcs.(*build.CallExpr); ok && call.X.(*build.Ident).Name == "glob" { - // Remove any glob calls, taze uses explicit source lists. - r.DelAttr("assets") - } - - for _, s := range r.AttrStrings("assets") { - if strings.HasPrefix(s, ":") || strings.HasPrefix(s, "//") { - continue // keep rule references - } - if _, ok := assetFiles[s]; !ok { - edit.ListAttributeDelete(r, "assets", s, pkg) - } - } - } - - removeSourcesUsed(bld, "ng_module", "assets", assetFiles) - if len(assetFiles) == 0 { - return nil - } - - // Add to the last rule, to match behaviour with *.ts sources. - lastModule := getLastRule(bld, "ng_module", ruleTypeRegular) - if lastModule == nil { - // Fall back to using any ng_module - lastModule = getLastRule(bld, "ng_module", ruleTypeAny) - } - if lastModule == nil { - // Should not happen by preconditions of this function. - return fmt.Errorf("no ng_module rules in BUILD?") - } - - for newAsset := range assetFiles { - val := &build.StringExpr{Value: newAsset} - edit.AddValueToListAttribute(lastModule, "assets", pkg, val, nil) - } - return nil -} - -// getOrCreateRule returns or creates a rule of the given kind, with testonly = 1 or 0 depending on -// rt. If there's no such rule, it creates a new rule with the given ruleName. -// If there is more than one rule matching, it returns the *last* rule. -func getOrCreateRule(bld *build.File, ruleName, ruleKind string, rt ruleType) *build.Rule { - if r := getLastRule(bld, ruleKind, rt); r != nil { - return r - } - - // TODO(calebegg): Switch this to "_test" but still support "_tests" - if rt == ruleTypeTest { - ruleName += "_tests" - } - - loadArgs := []string{ruleKind} - bld.Stmt = edit.InsertLoad(bld.Stmt, tsSkylarkLabel, loadArgs, loadArgs) - - r := &build.Rule{&build.CallExpr{X: &build.Ident{Name: ruleKind}}, ""} - // Rename to *_ts if there's a name collision. This leaves open a collision with another rule - // called _ts, but that failure mode is unlikely to happen accidentally. - if edit.FindRuleByName(bld, ruleName) != nil { - ruleName = ruleName + "_ts" - } else if filepath.Base(filepath.Dir(bld.Path)) == ruleName { - // The various *_ajd macros do not have a "name" attribute, but implicitly use the package name. - // Make sure not to use the package name if there is a *_ajd rule. - for _, r := range bld.Rules("") { - if r.Name() == "" && strings.HasSuffix(r.Kind(), "_ajd") { - ruleName = ruleName + "_ts" - break - } - } - } - r.SetAttr("name", &build.StringExpr{Value: ruleName}) - if rt == ruleTypeTest || rt == ruleTypeTestSupport { - r.SetAttr("testonly", &build.Ident{Name: "True"}) - } - bld.Stmt = append(bld.Stmt, r.Call) - return r -} - -// ruleMatches return whether a rule matches the specified kind and rt value. -func ruleMatches(bld *build.File, r *build.Rule, kind string, rt ruleType) bool { - if !isKind(r, kind) { - return false - } - inTestingDir := determineRuleType(bld.Path, "somefile.ts") == ruleTypeTestSupport - hasTestsName := strings.HasSuffix(r.Name(), "_tests") - // Accept the rule if it matches the testonly attribute. - if rt == ruleTypeAny { - return true - } - if attrTruthy(r, "testonly") { - if inTestingDir && ((hasTestsName && rt == ruleTypeTest) || (!hasTestsName && rt == ruleTypeTestSupport)) { - return true - } - if !inTestingDir && rt == ruleTypeTest { - return true - } - } - return rt == ruleTypeRegular && !attrTruthy(r, "testonly") -} - -// targetRegisteredInRule returns whether a target has been registered in a rule that -// matches a specified ruleKind and ruleType in current build file -func targetRegisteredInRule(bld *build.File, ruleKind string, rt ruleType, target string) bool { - for _, r := range bld.Rules("") { - if ruleMatches(bld, r, ruleKind, rt) && hasDependency(bld, r, target) { - return true - } - } - return false -} - -// getRule returns the last rule in bld that has the given ruleKind and matches -// the specified rt value. -func getLastRule(bld *build.File, ruleKind string, rt ruleType) *build.Rule { - rules := getRules(bld, ruleKind, rt) - - if len(rules) == 0 { - return nil - } - - return rules[len(rules)-1] -} - -// getRules returns all the rules in bld that have the given ruleKind and -// matches the specified rt value. -func getRules(bld *build.File, ruleKind string, rt ruleType) []*build.Rule { - var rules []*build.Rule - for _, r := range bld.Rules("") { - if ruleMatches(bld, r, ruleKind, rt) { - rules = append(rules, r) - } - } - - return rules -} - -// FilterPaths filters the given paths, returning the deduplicated set of -// folders that contain TypeScript sources (.ts and .tsx) or BUILD files. -func FilterPaths(paths []string) []string { - fileSet := make(map[string]bool) - for _, p := range paths { - if !strings.HasSuffix(p, ".ts") && !strings.HasSuffix(p, ".tsx") && filepath.Base(p) != "BUILD" { - continue - } - fileSet[filepath.Dir(p)] = true - } - var newPaths []string - for k := range fileSet { - newPaths = append(newPaths, platform.Normalize(k)) - } - return newPaths -} - -// ResolvePackages resolves package paths, i.e. paths starting with '//', -// against the workspace root folder closest to the current working directory. -// It updates paths in place. -// It returns an error if it cannot find a workspace root or working directory. -func ResolvePackages(paths []string) error { - for i, p := range paths { - if strings.HasPrefix(p, "//") { - wd, err := os.Getwd() - if err != nil { - return fmt.Errorf("failed to get working directory: %v", err) - } - g3root, err := workspace.Root(wd) - if err != nil { - return fmt.Errorf("failed to find workspace root under %q: %v", wd, err) - } - paths[i] = filepath.Join(g3root, p) - } - } - return nil -} - -type noAncestorBUILDError struct{} - -func (nabe *noAncestorBUILDError) Error() string { - return "no ancestor BUILD file found" -} - -// FindBUILDFile searches for the closest parent BUILD file above pkg. It -// returns the parsed BUILD file, or an error if none can be found. -func FindBUILDFile(ctx context.Context, pkgToBUILD map[string]*build.File, - workspaceRoot string, packagePath string) (*build.File, error) { - if packagePath == "." || packagePath == "/" { - return nil, &noAncestorBUILDError{} - } - if bld, ok := pkgToBUILD[packagePath]; ok { - return bld, nil - } - buildPath := filepath.Join(workspaceRoot, packagePath, "BUILD") - bld, err := readBUILD(ctx, buildPath, filepath.Join(packagePath, "BUILD")) - if err != nil { - return nil, err - } else if bld == nil { - // Recursively search parent package and cache its location below if found. - bld, err = FindBUILDFile(ctx, pkgToBUILD, workspaceRoot, filepath.Dir(packagePath)) - } - if err == nil { - // NB: The cache key is packagePath ('foo/bar/baz'), even if build file was - // found at a higher location ('foo/BUILD'). This avoids re-testing for file - // existence. - pkgToBUILD[packagePath] = bld - } - return bld, err -} - -// Paths gets the list of paths for the current execution of taze. -func Paths(isRoot bool, files bool, recursive bool) ([]string, error) { - paths := flag.Args() - if len(paths) == 0 { - wd, err := os.Getwd() - if err != nil { - return nil, fmt.Errorf("failed to get working directory: %v", err) - } - paths = []string{wd} - } - - if len(paths) > 1 && isRoot { - return nil, fmt.Errorf("can only take exactly one path with -root") - } - - if files { - paths = FilterPaths(paths) - if len(paths) == 0 { - return nil, fmt.Errorf("WARNING: found no TypeScript files in %s", paths) - } - } - - if err := ResolvePackages(paths); err != nil { - return nil, fmt.Errorf("failed to resolve packages: %s", err) - } - - if recursive { - var lock sync.Mutex // guards allPaths - var allPaths []string - for _, p := range paths { - err := platform.Walk(p, func(path string, info os.FileMode) error { - if info.IsDir() { - lock.Lock() - allPaths = append(allPaths, path) - lock.Unlock() - } - return nil - }) - if err != nil { - return nil, fmt.Errorf("taze -recursive failed: %s", err) - } - } - sort.Sort(byLengthInverted(allPaths)) - paths = allPaths - } - - return paths, nil -} - -// Execute runs taze on paths using host. -func Execute(host *Updater, paths []string, isRoot, recursive bool) error { - ctx := context.Background() - for i, p := range paths { - isLastAndRoot := isRoot && i == len(paths)-1 - changed, _, err := host.UpdateBUILD(ctx, p, UpdateBUILDOptions{InNonWritableEnvironment: false, IsRoot: isLastAndRoot}) - if err != nil { - if recursive { - return fmt.Errorf("taze failed on %s/BUILD: %s", p, err) - } - return fmt.Errorf("taze failed: %s", err) - } - if changed { - if filepath.Base(p) == "BUILD" { - fmt.Printf("Wrote %s\n", p) - } else { - fmt.Printf("Wrote %s\n", filepath.Join(p, "BUILD")) - } - } - } - host.RegisterTestRules(ctx, paths...) - return nil -} - -// allPaths walks the file system and returns a list of all directories under -// all paths. -func allPaths(paths []string) ([]string, error) { - var allPaths []string - for _, p := range paths { - err := filepath.Walk(p, func(path string, info os.FileInfo, err error) error { - if err == nil && info.IsDir() { - allPaths = append(allPaths, path) - } - return err - }) - if err != nil { - return nil, err - } - } - sort.Sort(byLengthInverted(allPaths)) - return allPaths, nil -} - -type byLengthInverted []string - -func (s byLengthInverted) Len() int { return len(s) } -func (s byLengthInverted) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byLengthInverted) Less(i, j int) bool { return len(s[i]) > len(s[j]) } diff --git a/ts_auto_deps/updater/updater_test.go b/ts_auto_deps/updater/updater_test.go deleted file mode 100644 index 38c97401..00000000 --- a/ts_auto_deps/updater/updater_test.go +++ /dev/null @@ -1,564 +0,0 @@ -package updater - -import ( - "context" - "io/ioutil" - "os" - "path/filepath" - "reflect" - "strings" - "testing" - - "google3/net/proto2/go/proto" - "google3/third_party/bazel_buildifier/build/build" - - arpb "google3/third_party/bazel_rules/rules_typescript/ts_auto_deps/proto/analyze_result_go_proto" -) - -var ( - testTmpDir = os.Getenv("TEST_TMPDIR") -) - -func mktmp(fn string, content []byte) (string, error) { - p := fn - if !filepath.IsAbs(p) { - p = filepath.Join(testTmpDir, fn) - } - if err := os.MkdirAll(filepath.Dir(p), 0777); err != nil { - return "", err - } - return p, ioutil.WriteFile(p, content, 0666) -} - -func TestReadBuild(t *testing.T) { - p, err := mktmp("google3/foo/bar/BUILD", []byte(` -ts_library(name = 'a', srcs = ['b.ts']) -`)) - if err != nil { - t.Fatal(err) - } - bld, err := readBUILD(context.Background(), p, "foo/bar/BUILD") - if err != nil { - t.Fatal(err) - } - if bld.Path != "foo/bar/BUILD" { - t.Errorf("bld.Path: got %s, expected %s", bld.Path, "foo/bar/BUILD") - } -} - -func TestGlobSources(t *testing.T) { - for _, f := range []string{"a.ts", "a/b.ts", "c.tsx", "whatever", "foo.cpp", "d.d.ts", "._e.ts"} { - if _, err := mktmp(f, []byte("// content")); err != nil { - t.Fatal(err) - } - } - if err := os.Symlink("../blaze-bin/symlink.d.ts", filepath.Join(testTmpDir, "symlink.d.ts")); err != nil { - t.Fatal(err) - } - if err := os.Symlink("whatever", filepath.Join(testTmpDir, "whatever.d.ts")); err != nil { - t.Fatal(err) - } - srcs, err := globSources(context.Background(), testTmpDir, []string{"ts", "tsx"}) - if err != nil { - t.Fatal(err) - } - expected := srcSet(map[string]bool{ - "a.ts": true, - "c.tsx": true, - "d.d.ts": true, - "whatever.d.ts": true, - }) - if !reflect.DeepEqual(srcs, expected) { - t.Errorf("globSources: got %v, want %v", srcs, expected) - } -} - -func TestDetermineRuleType(t *testing.T) { - tests := []struct { - path string - source string - rt ruleType - }{ - {"java/com/google/myapp/BUILD", "foo.ts", ruleTypeRegular}, - {"java/com/google/myapp/BUILD", "foo_test.ts", ruleTypeTest}, - {"java/com/google/myapp/BUILD", "foo_test.tsx", ruleTypeTest}, - - - {"java/com/google/testing/mytesttool/BUILD", "foo.ts", ruleTypeRegular}, - {"testing/mytesttool/BUILD", "foo.ts", ruleTypeRegular}, - {"testing/mytesttool/BUILD", "foo_test.ts", ruleTypeTest}, - {"testing/mytesttool/BUILD", "foo_test.ts", ruleTypeTest}, - } - for _, tst := range tests { - rt := determineRuleType(tst.path, tst.source) - if rt != tst.rt { - t.Errorf("determineRuleType(%q, %q): got %v, expected %v", tst.path, tst.source, rt, tst.rt) - } - } -} - -func parseReport(t *testing.T, input string) *arpb.DependencyReport { - report := &arpb.DependencyReport{} - if err := proto.UnmarshalText(input, report); err != nil { - t.Error(err) - } - return report -} - -func TestBlazeAnalyzeError(t *testing.T) { - bld, err := build.ParseBuild("rules/BUILD", []byte(` -ts_library( - name = "firstrule", - srcs = [], -) -ts_library( - name = "secondrule", - srcs = [], -) - `)) - if err != nil { - t.Fatal(err) - } - mockAnalyze := func(_ string, targets []string) ([]byte, []byte, error) { - data, err := proto.Marshal(&arpb.AnalyzeResult{ - DependencyReport: []*arpb.DependencyReport{&arpb.DependencyReport{ - Rule: proto.String("//rules:firstrule"), - }}, - }) - return data, []byte(`Here's the actual error`), err - } - upd := &Updater{} - upd.blazeAnalyze = mockAnalyze - report, err := upd.runBlazeAnalyze("firstrule/BUILD", bld, bld.Rules("ts_library")) - if err == nil { - t.Fatalf("expected an error, got a report: %v", report) - } - expected := `parsing reports failed (1 reports for [//rules:firstrule //rules:secondrule]): -Here's the actual error` - if err.Error() != expected { - t.Errorf("runBlazeAnalyze: got %q, expected %q", err.Error(), expected) - } -} - -func TestUpdateDeps(t *testing.T) { - report := parseReport(t, ` - rule: "//foo:bar" - unnecessary_dependency: "//unnecessary_dep" - missing_dependency_group: { - dependency: "//missing_dep" - } - missing_source_file: "missing_file.ts"`) - - tests := []struct { - name string - before string - after string - changed bool - }{ - { - "Add missing dependency", - `ts_library( - name = "bar", - deps = [], - )`, - `ts_library( - name = "bar", - deps = ["//missing_dep"], - )`, - true, - }, - { - "Remove + Add dependency", - `ts_library( - name = "bar", - deps = ["//unnecessary_dep"], - )`, - `ts_library( - name = "bar", - deps = ["//missing_dep"], - )`, - true, - }, - { - "Remove nonexistent dep (e.g. due to macro)", - `ts_library( - name = "bar", - deps = ["//missing_dep"], - )`, - `ts_library( - name = "bar", - deps = ["//missing_dep"], - )`, - false, // Unchanged! - }, - { - "Remove nonexistent src", - `ts_library( - name = "bar", - srcs = ["hello.ts"], - deps = ["//missing_dep"], - )`, - `ts_library( - name = "bar", - srcs = ["hello.ts"], - deps = ["//missing_dep"], - )`, - false, // Unchanged! - }, - } - for _, tst := range tests { - bld, err := build.ParseBuild("foo/BUILD", []byte(tst.before)) - if err != nil { - t.Errorf("parse %s failed: %s in %s", tst.name, err, tst.before) - } - bldAft, err := build.ParseBuild("foo/BUILD", []byte(tst.after)) - if err != nil { - t.Errorf("parse %s after failed: %s", tst.name, err) - } - if err := updateDeps(bld, []*arpb.DependencyReport{report}); err != nil { - t.Errorf("update %s failed: %s", tst.name, err) - } - updated := string(build.Format(bld)) - after := string(build.Format(bldAft)) - if updated != after { - t.Errorf("update(%s), got:\n%s\n\nexpected:\n%s", tst.name, updated, after) - } - } -} - -func TestUnresolvedImportError(t *testing.T) { - report := parseReport(t, ` - rule: "//foo:bar" - unresolved_import: "unresolved/import"`) - - bld, err := build.ParseBuild("foo/BUILD", []byte(`ts_library( - name = "bar", - srcs = ["hello.ts"], - )`)) - if err != nil { - t.Fatal(err) - } - - expectedErr := "'// from ...'' comment, or the target BUILD files are incorrect?" - - err = updateDeps(bld, []*arpb.DependencyReport{report}) - if !strings.Contains(err.Error(), expectedErr) { - t.Errorf("returned error %s: expected it to contain %s", err, expectedErr) - } -} - -func TestDottedCall(t *testing.T) { - // Repro for a crash, b/35389044 - buildText := `foo.bar("baz")` - bld, err := build.ParseBuild("test", []byte(buildText)) - if err != nil { - t.Error(err) - } - removeUnusedLoad(bld, "ignored") -} - -func TestFilterPaths(t *testing.T) { - tests := []struct { - in []string - expected []string - }{ - {[]string{"foo/bar.txt", "foo/baz.ts"}, []string{"foo"}}, - {[]string{"bam.ts"}, []string{"."}}, - {[]string{"foo/BUILD"}, []string{"foo"}}, - {[]string{"r/foo.tsx"}, []string{"r"}}, - {[]string{"../../x.ts"}, []string{"../.."}}, - {[]string{"a.txt", "foo/b.txt"}, []string(nil)}, - } - for _, tst := range tests { - res := FilterPaths(tst.in) - if !reflect.DeepEqual(res, tst.expected) { - t.Errorf("FilterPaths(%v): got %v, expected %v", tst.in, res, tst.expected) - } - } -} - -func TestAddDep(t *testing.T) { - tests := []struct { - buildFile string - newDep string - expected string - }{ - {`ts_library(name = "lib", deps = ["//a", "//b", "//c"])`, - "//b", - `ts_library(name = "lib", deps = ["//a", "//b", "//c"])`}, - {`ts_library(name = "lib", deps = ["//a", "//b", "//c"])`, - "//d", - `ts_library(name = "lib", deps = ["//a", "//b", "//c", "//d"])`}, - {`ts_library(name = "lib", deps = ["//a", ":b", "//c"])`, - ":b", - `ts_library(name = "lib", deps = ["//a", ":b", "//c"])`}, - {`ts_library(name = "lib", deps = ["//a", ":b", "//c"])`, - "//buildloc:b", - `ts_library(name = "lib", deps = ["//a", ":b", "//c"])`}, - {`ts_library(name = "lib", deps = ["//a", "//buildloc:b", "//c"])`, - ":b", - `ts_library(name = "lib", deps = ["//a", "//buildloc:b", "//c"])`}, - {`ts_library(name = "lib", deps = ["//a", "//other:b", "//c"])`, - ":b", - `ts_library(name = "lib", deps = [":b", "//a", "//other:b", "//c"])`}, - {`ts_library(name = "lib", deps = ["//a", "//other:b", "//c"])`, - "//a:a", - `ts_library(name = "lib", deps = ["//a", "//other:b", "//c"])`}, - } - for _, tst := range tests { - bld, err := build.ParseBuild("buildloc/BUILD", []byte(tst.buildFile)) - if err != nil { - t.Fatalf("parse failure: %s - %v", tst.buildFile, err) - } - addDep(bld, bld.Rules("ts_library")[0], tst.newDep) - newContent := string(build.Format(bld)) - expectedBld, err := build.ParseBuild("buildloc/BUILD", []byte(tst.expected)) - if err != nil { - t.Fatalf("parse failure: %s - %v", tst.expected, err) - } - expected := string(build.Format(expectedBld)) - if newContent != expected { - t.Errorf("addDep(%s, %s): got %v, expected %v", tst.buildFile, tst.newDep, newContent, tst.expected) - } - } -} - -func TestRemoveSourcesUsed(t *testing.T) { - tests := []struct { - name string - buildFile string - ruleKind string - attrName string - srcs srcSet - expectedSrcs srcSet - }{ - { - name: "RemovesSources", - buildFile: `ts_library(name = "lib", srcs = ["foo.ts", "bar.ts"])`, - ruleKind: "ts_library", - attrName: "srcs", - srcs: map[string]bool{"foo.ts": true}, - expectedSrcs: map[string]bool{}, - }, - { - name: "WrongRuleKind", - buildFile: `ts_library(name = "lib", srcs = ["foo.ts", "bar.ts"])`, - ruleKind: "ng_module", - attrName: "srcs", - srcs: map[string]bool{"foo.ts": true}, - expectedSrcs: map[string]bool{"foo.ts": true}, - }, - { - name: "WrongAttrName", - buildFile: `ts_library(name = "lib", srcs = ["foo.ts", "bar.ts"])`, - ruleKind: "ts_library", - attrName: "deps", - srcs: map[string]bool{"foo.ts": true}, - expectedSrcs: map[string]bool{"foo.ts": true}, - }, - { - name: "MultipleRules", - buildFile: `ts_library(name = "lib", srcs = ["foo.ts"]) - ts_library(name = "lib2", srcs = ["bar.ts"])`, - ruleKind: "ts_library", - attrName: "srcs", - srcs: map[string]bool{"foo.ts": true, "bar.ts": true}, - expectedSrcs: map[string]bool{}, - }, - { - name: "ConcatenatedLists", - buildFile: `ts_library(name = "lib", srcs = ["foo.ts"] + ["bar.ts"])`, - ruleKind: "ts_library", - attrName: "srcs", - srcs: map[string]bool{"foo.ts": true, "bar.ts": true}, - expectedSrcs: map[string]bool{}, - }, - { - name: "ColonReferences", - buildFile: `ts_library(name = "lib", srcs = [":foo.ts", "bar.ts"])`, - ruleKind: "ts_library", - attrName: "srcs", - srcs: map[string]bool{"foo.ts": true}, - expectedSrcs: map[string]bool{}, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - bld, err := build.ParseBuild("foo/bar/BUILD", - []byte(test.buildFile)) - if err != nil { - t.Fatalf("parse failure: %v", err) - } - - removeSourcesUsed(bld, test.ruleKind, test.attrName, test.srcs) - if !reflect.DeepEqual(test.srcs, test.expectedSrcs) { - t.Errorf("expected removeSourcesUsed() = %v, expected %v", test.srcs, test.expectedSrcs) - } - }) - } -} - -func TestUpdateWebAssets(t *testing.T) { - ctx := context.Background() - bld, err := build.ParseBuild("foo/bar/BUILD", - []byte(`ng_module(name = "m", assets = [":rule", "gone.html"])`)) - if err != nil { - t.Fatalf("parse failure: %v", err) - } - testHTML, err := mktmp("google3/foo/bar/test.html", []byte(`

    test

    `)) - if err != nil { - t.Fatal(err) - } - defer func() { - if err := os.Remove(testHTML); err != nil { - t.Error(err) - } - }() - testCSS, err := mktmp("google3/foo/bar/test.css", []byte(`.test {}`)) - if err != nil { - t.Fatal(err) - } - defer func() { - if err := os.Remove(testCSS); err != nil { - t.Error(err) - } - }() - absoluteBuildPath := filepath.Join(filepath.Dir(testCSS), "BUILD") - if err := updateWebAssets(ctx, absoluteBuildPath, bld); err != nil { - t.Fatal(err) - } - data := string(build.Format(bld)) - expected := `ng_module( - name = "m", - assets = [ - ":rule", - "test.css", - "test.html", - ], -) -` - if data != expected { - t.Errorf("build file mismatch, got %s, expected %s", data, expected) - } -} - -func TestWebAssetReferredByColon(t *testing.T) { - ctx := context.Background() - bld, err := build.ParseBuild("foo/bar/BUILD", - []byte(`ng_module(name = "m", assets = [":colon.html"])`)) - if err != nil { - t.Fatalf("parse failure: %v", err) - } - colon, err := mktmp("google3/foo/bar/colon.html", []byte(`

    test

    `)) - if err != nil { - t.Fatal(err) - } - defer func() { - if err := os.Remove(colon); err != nil { - t.Error(err) - } - }() - absolutBuildPath := filepath.Join(filepath.Dir(colon), "BUILD") - if err := updateWebAssets(ctx, absolutBuildPath, bld); err != nil { - t.Error(err) - } - data := string(build.Format(bld)) - expected := `ng_module( - name = "m", - assets = [":colon.html"], -) -` - if data != expected { - t.Errorf("build file mismatch, got %s, expected %s", data, expected) - } -} - -func TestAbsoluteBlazeTarget(t *testing.T) { - bld := &build.File{Path: "foo/bar/BUILD", Type: build.TypeBuild} - tests := []struct{ target, expected string }{ - {"//foo/bar:bar", "//foo/bar:bar"}, - {":bar", "//foo/bar:bar"}, - {"bar", "//foo/bar:bar"}, - {"//foo/bar", "//foo/bar:bar"}, - } - for _, tst := range tests { - abs := AbsoluteBlazeTarget(bld, tst.target) - if abs != tst.expected { - t.Errorf("AbsoluteBlazeTarget(%q): got %q, expected %q", tst.target, abs, tst.expected) - } - } -} - -func TestFindBUILDFileCacheOnError(t *testing.T) { - ctx := context.Background() - cache := make(map[string]*build.File) - p, err := mktmp("google3/pkg/file", []byte("")) - if err != nil { - t.Fatal(err) - } - g3root := filepath.Dir(filepath.Dir(p)) - if filepath.Base(g3root) != "google3" { - t.Errorf("g3root should be called google3, got %q", g3root) - } - // No BUILD file was created in the file system so FindBUILDFile should - // return an error. - if _, err = FindBUILDFile(ctx, cache, g3root, "pkg"); err == nil { - t.Fatalf("returned no error, expected some error to occur") - } - if _, ok := cache["pkg"]; ok { - t.Fatalf("cache contained BUILD file for package") - } -} - -func TestHasSubdirectorySources(t *testing.T) { - tests := []struct { - name string - buildFile string - expected bool - }{ - { - name: "LocalSources", - buildFile: `ts_library(name = "lib", srcs = ["foo.ts", "bar.ts"])`, - expected: false, - }, - { - name: "SubdirectorySources", - buildFile: `ts_library(name = "lib", srcs = ["subdir/foo.ts", "subdir/bar.ts"])`, - expected: true, - }, - { - name: "LocalNgModuleSources", - buildFile: `ng_module(name = "lib", srcs = ["foo.ts", "bar.ts"])`, - expected: false, - }, - { - name: "SubdirectoryNgModuleSources", - buildFile: `ng_module(name = "lib", srcs = ["subdir/foo.ts", "subdir/bar.ts"])`, - expected: true, - }, - { - name: "LocalGlob", - buildFile: `ts_library(name = "lib", srcs = glob("*.ts"))`, - expected: false, - }, - { - name: "SubdirectoryGlob", - buildFile: `ts_library(name = "lib", srcs = glob("**/*.ts"))`, - expected: true, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - bld, err := build.ParseBuild("foo/bar/BUILD", - []byte(test.buildFile)) - if err != nil { - t.Fatalf("parse failure: %v", err) - } - - actual := hasSubdirectorySources(bld) - if actual != test.expected { - t.Errorf("got hasSubdirectorySouces() = %v, expected %v", actual, test.expected) - } - }) - } -} diff --git a/ts_auto_deps/workspace/workspace.go b/ts_auto_deps/workspace/workspace.go deleted file mode 100644 index db4d4fde..00000000 --- a/ts_auto_deps/workspace/workspace.go +++ /dev/null @@ -1,26 +0,0 @@ -package workspace - -import ( - "fmt" - "path/filepath" -) - -// Root finds the closest google3 root from p. -func Root(p string) (string, error) { - p, err := filepath.Abs(p) - if err != nil { - return "", fmt.Errorf("unable to determine google3 root from %s: %v", p, err) - } - - for step := p; step != "/" && step != "."; step = filepath.Dir(step) { - if filepath.Base(step) == "google3" { - return step, nil - } - } - return "", fmt.Errorf("unable to determine google3 root, no 'google3' in %s", p) -} - -// Name returns the name of the workspace. -func Name() string { - return "google3" -} diff --git a/ts_auto_deps/workspace/workspace.go.oss b/ts_auto_deps/workspace/workspace.go.oss deleted file mode 100644 index c7f1ac26..00000000 --- a/ts_auto_deps/workspace/workspace.go.oss +++ /dev/null @@ -1,13 +0,0 @@ -package workspace - -import "github.com/bazelbuild/buildtools/wspace" - -// Root finds the closest directory containing a WORKSPACE file from p. -func Root(p string) (string, error) { - return wspace.Find(p) -} - -// Name returns the name of the workspace. -func Name() string { - return "TODO" -} From e9b2131da038c7e65dde33c04ee7c5888063827c Mon Sep 17 00:00:00 2001 From: martinprobst Date: Mon, 2 Dec 2019 11:07:35 -0800 Subject: [PATCH 238/316] Add a test suite for json_marshal.bzl. PiperOrigin-RevId: 283376123 --- internal/common/json_marshal_test.bzl | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 internal/common/json_marshal_test.bzl diff --git a/internal/common/json_marshal_test.bzl b/internal/common/json_marshal_test.bzl new file mode 100644 index 00000000..6c4b475b --- /dev/null +++ b/internal/common/json_marshal_test.bzl @@ -0,0 +1,33 @@ +"""Unit tests for json marshaling. + +Note, this cannot live next to the file it tests, because that file is in +third_party bazel rules, and bazel doesn't support skylark testing yet. +""" + +load("//third_party/bazel_skylib/lib:unittest.bzl", "asserts", "unittest") +load("//third_party/bazel_rules/rules_typescript/internal:common/json_marshal.bzl", "json_marshal") + +def _test_impl(ctx): + env = unittest.begin(ctx) + asserts.equals(env, "\"abc\"", json_marshal("abc")) + asserts.equals(env, "123", json_marshal(123)) + asserts.equals(env, "true", json_marshal(True)) + asserts.equals(env, "false", json_marshal(False)) + asserts.equals(env, "\"//a:b\"", json_marshal(Label("//a:b"))) + asserts.equals(env, "[]", json_marshal([])) + asserts.equals(env, "{}", json_marshal({})) + asserts.equals(env, """[1, 2, 3]""", json_marshal([1, 2, 3])) + asserts.equals(env, """{"a": "b"}""", json_marshal({"a": "b"})) + asserts.equals(env, """{"none": false}""", json_marshal({"none": None})) + asserts.equals( + env, + """{"a": {"d": 1, "e": true, "f": ["f1", "f2"]}, "b": "val", "c": [{"g": false}]}""", + json_marshal({"a": {"d": 1, "e": True, "f": ["f1", "f2"]}, "b": "val", "c": [{"g": False}]}), + ) + + return unittest.end(env) + +_test = unittest.make(_test_impl) + +def json_marshal_test_suite(): + unittest.suite("json_marshal_tests", _test) From 951ae46a9651e9f6814b303c5902d858cc509aa4 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 4 Dec 2019 10:47:10 -0800 Subject: [PATCH 239/316] Remove incompatible_depset_is_not_iterable from bazelrc This flag is default-on now, and is being removed in the next version of Bazel. Thus, this inclusion in bazelrc was breaking buildkite against Bazel@HEAD. PiperOrigin-RevId: 283787955 --- .bazelrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index 6005eaac..01026c92 100644 --- a/.bazelrc +++ b/.bazelrc @@ -10,6 +10,3 @@ test --nolegacy_external_runfiles # Enable the "Managed Directories" feature common --experimental_allow_incremental_repository_updates - -# Opt-in to upcoming breaking change -build --incompatible_depset_is_not_iterable From 45726b48eefa63eefbcb36f457688488da78810a Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 9 Dec 2019 11:39:35 -0800 Subject: [PATCH 240/316] Add a tsetse rule that disallows mutating exports This is illegal for goog.modules emitted by tsickle. This is not enabled by default. PiperOrigin-RevId: 284600418 --- internal/common/compilation.bzl | 2 +- internal/tsetse/checker.ts | 2 +- internal/tsetse/error_code.ts | 1 + .../tsetse/rules/ban_mutable_exports_rule.ts | 71 +++++++++++++++++++ .../tests/ban_mutable_exports/examples.ts | 30 ++++++++ 5 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 internal/tsetse/rules/ban_mutable_exports_rule.ts create mode 100644 internal/tsetse/tests/ban_mutable_exports/examples.ts diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index e815f372..a2b64686 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -17,7 +17,7 @@ load(":common/json_marshal.bzl", "json_marshal") load(":common/module_mappings.bzl", "module_mappings_aspect") -load("@build_bazel_rules_nodejs//:declaration_provider.bzl", "DeclarationInfo") +load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo") _DEBUG = False diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 9eef4165..52d06f96 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -96,7 +96,7 @@ export class Checker { const thisChecker = this; this.currentSourceFile = sourceFile; this.failures = []; - ts.forEachChild(sourceFile, run); + run(sourceFile); return this.failures; function run(node: ts.Node) { diff --git a/internal/tsetse/error_code.ts b/internal/tsetse/error_code.ts index 71ca712a..87b7fd2e 100644 --- a/internal/tsetse/error_code.ts +++ b/internal/tsetse/error_code.ts @@ -13,4 +13,5 @@ export enum ErrorCode { BAN_PROMISE_AS_CONDITION = 21226, PROPERTY_RENAMING_SAFE = 21227, CONFORMANCE_PATTERN = 21228, + BAN_MUTABLE_EXPORTS = 21229, } diff --git a/internal/tsetse/rules/ban_mutable_exports_rule.ts b/internal/tsetse/rules/ban_mutable_exports_rule.ts new file mode 100644 index 00000000..5b5716d8 --- /dev/null +++ b/internal/tsetse/rules/ban_mutable_exports_rule.ts @@ -0,0 +1,71 @@ +/** + * @fileoverview Bans 'export' of mutable variables. + * It is illegal to mutate them, so you might as well use 'const'. + */ + +import * as ts from 'typescript'; + +import {Checker} from '../checker'; +import {ErrorCode} from '../error_code'; +import {AbstractRule} from '../rule'; + +const MUTABLE_EXPORTS_EXCEPTION_FILES = [ + // Allow in d.ts files, which are modelling external JS that doesn't + // follow our rules. + '.d.ts', +]; + +export class Rule extends AbstractRule { + readonly ruleName = 'ban-mutable-exports'; + readonly code = ErrorCode.BAN_MUTABLE_EXPORTS; + + register(checker: Checker) { + // Strategy: take all the exports of the file, then look at whether + // they're const or not. This is simpler than the alternative of + // trying to match all the various kinds of 'export' syntax, such + // as 'export var ...', 'export {...}', 'export default ...'. + checker.on(ts.SyntaxKind.SourceFile, checkFile, this.code); + } +} + +function checkFile(checker: Checker, file: ts.SourceFile) { + if (MUTABLE_EXPORTS_EXCEPTION_FILES.some( + (suffix) => file.fileName.endsWith(suffix))) { + return; + } + const sym = checker.typeChecker.getSymbolAtLocation(file); + if (!sym) return; + const exports = checker.typeChecker.getExportsOfModule(sym); + for (const exp of exports) { + // In the case of + // let x = 3; export {x}; + // The exported symbol is the latter x, but we must dealias to + // the former to judge whether it's const or not. + let sym = exp; + if (sym.flags & ts.SymbolFlags.Alias) { + sym = checker.typeChecker.getAliasedSymbol(exp); + } + const decl = sym.valueDeclaration; + if (!decl) continue; // Skip e.g. type declarations. + + if (decl.getSourceFile() !== file) { + // Reexports are best warned about in the original file + continue; + } + + if (!ts.isVariableDeclaration(decl) && !ts.isBindingElement(decl)) { + // Skip e.g. class declarations. + continue; + } + + const isConst = (ts.getCombinedNodeFlags(decl) & ts.NodeFlags.Const) !== 0; + if (!isConst) { + // Note: show the failure at the exported symbol's declaration site, + // not the dealiased 'sym', so that the error message shows at the + // 'export' statement and not the variable declaration. + checker.addFailureAtNode( + exp.declarations[0], + `Exports must be const.`); + } + } +} diff --git a/internal/tsetse/tests/ban_mutable_exports/examples.ts b/internal/tsetse/tests/ban_mutable_exports/examples.ts new file mode 100644 index 00000000..c687cad5 --- /dev/null +++ b/internal/tsetse/tests/ban_mutable_exports/examples.ts @@ -0,0 +1,30 @@ +/** + * @fileoverview Examples for the mutable exports rule. + * We expect every 'bad' to be an error, and every 'ok' to pass. + * These are checked as expected diagnostics in the BUILD file. + */ + +export let bad1 = 3; +export var bad2 = 3; +export var bad3 = 3, bad4 = 3; +var bad5 = 3; +export {bad5}; +let bad6 = 3; +export {bad6}; +export {bad6 as bad6alias}; +var bad7 = 3; +export {bad7 as default}; +export let {bad8} = { + bad8: 3 +}; +export let bad9: unknown; + +let ok1 = 3; +var ok2 = 3; +export const ok3 = 3; +const ok4 = 3; +const ok5 = 3; +export {ok5}; +export type ok6 = string; +export function ok7() {} +export class ok8 {} From fb718127a229b402eea03f80cbac98918a124a96 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Thu, 12 Dec 2019 07:52:26 -0800 Subject: [PATCH 241/316] Fix compilation issues with strictBindCallApply. With strictBindCallApply, TS complains that the unknown[] is incompatible with the [any?, ...any] array expected by .error. The workaround is to just switch to `.call` with splat. PiperOrigin-RevId: 285190781 --- internal/tsc_wrapped/worker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 0bdb04ce..f6bc505a 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -19,7 +19,7 @@ export const DEBUG = false; /** Maybe print a debug message (depending on a flag defaulting to false). */ export function debug(...args: Array) { - if (DEBUG) console.error.apply(console, args); + if (DEBUG) console.error.call(console, ...args); } /** @@ -27,7 +27,7 @@ export function debug(...args: Array) { * the end user. */ export function log(...args: Array) { - console.error.apply(console, args); + console.error.call(console, ...args); } /** From 8070923e23dc5cf2f7aec897b9458eb3fe25b1e4 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 12 Dec 2019 13:49:36 -0800 Subject: [PATCH 242/316] n/a PiperOrigin-RevId: 285262975 --- internal/common/compilation.bzl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index a2b64686..c11b71c6 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -516,10 +516,23 @@ def compile_ts( }, } -# Converts a dict to a struct, recursing into a single level of nested dicts. -# This allows users of compile_ts to modify or augment the returned dict before -# converting it to an immutable struct. -def ts_providers_dict_to_struct(d): +def ts_providers_dict_to_struct(d, preserve_js_struct_field = False): + """ Converts a dict to a struct, recursing into a single level of nested dicts. + + This allows users of compile_ts to modify or augment the returned dict before + converting it to an immutable struct. + + Args: + d: the dict to convert + preserve_js_struct_field: whether to preserve the js provider as a "js" field. + Please only set this to True if you are using this struct in another provider. + e.g. MyProvider(some_field = ts_providers_dict_to_struct(d, preserve_js_struct_field = True)) + *Do not use* if returning the struct from a rule. + + Returns: + An immutable struct created from the input dict + """ + for key, value in d.items(): if key != "output_groups" and type(value) == type({}): From 547a742068d454124fd9f087fb28b661f31a9c92 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 13 Dec 2019 10:12:38 -0800 Subject: [PATCH 243/316] Minor code cleanup PiperOrigin-RevId: 285422043 --- internal/tsetse/rules/ban_mutable_exports_rule.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/tsetse/rules/ban_mutable_exports_rule.ts b/internal/tsetse/rules/ban_mutable_exports_rule.ts index 5b5716d8..a4dc132c 100644 --- a/internal/tsetse/rules/ban_mutable_exports_rule.ts +++ b/internal/tsetse/rules/ban_mutable_exports_rule.ts @@ -9,12 +9,6 @@ import {Checker} from '../checker'; import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; -const MUTABLE_EXPORTS_EXCEPTION_FILES = [ - // Allow in d.ts files, which are modelling external JS that doesn't - // follow our rules. - '.d.ts', -]; - export class Rule extends AbstractRule { readonly ruleName = 'ban-mutable-exports'; readonly code = ErrorCode.BAN_MUTABLE_EXPORTS; @@ -29,8 +23,9 @@ export class Rule extends AbstractRule { } function checkFile(checker: Checker, file: ts.SourceFile) { - if (MUTABLE_EXPORTS_EXCEPTION_FILES.some( - (suffix) => file.fileName.endsWith(suffix))) { + // Allow in d.ts files, which are modelling external JS that doesn't + // follow our rules. + if (file.fileName.endsWith('.d.ts')) { return; } const sym = checker.typeChecker.getSymbolAtLocation(file); From a7af24c851d26db2577930bc28c6ec3aa0a5fcfc Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 7 Jan 2020 07:59:41 -0800 Subject: [PATCH 244/316] Update to rules_nodejs 1.0.0 Closes #480 PiperOrigin-RevId: 288497658 --- BUILD.bazel | 4 +- package.bzl | 4 +- package.json | 10 ++-- yarn.lock | 139 ++++++++++++++++++++++++++++----------------------- 4 files changed, 85 insertions(+), 72 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index b0a00518..3a519c58 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,7 +19,7 @@ # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives # gazelle:exclude node_modules load("@bazel_gazelle//:def.bzl", "gazelle") -load("@build_bazel_rules_nodejs//:index.bzl", "npm_package") +load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") exports_files([ "LICENSE", @@ -32,7 +32,7 @@ gazelle( ) # This package is included in the npm_bazel_typescript package in rules_nodejs/packages/typescript -npm_package( +pkg_npm( name = "npm_bazel_typescript_package", srcs = [ "//internal:npm_package_assets", diff --git a/package.bzl b/package.bzl index e1c4bb3e..cb33eab9 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "26c39450ce2d825abee5583a43733863098ed29d3cbaebf084ebaca59a21a1c8", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.0/rules_nodejs-0.39.0.tar.gz"], + sha256 = "3887b948779431ac443e6a64f31b9e1e17b8d386a31eebc50ec1d9b0a6cabd2b", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.0.0/rules_nodejs-1.0.0.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index 320fed56..c87382d8 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,11 @@ "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", "devDependencies": { - "@bazel/bazel": "^0.26.0", - "@bazel/buildifier": "^0.20.0", - "@bazel/ibazel": "^0.2.0", - "@bazel/jasmine": "^0.39.0", - "@bazel/typescript": "^0.39.0", + "@bazel/bazel": "^2.0.0", + "@bazel/buildifier": "^0.29.0", + "@bazel/ibazel": "^0.11.0", + "@bazel/jasmine": "^1.0.0", + "@bazel/typescript": "^1.0.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", "@types/node": "10.12.20", diff --git a/yarn.lock b/yarn.lock index 41251e7e..0d685afb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,66 +2,79 @@ # yarn lockfile v1 -"@bazel/bazel-darwin_x64@0.26.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.26.0.tgz#24660853a01e286359636025618a1fda1aa978e1" - integrity sha512-9qcRlTW9g8TPJ1PWYIkNDUMsEjdhN4sJz5fDjva3GM7mnIST0sgJiRRW5Y9L3Ksv9+jNWmIOlj5wsibAUYyb5w== - -"@bazel/bazel-linux_x64@0.26.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.26.0.tgz#9302b6df4363b5c492f2755174988935b84fb076" - integrity sha512-v9RTFIZb/A8Ej0Q1uCc/uTCRFZIRGqQpBVLO9Vqkbg4kScND9FxAI2RO0bv3Zhz7YTXBvJ8+kSfd/DY+0azwsA== - -"@bazel/bazel-win32_x64@0.26.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.26.0.tgz#ae878cf2aae0ad9799141e554c47417f426c1aa7" - integrity sha512-hmhuWQUzTmVLDusSt701LFzkWoRdEsakDtEGKgIuQuAJ7zqwH8QUn3PpWIg5BA0qF0gxJBKMfTHGvNhMft3pmg== - -"@bazel/bazel@^0.26.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.26.0.tgz#651513d5e11198f4c911024fdd57e76e0742fe9d" - integrity sha512-vxm3nuvYu97NRVkcRBfuLHqDytykCazZaTX13j+Ssqg0XIuuIiewTXGNKq2lcxeydJnscArMyYEv+gyXpexHDA== +"@bazel/bazel-darwin_x64@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-2.0.0.tgz#bd678069216dd470c6816a22c405f21e7f048038" + integrity sha512-I/pP+B+2xfY0g+OEpEcVnk8rizuC761pAzBOQjP3b+gz3AzeRgm05CpcSY7tfPIppMSYoy3uTZJ1XlwgUg7IQQ== + +"@bazel/bazel-linux_x64@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-2.0.0.tgz#2c76e3301e9178a90ec3ad00649e89b953eda0b7" + integrity sha512-iOr45G+511IbP7e+ISriG97WpfCAVXekTrTgL5mGg3NDBFCVNs350VquHAvmlXAoP5+IEug2pCOlkdEl4bLl8g== + +"@bazel/bazel-win32_x64@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-2.0.0.tgz#f12ac0738d2eac0fd255f099776194807cedfe50" + integrity sha512-5qs2qoa/paG/YYEM0yvrwuJIShoPVK2FX+Oz9jEWAQJsmU4drHA9Aq+gbBOirEFLmvYhleZ9XORCwu/5uAo8vA== + +"@bazel/bazel@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-2.0.0.tgz#feb8cf5a40ea6437ef69cac2a92072118b11c230" + integrity sha512-KQbv5dHNSfutbhXCc3KVMuBXPpUh6Af/hT9IRIaMTuiB6Nq2gEW9Z3aNqncopdZqV848V/qYxnqPnQ+S37fMyQ== + dependencies: + "@bazel/hide-bazel-files" latest optionalDependencies: - "@bazel/bazel-darwin_x64" "0.26.0" - "@bazel/bazel-linux_x64" "0.26.0" - "@bazel/bazel-win32_x64" "0.26.0" - -"@bazel/buildifier-darwin_x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.20.0.tgz#1aeceb5a1a57a62eef6415377dbe95091781a7d4" - integrity sha512-yV7niwbdpDDPUw1vgyk1wIjPl3+YOM4o5FPgFmnFgzf48JUqrF3PK6Blg95Z8SqGOVoJAOChRC1GvopzEUzwZA== - -"@bazel/buildifier-linux_x64@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.20.0.tgz#8cb6c8f999dbd8a9ee183906f202b698571d771b" - integrity sha512-djbBtcacgERWZoxjEm8lGmMyEaOYB3moiz0kioHTQc2F96wNLfm6Cikd4Ojrcj5VNQCMW9oy3YFTu+c5mIrCcA== - -"@bazel/buildifier@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.20.0.tgz#24a10e485fe65dbd75ef812cf37635df1fb91d0d" - integrity sha512-dahQRtE1KEp+efUV23q/JtOCSbQEk5C/+H3J33g8wP5roxMUa8mfDto85eloJ+gRPW7yOybxknuRYc4KSpgT7w== + "@bazel/bazel-darwin_x64" "2.0.0" + "@bazel/bazel-linux_x64" "2.0.0" + "@bazel/bazel-win32_x64" "2.0.0" + +"@bazel/buildifier-darwin_x64@0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.29.0.tgz#13dfaf3ea4d89f9d4da00085e894e90b7d302342" + integrity sha512-jiQIZo5z1c8oFokD2jObrkB04Bs+7RaUJ6WlHV9BBeJiRMGfRVUBUrOF5eJPk6VB8qknIOfHvJD/Ym5XUc1Zlw== + +"@bazel/buildifier-linux_x64@0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-linux_x64/-/buildifier-linux_x64-0.29.0.tgz#0191fc46735a1c281878642673844f2b717cd8dc" + integrity sha512-sXXY0gP4oC1nC1G8Baqd7kyBL/y9/qOqftKSkDe2Y7gBoc9GslwyexwDxTSxK0Gun/4Vcvc2eRu7b83hMOxuag== + +"@bazel/buildifier-win32_x64@0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier-win32_x64/-/buildifier-win32_x64-0.29.0.tgz#a63438c7a7d2dc593e626ed6e163e9d8ea93917a" + integrity sha512-hnOQfPhQNAIqbrhsHT3MWAyAZSUhKwxzEuZJZoOsGrW8fPonhKysdvfZJqfqJ6vDVYaMJKvLnSO1c9QZRhU7kQ== + +"@bazel/buildifier@^0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-0.29.0.tgz#7984739270c8d1dd23650f87a810e1e6367188d9" + integrity sha512-skJ7vVff7x3tB8crBCtJji2wU09uH0uD2N30xfOpVUgsMJSXktAQMj8+RPdMBqJQ9XS5+O5lmRthR35Ua7xQXA== optionalDependencies: - "@bazel/buildifier-darwin_x64" "0.20.0" - "@bazel/buildifier-linux_x64" "0.20.0" + "@bazel/buildifier-darwin_x64" "0.29.0" + "@bazel/buildifier-linux_x64" "0.29.0" + "@bazel/buildifier-win32_x64" "0.29.0" -"@bazel/ibazel@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c" - integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw= +"@bazel/hide-bazel-files@latest": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.0.0.tgz#779070dcb5ae121ff6c72d73bf3fb7bf68285d75" + integrity sha512-dfw2W7xDUPlRMcDMVO8gDkX9Xb7Thy3sP4PDODv+eiHOvwIi116X/wwy7mQUZISkJdEJ1zWy9ydpzvfetpYh4w== -"@bazel/jasmine@^0.32.0": - version "0.32.0" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.32.0.tgz#afbb3b7cb3aeabd55324962dec3253841ed617ee" - integrity sha512-yzXqa9lP+su6lqqFJbhcdvHOCgfgIm6zMt8i1doZU8O/RkefAWj2nv+8gY8dPGMMByB6herV/5QAowB88d6ZAA== +"@bazel/ibazel@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.11.0.tgz#6879c8032f5bee81ca632456304c16525160f47f" + integrity sha512-UOSMb29SjjXrs7VTn6eOAO2anmAgUC3hrsKwW3XyFV4pQdd71d0wjRqz36Vao4ICWXZcv4C6mRuVH2VCfZmG1w== + +"@bazel/jasmine@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.0.0.tgz#12aa82c0e4b7b5658e9e496b73c0cf660df2b0ae" + integrity sha512-cheQWMYs0PaS4kYwJC9tmAiyd0tLbPNcgoM+S8plNUp5k0gUVosCvQ0TOrxvRlKEY0ni1hdn9owPx2rUO1J+Wg== dependencies: - jasmine "~3.3.1" - jasmine-core "~3.3.0" + jasmine "~3.4.0" + jasmine-core "~3.4.0" v8-coverage "1.0.9" -"@bazel/typescript@^0.32.0": - version "0.32.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.32.0.tgz#648be4c63302cac95552c74d17c708adbcc4c366" - integrity sha512-D2wlWanIDiagj50GetmbIeXN73XSG3E5eIhlDNL1atHe4ZPo7rODJGfI1Yme9xD71nbDL7WjwH15wYOfeoWNhA== +"@bazel/typescript@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.0.0.tgz#2c7318b9a3aaa730f282b094ddf41dd16fda7b5a" + integrity sha512-caNOKz7EjVMgbedjVTreao9++9Sb9oYlU2nqDOMIK8MyoOUQvgGQWhFwF65XXGSb79Tzv8kaFQskoaH/iAs4ng== dependencies: protobufjs "6.8.8" semver "5.6.0" @@ -1812,10 +1825,10 @@ jasmine-core@2.8.0, jasmine-core@~2.8.0: resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" integrity sha1-vMl5rh+f0FcB5F5S5l06XWPxok4= -jasmine-core@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.3.0.tgz#dea1cdc634bc93c7e0d4ad27185df30fa971b10e" - integrity sha512-3/xSmG/d35hf80BEN66Y6g9Ca5l/Isdeg/j6zvbTYlTzeKinzmaTM4p9am5kYqOmE05D7s1t8FGjzdSnbUbceA== +jasmine-core@~3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.4.0.tgz#2a74618e966026530c3518f03e9f845d26473ce3" + integrity sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg== jasmine@^2.5.3: version "2.8.0" @@ -1826,13 +1839,13 @@ jasmine@^2.5.3: glob "^7.0.6" jasmine-core "~2.8.0" -jasmine@~3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.3.1.tgz#d61bb1dd8888859bd11ea83074a78ee13d949905" - integrity sha512-/vU3/H7U56XsxIXHwgEuWpCgQ0bRi2iiZeUpx7Nqo8n1TpoDHfZhkPIc7CO8I4pnMzYsi3XaSZEiy8cnTfujng== +jasmine@~3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.4.0.tgz#0fa68903ff0c9697459cd044b44f4dcef5ec8bdc" + integrity sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ== dependencies: - glob "^7.0.6" - jasmine-core "~3.3.0" + glob "^7.1.3" + jasmine-core "~3.4.0" jasminewd2@^2.1.0: version "2.2.0" From 125356acdcf34c14cf3dbc1aa0726481be8c36df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2020 08:31:39 -0800 Subject: [PATCH 245/316] Bump handlebars from 4.1.2 to 4.5.3 Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3) Signed-off-by: dependabot[bot] Closes #479 PiperOrigin-RevId: 288502738 --- yarn.lock | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0d685afb..f60c13d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -707,10 +707,10 @@ commander@2.6.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" integrity sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0= -commander@~2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== +commander@~2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== component-bind@1.0.0: version "1.0.0" @@ -1367,9 +1367,9 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2: integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= handlebars@^4.0.3: - version "4.1.2" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" - integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + version "4.5.3" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482" + integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA== dependencies: neo-async "^2.6.0" optimist "^0.6.1" @@ -1484,7 +1484,7 @@ hosted-git-info@^2.1.4: http-errors@1.6.3, http-errors@~1.6.3: version "1.6.3" - resolved "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= dependencies: depd "~1.1.2" @@ -2178,7 +2178,7 @@ minimatch@^3.0.2, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8, minimist@~0.0.1: +minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= @@ -2188,6 +2188,11 @@ minimist@^1.1.0, minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + minipass@^2.2.1, minipass@^2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" @@ -2734,7 +2739,7 @@ read-pkg@^3.0.0: readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: version "2.3.6" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" @@ -2747,7 +2752,7 @@ readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.0: readable-stream@~2.0.6: version "2.0.6" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= dependencies: core-util-is "~1.0.0" @@ -3506,11 +3511,11 @@ typescript@~3.1.6: integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== uglify-js@^3.1.4: - version "3.5.15" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.15.tgz#fe2b5378fd0b09e116864041437bff889105ce24" - integrity sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg== + version "3.7.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.4.tgz#e6d83a1aa32ff448bd1679359ab13d8db0fe0743" + integrity sha512-tinYWE8X1QfCHxS1lBS8yiDekyhSXOO6R66yNOCdUJeojxxw+PX2BHAz/BWyW7PQ7pkiWVxJfIEbiDxyLWvUGg== dependencies: - commander "~2.20.0" + commander "~2.20.3" source-map "~0.6.1" ultron@1.0.x: From f1af554a40e38c7fe2cfc610c7d50aa41b9bf094 Mon Sep 17 00:00:00 2001 From: martinprobst Date: Mon, 13 Jan 2020 09:04:20 -0800 Subject: [PATCH 246/316] Fix two "strictBindCallApply" problems in tsc_wrapped. PiperOrigin-RevId: 289453549 --- internal/tsc_wrapped/cache_test.ts | 2 +- internal/tsc_wrapped/strict_deps_test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/cache_test.ts b/internal/tsc_wrapped/cache_test.ts index e4aeaf3e..09e0afa8 100644 --- a/internal/tsc_wrapped/cache_test.ts +++ b/internal/tsc_wrapped/cache_test.ts @@ -22,7 +22,7 @@ import * as ts from 'typescript'; import {CachedFileLoader, FileCache, ProgramAndFileCache} from './cache'; import {invalidateFileCache, writeTempFile} from './test_support'; -function fauxDebug(...args: any[]) { +function fauxDebug(...args: [any?, ...any[]]) { console.error.apply(console, args); } diff --git a/internal/tsc_wrapped/strict_deps_test.ts b/internal/tsc_wrapped/strict_deps_test.ts index 2b555172..807e86e1 100644 --- a/internal/tsc_wrapped/strict_deps_test.ts +++ b/internal/tsc_wrapped/strict_deps_test.ts @@ -39,7 +39,7 @@ describe('strict deps', () => { if (!files[fileName]) { if (astCache.has(fileName)) return astCache.get(fileName); const file = originalGetSourceFile(fileName, ts.ScriptTarget.Latest); - astCache.set(fileName, file); + astCache.set(fileName, file!); return file; } return ts.createSourceFile( From ebcb921fcd254dd63888f0f90e6b550b22411417 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Mon, 13 Jan 2020 11:36:53 -0800 Subject: [PATCH 247/316] Expose declarations only via DeclarationInfo PiperOrigin-RevId: 289484723 --- internal/common/compilation.bzl | 167 +++++++++++++++----------------- 1 file changed, 80 insertions(+), 87 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index c11b71c6..514202ad 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -55,7 +55,13 @@ COMMON_ATTRIBUTES = { default = [], providers = [JsInfo], ), - "deps": attr.label_list(aspects = DEPS_ASPECTS), + "deps": attr.label_list( + aspects = DEPS_ASPECTS, + # TODO(b/139705078): require all deps have a DeclarationInfo provider + # and remove assert_js_or_typescript_deps which is attempting + # to enforce the same thing as this. + # providers = [DeclarationInfo], + ), "_additional_d_ts": _ADDITIONAL_D_TS, } @@ -75,85 +81,48 @@ def assert_js_or_typescript_deps(ctx, deps = None): # Fallback to `ctx.attr.deps`. deps = deps if deps != None else ctx.attr.deps for dep in deps: - if not hasattr(dep, "typescript") and not JsInfo in dep: + if not hasattr(dep, "typescript") and not JsInfo in dep and not DeclarationInfo in dep: allowed_deps_msg = "Dependencies must be ts_library" fail("%s is neither a TypeScript nor a JS producing rule.\n%s\n" % (dep.label, allowed_deps_msg)) _DEPSET_TYPE = type(depset()) -def _check_ts_provider(dep): - """Verifies the type shape of the typescript provider in dep, if it has one. - """ - - # Under Bazel, some third parties have created typescript providers which may not be compatible. - # Rather than users getting an obscure error later, explicitly check them and point to the - # target that created the bad provider. - # TODO(alexeagle): remove this after some transition period, maybe mid-2019 - if hasattr(dep, "typescript"): - if type(dep.typescript.declarations) != _DEPSET_TYPE: - fail("typescript provider in %s defined declarations as a %s rather than a depset" % ( - dep.label, - type(dep.typescript.declarations), - )) - if type(dep.typescript.transitive_declarations) != _DEPSET_TYPE: - fail("typescript provider in %s defined transitive_declarations as a %s rather than a depset" % ( - dep.label, - type(dep.typescript.transitive_declarations), - )) - if type(dep.typescript.type_blacklisted_declarations) != _DEPSET_TYPE: - fail("typescript provider in %s defined type_blacklisted_declarations as a %s rather than a depset" % ( - dep.label, - type(dep.typescript.type_blacklisted_declarations), - )) - return dep - -def _collect_dep_declarations(ctx, deps): - """Collects .d.ts files from typescript and javascript dependencies. +def _collect_dep_declarations(ctx, declaration_infos): + """Flattens DeclarationInfo from typescript and javascript dependencies. Args: ctx: ctx. - deps: dependent targets, generally ctx.attr.deps + declaration_infos: list of DeclarationInfo collected from dependent targets Returns: A struct of depsets for direct, transitive and type-blacklisted declarations. """ - deps_and_helpers = [ - _check_ts_provider(dep) - for dep in deps + getattr(ctx.attr, "_helpers", []) - if hasattr(dep, "typescript") - ] - # .d.ts files from direct dependencies, ok for strict deps - direct_deps_declarations = [dep.typescript.declarations for dep in deps_and_helpers] + direct_deps_declarations = [dep.declarations for dep in declaration_infos] # all reachable .d.ts files from dependencies. - transitive_deps_declarations = [ - dep.typescript.transitive_declarations - for dep in deps_and_helpers - ] + transitive_deps_declarations = [dep.transitive_declarations for dep in declaration_infos] # all reachable .d.ts files from node_modules attribute (if it has a typescript provider) - if hasattr(ctx.attr, "node_modules") and hasattr(ctx.attr.node_modules, "typescript"): - transitive_deps_declarations += [ctx.attr.node_modules.typescript.transitive_declarations] + if hasattr(ctx.attr, "node_modules"): + if DeclarationInfo in ctx.attr.node_modules: + transitive_deps_declarations.append(ctx.attr.node_modules[DeclarationInfo].transitive_declarations) + elif hasattr(ctx.attr.node_modules, "typescript"): + # TODO(b/139705078): remove this case after bazel BUILD file generation for node_modules is updated + transitive_deps_declarations.append([ctx.attr.node_modules.typescript.transitive_declarations]) # .d.ts files whose types tsickle will not emit (used for ts_declaration(generate_externs=False). - type_blacklisted_declarations = [ - dep.typescript.type_blacklisted_declarations - for dep in deps_and_helpers - ] + type_blacklisted_declarations = [dep.type_blacklisted_declarations for dep in declaration_infos] # If a tool like github.com/angular/clutz can create .d.ts from type annotated .js # its output will be collected here. - return struct( - direct = depset(transitive = direct_deps_declarations), - transitive = depset( - [extra for extra in ctx.files._additional_d_ts], - transitive = transitive_deps_declarations, - ), - type_blacklisted = depset(transitive = type_blacklisted_declarations), + return DeclarationInfo( + declarations = depset(transitive = direct_deps_declarations), + transitive_declarations = depset(ctx.files._additional_d_ts, transitive = transitive_deps_declarations), + type_blacklisted_declarations = depset(transitive = type_blacklisted_declarations), ) def _should_generate_externs(ctx): @@ -224,7 +193,7 @@ def compile_ts( ctx, is_library, srcs = None, - deps = None, + declaration_infos = None, compile_action = None, devmode_compile_action = None, jsx_factory = None, @@ -239,7 +208,7 @@ def compile_ts( ctx: ctx. is_library: boolean. False if only compiling .dts files. srcs: label list. Explicit list of sources to be used instead of ctx.attr.srcs. - deps: label list. Explicit list of deps to be used instead of ctx.attr.deps. + declaration_infos: list of DeclarationInfo. Explicit list of declarations to be used instead of those on ctx.attr.deps. compile_action: function. Creates the compilation action. devmode_compile_action: function. Creates the compilation action for devmode. @@ -254,16 +223,28 @@ def compile_ts( ### Collect srcs and outputs. srcs = srcs if srcs != None else ctx.attr.srcs - deps = deps if deps != None else ctx.attr.deps + if declaration_infos == None: + if not hasattr(ctx.attr, "deps"): + fail("compile_ts must either be called from a rule with a deps attr, or must be given declaration_infos") + + # Validate the user inputs. + # TODO(b/139705078): remove this when we require DeclarationInfo provider on deps + assert_js_or_typescript_deps(ctx, ctx.attr.deps) + + # By default, we collect dependencies from the ctx, when used as a rule + declaration_infos = [ + d[DeclarationInfo] + for d in ctx.attr.deps + getattr(ctx.attr, "_helpers", []) + # TODO(b/139705078): remove this when we require DeclarationInfo provider on deps + if DeclarationInfo in d + ] + tsconfig = tsconfig if tsconfig != None else ctx.outputs.tsconfig srcs_files = [f for t in srcs for f in t.files.to_list()] src_declarations = [] # d.ts found in inputs. tsickle_externs = [] # externs.js generated by tsickle, if any. has_sources = False - # Validate the user inputs. - assert_js_or_typescript_deps(ctx, deps) - for src in srcs: if src.label.package != ctx.label.package: # Sources can be in sub-folders, but not in sub-packages. @@ -298,9 +279,9 @@ def compile_ts( # Note: setting this variable controls whether tsickle is run at all. tsickle_externs = [ctx.actions.declare_file(ctx.label.name + ".externs.js")] - dep_declarations = _collect_dep_declarations(ctx, deps) - input_declarations = depset(src_declarations, transitive = [dep_declarations.transitive]) - type_blacklisted_declarations = dep_declarations.type_blacklisted + dep_declarations = _collect_dep_declarations(ctx, declaration_infos) + + type_blacklisted_declarations = dep_declarations.type_blacklisted_declarations if not is_library and not _should_generate_externs(ctx): type_blacklisted_declarations = depset(srcs_files, transitive = [type_blacklisted_declarations]) @@ -319,7 +300,7 @@ def compile_ts( if "TYPESCRIPT_PERF_TRACE_TARGET" in ctx.var: perf_trace = str(ctx.label) == ctx.var["TYPESCRIPT_PERF_TRACE_TARGET"] - compilation_inputs = dep_declarations.transitive.to_list() + srcs_files + compilation_inputs = dep_declarations.transitive_declarations.to_list() + srcs_files tsickle_externs_path = tsickle_externs[0] if tsickle_externs else None # Calculate allowed dependencies for strict deps enforcement. @@ -327,7 +308,7 @@ def compile_ts( # A target's sources may depend on each other, srcs_files, # or on a .d.ts from a direct dependency - transitive = [dep_declarations.direct], + transitive = [dep_declarations.declarations], ) tsconfig_es6 = tsc_wrapped_tsconfig( @@ -429,7 +410,7 @@ def compile_ts( # TODO(martinprobst): Merge the generated .d.ts files, and enforce strict # deps (do not re-export transitive types from the transitive closure). - transitive_decls = depset(src_declarations + gen_declarations, transitive = [dep_declarations.transitive]) + transitive_decls = depset(src_declarations + gen_declarations, transitive = [dep_declarations.transitive_declarations]) # both ts_library and ts_declarations generate .mjs files: # - for libraries, this is the ES6/production code @@ -451,9 +432,8 @@ def compile_ts( if not srcs_files: # Re-export sources from deps. # TODO(b/30018387): introduce an "exports" attribute. - for dep in deps: - if hasattr(dep, "typescript"): - declarations_depsets.append(dep.typescript.declarations) + for dep in declaration_infos: + declarations_depsets.append(dep.declarations) files_depsets.extend(declarations_depsets) # If this is a ts_declaration, add tsickle_externs to the outputs list to @@ -463,11 +443,17 @@ def compile_ts( files_depsets.append(depset(tsickle_externs)) transitive_es6_sources_sets = [es6_sources] - for dep in deps: + for dep in getattr(ctx.attr, "deps", []): if hasattr(dep, "typescript"): transitive_es6_sources_sets += [dep.typescript.transitive_es6_sources] transitive_es6_sources = depset(transitive = transitive_es6_sources_sets) + declarations_provider = DeclarationInfo( + declarations = depset(transitive = declarations_depsets), + transitive_declarations = transitive_decls, + type_blacklisted_declarations = type_blacklisted_declarations, + ) + return { "providers": [ DefaultInfo( @@ -484,12 +470,11 @@ def compile_ts( es5_sources = es5_sources, es6_sources = es6_sources, ), - # TODO(martinprobst): Prune transitive deps, see go/dtspruning - DeclarationInfo( - declarations = depset(transitive = declarations_depsets), - transitive_declarations = transitive_decls, - ), + declarations_provider, ], + # Also expose the DeclarationInfo as a named provider so that aspect implementations can reference it + # Otherwise they would be forced to reference it by a numeric index out of the "providers" list above. + "declarations": declarations_provider, "instrumented_files": { "dependency_attributes": ["deps", "runtime_deps"], "extensions": ["ts"], @@ -502,21 +487,16 @@ def compile_ts( # Expose the tags so that a Skylark aspect can access them. "tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags, "typescript": { - # TODO(b/139705078): remove when consumers migrated to DeclarationInfo - "declarations": depset(transitive = declarations_depsets), "devmode_manifest": devmode_manifest, "es5_sources": es5_sources, "es6_sources": es6_sources, "replay_params": replay_params, - # TODO(b/139705078): remove when consumers migrated to DeclarationInfo - "transitive_declarations": transitive_decls, "transitive_es6_sources": transitive_es6_sources, "tsickle_externs": tsickle_externs, - "type_blacklisted_declarations": type_blacklisted_declarations, }, } -def ts_providers_dict_to_struct(d, preserve_js_struct_field = False): +def ts_providers_dict_to_struct(d): """ Converts a dict to a struct, recursing into a single level of nested dicts. This allows users of compile_ts to modify or augment the returned dict before @@ -524,17 +504,30 @@ def ts_providers_dict_to_struct(d, preserve_js_struct_field = False): Args: d: the dict to convert - preserve_js_struct_field: whether to preserve the js provider as a "js" field. - Please only set this to True if you are using this struct in another provider. - e.g. MyProvider(some_field = ts_providers_dict_to_struct(d, preserve_js_struct_field = True)) - *Do not use* if returning the struct from a rule. Returns: An immutable struct created from the input dict """ + # These keys are present in the dict so that aspects can reference them, + # however they should not be output as legacy providers since we have modern + # symbol-typed providers for them. + js_provider = d.pop("js", None) + declarations_provider = d.pop("declarations", None) + + # Promote the "js" string-typed provider to a modern provider + if js_provider: + # Create a new providers list rather than modify the existing list + d["providers"] = d.get("providers", []) + [js_provider] for key, value in d.items(): if key != "output_groups" and type(value) == type({}): d[key] = struct(**value) - return struct(**d) + result = struct(**d) + + # Restore the elements we removed, to avoid side-effect of mutating the argument + if js_provider: + d["js"] = js_provider + if declarations_provider: + d["declarations"] = declarations_provider + return result From c71bff5fcc31ca66cb5b573581f538258cfea9d8 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Fri, 17 Jan 2020 16:36:37 -0800 Subject: [PATCH 248/316] Allow for ts strictdeps to look at multiple declaration sites of a symbol PiperOrigin-RevId: 290365047 --- internal/tsc_wrapped/strict_deps.ts | 19 ++++++++++++++----- internal/tsc_wrapped/strict_deps_test.ts | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/internal/tsc_wrapped/strict_deps.ts b/internal/tsc_wrapped/strict_deps.ts index c2cb7238..447fc3e7 100644 --- a/internal/tsc_wrapped/strict_deps.ts +++ b/internal/tsc_wrapped/strict_deps.ts @@ -85,15 +85,24 @@ export function checkModuleDeps( if (!sym || !sym.declarations || sym.declarations.length < 1) { continue; } - // Module imports can only have one declaration location. - const declFileName = sym.declarations[0].getSourceFile().fileName; - if (allowedMap[stripExt(declFileName)]) continue; - const importName = path.posix.relative(rootDir, declFileName); + const declFileNames = + sym.declarations.map(decl => decl.getSourceFile().fileName); + if (declFileNames.find( + declFileName => !!allowedMap[stripExt(declFileName)])) { + continue; + } + const importNames = declFileNames.map( + declFileName => path.posix.relative(rootDir, declFileName)); + + const extraDeclarationLocationsMessage = (importNames.length < 2) ? + '' : + `(It is also declared in ${importNames.slice(1).join(', ')}) `; result.push({ file: sf, start: modSpec.getStart(), length: modSpec.getEnd() - modSpec.getStart(), - messageText: `transitive dependency on ${importName} not allowed. ` + + messageText: `transitive dependency on ${importNames[0]} not allowed. ` + + extraDeclarationLocationsMessage + `Please add the BUILD target to your rule's deps.`, category: ts.DiagnosticCategory.Error, // semantics are close enough, needs taze. diff --git a/internal/tsc_wrapped/strict_deps_test.ts b/internal/tsc_wrapped/strict_deps_test.ts index 807e86e1..1e3ae470 100644 --- a/internal/tsc_wrapped/strict_deps_test.ts +++ b/internal/tsc_wrapped/strict_deps_test.ts @@ -132,4 +132,26 @@ describe('strict deps', () => { expect(diags[0].messageText) .toMatch(/dependency on blaze-bin\/p\/sd1.d.ts not allowed/); }); + + it('allows multiple declarations of the same clutz-generated module', () => { + const p = createProgram({ + '/src/blaze-bin/p/js1.d.ts': `declare module 'goog:thing' {}`, + '/src/blaze-bin/p/js2.d.ts': `declare module 'goog:thing' {}`, + '/src/blaze-bin/p/js3.d.ts': `declare module 'goog:thing' {}`, + // Import from the middle one, to be sure it doesn't pass just because the + // order so happens that we checked the declaration from the first one + '/src/p/my.ts': `import {} from 'goog:thing'; // taze: from //p:js2`, + }); + const good = checkModuleDeps( + p.getSourceFile('/src/p/my.ts')!, p.getTypeChecker(), + ['/src/blaze-bin/p/js2.d.ts'], '/src'); + expect(good.length).toBe(0); + + const bad = checkModuleDeps( + p.getSourceFile('/src/p/my.ts')!, p.getTypeChecker(), [], '/src'); + expect(bad.length).toBe(1); + expect(bad[0].messageText) + .toContain( + '(It is also declared in blaze-bin/p/js2.d.ts, blaze-bin/p/js3.d.ts)'); + }); }); From 66e8e8f18410708a8572d29c69fb196efc73d4ea Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 22 Jan 2020 02:13:36 -0800 Subject: [PATCH 249/316] Adds a tsetse rule to prevent constructing Sets using a string. Disallows `new Set('abc')` since that results in a Set containing 'a', 'b' and 'c'. - If that really is the intention of the code, it can be converted to `new Set('abc' as Iterable)` - If the intention was to have a Set containing 'abc', it should be `new Set(['abc'])` PiperOrigin-RevId: 290914197 --- internal/tsetse/error_code.ts | 1 + .../rules/ban_string_initialized_sets_rule.ts | 63 +++++++++++++++++++ internal/tsetse/runner.ts | 2 + .../ban_string_initialized_sets/negatives.ts | 42 +++++++++++++ .../ban_string_initialized_sets/positives.ts | 51 +++++++++++++++ 5 files changed, 159 insertions(+) create mode 100644 internal/tsetse/rules/ban_string_initialized_sets_rule.ts create mode 100644 internal/tsetse/tests/ban_string_initialized_sets/negatives.ts create mode 100644 internal/tsetse/tests/ban_string_initialized_sets/positives.ts diff --git a/internal/tsetse/error_code.ts b/internal/tsetse/error_code.ts index 87b7fd2e..10d36c55 100644 --- a/internal/tsetse/error_code.ts +++ b/internal/tsetse/error_code.ts @@ -14,4 +14,5 @@ export enum ErrorCode { PROPERTY_RENAMING_SAFE = 21227, CONFORMANCE_PATTERN = 21228, BAN_MUTABLE_EXPORTS = 21229, + BAN_STRING_INITIALIZED_SETS = 21230, } diff --git a/internal/tsetse/rules/ban_string_initialized_sets_rule.ts b/internal/tsetse/rules/ban_string_initialized_sets_rule.ts new file mode 100644 index 00000000..44087baf --- /dev/null +++ b/internal/tsetse/rules/ban_string_initialized_sets_rule.ts @@ -0,0 +1,63 @@ +/** + * @fileoverview Bans `new Set()` since it is a potential source of bugs + * due to strings also implementing `Iterable`. + */ + +import * as ts from 'typescript'; + +import {Checker} from '../checker'; +import {ErrorCode} from '../error_code'; +import {AbstractRule} from '../rule'; + +const errorMsg = 'Value passed to Set constructor is a string. This will' + + ' create a Set of the characters of the string, rather than a Set' + + ' containing the string. To make a Set of the string, pass an array' + + ' containing the string. To make a Set of the characters, use \'as\' to ' + + ' create an Iterable, eg: new Set(myStr as Iterable).'; + +export class Rule extends AbstractRule { + readonly ruleName = 'ban-string-initialized-sets'; + readonly code = ErrorCode.BAN_STRING_INITIALIZED_SETS; + + register(checker: Checker) { + checker.on(ts.SyntaxKind.NewExpression, checkNewExpression, this.code); + } +} + +function checkNewExpression(checker: Checker, node: ts.NewExpression) { + const typeChecker = checker.typeChecker; + + // Check that it's a Set which is being constructed + const ctorTypeSymbol = + typeChecker.getTypeAtLocation(node.expression).getSymbol(); + + if (!ctorTypeSymbol || ctorTypeSymbol.getEscapedName() !== 'SetConstructor') { + return; + } + const isES2015SetCtor = ctorTypeSymbol.declarations.some((decl) => { + return sourceFileIsStdLib(decl.getSourceFile()); + }); + if (!isES2015SetCtor) return; + + // If there's no arguments provided, then it's not a string so bail out. + if (!node.arguments || node.arguments.length !== 1) return; + + // Check the type of the first argument, expanding union & intersection types + const arg = node.arguments[0]; + const argType = typeChecker.getTypeAtLocation(arg); + const allTypes = argType.isUnionOrIntersection() ? argType.types : [argType]; + + // Checks if the type (or any of the union/intersection types) are either + // strings or string literals. + const typeContainsString = allTypes.some((tsType) => { + return (tsType.getFlags() & ts.TypeFlags.StringLike) !== 0; + }); + + if (!typeContainsString) return; + + checker.addFailureAtNode(arg, errorMsg); +} + +function sourceFileIsStdLib(sourceFile: ts.SourceFile) { + return /lib\.es2015\.(collection|iterable)\.d\.ts$/.test(sourceFile.fileName); +} diff --git a/internal/tsetse/runner.ts b/internal/tsetse/runner.ts index a2b76d40..8e2926aa 100644 --- a/internal/tsetse/runner.ts +++ b/internal/tsetse/runner.ts @@ -11,6 +11,7 @@ import {Checker} from './checker'; import {AbstractRule} from './rule'; import {Rule as BanExpectTruthyPromiseRule} from './rules/ban_expect_truthy_promise_rule'; import {Rule as BanPromiseAsConditionRule} from './rules/ban_promise_as_condition_rule'; +import {Rule as BanStringInitializedSetsRule} from './rules/ban_string_initialized_sets_rule'; import {Rule as CheckReturnValueRule} from './rules/check_return_value_rule'; import {Rule as EqualsNanRule} from './rules/equals_nan_rule'; import {Rule as MustUsePromisesRule} from './rules/must_use_promises_rule'; @@ -25,6 +26,7 @@ const ENABLED_RULES: AbstractRule[] = [ new BanExpectTruthyPromiseRule(), new MustUsePromisesRule(), new BanPromiseAsConditionRule(), + new BanStringInitializedSetsRule(), ]; /** diff --git a/internal/tsetse/tests/ban_string_initialized_sets/negatives.ts b/internal/tsetse/tests/ban_string_initialized_sets/negatives.ts new file mode 100644 index 00000000..e9a188ae --- /dev/null +++ b/internal/tsetse/tests/ban_string_initialized_sets/negatives.ts @@ -0,0 +1,42 @@ +// tslint:disable +function emptySet() { + const set = new Set(); +} + +function noConstructorArgs() { + const set = new Set; +} + +function nonStringSet() { + const set = new Set([1, 2, 3]); +} + +// This is an allowable way to create a set of strings +function setOfStrings() { + const set = new Set(['abc']); +} + +function setOfChars() { + const set = new Set('abc'.split('')); +} + +function explicitlyAllowString() { + const set = new Set('abc' as Iterable); +} + +// checks that just a property called 'Set' doesn't trigger the error +function justAKeyCalledSet(obj: {Set: {new (s: string): any}}) { + const set = new obj.Set('abc'); +} + +function destructuredConstructorCalledSet(obj: {Set: {new (s: string): any}}) { + const {Set} = obj; + const set = new Set('abc'); +} + +function locallyDeclaredSet() { + class Set { + constructor(private s: string) {} + } + const set = new Set('abc'); +} diff --git a/internal/tsetse/tests/ban_string_initialized_sets/positives.ts b/internal/tsetse/tests/ban_string_initialized_sets/positives.ts new file mode 100644 index 00000000..a4ec6955 --- /dev/null +++ b/internal/tsetse/tests/ban_string_initialized_sets/positives.ts @@ -0,0 +1,51 @@ +// tslint:disable +function setWithStringLiteral() { + const set = new Set('abc'); +} + +function setWithStringVariable(s: string) { + const set = new Set(s); +} + +function setWithStringUnionType(s: string|string[]) { + const set = new Set(s); +} + +function setWithStringExpression(fn: () => string) { + const set = new Set(fn()); +} + +function setWithStringExpression2() { + const set = new Set(Math.random() < 0.5 ? 'a' : 'b'); +} + +type TypeA = string|Set; +type TypeB = TypeA|(Iterable&IterableIterator); +function setWithComplexInitializationType(s: TypeB) { + const set = new Set(s); +} + +function setWithUnionStringType(s: string&{toString(): string}) { + const set = new Set(s); +} + +function setWithLocalAlias() { + const TotallyNotASet = Set; + const set = new TotallyNotASet('abc'); +} + +function setWithMultipleAliases() { + const Foo = Set; + const Bar = Foo; + const Baz = Bar; + const set = new Baz('abc'); +} + +function setUsingSetConstructorType(ctor: SetConstructor) { + const set = new ctor('abc'); +} + +type MySet = SetConstructor; +function setUsingAliasedSetConstructor(ctor: MySet) { + const set = new ctor('abc'); +} From 5fa7f87225c62d13876029003924dac865a5e689 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Wed, 22 Jan 2020 15:10:12 -0800 Subject: [PATCH 250/316] Require deps of ts_library to provide DeclarationInfo PiperOrigin-RevId: 291040689 --- internal/common/compilation.bzl | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 514202ad..a514e9e6 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -57,10 +57,7 @@ COMMON_ATTRIBUTES = { ), "deps": attr.label_list( aspects = DEPS_ASPECTS, - # TODO(b/139705078): require all deps have a DeclarationInfo provider - # and remove assert_js_or_typescript_deps which is attempting - # to enforce the same thing as this. - # providers = [DeclarationInfo], + providers = [DeclarationInfo], ), "_additional_d_ts": _ADDITIONAL_D_TS, } @@ -75,17 +72,6 @@ COMMON_OUTPUTS = { "tsconfig": "%{name}_tsconfig.json", } -# TODO(plf): Enforce this at analysis time. -def assert_js_or_typescript_deps(ctx, deps = None): - # `deps` args is optinal for backward compat. - # Fallback to `ctx.attr.deps`. - deps = deps if deps != None else ctx.attr.deps - for dep in deps: - if not hasattr(dep, "typescript") and not JsInfo in dep and not DeclarationInfo in dep: - allowed_deps_msg = "Dependencies must be ts_library" - - fail("%s is neither a TypeScript nor a JS producing rule.\n%s\n" % (dep.label, allowed_deps_msg)) - _DEPSET_TYPE = type(depset()) def _collect_dep_declarations(ctx, declaration_infos): @@ -227,16 +213,10 @@ def compile_ts( if not hasattr(ctx.attr, "deps"): fail("compile_ts must either be called from a rule with a deps attr, or must be given declaration_infos") - # Validate the user inputs. - # TODO(b/139705078): remove this when we require DeclarationInfo provider on deps - assert_js_or_typescript_deps(ctx, ctx.attr.deps) - # By default, we collect dependencies from the ctx, when used as a rule declaration_infos = [ d[DeclarationInfo] for d in ctx.attr.deps + getattr(ctx.attr, "_helpers", []) - # TODO(b/139705078): remove this when we require DeclarationInfo provider on deps - if DeclarationInfo in d ] tsconfig = tsconfig if tsconfig != None else ctx.outputs.tsconfig From 5d79e42953eb8614d961ccf0e3440884e974eeb3 Mon Sep 17 00:00:00 2001 From: rjamet Date: Thu, 23 Jan 2020 05:19:57 -0800 Subject: [PATCH 251/316] Remove an obsolete TODO in Tsetse's test utils. It's been implemented in the past. PiperOrigin-RevId: 291147258 --- internal/tsetse/util/testing/test_support.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index bfbc78b1..ece3695f 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -183,7 +183,6 @@ function fixMatchesExpectation(failure: Failure, expected: FixExpectations): `${i}th individualChange's fileName`, e.fileName, a.sourceFile.fileName); } - // TODO: Consider adding matchedCode as for the failure matcher. } } From 5bce5a23345789a7c7812062309063e1b2161fa2 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Sun, 26 Jan 2020 21:06:27 -0800 Subject: [PATCH 252/316] Internal only PiperOrigin-RevId: 291652895 --- internal/tsc_wrapped/tsc_wrapped.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index e73ece5f..8d8e537a 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -343,7 +343,13 @@ export function createProgramAndEmit( // Dynamically load the Angular compiler installed as a peerDep const ngtsc = require('@angular/compiler-cli'); - angularPlugin = new ngtsc.NgTscPlugin(ngOptions); + + // TODO(alexeagle): re-enable after Angular API changes land + // See https://github.com/angular/angular/pull/34792 + // and pending CL/289493608 + // By commenting this out, we allow Angular caretaker to sync changes from + // GitHub without having to coordinate any Piper patches in the same CL. + // angularPlugin = new ngtsc.NgTscPlugin(ngOptions); } catch (e) { return { diagnostics: [errorDiag( From 77d051395c8b9e902be9d2ea4c76d788ab05bdad Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 28 Jan 2020 11:14:23 -0800 Subject: [PATCH 253/316] Improve formatting of cyclical dependency error reporting This adds a line break between dependencies, since each line tends to be very long. It's easier to understand the cycle if the actual file names are grouped closer together into a column. This change adds a newline between each dependency in the cycle to better achieve that. It also adds space between the stacktrace below and the context above. Previously: Compilation failed Error: Cyclical dependency between files: src/b.ts -> src/a.ts -> src/b.ts Now: Compilation failed Error: Cyclical dependency between files: src/b.ts -> src/a.ts -> src/b.ts PiperOrigin-RevId: 291974463 --- internal/tsc_wrapped/manifest.ts | 4 ++-- internal/tsc_wrapped/tsc_wrapped_test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/tsc_wrapped/manifest.ts b/internal/tsc_wrapped/manifest.ts index 4e5b9f64..3642dc76 100644 --- a/internal/tsc_wrapped/manifest.ts +++ b/internal/tsc_wrapped/manifest.ts @@ -22,8 +22,8 @@ function topologicalSort( if (!referencedFileName) continue; // Ambient modules. if (!result[referencedFileName]) { if (visiting[referencedFileName]) { - const path = current + ' -> ' + Object.keys(visiting).join(' -> '); - throw new Error('Cyclical dependency between files:\n' + path); + const path = [current, ...Object.keys(visiting)].join(' ->\n'); + throw new Error(`\n\nCyclical dependency between files:\n${path}\n`); } visiting[referencedFileName] = true; topologicalSort(result, referencedFileName, modulesManifest, visiting); diff --git a/internal/tsc_wrapped/tsc_wrapped_test.ts b/internal/tsc_wrapped/tsc_wrapped_test.ts index 2351cd87..ccb4eee0 100644 --- a/internal/tsc_wrapped/tsc_wrapped_test.ts +++ b/internal/tsc_wrapped/tsc_wrapped_test.ts @@ -47,7 +47,7 @@ describe('tsc wrapped', () => { f(res, 'src/f3', 'src$f3', ['src$f1']); f(res, 'src/f1', 'src$f1', ['src$f2']); expect(() => constructManifest(res, {relativeOutputPath})) - .toThrowError(/src\/f2 -> src\/f3 -> src\/f1 -> src\/f2/g); + .toThrowError(/src\/f2 ->\nsrc\/f3 ->\nsrc\/f1 ->\nsrc\/f2/g); }); it('toposorts diamonds', () => { From 4e75af0b8eafd225068cbca5a8d54feba333cd38 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 6 Feb 2020 08:57:50 -0800 Subject: [PATCH 254/316] Remove obsolete incompatible flag Close https://github.com/bazelbuild/rules_typescript/pull/487 PiperOrigin-RevId: 293602783 --- .bazelci/presubmit.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index adf16142..86727d19 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -44,6 +44,5 @@ platforms: test_flags: - "--action_env=PATH" - "--test_env=PATH" - - "--incompatible_windows_native_test_wrapper" test_targets: - "..." From 64d5aa699df23b797c5c33cc9b5d4f9ef605ae1a Mon Sep 17 00:00:00 2001 From: Yannic Date: Mon, 10 Feb 2020 09:23:35 -0800 Subject: [PATCH 255/316] Make rules_typescript compatible with --incompatible_load_proto_rules_from_bzl Closes #488 PiperOrigin-RevId: 294235496 --- .../github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel index 3b326019..5e6ed7ce 100644 --- a/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel +++ b/third_party/github.com/bazelbuild/bazel/src/main/protobuf/BUILD.bazel @@ -3,6 +3,7 @@ # The generated `@bazel/typescript` npm package contains a trimmed BUILD file using # DEV-ONLY fences. load("@io_bazel_rules_go//go:def.bzl", "go_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") package(default_visibility = ["//:__pkg__"]) From 9f4e2da7ea5ac2eb992b897f2a63cea66732fb62 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Wed, 12 Feb 2020 13:32:58 -0800 Subject: [PATCH 256/316] Switch tsc_wrapped to a .js entry point This lets it work under the linker, where the execpath to the .js file is hard to calculate from the .ts input file path. This also wires up the ts-lit-plugin under Bazel if it appears in the tsconfig settings. Closes #490 PiperOrigin-RevId: 294743226 --- .bazelci/presubmit.yml | 1 + .bazelversion | 1 + internal/BUILD.bazel | 69 ++++++++----------- internal/tsc_wrapped/tsc_wrapped.ts | 12 ++++ .../{tsconfig.json => tsconfig.json.oss} | 0 internal/tsc_wrapped/worker.ts | 11 ++- internal/tsconfig.json | 26 +++++++ package.bzl | 4 +- package.json | 18 ++--- yarn.lock | 69 +++++-------------- 10 files changed, 105 insertions(+), 106 deletions(-) create mode 100644 .bazelversion rename internal/tsc_wrapped/{tsconfig.json => tsconfig.json.oss} (100%) create mode 100644 internal/tsconfig.json diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 86727d19..9695da48 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,4 +1,5 @@ --- +bazel: 2.1.0 platforms: ubuntu1604: run_targets: diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000..50aea0e7 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +2.1.0 \ No newline at end of file diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 0c70b531..bd2aa0cd 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -17,6 +17,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") +load("@npm//typescript:index.bzl", "tsc") load("@npm_bazel_typescript//:index.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) @@ -29,43 +30,35 @@ bzl_library( visibility = ["//visibility:public"], ) -# Vanilla typescript compiler: run the tsc.js binary distributed by TypeScript -nodejs_binary( - name = "tsc", - data = [ - "@npm//source-map-support", - "@npm//typescript", +_TSC_WRAPPED_TESTS = [ + "**/test_support.ts", + "**/*_test.ts", +] + +_TSC_WRAPPED_SRCS = glob( + [ + "tsc_wrapped/*.ts", + "tsetse/**/*.ts", ], - entry_point = "@npm//:node_modules/typescript/lib/tsc.js", - visibility = ["//internal:__subpackages__"], + exclude = _TSC_WRAPPED_TESTS + ["tsetse/tests/**"], ) +_TSC_WRAPPED_JS = [k[:-3] + ".js" for k in _TSC_WRAPPED_SRCS] +_TSC_WRAPPED_TYPINGS = [k[:-3] + ".d.ts" for k in _TSC_WRAPPED_SRCS] # Build our custom compiler using the vanilla one -ts_library( +tsc( name = "tsc_wrapped", - srcs = glob( - [ - "tsc_wrapped/*.ts", - "tsetse/**/*.ts", - ], - exclude = [ - "**/test_support.ts", - "**/*_test.ts", - ], - ), - compiler = ":tsc", - data = [ - "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", + args = [ + "--declaration", + "-p", + "$(execpath //internal:tsconfig.json)", + "--outDir", + "$(RULEDIR)", ], - module_name = "@bazel/typescript", - module_root = "tsc_wrapped/index.d.ts", - supports_workers = False, - tsconfig = "//internal:tsc_wrapped/tsconfig.json", + outs = _TSC_WRAPPED_JS + _TSC_WRAPPED_TYPINGS, visibility = ["//visibility:public"], - # Cannot have any deps (except npm fine grained deps) because it doesn't - # work with vanilla tsc. - # Workaround for https://github.com/Microsoft/TypeScript/issues/22208 - deps = [ + data = _TSC_WRAPPED_SRCS + [ + "//internal:tsconfig.json", "@npm//@types/node", "@npm//protobufjs", "@npm//tsickle", @@ -88,23 +81,16 @@ nodejs_binary( "@npm//tsutils", "@npm//typescript", ], - entry_point = ":tsc_wrapped/tsc_wrapped.ts", + entry_point = ":tsc_wrapped/tsc_wrapped.js", visibility = ["//visibility:public"], ) ts_library( name = "test_lib", - srcs = glob([ - "tsc_wrapped/*_test.ts", - "tsetse/**/*_test.ts", - ]) + [ - "tsc_wrapped/test_support.ts", - "tsetse/util/testing/test_support.ts", - ], + srcs = glob(_TSC_WRAPPED_TESTS) + _TSC_WRAPPED_TYPINGS, compiler = "@build_bazel_rules_typescript//internal:tsc_wrapped_bin", - tsconfig = "//internal:tsc_wrapped/tsconfig.json", + tsconfig = "//internal:tsconfig.json", deps = [ - ":tsc_wrapped", "@npm//@types/jasmine", "@npm//@types/node", "@npm//tsickle", @@ -115,8 +101,9 @@ ts_library( jasmine_node_test( name = "test", srcs = [], - deps = [ + deps = _TSC_WRAPPED_JS + [ ":test_lib", + "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto", "@npm//jasmine", "@npm//protobufjs", "@npm//source-map", diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 8d8e537a..848ba2e5 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -371,6 +371,18 @@ export function createProgramAndEmit( compilerHost.inputFiles, options, compilerHost, oldProgram)); cache.putProgram(bazelOpts.target, program); + for (const pluginConfig of options['plugins'] as ts.PluginImport[] || []) { + if (pluginConfig.name === 'ts-lit-plugin') { + const litTscPlugin = + // Lazy load, so that code that does not use the plugin doesn't even + // have to spend the time to parse and load the plugin's source. + // + // tslint:disable-next-line:no-require-imports + new (require('ts-lit-plugin/lib/bazel-plugin').Plugin)( + program, pluginConfig) as DiagnosticPlugin; + diagnosticPlugins.push(litTscPlugin); + } + } if (!bazelOpts.isJsTranspilation) { // If there are any TypeScript type errors abort now, so the error diff --git a/internal/tsc_wrapped/tsconfig.json b/internal/tsc_wrapped/tsconfig.json.oss similarity index 100% rename from internal/tsc_wrapped/tsconfig.json rename to internal/tsc_wrapped/tsconfig.json.oss diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index f6bc505a..71fdf259 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -88,8 +88,15 @@ function loadWorkerPb() { // workspace location // This extra lookup should never happen in google3. It's only needed for // local development in the rules_typescript repo. - protofile = require.resolve( - 'build_bazel_rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'); + + const runfiles = process.env['BAZEL_NODE_RUNFILES_HELPER']; + if (runfiles) { + protofile = require(runfiles).resolve( + 'build_bazel_rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'); + } else { + protofile = + 'build_bazel_rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; + } } const protoNamespace = protobufjs.loadSync(protofile); diff --git a/internal/tsconfig.json b/internal/tsconfig.json new file mode 100644 index 00000000..f69878c7 --- /dev/null +++ b/internal/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "strict": true, + "module": "CommonJS", + "target": "ES2015", + "types": [ + "node", + ], + "lib": [ + "dom", + "es5", + "es2015.core", + "es2015.collection", + "es2015.promise", + // This will need to become es2018.asynciterable when + // bumping the version of TypeScript in rules_typescript/package.json + "es2018.asynciterable" + ] + }, + // We run the plain tsc compiler so we need to exclude files we don't want it to visit + "exclude": [ + "**/test_support.ts", + "**/*_test.ts", + "*/tests" + ] +} diff --git a/package.bzl b/package.bzl index cb33eab9..1d77473f 100644 --- a/package.bzl +++ b/package.bzl @@ -30,8 +30,8 @@ def rules_typescript_dev_dependencies(): _maybe( http_archive, name = "build_bazel_rules_nodejs", - sha256 = "3887b948779431ac443e6a64f31b9e1e17b8d386a31eebc50ec1d9b0a6cabd2b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.0.0/rules_nodejs-1.0.0.tar.gz"], + sha256 = "b6670f9f43faa66e3009488bbd909bc7bc46a5a9661a33f6bc578068d1837f37", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.3.0/rules_nodejs-1.3.0.tar.gz"], ) # For protocol buffers diff --git a/package.json b/package.json index c87382d8..8854919a 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,14 @@ "homepage": "https://github.com/bazelbuild/rules_typescript", "license": "Apache-2.0", "devDependencies": { - "@bazel/bazel": "^2.0.0", + "@bazel/bazelisk": "^1.3.0", "@bazel/buildifier": "^0.29.0", "@bazel/ibazel": "^0.11.0", "@bazel/jasmine": "^1.0.0", "@bazel/typescript": "^1.0.0", "@types/jasmine": "^2.8.2", "@types/long": "^4.0.0", - "@types/node": "10.12.20", + "@types/node": "^12.0.0", "@types/source-map": "^0.5.1", "@types/tmp": "^0.0.33", "clang-format": "1.0.49", @@ -32,17 +32,17 @@ "shelljs": "^0.8.2", "source-map-support": "0.5.9", "tmp": "0.0.33", - "tsickle": "0.33.1", + "tsickle": "0.38.0", "tsutils": "2.27.2", - "typescript": "~3.1.6", + "typescript": "^3.7.5", "which": "~1.0.5" }, "scripts": { - "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e", + "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazelisk build //examples/app:e2e //examples/protocol_buffers:e2e", "e2e": "yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver", - "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", - "e2e-examples-app-prodserver": "concurrently \"bazel run //examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", - "e2e-examples-protobuf-devserver": "concurrently \"bazel run //examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", - "e2e-examples-protobuf-prodserver": "concurrently \"bazel run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first" + "e2e-examples-app-devserver": "concurrently \"bazelisk run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", + "e2e-examples-app-prodserver": "concurrently \"bazelisk run //examples/app:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first", + "e2e-examples-protobuf-devserver": "concurrently \"bazelisk run //examples/protocol_buffers:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first", + "e2e-examples-protobuf-prodserver": "concurrently \"bazelisk run //examples/protocol_buffers:prodserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite protocol_buffers\" --kill-others --success first" } } diff --git a/yarn.lock b/yarn.lock index f60c13d2..90b98923 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,31 +2,10 @@ # yarn lockfile v1 -"@bazel/bazel-darwin_x64@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-2.0.0.tgz#bd678069216dd470c6816a22c405f21e7f048038" - integrity sha512-I/pP+B+2xfY0g+OEpEcVnk8rizuC761pAzBOQjP3b+gz3AzeRgm05CpcSY7tfPIppMSYoy3uTZJ1XlwgUg7IQQ== - -"@bazel/bazel-linux_x64@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-2.0.0.tgz#2c76e3301e9178a90ec3ad00649e89b953eda0b7" - integrity sha512-iOr45G+511IbP7e+ISriG97WpfCAVXekTrTgL5mGg3NDBFCVNs350VquHAvmlXAoP5+IEug2pCOlkdEl4bLl8g== - -"@bazel/bazel-win32_x64@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-2.0.0.tgz#f12ac0738d2eac0fd255f099776194807cedfe50" - integrity sha512-5qs2qoa/paG/YYEM0yvrwuJIShoPVK2FX+Oz9jEWAQJsmU4drHA9Aq+gbBOirEFLmvYhleZ9XORCwu/5uAo8vA== - -"@bazel/bazel@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-2.0.0.tgz#feb8cf5a40ea6437ef69cac2a92072118b11c230" - integrity sha512-KQbv5dHNSfutbhXCc3KVMuBXPpUh6Af/hT9IRIaMTuiB6Nq2gEW9Z3aNqncopdZqV848V/qYxnqPnQ+S37fMyQ== - dependencies: - "@bazel/hide-bazel-files" latest - optionalDependencies: - "@bazel/bazel-darwin_x64" "2.0.0" - "@bazel/bazel-linux_x64" "2.0.0" - "@bazel/bazel-win32_x64" "2.0.0" +"@bazel/bazelisk@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.3.0.tgz#dc312dd30ad01e9af86e53b40795ab6e545fa55b" + integrity sha512-73H1nq3572tTf+dhDT86aWQN+LCyfxrh05jabqPXp6cpR8soxte3gS5oUqkN36fUe+J2HzNiV4CXZTz4Xytd3Q== "@bazel/buildifier-darwin_x64@0.29.0": version "0.29.0" @@ -52,11 +31,6 @@ "@bazel/buildifier-linux_x64" "0.29.0" "@bazel/buildifier-win32_x64" "0.29.0" -"@bazel/hide-bazel-files@latest": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.0.0.tgz#779070dcb5ae121ff6c72d73bf3fb7bf68285d75" - integrity sha512-dfw2W7xDUPlRMcDMVO8gDkX9Xb7Thy3sP4PDODv+eiHOvwIi116X/wwy7mQUZISkJdEJ1zWy9ydpzvfetpYh4w== - "@bazel/ibazel@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.11.0.tgz#6879c8032f5bee81ca632456304c16525160f47f" @@ -144,16 +118,16 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q== -"@types/node@10.12.20": - version "10.12.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.20.tgz#f79f959acd3422d0889bd1ead1664bd2d17cd367" - integrity sha512-9spv6SklidqxevvZyOUGjZVz4QRXGu2dNaLyXIFzFYZW0AGDykzPRIUFJXTlQXyfzAucddwTcGtJNim8zqSOPA== - "@types/node@^10.1.0": version "10.14.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.6.tgz#9cbfcb62c50947217f4d88d4d274cc40c22625a9" integrity sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg== +"@types/node@^12.0.0": + version "12.12.27" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.27.tgz#d7506f73160ad30fcebbcf5b8b7d2d976e649e42" + integrity sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A== + "@types/node@^6.0.46": version "6.0.92" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.92.tgz#e7f721ae282772e12ba2579968c00d9cce422c5d" @@ -3195,11 +3169,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - spawn-command@^0.0.2-1: version "0.0.2" resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" @@ -3464,14 +3433,10 @@ tree-kill@^1.1.0: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" integrity sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg== -tsickle@0.33.1: - version "0.33.1" - resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.33.1.tgz#eee4ebabeda3bcd8afc32cee34c822cbe3e839ec" - integrity sha512-SpW2G3PvDGs4a5sMXPlWnCWHWRviWjSlI3U0734e3fU3U39VAE0NPr8M3W1cuL/OU/YXheYipGeEwtIJ5k0NHQ== - dependencies: - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map "^0.7.3" +tsickle@0.38.0: + version "0.38.0" + resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.38.0.tgz#89f5952c9bb3ba0b36dc384975e23cf90e584822" + integrity sha512-k7kI6afBuLd2jIrj9JR8lKhEkp99sFVRKQbHeaHQkdvDaH5AvzwqA/qX+aNj28OfuAsWryOKAZoXm24l7JelEw== tslib@^1.8.1: version "1.9.0" @@ -3505,10 +3470,10 @@ type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" -typescript@~3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" - integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== +typescript@^3.7.5: + version "3.7.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" + integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw== uglify-js@^3.1.4: version "3.7.4" From 0ee90d34affc58b5146a4c78bf139dbfe4c2f6e7 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 17 Feb 2020 23:17:24 -0800 Subject: [PATCH 257/316] Fix null dereference of angularPlugin. PiperOrigin-RevId: 295670447 --- internal/tsc_wrapped/tsc_wrapped.ts | 4 +++- internal/tsc_wrapped/worker.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 848ba2e5..659a91ad 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -360,7 +360,9 @@ export function createProgramAndEmit( // Wrap host only needed until after Ivy cleanup // TODO(alexeagle): remove after ngsummary and ngfactory files eliminated - compilerHost = angularPlugin!.wrapHost!(files, compilerHost); + if (angularPlugin) { + compilerHost = angularPlugin.wrapHost!(files, compilerHost); + } } diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 71fdf259..2a6d1eec 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -72,7 +72,7 @@ declare namespace workerProto { */ function loadWorkerPb() { const protoPath = - '../../third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; + './third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; // Use node module resolution so we can find the .proto file in any of the // root dirs From 77c69906c4b87a373e54a0ebfc9a91c1f3b3c024 Mon Sep 17 00:00:00 2001 From: evanm Date: Tue, 18 Feb 2020 11:00:44 -0800 Subject: [PATCH 258/316] construct plugins just before using them The common plugins includes the tsetse plugin, which grabs the Program's TypeChecker as part of its construction, which causes TS to do a bunch of work. By moving the plugin construction here, that work happens in the code above (where we explicitly ask TS for diagnostics), which makes perf trace accounting for type checking more accurate. PiperOrigin-RevId: 295773738 --- internal/tsc_wrapped/tsc_wrapped.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 659a91ad..442ce6f4 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -64,9 +64,6 @@ export function gatherDiagnostics( options: ts.CompilerOptions, bazelOpts: BazelOptions, program: ts.Program, disabledTsetseRules: string[], angularPlugin?: TscPlugin, plugins: DiagnosticPlugin[] = []): ts.Diagnostic[] { - // Install extra diagnostic plugins - plugins.push( - ...getCommonPlugins(options, bazelOpts, program, disabledTsetseRules)); if (angularPlugin) { program = angularPlugin.wrap(program); } @@ -94,6 +91,10 @@ export function gatherDiagnostics( }); perfTrace.snapshotMemoryUsage(); } + + // Install extra diagnostic plugins + plugins.push( + ...getCommonPlugins(options, bazelOpts, program, disabledTsetseRules)); for (const plugin of plugins) { perfTrace.wrap(`${plugin.name} diagnostics`, () => { for (const sf of sourceFilesToCheck) { From 80c60c0415ff03a28e74e4b0a32253a34c51745b Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 18 Feb 2020 17:23:38 -0800 Subject: [PATCH 259/316] Deleting the google-internal path for ts-lit-plugin in favor of the open source one. PiperOrigin-RevId: 295860542 --- internal/common/tsconfig.bzl | 3 ++- internal/tsc_wrapped/tsconfig.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 4c4427dc..14b4df5c 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -162,7 +162,6 @@ def create_tsconfig( if hasattr(ctx.attr, "compile_angular_templates") and ctx.attr.compile_angular_templates: bazel_options["compileAngularTemplates"] = True - if disable_strict_deps: bazel_options["disableStrictDeps"] = disable_strict_deps bazel_options["allowedStrictDeps"] = [] @@ -263,8 +262,10 @@ def create_tsconfig( "inlineSources": True, # Implied by inlineSourceMap: True "sourceMap": False, + "plugins": [], } + if hasattr(ctx.attr, "node_modules"): compiler_options["typeRoots"] = ["/".join([p for p in [ workspace_path, diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index a50ac1cc..13851ca7 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -183,7 +183,6 @@ export interface BazelOptions { */ compileAngularTemplates?: boolean; - /** * Override for ECMAScript target language level to use for devmode. * From 881f442c51386ef44f87627ff72df981aafd95b4 Mon Sep 17 00:00:00 2001 From: evanm Date: Wed, 19 Feb 2020 10:41:41 -0800 Subject: [PATCH 260/316] clarify why expected_diagostics isn't available to everyone Someone was wondering why it had this whitelist, so add a bit more info to the comment. PiperOrigin-RevId: 296003095 --- internal/tsc_wrapped/tsc_wrapped.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 442ce6f4..24e2e6ee 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -286,7 +286,10 @@ function runOneBuild( return true; } -// We only allow our own code to use the expected_diagnostics attribute +// We use the expected_diagnostics attribute for writing compilation tests. +// We don't want to expose it to users as a general-purpose feature, because +// we don't want users to end up using it like a fancy @ts-ignore. +// So instead it's limited to a whitelist. const expectDiagnosticsWhitelist: string[] = [ ]; From 906637aabd653a0a7b7efb4d47641b30b3fd51b5 Mon Sep 17 00:00:00 2001 From: evanm Date: Fri, 21 Feb 2020 11:19:02 -0800 Subject: [PATCH 261/316] don't stat() all input files As part of transpilation we might receive directories as input files. To check, we tested each file for whether it was a directory or not. This disk access evaded our various caches. To fix: 1. only check for directories in transpilation; 2. when checking for directories, assume names ending in sourc file extensions like ".js" are not directories. PiperOrigin-RevId: 296473783 --- internal/tsc_wrapped/tsc_wrapped.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 24e2e6ee..077a9480 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -177,11 +177,14 @@ function tagDiagnosticWithPlugin( * them to their .js or .ts contents. */ function expandSourcesFromDirectories(fileList: string[], filePath: string) { + if (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || + filePath.endsWith('.js')) { + fileList.push(filePath); + return; + } + if (!fs.statSync(filePath).isDirectory()) { - if (filePath.endsWith('.ts') || filePath.endsWith('.tsx') || - filePath.endsWith('.js')) { - fileList.push(filePath); - } + // subdirectories may also contain e.g. .java files, which we ignore. return; } const entries = fs.readdirSync(filePath); @@ -223,10 +226,14 @@ function runOneBuild( angularCompilerOptions } = parsed; - const sourceFiles: string[] = []; - for (let i = 0; i < files.length; i++) { - const filePath = files[i]; - expandSourcesFromDirectories(sourceFiles, filePath); + let sourceFiles: string[] = []; + if (bazelOpts.isJsTranspilation) { + // Under JS transpilations, some inputs might be directories. + for (const filePath of files) { + expandSourcesFromDirectories(sourceFiles, filePath); + } + } else { + sourceFiles = files; } if (bazelOpts.maxCacheSizeMb !== undefined) { From 122cc04124450fdf27c4dcd749f411c5fe4886c5 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 24 Feb 2020 11:12:52 -0800 Subject: [PATCH 262/316] Fix worker loading when using require.resolve The breakage was observed downstream in @bazel/worker package which no longer worked. Closes #491 PiperOrigin-RevId: 296932382 --- internal/tsc_wrapped/worker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 2a6d1eec..0a3239d5 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -88,14 +88,14 @@ function loadWorkerPb() { // workspace location // This extra lookup should never happen in google3. It's only needed for // local development in the rules_typescript repo. - const runfiles = process.env['BAZEL_NODE_RUNFILES_HELPER']; if (runfiles) { protofile = require(runfiles).resolve( 'build_bazel_rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'); - } else { - protofile = - 'build_bazel_rules_typescript/third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; + } + if (!protofile) { + throw new Error( + `cannot find worker_protocol.proto at ${protoPath} or in Runfiles`); } } From 571f38e70629a5a859f3e550fa95310c26a2fa94 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Tue, 25 Feb 2020 13:03:18 -0800 Subject: [PATCH 263/316] Wire up Angular 9 templates as a ts_library plugin PiperOrigin-RevId: 297183761 --- internal/common/compilation.bzl | 10 ++- internal/common/tsconfig.bzl | 14 +++- internal/tsc_wrapped/plugin_api.ts | 33 +++----- internal/tsc_wrapped/tsc_wrapped.ts | 115 ++++++++++++++++------------ internal/tsc_wrapped/tsconfig.ts | 16 +++- 5 files changed, 106 insertions(+), 82 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index a514e9e6..8e36bfac 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -156,7 +156,7 @@ def _outputs(ctx, label, srcs_files = []): # Temporary until all imports of ngfactory/ngsummary files are removed # TODO(alexeagle): clean up after Ivy launch - if getattr(ctx, "compile_angular_templates", False): + if getattr(ctx.attr, "use_angular_plugin", False): closure_js_files += [ctx.actions.declare_file(basename + ".ngfactory.mjs")] closure_js_files += [ctx.actions.declare_file(basename + ".ngsummary.mjs")] @@ -166,9 +166,11 @@ def _outputs(ctx, label, srcs_files = []): # Temporary until all imports of ngfactory/ngsummary files are removed # TODO(alexeagle): clean up after Ivy launch - if getattr(ctx, "compile_angular_templates", False): + if getattr(ctx.attr, "use_angular_plugin", False): devmode_js_files += [ctx.actions.declare_file(basename + ".ngfactory.js")] devmode_js_files += [ctx.actions.declare_file(basename + ".ngsummary.js")] + declaration_files += [ctx.actions.declare_file(basename + ".ngfactory.d.ts")] + declaration_files += [ctx.actions.declare_file(basename + ".ngsummary.d.ts")] return struct( closure_js = closure_js_files, devmode_js = devmode_js_files, @@ -336,7 +338,7 @@ def compile_ts( replay_params = None if has_sources: - inputs = compilation_inputs + [tsconfig] + inputs = compilation_inputs + [tsconfig] + getattr(ctx.files, "angular_assets", []) replay_params = compile_action( ctx, inputs, @@ -382,7 +384,7 @@ def compile_ts( )) devmode_compile_action( ctx, - compilation_inputs + [tsconfig_json_es5], + compilation_inputs + [tsconfig_json_es5] + getattr(ctx.files, "angular_assets", []), outputs, tsconfig_json_es5, node_profile_args, diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 14b4df5c..d30b1c55 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -159,8 +159,18 @@ def create_tsconfig( "expectedDiagnostics": getattr(ctx.attr, "expected_diagnostics", []), } - if hasattr(ctx.attr, "compile_angular_templates") and ctx.attr.compile_angular_templates: - bazel_options["compileAngularTemplates"] = True + if getattr(ctx.attr, "use_angular_plugin", False): + bazel_options["angularCompilerOptions"] = { + # Needed for back-compat with explicit AOT bootstrap + # which has imports from generated .ngfactory files + "generateNgFactoryShims": True, + # Needed for back-compat with AOT tests which import the + # .ngsummary files + "generateNgSummaryShims": True, + # Bazel expects output files will always be produced + "allowEmptyCodegenFiles": True, + "assets": [a.path for a in getattr(ctx.files, "angular_assets", [])], + } if disable_strict_deps: bazel_options["disableStrictDeps"] = disable_strict_deps diff --git a/internal/tsc_wrapped/plugin_api.ts b/internal/tsc_wrapped/plugin_api.ts index e09954d3..2bcfa210 100644 --- a/internal/tsc_wrapped/plugin_api.ts +++ b/internal/tsc_wrapped/plugin_api.ts @@ -17,8 +17,8 @@ /** * @fileoverview - * Provides APIs for extending TypeScript. - * Based on the LanguageService plugin API in TS 2.3 + * Provides APIs for extending TypeScript command-line compiler. + * It's roughly analogous to how the Language Service allows plugins. */ import * as ts from 'typescript'; @@ -29,13 +29,6 @@ export interface PluginCompilerHost extends ts.CompilerHost { * In vanilla tsc, these are the ts.ParsedCommandLine#fileNames */ inputFiles: ReadonlyArray; - - /** - * A helper the transformer can use when generating new import statements - * @param fileName the absolute path to the file as referenced in the ts.Program - * @return a string suitable for use in an import statement - */ - fileNameToModuleId: (fileName: string) => string; } /** @@ -48,10 +41,10 @@ export interface PluginCompilerHost extends ts.CompilerHost { * * The methods on the plugin will be called in the order shown below: * - wrapHost to intercept CompilerHost methods and contribute inputFiles to the program - * - wrap to intercept diagnostics requests on the program + * - setupCompilation to capture the ts.Program * - createTransformers once it's time to emit */ -export interface TscPlugin { +export interface EmitPlugin { /** * Allow plugins to add additional files to the program. * For example, Angular creates ngsummary and ngfactory files. @@ -59,27 +52,19 @@ export interface TscPlugin { * @param inputFiles the files that were part of the original program * @param compilerHost: the original host (likely a ts.CompilerHost) that we can delegate to */ - wrapHost?(inputFiles: string[], compilerHost: PluginCompilerHost): PluginCompilerHost; + wrapHost?(compilerHost: ts.CompilerHost, inputFiles: string[], options: ts.CompilerOptions): PluginCompilerHost; - /** - * Same API as ts.LanguageService: allow the plugin to contribute additional - * diagnostics - * IMPORTANT: plugins must propagate the diagnostics from the original program. - * Execution of plugins is not additive; only the result from the top-most - * wrapped Program is used. - */ - wrap(p: ts.Program, config?: {}, host?: ts.CompilerHost): ts.Program; + setupCompilation(program: ts.Program, oldProgram?: ts.Program): void; + getNextProgram?(): ts.Program; + /** * Allow plugins to contribute additional TypeScript CustomTransformers. * These can modify the TS AST, JS AST, or .d.ts output AST. */ - createTransformers?(host: PluginCompilerHost): ts.CustomTransformers; + createTransformers(): ts.CustomTransformers; } -// TODO(alexeagle): this should be unioned with tsserverlibrary.PluginModule -export type Plugin = TscPlugin; - /** * The proxy design pattern, allowing us to customize behavior of the delegate * object. diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 077a9480..71ca1eea 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -10,7 +10,7 @@ import {CompilerHost} from './compiler_host'; import * as bazelDiagnostics from './diagnostics'; import {constructManifest} from './manifest'; import * as perfTrace from './perf_trace'; -import {DiagnosticPlugin, PluginCompilerHost, TscPlugin} from './plugin_api'; +import {DiagnosticPlugin, PluginCompilerHost, EmitPlugin} from './plugin_api'; import {Plugin as StrictDepsPlugin} from './strict_deps'; import {BazelOptions, parseTsconfig, resolveNormalizedPath} from './tsconfig'; import {debug, log, runAsWorker, runWorkerLoop} from './worker'; @@ -62,11 +62,8 @@ function isCompilationTarget( */ export function gatherDiagnostics( options: ts.CompilerOptions, bazelOpts: BazelOptions, program: ts.Program, - disabledTsetseRules: string[], angularPlugin?: TscPlugin, + disabledTsetseRules: string[], plugins: DiagnosticPlugin[] = []): ts.Diagnostic[] { - if (angularPlugin) { - program = angularPlugin.wrap(program); - } const diagnostics: ts.Diagnostic[] = []; perfTrace.wrap('type checking', () => { @@ -218,13 +215,7 @@ function runOneBuild( throw new Error( 'Impossible state: if parseTsconfig returns no errors, then parsed should be non-null'); } - const { - options, - bazelOpts, - files, - disabledTsetseRules, - angularCompilerOptions - } = parsed; + const {options, bazelOpts, files, disabledTsetseRules} = parsed; let sourceFiles: string[] = []; if (bazelOpts.isJsTranspilation) { @@ -259,8 +250,7 @@ function runOneBuild( const perfTracePath = bazelOpts.perfTracePath; if (!perfTracePath) { const {diagnostics} = createProgramAndEmit( - fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, - angularCompilerOptions); + fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules); if (diagnostics.length > 0) { console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); return false; @@ -271,8 +261,7 @@ function runOneBuild( log('Writing trace to', perfTracePath); const success = perfTrace.wrap('runOneBuild', () => { const {diagnostics} = createProgramAndEmit( - fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules, - angularCompilerOptions); + fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules); if (diagnostics.length > 0) { console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); return false; @@ -321,8 +310,7 @@ function errorDiag(messageText: string) { */ export function createProgramAndEmit( fileLoader: FileLoader, options: ts.CompilerOptions, - bazelOpts: BazelOptions, files: string[], disabledTsetseRules: string[], - angularCompilerOptions?: {[key: string]: unknown}): + bazelOpts: BazelOptions, files: string[], disabledTsetseRules: string[]): {program?: ts.Program, diagnostics: ts.Diagnostic[]} { // Beware! createProgramAndEmit must not print to console, nor exit etc. // Handle errors by reporting and returning diagnostics. @@ -336,44 +324,52 @@ export function createProgramAndEmit( const moduleResolver = bazelOpts.isJsTranspilation ? makeJsModuleResolver(bazelOpts.workspaceName) : ts.resolveModuleName; + + // Files which should be allowed to be read, but aren't TypeScript code + const assets: string[] = []; + if (bazelOpts.angularCompilerOptions) { + if (bazelOpts.angularCompilerOptions.assets) { + assets.push(...bazelOpts.angularCompilerOptions.assets); + } + } + const tsickleCompilerHost = new CompilerHost( - files, options, bazelOpts, compilerHostDelegate, fileLoader, + [...files, ...assets], options, bazelOpts, compilerHostDelegate, fileLoader, moduleResolver); let compilerHost: PluginCompilerHost = tsickleCompilerHost; const diagnosticPlugins: DiagnosticPlugin[] = []; - let angularPlugin: TscPlugin|undefined; - if (bazelOpts.compileAngularTemplates) { + let angularPlugin: EmitPlugin&DiagnosticPlugin|undefined; + if (bazelOpts.angularCompilerOptions) { try { - const ngOptions = angularCompilerOptions || {}; + const ngOptions = bazelOpts.angularCompilerOptions; // Add the rootDir setting to the options passed to NgTscPlugin. // Required so that synthetic files added to the rootFiles in the program // can be given absolute paths, just as we do in tsconfig.ts, matching // the behavior in TypeScript's tsconfig parsing logic. ngOptions['rootDir'] = options.rootDir; - // Dynamically load the Angular compiler installed as a peerDep - const ngtsc = require('@angular/compiler-cli'); + let angularPluginEntryPoint = '@angular/compiler-cli'; - // TODO(alexeagle): re-enable after Angular API changes land - // See https://github.com/angular/angular/pull/34792 - // and pending CL/289493608 - // By commenting this out, we allow Angular caretaker to sync changes from - // GitHub without having to coordinate any Piper patches in the same CL. - // angularPlugin = new ngtsc.NgTscPlugin(ngOptions); + // Dynamically load the Angular compiler. + // Lazy load, so that code that does not use the plugin doesn't even + // have to spend the time to parse and load the plugin's source. + // + // tslint:disable-next-line:no-require-imports + const ngtsc = require(angularPluginEntryPoint); + angularPlugin = new ngtsc.NgTscPlugin(ngOptions); + diagnosticPlugins.push(angularPlugin!); } catch (e) { return { diagnostics: [errorDiag( - 'when using `ts_library(compile_angular_templates=True)`, ' + + 'when using `ts_library(use_angular_plugin=True)`, ' + `you must install @angular/compiler-cli (was: ${e})`)] }; } - // Wrap host only needed until after Ivy cleanup - // TODO(alexeagle): remove after ngsummary and ngfactory files eliminated - if (angularPlugin) { - compilerHost = angularPlugin.wrapHost!(files, compilerHost); - } + // Wrap host so that Ivy compiler can add a file to it (has synthetic types for checking templates) + // TODO(arick): remove after ngsummary and ngfactory files eliminated + compilerHost = angularPlugin!.wrapHost!(compilerHost, files, options); } @@ -384,6 +380,16 @@ export function createProgramAndEmit( compilerHost.inputFiles, options, compilerHost, oldProgram)); cache.putProgram(bazelOpts.target, program); + let transformers: ts.CustomTransformers = { + before: [], + after: [], + afterDeclarations: [], + }; + if (angularPlugin) { + angularPlugin.setupCompilation(program); + transformers = angularPlugin.createTransformers(); + } + for (const pluginConfig of options['plugins'] as ts.PluginImport[] || []) { if (pluginConfig.name === 'ts-lit-plugin') { const litTscPlugin = @@ -402,8 +408,7 @@ export function createProgramAndEmit( // messages refer to the original source. After any subsequent passes // (decorator downleveling or tsickle) we do not type check. let diagnostics = gatherDiagnostics( - options, bazelOpts, program, disabledTsetseRules, angularPlugin, - diagnosticPlugins); + options, bazelOpts, program, disabledTsetseRules, diagnosticPlugins); if (!expectDiagnosticsWhitelist.length || expectDiagnosticsWhitelist.some(p => bazelOpts.target.startsWith(p))) { diagnostics = bazelDiagnostics.filterExpected( @@ -415,33 +420,43 @@ export function createProgramAndEmit( 'expected_diagnostics, but got ' + bazelOpts.target)); } + // The Angular plugin creates a new program with template type-check information + // This consumes (destroys) the old program so it's not suitable for re-use anymore + // Ask Angular to give us the updated reusable program. + if (angularPlugin) { + cache.putProgram(bazelOpts.target, angularPlugin.getNextProgram!()); + } + if (diagnostics.length > 0) { debug('compilation failed at', new Error().stack!); return {program, diagnostics}; } } + // Angular might have added files like input.ngfactory.ts or input.ngsummary.ts + // and these need to be emitted. + // TODO(arick): remove after Ivy is enabled and ngsummary/ngfactory files no longer needed + function isAngularFile(sf: ts.SourceFile) { + if (!/\.ng(factory|summary)\.ts$/.test(sf.fileName)) { + return false; + } + return isCompilationTarget(bazelOpts, { + fileName: sf.fileName.slice(0, /*'.ngfactory|ngsummary.ts'.length*/ -13) + '.ts' + } as ts.SourceFile); + } + const compilationTargets = program.getSourceFiles().filter( - fileName => isCompilationTarget(bazelOpts, fileName)); + sf => isCompilationTarget(bazelOpts, sf) || isAngularFile(sf)); let diagnostics: ts.Diagnostic[] = []; let useTsickleEmit = bazelOpts.tsickle; - let transforms: ts.CustomTransformers = { - before: [], - after: [], - afterDeclarations: [], - }; - - if (angularPlugin) { - transforms = angularPlugin.createTransformers!(compilerHost); - } if (useTsickleEmit) { diagnostics = emitWithTsickle( program, tsickleCompilerHost, compilationTargets, options, bazelOpts, - transforms); + transformers); } else { - diagnostics = emitWithTypescript(program, compilationTargets, transforms); + diagnostics = emitWithTypescript(program, compilationTargets, transformers); } if (diagnostics.length > 0) { diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index 13851ca7..be964ebc 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -179,9 +179,17 @@ export interface BazelOptions { hasImplementation?: boolean; /** - * Enable the Angular ngtsc plugin. + * If present, run the Angular ngtsc plugin with the given options. */ - compileAngularTemplates?: boolean; + angularCompilerOptions?: { + [k: string]: any, + assets: string[], + // Ideally we would + // import {AngularCompilerOptions} from '@angular/compiler-cli'; + // and the type would be AngularCompilerOptions&{assets: string[]}; + // but we don't want a dependency from @bazel/typescript to @angular/compiler-cli + // as it's conceptually cyclical. + }; /** * Override for ECMAScript target language level to use for devmode. @@ -372,6 +380,10 @@ export function parseTsconfig( bazelOpts.nodeModulesPrefix = resolveNormalizedPath(options.rootDir!, bazelOpts.nodeModulesPrefix); } + if (bazelOpts.angularCompilerOptions && bazelOpts.angularCompilerOptions.assets) { + bazelOpts.angularCompilerOptions.assets = bazelOpts.angularCompilerOptions.assets.map( + f => resolveNormalizedPath(options.rootDir!, f)); + } let disabledTsetseRules: string[] = []; for (const pluginConfig of options['plugins'] as PluginImportWithConfig[] || From 510e9ecaf274ccc7571167dff098af8095d6a256 Mon Sep 17 00:00:00 2001 From: alexeagle Date: Tue, 25 Feb 2020 14:23:57 -0800 Subject: [PATCH 264/316] Don't initialize tsconfig with empty plugins. That overrides the user's selected plugins. PiperOrigin-RevId: 297202791 --- internal/common/tsconfig.bzl | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index d30b1c55..fc1d6f75 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -17,7 +17,6 @@ load(":common/module_mappings.bzl", "get_module_mappings") - _DEBUG = False def create_tsconfig( @@ -272,10 +271,8 @@ def create_tsconfig( "inlineSources": True, # Implied by inlineSourceMap: True "sourceMap": False, - "plugins": [], } - if hasattr(ctx.attr, "node_modules"): compiler_options["typeRoots"] = ["/".join([p for p in [ workspace_path, From 10a5a86885f95ab788fd841ade47b6a16e0c13d6 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 26 Feb 2020 14:49:32 -0800 Subject: [PATCH 265/316] Restore worker_protocol.proto path PiperOrigin-RevId: 297453665 --- internal/tsc_wrapped/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tsc_wrapped/worker.ts b/internal/tsc_wrapped/worker.ts index 0a3239d5..94d3bbb3 100644 --- a/internal/tsc_wrapped/worker.ts +++ b/internal/tsc_wrapped/worker.ts @@ -72,7 +72,7 @@ declare namespace workerProto { */ function loadWorkerPb() { const protoPath = - './third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; + '../../third_party/github.com/bazelbuild/bazel/src/main/protobuf/worker_protocol.proto'; // Use node module resolution so we can find the .proto file in any of the // root dirs From 537bcdef3ad58e4a1f9dd0512d1453de1eadab72 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 4 Mar 2020 12:23:55 -0800 Subject: [PATCH 266/316] Add BANNED_PROPERTY_READ to TS Conformance PiperOrigin-RevId: 298911342 --- .../tsetse/rules/conformance_pattern_rule.ts | 4 + .../property_read_test.ts | 82 ++++++++++++++++++ internal/tsetse/util/pattern_config.ts | 1 + .../pattern_engines/property_read_engine.ts | 83 +++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts create mode 100644 internal/tsetse/util/pattern_engines/property_read_engine.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index feb72c26..5b33edc8 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -7,6 +7,7 @@ import {CallNonConstantArgumentEngine} from '../util/pattern_engines/name_call_n import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; +import {PropertyReadEngine} from '../util/pattern_engines/property_read_engine'; import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; @@ -37,6 +38,9 @@ export class ConformancePatternRule implements AbstractRule { case PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT: this.engine = new CallNonConstantArgumentEngine(config, fixer); break; + case PatternKind.BANNED_PROPERTY_READ: + this.engine = new PropertyReadEngine(config, fixer); + break; default: throw new Error('Config type not recognized, or not implemented yet.'); } diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts new file mode 100644 index 00000000..1a09e819 --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts @@ -0,0 +1,82 @@ +import 'jasmine'; + +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {setDebug} from '../../util/ast_tools'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +describe('BANNED_PROPERTY_READ', () => { + describe('simpler matcher tests', () => { + const config = { + errorMessage: 'do not read location.href', + kind: PatternKind.BANNED_PROPERTY_READ, + values: ['Location.prototype.href'] + }; + const rule = new ConformancePatternRule(config); + + setDebug(true); + + it('check property access from the RHS of an assignment', () => { + const source = [ + `var x;`, + `x = location.href;`, + ]; + const results = compileAndCheck(rule, ...source); + + expect(results).toHaveFailuresMatching({ + matchedCode: `x = location.href`, + messageText: 'do not read location.href' + }); + }); + + it('check property access from the LHS of an assignment', () => { + const source = [ + `location.href = 'abc';`, + ]; + const results = compileAndCheck(rule, ...source); + + expect(results).toHaveNoFailures(); + }); + + it('check property access from the LHS of a non-assignment binary operation', + () => { + const source = [ + `var x = (location.href == "abc");`, + ]; + const results = compileAndCheck(rule, ...source); + + expect(results).toHaveFailuresMatching({ + matchedCode: `location.href == "abc"`, + messageText: 'do not read location.href' + }); + }); + + it('check property access from the RHS of a non-assignment binary operation', + () => { + const source = [ + `var x = ("abc" == location.href);`, + ]; + const results = compileAndCheck(rule, ...source); + + expect(results).toHaveFailuresMatching({ + matchedCode: `"abc" == location.href`, + messageText: 'do not read location.href' + }); + }); + + it('check property read from variable initializations', () => { + const source = [ + `var x = location.href;`, + ]; + const results = compileAndCheck(rule, ...source); + + expect(results).toHaveFailuresMatching({ + matchedCode: `var x = location.href;`, + messageText: 'do not read location.href' + }); + }); + }); +}); + +beforeEach(() => { + jasmine.addMatchers(customMatchers); +}); diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index cb35d41c..28305589 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -8,6 +8,7 @@ export enum PatternKind { BANNED_NAME = 'banned-name', BANNED_PROPERTY_WRITE = 'banned-property-write', BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', + BANNED_PROPERTY_READ = 'banned-property-read', // Not from JSConformance. BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT = 'banned-call-non-constant-argument' } diff --git a/internal/tsetse/util/pattern_engines/property_read_engine.ts b/internal/tsetse/util/pattern_engines/property_read_engine.ts new file mode 100644 index 00000000..03a4e02a --- /dev/null +++ b/internal/tsetse/util/pattern_engines/property_read_engine.ts @@ -0,0 +1,83 @@ +import * as ts from 'typescript'; +import {Checker} from '../../checker'; +import {ErrorCode} from '../../error_code'; +import {debugLog} from '../ast_tools'; +import {Fixer} from '../fixer'; +import {PropertyMatcher} from '../match_symbol'; +import {Config} from '../pattern_config'; +import {PatternEngine} from '../pattern_engines/pattern_engine'; + +/** + * The engine for BANNED_PROPERTY_READ. + */ +export class PropertyReadEngine extends PatternEngine { + private readonly matcher: PropertyMatcher; + constructor(config: Config, fixer?: Fixer) { + super(config, fixer); + // TODO: Support more than one single value here, or even build a + // multi-pattern engine. This would help for performance. + if (this.config.values.length !== 1) { + throw new Error(`BANNED_PROPERTY_READ expects one value, got(${ + this.config.values.join(',')})`); + } + this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); + } + + register(checker: Checker) { + checker.on( + ts.SyntaxKind.VariableStatement, this.checkAndFilterResults.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + checker.on( + ts.SyntaxKind.BinaryExpression, this.checkAndFilterResults.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + } + + check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { + // Check property read in variable initializations. + // For example, var a = object.property. + if (ts.isVariableStatement(n)) { + for (const declaration of n.declarationList.declarations) { + if (declaration.initializer !== undefined && + ts.isPropertyAccessExpression(declaration.initializer)) { + debugLog(`Inspecting ${n.getText().trim()}`); + if (this.matcher.matches(declaration.initializer, tc)) { + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + } + } + } + } + + // Check property read in binary expressions. + // If it is an assignment, it is a match if the property access + // appears at the RHS of the assignment. + if (ts.isBinaryExpression(n)) { + debugLog(`inspecting ${n.getText().trim()}`); + // If the expression is an assignment, then the property must appear at + // the right-hand side of the expression. + if (n.operatorToken.getText().trim() === '=') { + if (ts.isPropertyAccessExpression(n.right) && + this.matcher.matches(n.right, tc)) { + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + } + } + // If it is a non-assignment binary expression, + // the property access may appear either side of the expression. + else { + if ((ts.isPropertyAccessExpression(n.right) && + this.matcher.matches(n.right, tc)) || + (ts.isPropertyAccessExpression(n.left) && + this.matcher.matches(n.left, tc))) { + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + } + } + } + + return; + } +} From 06338d143367b11013cfcf1d2c41e67b29dd883e Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 4 Mar 2020 13:04:37 -0800 Subject: [PATCH 267/316] Add an optional file path filter to AbsoluteMatcher. PiperOrigin-RevId: 298920299 --- .../ban_conformance_pattern/util_test.ts | 193 ++++++++++++++++++ internal/tsetse/util/match_symbol.ts | 95 ++++++++- 2 files changed, 279 insertions(+), 9 deletions(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts index 94ab2346..497821ba 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts @@ -95,3 +95,196 @@ describe('The constant-ness logic', () => { } }); }); + +describe('test AbsoluteMatcher with file path', () => { + it('matched path', () => { + + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_0'; + var a = Foo.bar("123");` + ]; + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + + expect(results).toHaveFailuresMatching( + {matchedCode: `bar`, messageText: 'banned name with file path'}); + }); + + it('unmatched path', () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_1'; + var a = Foo.bar("123");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('local exported definition', () => { + // This is a match because Foo.bar is an exported symbol. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = + [`export class Foo { static bar(s: string) {return s + "abc";} } + var a = Foo.bar("123");`]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `bar`, messageText: 'banned name with file path'}); + }); + + it('local non-exported definition', () => { + // This is not a match because Foo.bar is a non-exported locally defined + // symbol. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [`class Foo { static bar(s: string) {return s + "abc";} } + var a = Foo.bar("123");`]; + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('property test 1', () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.s'] + }; + const sources = [ + `export class Foo { static s : string; }`, + `import {Foo} from './file_0'; + var a = Foo.s;`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `s`, messageText: 'banned name with file path'}); + }); + + it('property test 2', () => { + // This is a match because Moo inherits s from Foo. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.s'] + }; + const sources = [ + `export class Foo { static s : string; }`, + `import {Foo} from './file_0'; + export class Moo extends Foo { static t : string; }`, + `import {Moo} from './file_1'; + var a = Moo.s;`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `s`, messageText: 'banned name with file path'}); + }); + + it('property test 3', () => { + // This is not a match because Moo redefines s. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.s'] + }; + const sources = [ + `export class Foo { static s : string; }`, + `import {Foo} from './file_0'; + export class Moo extends Foo { static s : string; }`, + `import {Moo} from './file_1'; + var a = Moo.s;`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('inheritance test 1', () => { + // This is a match because Moo inherits bar from Foo. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_0'; + export class Moo extends Foo { static far(s: string) {return s + "def";} }`, + `import {Moo} from './file_1'; + Moo.bar("abc");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `bar`, messageText: 'banned name with file path'}); + }); + + it('inheritance test 2', () => { + // This is not a match because Moo redefines bar. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} } + export class Moo extends Foo { static bar(s: string) {return s + "def";} }`, + `import {Foo, Moo} from './file_0'; + Moo.bar("abc");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('interface', () => { + // This is not a match because even though bar specified is interface Moo, + // its actual definition is in class Boo. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_1|Moo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_0'; + export interface Moo extends Foo { }`, + `import {Moo} from './file_1'; + export class Boo implements Moo { static bar(s: string) {return s + "def";} }`, + `import {Boo} from './file_2'; + Boo.bar("abc");`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); +}); diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index f446e194..d0956472 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -1,10 +1,11 @@ import * as ts from 'typescript'; import {dealias, debugLog, isAmbientDeclaration, isDeclaration, isInStockLibraries, isPartOfImportStatement} from './ast_tools'; +const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; const FQN_FORMAT = `(${JS_IDENTIFIER_FORMAT}\.)*${JS_IDENTIFIER_FORMAT}`; // A fqn made out of a dot-separated chain of JS identifiers. -const ABSOLUTE_RE = new RegExp(`^${FQN_FORMAT}$`); +const ABSOLUTE_RE = new RegExp(`^(${PATH_NAME_FORMAT}\\|){0,1}${FQN_FORMAT}$`); /** * This class matches symbols given a "foo.bar.baz" name, where none of the @@ -14,18 +15,59 @@ const ABSOLUTE_RE = new RegExp(`^${FQN_FORMAT}$`); * strongly suggest finding the expected symbol in externs to find the object * name on which the symbol was initially defined. * - * TODO(rjamet): add a file-based optional filter, since FQNs tell you where - * your imported symbols were initially defined. That would let us be more - * specific in matches (say, you want to ban the fromLiteral in foo.ts but not - * the one from bar.ts). + * This matcher supports an optional file path filter. The filter specifies + * (part of) the path of the file in which the symbol of interest is defined. + * To add a file path filer to name "foo.bar.baz", prepend the path and + * the separator "|" to the name. For example, "path/to/file.ts|foo.bar.baz". + * With this filter, only symbols named "foo.bar.baz" that are defined in a path + * that contains "path/to/file.ts" are matched. + * + * This filter is useful when mutiple symbols have the same name but + * you want to match with a specific one. For example, assume that there are + * two classes named "Foo" defined in /path/to/file0 and /path/to/file1. + * // in /path/to/file0 + * export class Foo { static bar() {return "Foo.bar in file0";} } + * + * // in /path/to/file1 + * export class Foo { static bar() {return "Foo.bar in file1";} } + * + * Suppose that these two classes are referenced in two other files. + * // in /path/to/file2 + * import {Foo} from /path/to/file0; + * Foo.bar(); + * + * // in /path/to/file3 + * import {Foo} from /path/to/file1; + * Foo.bar(); + * + * An absolute matcher "Foo.bar" without a file filter will match with both + * references to "Foo.bar" in /path/to/file2 and /path/to/file3. + * An absolute matcher "/path/to/file1|Foo.bar", however, only matches with the + * "Foo.bar()" in /path/to/file3 because that references the "Foo.bar" defined + * in /path/to/file1. + * + * Note that an absolute matcher will match with any reference to the symbol + * defined in the file(s) specified by the file filter. For example, assume that + * Foo from file1 is extended in file4. + * + * // in /path/to/file4 + * import {Foo} from /path/to/file1; + * class Moo { static tar() {return "Moo.tar in file4";} } + * Moo.bar(); + * + * An absolute matcher "/path/to/file1|Foo.bar" matches with "Moo.bar()" because + * "bar" is defined as part of Foo in /path/to/file1. */ export class AbsoluteMatcher { /** - * From a "path/to/file.ts:foo.bar.baz" or "foo.bar.baz" matcher + * From a "path/to/file.ts|foo.bar.baz" or "foo.bar.baz" matcher * specification, builds a Matcher. */ - constructor(readonly bannedName: string) { - if (!bannedName.match(ABSOLUTE_RE)) { + readonly filePath: string; + readonly bannedName: string; + + constructor(spec: string) { + if (!spec.match(ABSOLUTE_RE)) { throw new Error('Malformed matcher selector.'); } @@ -35,12 +77,21 @@ export class AbsoluteMatcher { // on `foo`. To avoid any confusion, throw there if we see `prototype` in // the spec: that way, it's obvious that you're not trying to match // properties. - if (this.bannedName.match('.prototype.')) { + if (spec.match('.prototype.')) { throw new Error( 'Your pattern includes a .prototype, but the AbsoluteMatcher is ' + 'meant for non-object matches. Use the PropertyMatcher instead, or ' + 'the Property-based PatternKinds.'); } + + if (spec.includes('|')) { + // File path is present so we split spec by the separator "|". + [this.filePath, this.bannedName] = spec.split('|', 2); + } else { + // File path is omitted so spec is bannedName. + this.filePath = ''; + this.bannedName = spec; + } } matches(n: ts.Node, tc: ts.TypeChecker): boolean { @@ -79,6 +130,14 @@ export class AbsoluteMatcher { // either a declare somewhere, or one of the core libraries that // are loaded by default. if (!fqn.startsWith('"')) { + // If this matcher includes a file path, it means that the targeted symbol + // is defined and explicitly exported in some file. If the current symbol + // is not associated with a specific file (because it is a local symbol or + // ambient symbol), it is not a match. + if (this.filePath !== '') { + return false; + } + // We need to trace things back, so get declarations of the symbol. const declarations = s.getDeclarations(); if (!declarations) { @@ -91,6 +150,24 @@ export class AbsoluteMatcher { return false; } } + // If we know the file info of the symbol, and this matcher includes a file + // path, we check if they match. + else { + if (this.filePath !== '') { + const last = fqn.indexOf('"', 1); + if (last === -1) { + throw new Error('Malformed fully-qualified name.'); + } + const sympath = fqn.substring(1, last); + debugLog(`The file path of the symbol is ${sympath}`); + if (!sympath.match(this.filePath)) { + debugLog( + `The file path of the symbol does not match the ` + + `file path of the matcher`); + return false; + } + } + } debugLog(`all clear, report finding`); return true; From c67d22a9beec1c8023fbafccea1284cb66c99f3a Mon Sep 17 00:00:00 2001 From: martinprobst Date: Thu, 5 Mar 2020 07:20:03 -0800 Subject: [PATCH 268/316] Turn back on TypeScript error truncation. TypeScript runs out of memory trying to produce a human readable diagnostic in certain situations (infinitely recursing through anonymous type), see https://github.com/Microsoft/TypeScript/issues/37230. That's a bug, but more generally speaking, the default TypeScript behaviour is to run with error truncation. That's for a reason: some errors are much more readable with truncation. TypeScript's core team made the call that error truncation is generally a good idea, so we should follow along unless we have strong data indication otherwise (which we don't). Beyond that, error truncation being the default means it is the better tested path, so we'll probably save us some trouble in the future by keeping it enabled. PiperOrigin-RevId: 299096788 --- internal/common/tsconfig.bzl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index fc1d6f75..8df9ff48 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -253,10 +253,17 @@ def create_tsconfig( # Interpret JSX as React calls (until someone asks for something different) "jsx": "react", - # Print out full errors. By default TS truncates errors >100 chars. This can make it - # impossible to understand some errors. - "noErrorTruncation": True, - # Do not emit files if they had errors (avoid accidentally serving broken code). + # Truncate excessively long errors. + # While truncation can make some errors harder to understand, it makes + # others easier to read. Additionally, for certain errors, TypeScript + # can run out of memory trying to convert them into a humand readable + # string (see https://github.com/Microsoft/TypeScript/issues/37230). + # That's a bug, but the general default configuration of TypeScript is + # to truncate, so following that seems safer and more in line with the + # expected developer UX. + "noErrorTruncation": False, + # Do not emit files if they had errors (avoid accidentally serving + # broken code). "noEmitOnError": False, # Create .d.ts files as part of compilation. "declaration": True, From bc3c9a63344960b05308f608b108ae9d2ecca349 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 10 Mar 2020 14:23:26 -0700 Subject: [PATCH 269/316] Migrate users from legacy build_test to new implementation. PiperOrigin-RevId: 300177036 --- .../tests/ban_expect_truthy_promise/BUILD | 15 ++++++------- .../tests/ban_promise_as_condition/BUILD | 21 ++++++++++--------- .../tsetse/tests/check_return_value/BUILD | 21 ++++++++++--------- internal/tsetse/tests/equals_nan/BUILD | 15 ++++++------- internal/tsetse/tests/must_use_promises/BUILD | 11 +++++----- 5 files changed, 44 insertions(+), 39 deletions(-) diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index 13772f98..b92a83fd 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -14,6 +14,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") + licenses(["notice"]) # Apache 2.0 error_message = "error TS21224: Value passed.*" @@ -33,13 +34,13 @@ ts_library( "positives.ts", ], expected_diagnostics = [ - "\(29,5\).*" + error_message, - "\(30,5\).*" + error_message, - "\(31,5\).*" + error_message, - "\(32,5\).*" + error_message, - "\(33,5\).*" + error_message, - "\(34,5\).*" + error_message, - "\(35,5\).*" + error_message, + "\\(29,5\\).*" + error_message, + "\\(30,5\\).*" + error_message, + "\\(31,5\\).*" + error_message, + "\\(32,5\\).*" + error_message, + "\\(33,5\\).*" + error_message, + "\\(34,5\\).*" + error_message, + "\\(35,5\\).*" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", deps = [ diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD index 019903df..0a1540d9 100644 --- a/internal/tsetse/tests/ban_promise_as_condition/BUILD +++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD @@ -14,6 +14,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") + licenses(["notice"]) # Apache 2.0 error_message = "error TS21226: Found a thenable.*" @@ -25,16 +26,16 @@ ts_library( "positives.ts", ], expected_diagnostics = [ - "\(7,7\).*" + error_message, - "\(15,7\).*" + error_message, - "\(23,19\).*" + error_message, - "\(25,10\).*" + error_message, - "\(30,34\).*" + error_message, - "\(31,34\).*" + error_message, - "\(37,19\).*" + error_message, - "\(39,10\).*" + error_message, - "\(44,34\).*" + error_message, - "\(45,34\).*" + error_message, + "\\(7,7\\).*" + error_message, + "\\(15,7\\).*" + error_message, + "\\(23,19\\).*" + error_message, + "\\(25,10\\).*" + error_message, + "\\(30,34\\).*" + error_message, + "\\(31,34\\).*" + error_message, + "\\(37,19\\).*" + error_message, + "\\(39,10\\).*" + error_message, + "\\(44,34\\).*" + error_message, + "\\(45,34\\).*" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", ) diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index 2afcf62e..989f892a 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -14,6 +14,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") + licenses(["notice"]) # Apache 2.0 error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" @@ -30,11 +31,11 @@ ts_library( testonly = 1, srcs = ["expected_diagnostics.ts"], expected_diagnostics = [ - "\(6,1\).*" + error_message, - "\(8,1\).*" + error_message, - "\(12,1\).*" + error_message, - "\(16,1\).*" + error_message, - "\(19,1\).*" + error_message, + "\\(6,1\\).*" + error_message, + "\\(8,1\\).*" + error_message, + "\\(12,1\\).*" + error_message, + "\\(16,1\\).*" + error_message, + "\\(19,1\\).*" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", ) @@ -51,11 +52,11 @@ ts_library( testonly = 1, srcs = ["unused_return_value_user_defined_function.ts"], expected_diagnostics = [ - "\(4,1\).*" + error_message, - "\(5,1\).*" + error_message, - "\(7,1\).*" + error_message, - "\(9,1\).*" + error_message, - "\(15,1\).*" + error_message, + "\\(4,1\\).*" + error_message, + "\\(5,1\\).*" + error_message, + "\\(7,1\\).*" + error_message, + "\\(9,1\\).*" + error_message, + "\\(15,1\\).*" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", deps = [ diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD index 5fb48ffd..c8dfdc5b 100644 --- a/internal/tsetse/tests/equals_nan/BUILD +++ b/internal/tsetse/tests/equals_nan/BUILD @@ -14,6 +14,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") + licenses(["notice"]) # Apache 2.0 ts_library( @@ -23,13 +24,13 @@ ts_library( "positives.ts", ], expected_diagnostics = [ - "\(2,19\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", - "\(6,5\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", - "\(7,5\): error TS21223: x == NaN is always false; use isNaN\(x\) instead", - "\(8,5\): error TS21223: x !== NaN is always true; use !isNaN\(x\) instead", - "\(9,5\): error TS21223: x != NaN is always true; use !isNaN\(x\) instead", - "\(11,1\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", - "\(12,1\): error TS21223: x === NaN is always false; use isNaN\(x\) instead", + "\\(2,19\\): error TS21223: x === NaN is always false; use isNaN\\(x\\) instead", + "\\(6,5\\): error TS21223: x === NaN is always false; use isNaN\\(x\\) instead", + "\\(7,5\\): error TS21223: x == NaN is always false; use isNaN\\(x\\) instead", + "\\(8,5\\): error TS21223: x !== NaN is always true; use !isNaN\\(x\\) instead", + "\\(9,5\\): error TS21223: x != NaN is always true; use !isNaN\\(x\\) instead", + "\\(11,1\\): error TS21223: x === NaN is always false; use isNaN\\(x\\) instead", + "\\(12,1\\): error TS21223: x === NaN is always false; use isNaN\\(x\\) instead", ], ) diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD index 8b9b2f71..827cef8d 100644 --- a/internal/tsetse/tests/must_use_promises/BUILD +++ b/internal/tsetse/tests/must_use_promises/BUILD @@ -14,6 +14,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") + licenses(["notice"]) # Apache 2.0 error_message = "TS21225: All Promises in async functions must either be awaited or used in an expression." @@ -25,11 +26,11 @@ ts_library( "positives.ts", ], expected_diagnostics = [ - "\(29,3\)" + error_message, - "\(30,3\)" + error_message, - "\(31,3\)" + error_message, - "\(32,3\)" + error_message, - "\(34,3\)" + error_message, + "\\(29,3\\)" + error_message, + "\\(30,3\\)" + error_message, + "\\(31,3\\)" + error_message, + "\\(32,3\\)" + error_message, + "\\(34,3\\)" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", ) From c9a7ab511bc46df8c5eb44b0aeefaf73fd79d16c Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 12 Mar 2020 14:28:28 -0700 Subject: [PATCH 270/316] Fix PropertyMatcher's improper handling of intersection/union types. PiperOrigin-RevId: 300624585 --- .../property_read_test.ts | 22 +++++++++++++++++++ internal/tsetse/util/match_symbol.ts | 5 +++++ 2 files changed, 27 insertions(+) diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts index 1a09e819..d0fbee77 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts @@ -75,6 +75,28 @@ describe('BANNED_PROPERTY_READ', () => { }); }); }); + + describe('advanced type property tests', () => { + const config = { + errorMessage: 'do not read window.location', + kind: PatternKind.BANNED_PROPERTY_READ, + // global variable `window` is of type `Window & typeof globalThis`, + // but we can only specify `Window` here. PropertyMatcher should be + // able to resolve intersection types by itself. See lib.dom.d.ts. + values: ['Window.prototype.location'] + }; + const rule = new ConformancePatternRule(config); + + it('check property read from variable initializations', () => { + const source = 'var l = window.location;'; + const results = compileAndCheck(rule, source); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'var l = window.location;', + messageText: 'do not read window.location' + }); + }); + }); }); beforeEach(() => { diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index d0956472..c35ca7dc 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -223,6 +223,11 @@ export class PropertyMatcher { if (this.exactTypeMatches(inspectedType)) { return true; } + // If the type is an intersection/union, check if any of the component matches + if (inspectedType.isUnionOrIntersection()) { + return inspectedType.types.some(comp => this.typeMatches(comp)); + } + const baseTypes = inspectedType.getBaseTypes() || []; return baseTypes.some(base => this.exactTypeMatches(base)); } From ffc1ae96c6740de1b695284777fce756cbc2e925 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 12 Mar 2020 16:23:18 -0700 Subject: [PATCH 271/316] Fix PropertyMatcher's improper handling of intersection/union types. PiperOrigin-RevId: 300647116 --- .../property_read_test.ts | 22 ------------------- internal/tsetse/util/match_symbol.ts | 5 ----- 2 files changed, 27 deletions(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts index d0fbee77..1a09e819 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts @@ -75,28 +75,6 @@ describe('BANNED_PROPERTY_READ', () => { }); }); }); - - describe('advanced type property tests', () => { - const config = { - errorMessage: 'do not read window.location', - kind: PatternKind.BANNED_PROPERTY_READ, - // global variable `window` is of type `Window & typeof globalThis`, - // but we can only specify `Window` here. PropertyMatcher should be - // able to resolve intersection types by itself. See lib.dom.d.ts. - values: ['Window.prototype.location'] - }; - const rule = new ConformancePatternRule(config); - - it('check property read from variable initializations', () => { - const source = 'var l = window.location;'; - const results = compileAndCheck(rule, source); - - expect(results).toHaveFailuresMatching({ - matchedCode: 'var l = window.location;', - messageText: 'do not read window.location' - }); - }); - }); }); beforeEach(() => { diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index c35ca7dc..d0956472 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -223,11 +223,6 @@ export class PropertyMatcher { if (this.exactTypeMatches(inspectedType)) { return true; } - // If the type is an intersection/union, check if any of the component matches - if (inspectedType.isUnionOrIntersection()) { - return inspectedType.types.some(comp => this.typeMatches(comp)); - } - const baseTypes = inspectedType.getBaseTypes() || []; return baseTypes.some(base => this.exactTypeMatches(base)); } From 59c7ae5ebd45d301b3eb29f48e308140f6097a35 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 13 Mar 2020 14:33:25 -0700 Subject: [PATCH 272/316] Fix PropertyMatcher's improper handling of intersection/union types. PiperOrigin-RevId: 300828250 --- .../property_read_test.ts | 22 +++++++++++++++++++ internal/tsetse/util/match_symbol.ts | 5 +++++ 2 files changed, 27 insertions(+) diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts index 1a09e819..d0fbee77 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts @@ -75,6 +75,28 @@ describe('BANNED_PROPERTY_READ', () => { }); }); }); + + describe('advanced type property tests', () => { + const config = { + errorMessage: 'do not read window.location', + kind: PatternKind.BANNED_PROPERTY_READ, + // global variable `window` is of type `Window & typeof globalThis`, + // but we can only specify `Window` here. PropertyMatcher should be + // able to resolve intersection types by itself. See lib.dom.d.ts. + values: ['Window.prototype.location'] + }; + const rule = new ConformancePatternRule(config); + + it('check property read from variable initializations', () => { + const source = 'var l = window.location;'; + const results = compileAndCheck(rule, source); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'var l = window.location;', + messageText: 'do not read window.location' + }); + }); + }); }); beforeEach(() => { diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index d0956472..c35ca7dc 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -223,6 +223,11 @@ export class PropertyMatcher { if (this.exactTypeMatches(inspectedType)) { return true; } + // If the type is an intersection/union, check if any of the component matches + if (inspectedType.isUnionOrIntersection()) { + return inspectedType.types.some(comp => this.typeMatches(comp)); + } + const baseTypes = inspectedType.getBaseTypes() || []; return baseTypes.some(base => this.exactTypeMatches(base)); } From df3afdb31b0486af670a2c87cbc8770abf5c1f7d Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 27 Mar 2020 08:33:37 -0700 Subject: [PATCH 273/316] Expose official mapping from closure to devmode files PiperOrigin-RevId: 303334892 --- internal/common/compilation.bzl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 8e36bfac..0bee98e2 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -133,7 +133,7 @@ def _outputs(ctx, label, srcs_files = []): srcs_files: File list. sources files list. Returns: - A struct of file lists for different output types. + A struct of file lists for different output types and their relationship to each other. """ workspace_segments = label.workspace_root.split("/") if label.workspace_root else [] package_segments = label.package.split("/") if label.package else [] @@ -143,6 +143,7 @@ def _outputs(ctx, label, srcs_files = []): closure_js_files = [] devmode_js_files = [] declaration_files = [] + transpilation_infos = [] for input_file in srcs_files: is_dts = input_file.short_path.endswith(".d.ts") if is_dts and not create_shim_files: @@ -152,7 +153,8 @@ def _outputs(ctx, label, srcs_files = []): if basename.endswith(ext): basename = basename[:-len(ext)] break - closure_js_files += [ctx.actions.declare_file(basename + ".mjs")] + closure_js_file = ctx.actions.declare_file(basename + ".mjs") + closure_js_files.append(closure_js_file) # Temporary until all imports of ngfactory/ngsummary files are removed # TODO(alexeagle): clean up after Ivy launch @@ -161,7 +163,9 @@ def _outputs(ctx, label, srcs_files = []): closure_js_files += [ctx.actions.declare_file(basename + ".ngsummary.mjs")] if not is_dts: - devmode_js_files += [ctx.actions.declare_file(basename + ".js")] + devmode_js_file = ctx.actions.declare_file(basename + ".js") + devmode_js_files.append(devmode_js_file) + transpilation_infos.append(struct(closure = closure_js_file, devmode = devmode_js_file)) declaration_files += [ctx.actions.declare_file(basename + ".d.ts")] # Temporary until all imports of ngfactory/ngsummary files are removed @@ -175,6 +179,7 @@ def _outputs(ctx, label, srcs_files = []): closure_js = closure_js_files, devmode_js = devmode_js_files, declarations = declaration_files, + transpilation_infos = transpilation_infos, ) def compile_ts( @@ -257,6 +262,9 @@ def compile_ts( transpiled_devmode_js = outs.devmode_js gen_declarations = outs.declarations + # Not all existing implementations of outputs() may return transpilation_infos + transpilation_infos = getattr(outs, "transpilation_infos", []) + if has_sources and _get_runtime(ctx) != "nodejs": # Note: setting this variable controls whether tsickle is run at all. tsickle_externs = [ctx.actions.declare_file(ctx.label.name + ".externs.js")] @@ -475,6 +483,7 @@ def compile_ts( "replay_params": replay_params, "transitive_es6_sources": transitive_es6_sources, "tsickle_externs": tsickle_externs, + "transpilation_infos": transpilation_infos, }, } From a6438cb3c793b6aa3b63db7a3cf78341424986bf Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 30 Mar 2020 11:53:00 -0700 Subject: [PATCH 274/316] Extend AbsoluteMatcher's file-matching capabilities to support matching against a global definition. PiperOrigin-RevId: 303789656 --- .../name_call_non_constant_argument_test.ts | 10 ++--- .../ban_conformance_pattern/name_test.ts | 6 +-- .../ban_conformance_pattern/util_test.ts | 45 ++++++++++++++++++- internal/tsetse/util/match_symbol.ts | 44 +++++++++--------- 4 files changed, 75 insertions(+), 30 deletions(-) diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts index dba2664e..b4b24cfc 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts @@ -6,7 +6,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const config = { errorMessage: 'do not call bar.foo with non-literal 1st arg', kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['bar:0'] + values: ['ANY_SYMBOL|bar:0'] }; const rule = new ConformancePatternRule(config); @@ -38,7 +38,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const rule = new ConformancePatternRule({ errorMessage: 'non-literal arg', kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['aaa:1', 'bbb:0'] + values: ['ANY_SYMBOL|aaa:1', 'ANY_SYMBOL|bbb:0'] }); const sources = [ @@ -61,7 +61,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const rule = new ConformancePatternRule({ errorMessage: 'non-literal arg', kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['Car.buildFromParts:0'] + values: ['ANY_SYMBOL|Car.buildFromParts:0'] }); const sources = [ @@ -81,7 +81,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const rule = new ConformancePatternRule({ errorMessage: 'non-literal arg', kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['URL.createObjectURL:0'] + values: ['GLOBAL|URL.createObjectURL:0'] }); const sources = [`URL.createObjectURL(window.name);\n`]; @@ -96,7 +96,7 @@ describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { const rule = new ConformancePatternRule({ errorMessage: 'non-literal arg', kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['eval:0'] + values: ['GLOBAL|eval:0'] }); const sources = [`eval(window.name);\n`]; diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts index 4e8609ce..0a0eeaf5 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/name_test.ts @@ -7,7 +7,7 @@ describe('BANNED_NAME', () => { const config = { errorMessage: 'no Infinity', kind: PatternKind.BANNED_NAME, - values: ['Infinity'] + values: ['GLOBAL|Infinity'] }; const source = `Infinity; 1+1;`; const results = compileAndCheck(new ConformancePatternRule(config), source); @@ -20,7 +20,7 @@ describe('BANNED_NAME', () => { const config = { errorMessage: 'no blob url', kind: PatternKind.BANNED_NAME, - values: ['URL.createObjectURL'] + values: ['GLOBAL|URL.createObjectURL'] }; const source = `URL.createObjectURL({});`; const results = compileAndCheck(new ConformancePatternRule(config), source); @@ -39,7 +39,7 @@ describe('BANNED_NAME', () => { const config = { errorMessage: 'should not trigger', kind: PatternKind.BANNED_NAME, - values: ['whatever'] + values: ['ANY_SYMBOL|whatever'] }; const sources = [ `export type Foo = {bar: number, baz: (x:string)=>void}`, diff --git a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts index 497821ba..a234337d 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts @@ -96,7 +96,21 @@ describe('The constant-ness logic', () => { }); }); -describe('test AbsoluteMatcher with file path', () => { +describe('test AbsoluteMatcher', () => { + it('requires a scope', () => { + const config = { + errorMessage: 'banned name with no scope', + kind: PatternKind.BANNED_NAME, + values: ['exec'] + }; + const sources = [`eval('alert("hi");');`]; + + const check = () => + compileAndCheck(new ConformancePatternRule(config), ...sources); + + expect(check).toThrowError('Malformed matcher selector.'); + }); + it('matched path', () => { const config = { @@ -151,6 +165,35 @@ describe('test AbsoluteMatcher with file path', () => { {matchedCode: `bar`, messageText: 'banned name with file path'}); }); + it('global definition', () => { + const config = { + errorMessage: 'banned ambient name', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|eval'] + }; + const sources = [`eval('alert("hi");');`]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `eval`, messageText: 'banned ambient name'}); + }); + + it('global definition with the same name as a custom method', () => { + const config = { + errorMessage: 'banned ambient name', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|eval'] + }; + const sources = + [`export class Foo { static eval(s: string) { return s + "abc";} } + var a = Foo.eval("123");`]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + it('local non-exported definition', () => { // This is not a match because Foo.bar is a non-exported locally defined // symbol. diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index c35ca7dc..842292c8 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -5,7 +5,10 @@ const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; const FQN_FORMAT = `(${JS_IDENTIFIER_FORMAT}\.)*${JS_IDENTIFIER_FORMAT}`; // A fqn made out of a dot-separated chain of JS identifiers. -const ABSOLUTE_RE = new RegExp(`^(${PATH_NAME_FORMAT}\\|){0,1}${FQN_FORMAT}$`); +const ABSOLUTE_RE = new RegExp(`^${PATH_NAME_FORMAT}\\|${FQN_FORMAT}$`); +const GLOBAL = 'GLOBAL'; +const ANY_SYMBOL = 'ANY_SYMBOL'; + /** * This class matches symbols given a "foo.bar.baz" name, where none of the @@ -15,10 +18,13 @@ const ABSOLUTE_RE = new RegExp(`^(${PATH_NAME_FORMAT}\\|){0,1}${FQN_FORMAT}$`); * strongly suggest finding the expected symbol in externs to find the object * name on which the symbol was initially defined. * - * This matcher supports an optional file path filter. The filter specifies + * This matcher requires a scope for the symbol, which may be `GLOBAL`, + * `ANY_SCOPE`, or a file path filter. The matcher begins with this scope, then + * the separator "|", followed by the symbol name. For example, "GLOBAL|eval". + * + * The file filter specifies * (part of) the path of the file in which the symbol of interest is defined. - * To add a file path filer to name "foo.bar.baz", prepend the path and - * the separator "|" to the name. For example, "path/to/file.ts|foo.bar.baz". + * For example, "path/to/file.ts|foo.bar.baz". * With this filter, only symbols named "foo.bar.baz" that are defined in a path * that contains "path/to/file.ts" are matched. * @@ -60,8 +66,7 @@ const ABSOLUTE_RE = new RegExp(`^(${PATH_NAME_FORMAT}\\|){0,1}${FQN_FORMAT}$`); */ export class AbsoluteMatcher { /** - * From a "path/to/file.ts|foo.bar.baz" or "foo.bar.baz" matcher - * specification, builds a Matcher. + * From a "path/to/file.ts|foo.bar.baz", builds a Matcher. */ readonly filePath: string; readonly bannedName: string; @@ -84,14 +89,8 @@ export class AbsoluteMatcher { 'the Property-based PatternKinds.'); } - if (spec.includes('|')) { - // File path is present so we split spec by the separator "|". - [this.filePath, this.bannedName] = spec.split('|', 2); - } else { - // File path is omitted so spec is bannedName. - this.filePath = ''; - this.bannedName = spec; - } + // Split spec by the separator "|". + [this.filePath, this.bannedName] = spec.split('|', 2); } matches(n: ts.Node, tc: ts.TypeChecker): boolean { @@ -130,11 +129,14 @@ export class AbsoluteMatcher { // either a declare somewhere, or one of the core libraries that // are loaded by default. if (!fqn.startsWith('"')) { - // If this matcher includes a file path, it means that the targeted symbol - // is defined and explicitly exported in some file. If the current symbol - // is not associated with a specific file (because it is a local symbol or - // ambient symbol), it is not a match. - if (this.filePath !== '') { + // If this matcher includes a non-empty file path, it means that the + // targeted symbol is defined and explicitly exported in some file. If the + // current symbol is not associated with a specific file (because it is a + // local symbol or ambient symbol), it is not a match. + if (this.filePath !== GLOBAL && this.filePath !== ANY_SYMBOL) { + debugLog( + `The symbol has no file path and one is specified by the ` + + `matcher`); return false; } @@ -153,14 +155,14 @@ export class AbsoluteMatcher { // If we know the file info of the symbol, and this matcher includes a file // path, we check if they match. else { - if (this.filePath !== '') { + if (this.filePath !== ANY_SYMBOL) { const last = fqn.indexOf('"', 1); if (last === -1) { throw new Error('Malformed fully-qualified name.'); } const sympath = fqn.substring(1, last); debugLog(`The file path of the symbol is ${sympath}`); - if (!sympath.match(this.filePath)) { + if (!sympath.match(this.filePath) || this.filePath === GLOBAL) { debugLog( `The file path of the symbol does not match the ` + `file path of the matcher`); From c25c74db7cb00ce55902fdba3eb2301f86286e88 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 2 Apr 2020 18:44:32 -0700 Subject: [PATCH 275/316] Improve performance by checking multiple properties and identifiers in parallel. PiperOrigin-RevId: 304521229 --- internal/tsetse/checker.ts | 115 +++++++++++++++--- .../tsetse/rules/check_return_value_rule.ts | 2 +- .../tsetse/rules/must_use_promises_rule.ts | 2 +- .../tsetse/rules/property_renaming_safe.ts | 2 +- .../ban_conformance_pattern/util_test.ts | 8 +- .../tsetse/tests/check_return_value/BUILD | 2 +- internal/tsetse/util/pattern_config.ts | 2 + .../util/pattern_engines/name_engine.ts | 14 ++- .../pattern_engines/property_write_engine.ts | 28 +++-- 9 files changed, 139 insertions(+), 36 deletions(-) diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 52d06f96..be5fb250 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -22,18 +22,26 @@ interface Handler { * possible. Compiler uses execute() to run the Tsetse check. */ export class Checker { + /** Node to handlers mapping for all enabled rules. */ + private readonly nodeHandlersMap = new Map(); /** - * nodeHandlersMap contains node to handlers mapping for all enabled rules. + * Mapping from identifier name to handlers for all rules inspecting property + * names. */ - private nodeHandlersMap = new Map(); + private readonly namedIdentifierHandlersMap = new Map(); + /** + * Mapping from property name to handlers for all rules inspecting property + * accesses expressions. + */ + private readonly namedPropertyAccessHandlersMap = + new Map(); + private failures: Failure[] = []; private currentSourceFile: ts.SourceFile|undefined; // currentCode will be set before invoking any handler functions so the value // initialized here is never used. private currentCode = 0; - /** - * Allow typed rules via typeChecker. - */ + /** Allow typed rules via typeChecker. */ typeChecker: ts.TypeChecker; constructor(program: ts.Program) { @@ -50,8 +58,7 @@ export class Checker { nodeKind: T['kind'], handlerFunction: (checker: Checker, node: T) => void, code: number) { const newHandler: Handler = {handlerFunction, code}; - const registeredHandlers: Handler[]|undefined = - this.nodeHandlersMap.get(nodeKind); + const registeredHandlers = this.nodeHandlersMap.get(nodeKind); if (registeredHandlers === undefined) { this.nodeHandlersMap.set(nodeKind, [newHandler]); } else { @@ -59,6 +66,43 @@ export class Checker { } } + /** + * Similar to `on`, but registers handlers on more specific node type, i.e., + * identifiers. + */ + onNamedIdentifier( + identifierName: string, + handlerFunction: (checker: Checker, node: ts.Identifier) => void, + code: number) { + const newHandler: Handler = {handlerFunction, code}; + const registeredHandlers = + this.namedIdentifierHandlersMap.get(identifierName); + if (registeredHandlers === undefined) { + this.namedIdentifierHandlersMap.set(identifierName, [newHandler]); + } else { + registeredHandlers.push(newHandler); + } + } + + /** + * Similar to `on`, but registers handlers on more specific node type, i.e., + * property access expressions. + */ + onNamedPropertyAccess( + propertyName: string, + handlerFunction: + (checker: Checker, node: ts.PropertyAccessExpression) => void, + code: number) { + const newHandler: Handler = {handlerFunction, code}; + const registeredHandlers = + this.namedPropertyAccessHandlersMap.get(propertyName); + if (registeredHandlers === undefined) { + this.namedPropertyAccessHandlersMap.set(propertyName, [newHandler]); + } else { + registeredHandlers.push(newHandler); + } + } + /** * Add a failure with a span. addFailure() is currently private because * `addFailureAtNode` is preferred. @@ -87,6 +131,47 @@ export class Checker { node.getStart(this.currentSourceFile), node.getEnd(), failureText, fix); } + /** Dispatch general handlers registered via `on` */ + dispatchNodeHandlers(node: ts.Node) { + const handlers = this.nodeHandlersMap.get(node.kind); + if (handlers === undefined) { + return; + } + + for (const handler of handlers) { + this.currentCode = handler.code; + handler.handlerFunction(this, node); + } + } + + /** Dispatch identifier handlers registered via `onNamedIdentifier` */ + dispatchNamedIdentifierHandlers(id: ts.Identifier) { + const handlers = this.namedIdentifierHandlersMap.get(id.text); + if (handlers === undefined) { + return; + } + + for (const handler of handlers) { + this.currentCode = handler.code; + handler.handlerFunction(this, id); + } + } + + /** + * Dispatch property access handlers registered via `onNamedPropertyAccess` + */ + dispatchNamedPropertyAccessHandlers(prop: ts.PropertyAccessExpression) { + const handlers = this.namedPropertyAccessHandlersMap.get(prop.name.text); + if (handlers === undefined) { + return; + } + + for (const handler of handlers) { + this.currentCode = handler.code; + handler.handlerFunction(this, prop); + } + } + /** * Walk `sourceFile`, invoking registered handlers with Checker as the first * argument and current node as the second argument. Return failures if there @@ -100,14 +185,16 @@ export class Checker { return this.failures; function run(node: ts.Node) { - const handlers: Handler[]|undefined = - thisChecker.nodeHandlersMap.get(node.kind); - if (handlers !== undefined) { - for (const handler of handlers) { - thisChecker.currentCode = handler.code; - handler.handlerFunction(thisChecker, node); - } + // Dispatch handlers registered via `on` + thisChecker.dispatchNodeHandlers(node); + + // Dispatch handlers for named identifiers and properties + if (ts.isIdentifier(node)) { + thisChecker.dispatchNamedIdentifierHandlers(node); + } else if (ts.isPropertyAccessExpression(node)) { + thisChecker.dispatchNamedPropertyAccessHandlers(node); } + ts.forEachChild(node, run); } } diff --git a/internal/tsetse/rules/check_return_value_rule.ts b/internal/tsetse/rules/check_return_value_rule.ts index d52a0f7a..6ac0f229 100644 --- a/internal/tsetse/rules/check_return_value_rule.ts +++ b/internal/tsetse/rules/check_return_value_rule.ts @@ -11,7 +11,7 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; const FAILURE_STRING = 'return value is unused.' - + '\n\tSee http://tsetse.info/check-return-value'; + + '\n\tSee go/ts-conformance#check-return-value'; // A list of well-known functions that the return value must be used. If unused // then the function call is either a no-op (e.g. 'foo.trim()' foo is unchanged) diff --git a/internal/tsetse/rules/must_use_promises_rule.ts b/internal/tsetse/rules/must_use_promises_rule.ts index 7e4905a3..8bc8db0c 100644 --- a/internal/tsetse/rules/must_use_promises_rule.ts +++ b/internal/tsetse/rules/must_use_promises_rule.ts @@ -12,7 +12,7 @@ import {AbstractRule} from '../rule'; const FAILURE_STRING = 'All Promises in async functions must either be awaited or used in an expression.' + - '\n\tSee http://tsetse.info/must-use-promises'; + '\n\tSee go/ts-conformance#must-use-promises'; export class Rule extends AbstractRule { readonly ruleName = 'must-use-promises'; diff --git a/internal/tsetse/rules/property_renaming_safe.ts b/internal/tsetse/rules/property_renaming_safe.ts index 7b842442..03d82fd0 100644 --- a/internal/tsetse/rules/property_renaming_safe.ts +++ b/internal/tsetse/rules/property_renaming_safe.ts @@ -50,5 +50,5 @@ function checkIndexSignAccessedWithPropAccess( `${typeChecker.typeToString(t)}. The type has a string index ` + `signature, but it is being accessed using a dotted property ` + `access. -See http://tsetse.info/property-renaming-safe.`); +See go/ts-conformance#property-renaming-safe.`); } diff --git a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts index a234337d..dd44a5d1 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts +++ b/internal/tsetse/tests/ban_conformance_pattern/util_test.ts @@ -11,11 +11,11 @@ import {compile, compileAndCheck} from '../../util/testing/test_support'; describe('Debug output', () => { it('turns on and off', () => { - const source = `const obj = {prop:'val'}; obj.prop = 'foo';`; + const source = `location.href = 'foo';`; const rule = new ConformancePatternRule({ errorMessage: 'does not matter', kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'] + values: ['Location.prototype.href'] }); const logs: string[] = []; @@ -27,13 +27,13 @@ describe('Debug output', () => { setDebug(true); compileAndCheck(rule, source); - expect(logs).toEqual([`inspecting obj.prop = 'foo'`]); + expect(logs).toEqual([`inspecting location.href = 'foo'`]); setDebug(false); compileAndCheck(rule, source); // Nothing more appended: debug was false - expect(logs).toEqual([`inspecting obj.prop = 'foo'`]); + expect(logs).toEqual([`inspecting location.href = 'foo'`]); }); }); diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index 989f892a..f15e5cbb 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -17,7 +17,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 -error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" +error_message = "TS21222: return value is unused.\\n\\tSee go/ts-conformance#check-return-value" ts_library( name = "no_expected_diagnostics_test", diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 28305589..9517c1f7 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -7,9 +7,11 @@ export enum PatternKind { BANNED_NAME = 'banned-name', BANNED_PROPERTY_WRITE = 'banned-property-write', + /** @deprecated use `BANNED_PROPERTY_WRITE` instead */ BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', BANNED_PROPERTY_READ = 'banned-property-read', // Not from JSConformance. + /** @deprecated use `BANNED_PROPERTY` instead */ BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT = 'banned-call-non-constant-argument' } diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index 33126190..666779b8 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -1,4 +1,5 @@ import * as ts from 'typescript'; + import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog, shouldExamineNode} from '../ast_tools'; @@ -21,15 +22,16 @@ export class NameEngine extends PatternEngine { } register(checker: Checker) { - checker.on( - ts.SyntaxKind.Identifier, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); + // `String.prototype.split` only returns emtpy array when both the string + // and the splitter are empty. Here we should be able to safely assert pop + // returns a non-null result. + const bannedIdName = this.matcher.bannedName.split('.').pop()!; + checker.onNamedIdentifier(bannedIdName, (c: Checker, n: ts.Node) => { + this.checkAndFilterResults(c, n); + }, ErrorCode.CONFORMANCE_PATTERN); } check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { - return; - } debugLog(`inspecting ${n.getText().trim()}`); if (!this.matcher.matches(n, tc)) { debugLog('Not the right global name.'); diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 640ff646..9ca2887a 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -24,21 +24,33 @@ export class PropertyWriteEngine extends PatternEngine { } register(checker: Checker) { - checker.on( - ts.SyntaxKind.BinaryExpression, this.checkAndFilterResults.bind(this), + checker.onNamedPropertyAccess( + this.matcher.bannedProperty, this.checkAndFilterResults.bind(this), ErrorCode.CONFORMANCE_PATTERN); } check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - if (!isPropertyWriteExpression(n)) { + if (!ts.isPropertyAccessExpression(n)) { + throw new Error( + `Should not happen: node is not a PropertyAccessExpression`); + } + + if (!ts.isBinaryExpression(n.parent)) { + return; + } + + if (n.parent.operatorToken.getText().trim() !== '=') { return; } - debugLog(`inspecting ${n.getText().trim()}`); - if (!this.matcher.matches(n.left, tc)) { + + if (n.parent.left !== n) { + return; + } + + debugLog(`inspecting ${n.parent.getText().trim()}`); + if (!this.matcher.matches(n, tc)) { return; } - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; + return n.parent; } } From 0a90cfe1d98a584a4291c82feefb9b74b8ad68fd Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 6 Apr 2020 19:43:56 -0700 Subject: [PATCH 276/316] Add a new conformance pattern to examine property access PiperOrigin-RevId: 305169505 --- .../tsetse/rules/conformance_pattern_rule.ts | 4 + .../ban_conformance_pattern/property_test.ts | 111 ++++++++++++++++++ internal/tsetse/util/pattern_config.ts | 12 +- .../util/pattern_engines/property_engine.ts | 50 ++++++++ 4 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 internal/tsetse/tests/ban_conformance_pattern/property_test.ts create mode 100644 internal/tsetse/util/pattern_engines/property_engine.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index 5b33edc8..f1188943 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -6,6 +6,7 @@ import {Config, PatternKind} from '../util/pattern_config'; import {CallNonConstantArgumentEngine} from '../util/pattern_engines/name_call_non_constant_argument'; import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; +import {PropertyEngine} from '../util/pattern_engines/property_engine'; import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; import {PropertyReadEngine} from '../util/pattern_engines/property_read_engine'; import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; @@ -26,6 +27,9 @@ export class ConformancePatternRule implements AbstractRule { constructor(config: Config, fixer?: Fixer) { switch (config.kind) { + case PatternKind.BANNED_PROPERTY: + this.engine = new PropertyEngine(config, fixer); + break; case PatternKind.BANNED_PROPERTY_WRITE: this.engine = new PropertyWriteEngine(config, fixer); break; diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_test.ts b/internal/tsetse/tests/ban_conformance_pattern/property_test.ts new file mode 100644 index 00000000..1fcd0a6f --- /dev/null +++ b/internal/tsetse/tests/ban_conformance_pattern/property_test.ts @@ -0,0 +1,111 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; + +describe('BANNED_PROPERTY', () => { + beforeEach(() => { + jasmine.addMatchers(customMatchers); + }); + + it('matches simple property access on dom properties', () => { + const config = { + errorMessage: 'No Location#href access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.href'], + }; + const source = 'const href = location.href;'; + const results = compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'location.href', + messageText: 'No Location#href access', + }); + }); + + it('matches simple property access on properties of TS built-in types', + () => { + const config = { + errorMessage: 'No Array#map access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Array.prototype.map'], + }; + const source = '[].map(() => 1);'; + + const results = + compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveFailuresMatching({ + matchedCode: '[].map', + messageText: 'No Array#map access', + }); + }); + + it('matches simple property access on properties of user-defined global types', + () => { + const config = { + errorMessage: 'No Ty#foo access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Ty.prototype.foo'], + }; + const funcPropAccess = `class Ty { + foo() {} + bar: number = 1; + } + new Ty().foo(); + `; + let results = + compileAndCheck(new ConformancePatternRule(config), funcPropAccess); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'new Ty().foo', + messageText: 'No Ty#foo access', + }); + + const nonFuncPropAccess = `class Ty { + foo: number = 1; + bar() {} + } + new Ty().foo; + `; + results = compileAndCheck( + new ConformancePatternRule(config), nonFuncPropAccess); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'new Ty().foo', + messageText: 'No Ty#foo access', + }); + }); + + it('does not match in-module defined type', () => { + const config = { + errorMessage: 'No Location#replace access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.location'], + }; + const source = `export {}; // export makes the file a module + class Location { replace(x: string) {} } + new Location().replace('a');` + const results = compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveNoFailures(); + }); + + it('does not match properties after fancy type casts', () => { + const config = { + errorMessage: 'No Location#href access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.replace'], + }; + const source = [ + // Grey area of tests that don't trigger, but probably could + '(location as unknown as {replace: (url: string) => void}).replace(\'\');', + // We don't trigger on any, since it's not the right type. + 'const locationAsAny: any = location;', + 'locationAsAny.replace(\'https://example.com/script.js\');', + ]; + const results = + compileAndCheck(new ConformancePatternRule(config), ...source); + + expect(results).toHaveNoFailures(); + }); +}); diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 9517c1f7..3c78c8f2 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -5,12 +5,22 @@ * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework) */ export enum PatternKind { + /** Ban use of fully distinguished names. */ BANNED_NAME = 'banned-name', + /** Ban use of instance properties */ + BANNED_PROPERTY = 'banned-property', + /** + * Ban instance property, like BANNED_PROPERTY but where reads of the + * property are allowed. + */ BANNED_PROPERTY_WRITE = 'banned-property-write', /** @deprecated use `BANNED_PROPERTY_WRITE` instead */ BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', + /** + * Ban instance property, like BANNED_PROPERTY but where writes of the + * property are allowed. + */ BANNED_PROPERTY_READ = 'banned-property-read', - // Not from JSConformance. /** @deprecated use `BANNED_PROPERTY` instead */ BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT = 'banned-call-non-constant-argument' } diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts new file mode 100644 index 00000000..a3b2a8c4 --- /dev/null +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -0,0 +1,50 @@ +import * as ts from 'typescript'; + +import {Checker} from '../../checker'; +import {ErrorCode} from '../../error_code'; +import {debugLog} from '../ast_tools'; +import {Fixer} from '../fixer'; +import {PropertyMatcher} from '../match_symbol'; +import {Config} from '../pattern_config'; +import {PatternEngine} from '../pattern_engines/pattern_engine'; + +/** + * Engine for the BANNED_PROPERTY pattern. It captures accesses to property + * matching the spec regardless whether it's a read or write. + */ +export class PropertyEngine extends PatternEngine { + private readonly matcher: PropertyMatcher; + constructor(config: Config, fixer?: Fixer) { + super(config, fixer); + // Although noted in other engines, it is difficult to support multiple + // values within the current design. It may be easier to only allow a single + // value in the config. + if (this.config.values.length !== 1) { + throw new Error(`BANNED_PROPERTY expects one value, got(${ + this.config.values.join(',')})`); + } + this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); + } + + register(checker: Checker) { + checker.onNamedPropertyAccess( + this.matcher.bannedProperty, this.checkAndFilterResults.bind(this), + ErrorCode.CONFORMANCE_PATTERN); + } + + // TODO(pwng): only plain property access expressions are supported for now. + // In the future, support more patterns including `location['href']` and + // `const {href} = location;`. That possibly requires refactoring + // `PropertyMatcher` or adding new types of matchers. + check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { + if (!ts.isPropertyAccessExpression(n)) { + throw new Error( + `Should not happen: node is not a PropertyAccessExpression`); + } + debugLog(`inspecting ${n.getText().trim()}`); + if (!this.matcher.matches(n, tc)) { + return; + } + return n; + } +} From e1de41c68e320ad5950b2e24d9637f32a6c620aa Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 15 Apr 2020 09:24:50 -0700 Subject: [PATCH 277/316] Use generics to avoid run-time type confusion due to Map bivariance in TS. PiperOrigin-RevId: 306657994 --- internal/tsetse/checker.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index be5fb250..9d5c1d28 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -11,8 +11,8 @@ import {Failure, Fix} from './failure'; * A Handler contains a handler function and its corresponding error code so * when the handler function is triggered we know which rule is violated. */ -interface Handler { - handlerFunction(checker: Checker, node: ts.Node): void; +interface Handler { + handlerFunction(checker: Checker, node: T): void; code: number; } @@ -23,18 +23,20 @@ interface Handler { */ export class Checker { /** Node to handlers mapping for all enabled rules. */ - private readonly nodeHandlersMap = new Map(); + private readonly nodeHandlersMap = + new Map[]>(); /** * Mapping from identifier name to handlers for all rules inspecting property * names. */ - private readonly namedIdentifierHandlersMap = new Map(); + private readonly namedIdentifierHandlersMap = + new Map[]>(); /** * Mapping from property name to handlers for all rules inspecting property * accesses expressions. */ private readonly namedPropertyAccessHandlersMap = - new Map(); + new Map[]>(); private failures: Failure[] = []; private currentSourceFile: ts.SourceFile|undefined; @@ -57,7 +59,7 @@ export class Checker { on( nodeKind: T['kind'], handlerFunction: (checker: Checker, node: T) => void, code: number) { - const newHandler: Handler = {handlerFunction, code}; + const newHandler: Handler = {handlerFunction, code}; const registeredHandlers = this.nodeHandlersMap.get(nodeKind); if (registeredHandlers === undefined) { this.nodeHandlersMap.set(nodeKind, [newHandler]); @@ -74,7 +76,7 @@ export class Checker { identifierName: string, handlerFunction: (checker: Checker, node: ts.Identifier) => void, code: number) { - const newHandler: Handler = {handlerFunction, code}; + const newHandler: Handler = {handlerFunction, code}; const registeredHandlers = this.namedIdentifierHandlersMap.get(identifierName); if (registeredHandlers === undefined) { @@ -93,7 +95,8 @@ export class Checker { handlerFunction: (checker: Checker, node: ts.PropertyAccessExpression) => void, code: number) { - const newHandler: Handler = {handlerFunction, code}; + const newHandler: + Handler = {handlerFunction, code}; const registeredHandlers = this.namedPropertyAccessHandlersMap.get(propertyName); if (registeredHandlers === undefined) { From 9c037851d44faa833b9b93c8acd0fc9e0185c944 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 20 Apr 2020 09:51:55 -0700 Subject: [PATCH 278/316] Update internal URLs for tsetse conformance checks. PiperOrigin-RevId: 307418854 --- internal/tsetse/rules/check_return_value_rule.ts | 5 +++-- internal/tsetse/rules/must_use_promises_rule.ts | 3 ++- internal/tsetse/rules/property_renaming_safe.ts | 2 +- internal/tsetse/tests/check_return_value/BUILD | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/tsetse/rules/check_return_value_rule.ts b/internal/tsetse/rules/check_return_value_rule.ts index 6ac0f229..7863cf5e 100644 --- a/internal/tsetse/rules/check_return_value_rule.ts +++ b/internal/tsetse/rules/check_return_value_rule.ts @@ -10,8 +10,8 @@ import {Checker} from '../checker'; import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; -const FAILURE_STRING = 'return value is unused.' - + '\n\tSee go/ts-conformance#check-return-value'; +const FAILURE_STRING = 'return value is unused.' + + '\n\tSee http://tsetse.info/check-return-value'; // A list of well-known functions that the return value must be used. If unused // then the function call is either a no-op (e.g. 'foo.trim()' foo is unchanged) @@ -40,6 +40,7 @@ const METHODS_TO_CHECK = new Set([ ['string', 'trim'], ].map(list => list.join('#'))); +/** A rule to ensure required return values from common functions are used. */ export class Rule extends AbstractRule { readonly ruleName = 'check-return-value'; readonly code = ErrorCode.CHECK_RETURN_VALUE; diff --git a/internal/tsetse/rules/must_use_promises_rule.ts b/internal/tsetse/rules/must_use_promises_rule.ts index 8bc8db0c..f5835744 100644 --- a/internal/tsetse/rules/must_use_promises_rule.ts +++ b/internal/tsetse/rules/must_use_promises_rule.ts @@ -12,8 +12,9 @@ import {AbstractRule} from '../rule'; const FAILURE_STRING = 'All Promises in async functions must either be awaited or used in an expression.' + - '\n\tSee go/ts-conformance#must-use-promises'; + '\n\tSee http://tsetse.info/must-use-promises'; +/** A rule to ensure promises in async functions are awaited or used. */ export class Rule extends AbstractRule { readonly ruleName = 'must-use-promises'; readonly code = ErrorCode.MUST_USE_PROMISES; diff --git a/internal/tsetse/rules/property_renaming_safe.ts b/internal/tsetse/rules/property_renaming_safe.ts index 03d82fd0..7b842442 100644 --- a/internal/tsetse/rules/property_renaming_safe.ts +++ b/internal/tsetse/rules/property_renaming_safe.ts @@ -50,5 +50,5 @@ function checkIndexSignAccessedWithPropAccess( `${typeChecker.typeToString(t)}. The type has a string index ` + `signature, but it is being accessed using a dotted property ` + `access. -See go/ts-conformance#property-renaming-safe.`); +See http://tsetse.info/property-renaming-safe.`); } diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD index f15e5cbb..989f892a 100644 --- a/internal/tsetse/tests/check_return_value/BUILD +++ b/internal/tsetse/tests/check_return_value/BUILD @@ -17,7 +17,7 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") licenses(["notice"]) # Apache 2.0 -error_message = "TS21222: return value is unused.\\n\\tSee go/ts-conformance#check-return-value" +error_message = "TS21222: return value is unused.\\n\\tSee http://tsetse.info/check-return-value" ts_library( name = "no_expected_diagnostics_test", From fd519147d5f235bb2e8ef5c68282288c13a9bfd0 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 21 Apr 2020 09:06:55 -0700 Subject: [PATCH 279/316] Move tsetse/tests/ban_conformance_pattern/* tests into the same directory as the code under test. PiperOrigin-RevId: 307616092 --- .../conformance_pattern_rule_test.ts} | 4 ++-- .../{tests/ban_conformance_pattern => util}/fixer_test.ts | 8 ++++---- .../name_call_non_constant_argument_test.ts | 0 .../pattern_engines/name_engine_test.ts} | 0 .../pattern_engines/property_engine_test.ts} | 0 .../property_non_constant_write_engine_test.ts} | 0 .../pattern_engines/property_read_engine_test.ts} | 0 .../pattern_engines/property_write_engine_test.ts} | 0 .../{tests/ban_conformance_pattern => util}/util_test.ts | 8 ++++---- .../ban_conformance_pattern => util}/whitelist_test.ts | 6 +++--- 10 files changed, 13 insertions(+), 13 deletions(-) rename internal/tsetse/{tests/ban_conformance_pattern/rule_creation_test.ts => rules/conformance_pattern_rule_test.ts} (82%) rename internal/tsetse/{tests/ban_conformance_pattern => util}/fixer_test.ts (96%) rename internal/tsetse/{tests/ban_conformance_pattern => util/pattern_engines}/name_call_non_constant_argument_test.ts (100%) rename internal/tsetse/{tests/ban_conformance_pattern/name_test.ts => util/pattern_engines/name_engine_test.ts} (100%) rename internal/tsetse/{tests/ban_conformance_pattern/property_test.ts => util/pattern_engines/property_engine_test.ts} (100%) rename internal/tsetse/{tests/ban_conformance_pattern/property_non_constant_write_test.ts => util/pattern_engines/property_non_constant_write_engine_test.ts} (100%) rename internal/tsetse/{tests/ban_conformance_pattern/property_read_test.ts => util/pattern_engines/property_read_engine_test.ts} (100%) rename internal/tsetse/{tests/ban_conformance_pattern/property_write_test.ts => util/pattern_engines/property_write_engine_test.ts} (100%) rename internal/tsetse/{tests/ban_conformance_pattern => util}/util_test.ts (97%) rename internal/tsetse/{tests/ban_conformance_pattern => util}/whitelist_test.ts (95%) diff --git a/internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts b/internal/tsetse/rules/conformance_pattern_rule_test.ts similarity index 82% rename from internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts rename to internal/tsetse/rules/conformance_pattern_rule_test.ts index 46cc1563..9d7eaa08 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/rule_creation_test.ts +++ b/internal/tsetse/rules/conformance_pattern_rule_test.ts @@ -1,6 +1,6 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {customMatchers} from '../../util/testing/test_support'; +import {ConformancePatternRule, PatternKind} from './conformance_pattern_rule'; +import {customMatchers} from '../util/testing/test_support'; describe('ConformancePatternRule creation', () => { describe('naming', () => { diff --git a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts b/internal/tsetse/util/fixer_test.ts similarity index 96% rename from internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts rename to internal/tsetse/util/fixer_test.ts index afd91779..8ad3eb99 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/fixer_test.ts +++ b/internal/tsetse/util/fixer_test.ts @@ -1,9 +1,9 @@ import 'jasmine'; import * as ts from 'typescript'; -import {Failure, Fix} from '../../failure'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {buildReplacementFixer, Fixer, maybeAddNamedImport, maybeAddNamespaceImport} from '../../util/fixer'; -import {compile, compileAndCheck, customMatchers} from '../../util/testing/test_support'; +import {Failure, Fix} from '../failure'; +import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {buildReplacementFixer, Fixer, maybeAddNamedImport, maybeAddNamespaceImport} from './fixer'; +import {compile, compileAndCheck, customMatchers} from './testing/test_support'; const uppercaseFixer: Fixer = { getFixForFlaggedNode(node: ts.Node): Fix { diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument_test.ts similarity index 100% rename from internal/tsetse/tests/ban_conformance_pattern/name_call_non_constant_argument_test.ts rename to internal/tsetse/util/pattern_engines/name_call_non_constant_argument_test.ts diff --git a/internal/tsetse/tests/ban_conformance_pattern/name_test.ts b/internal/tsetse/util/pattern_engines/name_engine_test.ts similarity index 100% rename from internal/tsetse/tests/ban_conformance_pattern/name_test.ts rename to internal/tsetse/util/pattern_engines/name_engine_test.ts diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_test.ts b/internal/tsetse/util/pattern_engines/property_engine_test.ts similarity index 100% rename from internal/tsetse/tests/ban_conformance_pattern/property_test.ts rename to internal/tsetse/util/pattern_engines/property_engine_test.ts diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts similarity index 100% rename from internal/tsetse/tests/ban_conformance_pattern/property_non_constant_write_test.ts rename to internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts b/internal/tsetse/util/pattern_engines/property_read_engine_test.ts similarity index 100% rename from internal/tsetse/tests/ban_conformance_pattern/property_read_test.ts rename to internal/tsetse/util/pattern_engines/property_read_engine_test.ts diff --git a/internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts b/internal/tsetse/util/pattern_engines/property_write_engine_test.ts similarity index 100% rename from internal/tsetse/tests/ban_conformance_pattern/property_write_test.ts rename to internal/tsetse/util/pattern_engines/property_write_engine_test.ts diff --git a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts b/internal/tsetse/util/util_test.ts similarity index 97% rename from internal/tsetse/tests/ban_conformance_pattern/util_test.ts rename to internal/tsetse/util/util_test.ts index dd44a5d1..21c33bcf 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/util_test.ts +++ b/internal/tsetse/util/util_test.ts @@ -4,10 +4,10 @@ */ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {isInStockLibraries, setDebug} from '../../util/ast_tools'; -import {isLiteral} from '../../util/is_literal'; -import {compile, compileAndCheck} from '../../util/testing/test_support'; +import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {isInStockLibraries, setDebug} from './ast_tools'; +import {isLiteral} from './is_literal'; +import {compile, compileAndCheck} from './testing/test_support'; describe('Debug output', () => { it('turns on and off', () => { diff --git a/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts b/internal/tsetse/util/whitelist_test.ts similarity index 95% rename from internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts rename to internal/tsetse/util/whitelist_test.ts index 93e17bd9..475c6203 100644 --- a/internal/tsetse/tests/ban_conformance_pattern/whitelist_test.ts +++ b/internal/tsetse/util/whitelist_test.ts @@ -1,7 +1,7 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {WhitelistReason} from '../../util/pattern_config'; -import {compileAndCheck, customMatchers, getTempDirForWhitelist} from '../../util/testing/test_support'; +import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {WhitelistReason} from './pattern_config'; +import {compileAndCheck, customMatchers, getTempDirForWhitelist} from './testing/test_support'; const tmpPrefixForWhitelist = getTempDirForWhitelist(); const tmpRegexpForWhitelist = From 90fe735fbdfe23f41a1589029bfdb51231cd4742 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Fri, 24 Apr 2020 14:53:09 -0700 Subject: [PATCH 280/316] Restrict AbsoluteMatcher to match FQN rather than suffix of FQN. PiperOrigin-RevId: 308331290 --- internal/tsetse/util/match_symbol.ts | 6 ++++-- internal/tsetse/util/util_test.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index 842292c8..80ec1661 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -107,8 +107,10 @@ export class AbsoluteMatcher { const fqn = tc.getFullyQualifiedName(s); debugLog(`got FQN ${fqn}`); - // Name-based check - if (!(fqn.endsWith('.' + this.bannedName) || fqn === this.bannedName)) { + // Name-based check: `getFullyQualifiedName` returns `"filename".foo.bar` or + // just `foo.bar` if the symbol is ambient. The check here should consider + // both cases. + if (!(fqn.endsWith('".' + this.bannedName) || fqn === this.bannedName)) { debugLog(`FQN ${fqn} doesn't match name ${this.bannedName}`); return false; // not a use of the symbols we want } diff --git a/internal/tsetse/util/util_test.ts b/internal/tsetse/util/util_test.ts index 21c33bcf..e4a15dad 100644 --- a/internal/tsetse/util/util_test.ts +++ b/internal/tsetse/util/util_test.ts @@ -268,6 +268,23 @@ describe('test AbsoluteMatcher', () => { expect(results).toHaveNoFailures(); }); + it('Property of type defined in in-stock library', () => { + const config = { + errorMessage: 'banned name without file path', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|open'] + }; + const sources = [ + 'const elem = new XMLHttpRequest();', + 'elem.open("get", "url");', // FQN of elem.open is XMLHttpRequest.open + // and shouldn't be banned + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + it('inheritance test 1', () => { // This is a match because Moo inherits bar from Foo. const config = { From 98fd4df65c702b7d0e303ea316e0127c08e5f04a Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Sat, 25 Apr 2020 14:44:38 -0700 Subject: [PATCH 281/316] Fix the bug where AbsoluteMatcher misses identifiers used in the initializer of a named declaration. PiperOrigin-RevId: 308440132 --- internal/tsetse/util/ast_tools.ts | 34 +++++++++++++++++----------- internal/tsetse/util/match_symbol.ts | 4 ++-- internal/tsetse/util/util_test.ts | 15 ++++++++++++ 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index 024c0087..39a447c8 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -124,22 +124,30 @@ export function isPartOfImportStatement(n: ts.Node) { p => p.kind === ts.SyntaxKind.ImportDeclaration); } -/** - * Returns whether `n` is a declaration. - */ -export function isDeclaration(n: ts.Node): n is ts.VariableDeclaration| - ts.ClassDeclaration|ts.FunctionDeclaration|ts.MethodDeclaration| - ts.PropertyDeclaration|ts.VariableDeclarationList|ts.InterfaceDeclaration| +function isWhitelistedNamedDeclaration(n: ts.Node): + n is ts.VariableDeclaration|ts.ClassDeclaration|ts.FunctionDeclaration| + ts.MethodDeclaration|ts.PropertyDeclaration|ts.InterfaceDeclaration| ts.TypeAliasDeclaration|ts.EnumDeclaration|ts.ModuleDeclaration| - ts.ImportDeclaration|ts.ImportEqualsDeclaration|ts.ExportDeclaration| - ts.MissingDeclaration { + ts.ImportEqualsDeclaration|ts.ExportDeclaration|ts.MissingDeclaration| + ts.ImportClause|ts.ExportSpecifier|ts.ImportSpecifier { return ts.isVariableDeclaration(n) || ts.isClassDeclaration(n) || ts.isFunctionDeclaration(n) || ts.isMethodDeclaration(n) || - ts.isPropertyDeclaration(n) || ts.isVariableDeclarationList(n) || - ts.isInterfaceDeclaration(n) || ts.isTypeAliasDeclaration(n) || - ts.isEnumDeclaration(n) || ts.isModuleDeclaration(n) || - ts.isImportDeclaration(n) || ts.isImportEqualsDeclaration(n) || - ts.isExportDeclaration(n) || ts.isMissingDeclaration(n); + ts.isPropertyDeclaration(n) || ts.isInterfaceDeclaration(n) || + ts.isTypeAliasDeclaration(n) || ts.isEnumDeclaration(n) || + ts.isModuleDeclaration(n) || ts.isImportEqualsDeclaration(n) || + ts.isExportDeclaration(n) || ts.isMissingDeclaration(n) || + ts.isImportClause(n) || ts.isExportSpecifier(n) || + ts.isImportSpecifier(n); +} + +/** Returns whether `n` is being declared in a declaration statement. */ +export function isNameInDeclaration(n: ts.Node): boolean { + const p = n.parent; + if (p === undefined) return false; + + return (isWhitelistedNamedDeclaration(p) && p.name === n) || + // TODO(pwng) Double-check if these two cases are needed + ts.isVariableDeclarationList(p) || ts.isImportDeclaration(p); } /** Type guard for expressions that looks like property writes. */ diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index 80ec1661..721ddec2 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -1,5 +1,5 @@ import * as ts from 'typescript'; -import {dealias, debugLog, isAmbientDeclaration, isDeclaration, isInStockLibraries, isPartOfImportStatement} from './ast_tools'; +import {dealias, debugLog, isAmbientDeclaration, isInStockLibraries, isNameInDeclaration, isPartOfImportStatement} from './ast_tools'; const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; @@ -120,7 +120,7 @@ export class AbsoluteMatcher { // avoid flooding users with warnings (as the actual use will be alerted) // and bad fixes. const p = n.parent; - if (p && (isDeclaration(p) || isPartOfImportStatement(p))) { + if (isNameInDeclaration(n) || (p && isPartOfImportStatement(p))) { debugLog(`We don't flag symbol declarations`); return false; } diff --git a/internal/tsetse/util/util_test.ts b/internal/tsetse/util/util_test.ts index e4a15dad..166299e2 100644 --- a/internal/tsetse/util/util_test.ts +++ b/internal/tsetse/util/util_test.ts @@ -194,6 +194,21 @@ describe('test AbsoluteMatcher', () => { expect(results).toHaveNoFailures(); }); + it('In-stock lib symbol used as part of the initializer in named declaration', + () => { + const config = { + errorMessage: 'banned ambient name', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|open'], + }; + const sources = ['const op = open;']; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: 'open', messageText: 'banned ambient name'}); + }); + it('local non-exported definition', () => { // This is not a match because Foo.bar is a non-exported locally defined // symbol. From 38c82726b958d6c8ff065d5b9347584b3e754ea9 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Sat, 25 Apr 2020 22:05:52 -0700 Subject: [PATCH 282/316] Support multi-value config in all pattern engines. PiperOrigin-RevId: 308466106 --- internal/tsetse/util/ast_tools.ts | 2 + .../name_call_non_constant_argument.ts | 105 +++++++------- .../util/pattern_engines/name_engine.ts | 48 +++---- .../util/pattern_engines/pattern_engine.ts | 38 +++--- .../util/pattern_engines/property_engine.ts | 53 +++----- .../property_non_constant_write_engine.ts | 57 ++++---- .../pattern_engines/property_read_engine.ts | 128 +++++++++--------- .../pattern_engines/property_write_engine.ts | 66 ++++----- 8 files changed, 233 insertions(+), 264 deletions(-) diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index 39a447c8..ee012bf7 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -59,6 +59,8 @@ export function findInChildren( * blocks, module declarations, JSDoc, lib.d.ts nodes, that kind of things. */ export function shouldExamineNode(n: ts.Node) { + // TODO(b/154674207): Only `isInStockLibraries` seems to be effective here. + // Remove the others. return !( ts.isBlock(n) || ts.isModuleBlock(n) || ts.isModuleDeclaration(n) || ts.isSourceFile(n) || (n.parent && ts.isTypeNode(n.parent)) || diff --git a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts index 1af786db..48cf99b6 100644 --- a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts +++ b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts @@ -8,6 +8,46 @@ import {AbsoluteMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; +function parseSpec(value: string): [AbsoluteMatcher, number] { + const [matcherSpec, strPosition] = value.split(':', 2); + if (!matcherSpec || !strPosition.match('^\\d+$')) { + throw new Error(`Couldn\'t parse value '${value}'`); + } + const position = Number(strPosition); + return [new AbsoluteMatcher(matcherSpec), position]; +} + +/** + * Inspects a particular CallExpression to see if it calls the target + * function with a non-literal parameter in the target position. Returns + * that CallExpression if `n` matches the search, undefined otherwise. + */ +function checkCallExpr( + tc: ts.TypeChecker, n: ts.CallExpression, matcher: AbsoluteMatcher, + position: number): ts.CallExpression|undefined { + debugLog(`inspecting ${n.getText().trim()}`); + + if (!matcher.matches(n.expression, tc)) { + debugLog(`Wrong symbol, not ${matcher.bannedName}`); + return; + } + if (n.arguments.length < position) { + debugLog(`Good symbol, not enough arguments to match (got ${ + n.arguments.length}, want ${position})`); + return; + } + if (isLiteral(tc, n.arguments[position])) { + debugLog(`Good symbol, argument literal`); + return; + } + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + + // No match. + return; +} + /** * The engine for BANNED_CALL_NON_CONSTANT_ARGUMENT. * @@ -22,65 +62,16 @@ import {PatternEngine} from './pattern_engine'; * function "buildFromParts" that lives in its own module. */ export class CallNonConstantArgumentEngine extends PatternEngine { - private readonly matchers: Array<[AbsoluteMatcher, number]> = []; - - constructor(config: Config, fixer?: Fixer) { - super(config, fixer); - for (const v of config.values) { - const [matcherSpec, strPosition] = v.split(':', 2); - if (!matcherSpec || !strPosition.match('^\\d+$')) { - throw new Error('Couldn\'t parse values'); - } - const position = Number(strPosition); - this.matchers.push([new AbsoluteMatcher(matcherSpec), position]); - } - } - register(checker: Checker) { - checker.on( - ts.SyntaxKind.CallExpression, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); - } - - check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - if (!ts.isCallExpression(n)) { - debugLog(`Should not happen: node is not a CallExpression`); - return; - } - debugLog(`inspecting ${n.getText().trim()}`); + for (const value of this.config.values) { + const [matcher, position] = parseSpec(value); - /** - * Inspects a particular CallExpression to see if it calls the target - * function with a non-literal parameter in the target position. Returns - * that CallExpression if `n` matches the search, undefined otherwise. - */ - function checkIndividual( - n: ts.CallExpression, m: [AbsoluteMatcher, number]): ts.CallExpression| - undefined { - if (!m[0].matches(n.expression, tc)) { - debugLog(`Wrong symbol, not ${m[0].bannedName}`); - return; - } - if (n.arguments.length < m[1]) { - debugLog(`Good symbol, not enough arguments to match (got ${ - n.arguments.length}, want ${m[1]})`); - return; - } - if (isLiteral(tc, n.arguments[m[1]])) { - debugLog(`Good symbol, argument literal`); - return; - } - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; + checker.on( + ts.SyntaxKind.CallExpression, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.CallExpression) => + checkCallExpr(tc, n, matcher, position)), + ErrorCode.CONFORMANCE_PATTERN); } - - for (const m of this.matchers) { - // The first matching matcher will be used. - const r = checkIndividual(n, m); - if (r) return r; - } - // No match. - return; } } diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index 666779b8..07742a4b 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -2,41 +2,37 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; -import {debugLog, shouldExamineNode} from '../ast_tools'; +import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; import {AbsoluteMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; -export class NameEngine extends PatternEngine { - private readonly matcher: AbsoluteMatcher; - constructor(config: Config, fixer?: Fixer) { - super(config, fixer); - // TODO: Support more than one single value here, or even build a - // multi-pattern engine. This would help for performance. - if (this.config.values.length !== 1) { - throw new Error(`BANNED_NAME expects one value, got(${ - this.config.values.join(',')})`); - } - this.matcher = new AbsoluteMatcher(this.config.values[0]); +function checkId( + tc: ts.TypeChecker, n: ts.Identifier, + matcher: AbsoluteMatcher): ts.Identifier|undefined { + debugLog(`inspecting ${n.getText().trim()}`); + if (!matcher.matches(n, tc)) { + debugLog('Not the right global name.'); + return; } + return n; +} +export class NameEngine extends PatternEngine { register(checker: Checker) { - // `String.prototype.split` only returns emtpy array when both the string - // and the splitter are empty. Here we should be able to safely assert pop - // returns a non-null result. - const bannedIdName = this.matcher.bannedName.split('.').pop()!; - checker.onNamedIdentifier(bannedIdName, (c: Checker, n: ts.Node) => { - this.checkAndFilterResults(c, n); - }, ErrorCode.CONFORMANCE_PATTERN); - } + for (const value of this.config.values) { + const matcher = new AbsoluteMatcher(value); - check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - debugLog(`inspecting ${n.getText().trim()}`); - if (!this.matcher.matches(n, tc)) { - debugLog('Not the right global name.'); - return; + // `String.prototype.split` only returns emtpy array when both the string + // and the splitter are empty. Here we should be able to safely assert pop + // returns a non-null result. + const bannedIdName = matcher.bannedName.split('.').pop()!; + checker.onNamedIdentifier( + bannedIdName, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.Identifier) => checkId(tc, n, matcher)), + ErrorCode.CONFORMANCE_PATTERN); } - return n; } } diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index d6b60ce8..f0f1d66d 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -1,4 +1,5 @@ import * as ts from 'typescript'; + import {Checker} from '../../checker'; import {Fix} from '../../failure'; import {Fixer} from '../../util/fixer'; @@ -37,26 +38,25 @@ export abstract class PatternEngine { abstract register(checker: Checker): void; /** - * `check` is the PatternEngine subclass-specific matching logic. Overwrite - * with what the engine looks for, i.e., AST matching. The whitelisting logic - * and fix generation are handled in `checkAndFilterResults`. - */ - abstract check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined; - - /** - * A wrapper for `check` that handles aspects of the analysis that are not - * engine-specific, and which defers to the subclass-specific logic - * afterwards. + * A composer that wraps checking functions with code handling aspects of the + * analysis that are not engine-specific, and which defers to the + * subclass-specific logic afterwards. Subclasses should transform their + * checking logic with this composer before registered on the checker. */ - checkAndFilterResults(c: Checker, n: ts.Node) { - if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { - return; - } - const matchedNode = this.check(c.typeChecker, n); - if (matchedNode && !this.isWhitelisted(matchedNode)) { - const fix: Fix|undefined = - this.fixer ? this.fixer.getFixForFlaggedNode(matchedNode) : undefined; - c.addFailureAtNode(matchedNode, this.config.errorMessage, fix); + protected wrapCheckWithWhitelistingAndFixer( + checkFunction: (tc: ts.TypeChecker, n: T) => ts.Node | + undefined): (c: Checker, n: T) => void { + return (c: Checker, n: T) => { + if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { + return; + } + const matchedNode = checkFunction(c.typeChecker, n); + if (matchedNode && !this.isWhitelisted(matchedNode)) { + const fix: Fix|undefined = this.fixer ? + this.fixer.getFixForFlaggedNode(matchedNode) : + undefined; + c.addFailureAtNode(matchedNode, this.config.errorMessage, fix); + } } } diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts index a3b2a8c4..2476a6b2 100644 --- a/internal/tsetse/util/pattern_engines/property_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -8,43 +8,34 @@ import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; +function checkPropAccessExpr( + tc: ts.TypeChecker, n: ts.PropertyAccessExpression, + matcher: PropertyMatcher): ts.Node|undefined { + debugLog(`inspecting ${n.getText().trim()}`); + if (!matcher.matches(n, tc)) { + return; + } + return n; +} + /** * Engine for the BANNED_PROPERTY pattern. It captures accesses to property * matching the spec regardless whether it's a read or write. */ export class PropertyEngine extends PatternEngine { - private readonly matcher: PropertyMatcher; - constructor(config: Config, fixer?: Fixer) { - super(config, fixer); - // Although noted in other engines, it is difficult to support multiple - // values within the current design. It may be easier to only allow a single - // value in the config. - if (this.config.values.length !== 1) { - throw new Error(`BANNED_PROPERTY expects one value, got(${ - this.config.values.join(',')})`); - } - this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); - } - register(checker: Checker) { - checker.onNamedPropertyAccess( - this.matcher.bannedProperty, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); - } - - // TODO(pwng): only plain property access expressions are supported for now. - // In the future, support more patterns including `location['href']` and - // `const {href} = location;`. That possibly requires refactoring - // `PropertyMatcher` or adding new types of matchers. - check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - if (!ts.isPropertyAccessExpression(n)) { - throw new Error( - `Should not happen: node is not a PropertyAccessExpression`); - } - debugLog(`inspecting ${n.getText().trim()}`); - if (!this.matcher.matches(n, tc)) { - return; + for (const value of this.config.values) { + const matcher = PropertyMatcher.fromSpec(value); + // TODO(b/154675140): only plain property access expressions are supported + // for now. In the future, support more patterns including + // `location['href']` and `const {href} = location;`. That possibly + // requires refactoring `PropertyMatcher` or adding new types of matchers. + checker.onNamedPropertyAccess( + matcher.bannedProperty, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.PropertyAccessExpression) => + checkPropAccessExpr(tc, n, matcher)), + ErrorCode.CONFORMANCE_PATTERN); } - return n; } } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index 08b67813..dca8503d 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -8,43 +8,38 @@ import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; +function checkBinExpr( + tc: ts.TypeChecker, n: ts.BinaryExpression, + matcher: PropertyMatcher): ts.Node|undefined { + if (!isPropertyWriteExpression(n)) { + return; + } + debugLog(`inspecting ${n.getFullText().trim()}`); + if (!matcher.matches(n.left, tc)) { + debugLog('Not an assignment to the right property'); + return; + } + if (isLiteral(tc, n.right)) { + debugLog(`Assigned value (${ + n.right.getFullText()}) is a compile-time constant.`); + return; + } + return n; +} + /** * The engine for BANNED_PROPERTY_NON_CONSTANT_WRITE. */ export class PropertyNonConstantWriteEngine extends PatternEngine { - private readonly matcher: PropertyMatcher; - constructor(config: Config, fixer?: Fixer) { - super(config, fixer); - // TODO: Support more than one single value here, or even build a - // multi-pattern engine. This would help for performance. - if (this.config.values.length !== 1) { - throw new Error( - `BANNED_PROPERTY_NON_CONSTANT_WRITE expects one value, got(${ - this.config.values.join(',')})`); - } - this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); - } - register(checker: Checker) { - checker.on( - ts.SyntaxKind.BinaryExpression, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); - } + for (const value of this.config.values) { + const matcher = PropertyMatcher.fromSpec(value); - check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - if (!isPropertyWriteExpression(n)) { - return; - } - debugLog(`inspecting ${n.getFullText().trim()}`); - if (!this.matcher.matches(n.left, tc)) { - debugLog('Not an assignment to the right property'); - return; - } - if (isLiteral(tc, n.right)) { - debugLog(`Assigned value (${ - n.right.getFullText()}) is a compile-time constant.`); - return; + checker.on( + ts.SyntaxKind.BinaryExpression, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.BinaryExpression) => checkBinExpr(tc, n, matcher)), + ErrorCode.CONFORMANCE_PATTERN); } - return n; } } diff --git a/internal/tsetse/util/pattern_engines/property_read_engine.ts b/internal/tsetse/util/pattern_engines/property_read_engine.ts index 03a4e02a..f6f71124 100644 --- a/internal/tsetse/util/pattern_engines/property_read_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_read_engine.ts @@ -8,76 +8,78 @@ import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; /** - * The engine for BANNED_PROPERTY_READ. + * Check property read in variable initializations. For example, var a = + * object.property. */ -export class PropertyReadEngine extends PatternEngine { - private readonly matcher: PropertyMatcher; - constructor(config: Config, fixer?: Fixer) { - super(config, fixer); - // TODO: Support more than one single value here, or even build a - // multi-pattern engine. This would help for performance. - if (this.config.values.length !== 1) { - throw new Error(`BANNED_PROPERTY_READ expects one value, got(${ - this.config.values.join(',')})`); +function checkVarStmt( + tc: ts.TypeChecker, n: ts.VariableStatement, + matcher: PropertyMatcher): ts.Node|undefined { + for (const declaration of n.declarationList.declarations) { + if (declaration.initializer !== undefined && + ts.isPropertyAccessExpression(declaration.initializer)) { + debugLog(`Inspecting ${n.getText().trim()}`); + if (matcher.matches(declaration.initializer, tc)) { + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + } } - this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); } + return; +} - register(checker: Checker) { - checker.on( - ts.SyntaxKind.VariableStatement, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); - checker.on( - ts.SyntaxKind.BinaryExpression, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); +/** + * Check property read in binary expressions. If it is an assignment, it is a + * match if the property access appears at the RHS of the assignment. + */ +function checkBinExpr( + tc: ts.TypeChecker, n: ts.BinaryExpression, + matcher: PropertyMatcher): ts.Node|undefined { + debugLog(`inspecting ${n.getText().trim()}`); + // If the expression is an assignment, then the property must appear + // at the right-hand side of the expression. + if (n.operatorToken.getText().trim() === '=') { + if (ts.isPropertyAccessExpression(n.right) && + matcher.matches(n.right, tc)) { + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; + } } - - check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - // Check property read in variable initializations. - // For example, var a = object.property. - if (ts.isVariableStatement(n)) { - for (const declaration of n.declarationList.declarations) { - if (declaration.initializer !== undefined && - ts.isPropertyAccessExpression(declaration.initializer)) { - debugLog(`Inspecting ${n.getText().trim()}`); - if (this.matcher.matches(declaration.initializer, tc)) { - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - } - } - } + // If it is a non-assignment binary expression, + // the property access may appear either side of the expression. + else { + if ((ts.isPropertyAccessExpression(n.right) && + matcher.matches(n.right, tc)) || + (ts.isPropertyAccessExpression(n.left) && + matcher.matches(n.left, tc))) { + debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); + return n; } + } + return; +} - // Check property read in binary expressions. - // If it is an assignment, it is a match if the property access - // appears at the RHS of the assignment. - if (ts.isBinaryExpression(n)) { - debugLog(`inspecting ${n.getText().trim()}`); - // If the expression is an assignment, then the property must appear at - // the right-hand side of the expression. - if (n.operatorToken.getText().trim() === '=') { - if (ts.isPropertyAccessExpression(n.right) && - this.matcher.matches(n.right, tc)) { - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - } - } - // If it is a non-assignment binary expression, - // the property access may appear either side of the expression. - else { - if ((ts.isPropertyAccessExpression(n.right) && - this.matcher.matches(n.right, tc)) || - (ts.isPropertyAccessExpression(n.left) && - this.matcher.matches(n.left, tc))) { - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - } - } - } +/** + * The engine for BANNED_PROPERTY_READ. + */ +export class PropertyReadEngine extends PatternEngine { + register(checker: Checker) { + for (const value of this.config.values) { + const matcher = PropertyMatcher.fromSpec(value); - return; + checker.on( + ts.SyntaxKind.VariableStatement, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.VariableStatement) => checkVarStmt(tc, n, matcher)), + ErrorCode.CONFORMANCE_PATTERN); + + checker.on( + ts.SyntaxKind.BinaryExpression, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.BinaryExpression) => checkBinExpr(tc, n, matcher)), + ErrorCode.CONFORMANCE_PATTERN); + } } } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 9ca2887a..9145a8b3 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -7,50 +7,42 @@ import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; -/** - * The engine for BANNED_PROPERTY_WRITE. - */ -export class PropertyWriteEngine extends PatternEngine { - private readonly matcher: PropertyMatcher; - constructor(config: Config, fixer?: Fixer) { - super(config, fixer); - // TODO: Support more than one single value here, or even build a - // multi-pattern engine. This would help for performance. - if (this.config.values.length !== 1) { - throw new Error(`BANNED_PROPERTY_WRITE expects one value, got(${ - this.config.values.join(',')})`); - } - this.matcher = PropertyMatcher.fromSpec(this.config.values[0]); +function checkPropAccessExpr( + tc: ts.TypeChecker, n: ts.PropertyAccessExpression, + matcher: PropertyMatcher): ts.Node|undefined { + if (!ts.isBinaryExpression(n.parent)) { + return; } - register(checker: Checker) { - checker.onNamedPropertyAccess( - this.matcher.bannedProperty, this.checkAndFilterResults.bind(this), - ErrorCode.CONFORMANCE_PATTERN); + if (n.parent.operatorToken.getText().trim() !== '=') { + return; } - check(tc: ts.TypeChecker, n: ts.Node): ts.Node|undefined { - if (!ts.isPropertyAccessExpression(n)) { - throw new Error( - `Should not happen: node is not a PropertyAccessExpression`); - } - - if (!ts.isBinaryExpression(n.parent)) { - return; - } + if (n.parent.left !== n) { + return; + } - if (n.parent.operatorToken.getText().trim() !== '=') { - return; - } + debugLog(`inspecting ${n.parent.getText().trim()}`); + if (!matcher.matches(n, tc)) { + return; + } + return n.parent; +} - if (n.parent.left !== n) { - return; - } +/** + * The engine for BANNED_PROPERTY_WRITE. + */ +export class PropertyWriteEngine extends PatternEngine { + register(checker: Checker) { + for (const value of this.config.values) { + const matcher = PropertyMatcher.fromSpec(value); - debugLog(`inspecting ${n.parent.getText().trim()}`); - if (!this.matcher.matches(n, tc)) { - return; + checker.onNamedPropertyAccess( + matcher.bannedProperty, + this.wrapCheckWithWhitelistingAndFixer( + (tc, n: ts.PropertyAccessExpression) => + checkPropAccessExpr(tc, n, matcher)), + ErrorCode.CONFORMANCE_PATTERN); } - return n.parent; } } From 548b6726cfdf25c8f84842522770bc7e2ce9523a Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 27 Apr 2020 10:17:27 -0700 Subject: [PATCH 283/316] Allow `debugLog` to accept lazily evaluated arguments to avoid building expensive strings when unnecessary. PiperOrigin-RevId: 308645875 --- internal/tsetse/util/ast_tools.ts | 10 ++++---- internal/tsetse/util/fixer.ts | 23 ++++++++++-------- internal/tsetse/util/match_symbol.ts | 24 +++++++++---------- .../name_call_non_constant_argument.ts | 16 +++++++------ .../util/pattern_engines/name_engine.ts | 4 ++-- .../util/pattern_engines/property_engine.ts | 2 +- .../property_non_constant_write_engine.ts | 9 +++---- .../pattern_engines/property_read_engine.ts | 19 ++++++++------- .../pattern_engines/property_write_engine.ts | 2 +- 9 files changed, 60 insertions(+), 49 deletions(-) diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index ee012bf7..748d1b66 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -20,8 +20,10 @@ export function setDebug(state: boolean) { /** * Debug helper. */ -export function debugLog(msg: string) { - if (DEBUG) console.log(msg); +export function debugLog(msg: () => string) { + if (DEBUG) { + console.log(msg()); + } } /** @@ -186,6 +188,6 @@ export function logASTWalkError(verbose: boolean, n: ts.Node, e: Error) { } catch { } debugLog( - `Walking node ${nodeText} failed with error ${e}.\n` + - `Stacktrace:\n${e.stack}`); + () => `Walking node ${nodeText} failed with error ${e}.\n` + + `Stacktrace:\n${e.stack}`); } diff --git a/internal/tsetse/util/fixer.ts b/internal/tsetse/util/fixer.ts index 2b769832..75138ba7 100644 --- a/internal/tsetse/util/fixer.ts +++ b/internal/tsetse/util/fixer.ts @@ -64,7 +64,7 @@ export function maybeAddNamedImport( continue; // Jump to the next import. } if (ts.isNamespaceImport(parsedDecl.namedBindings)) { - debugLog(`... but it's a wildcard import`); + debugLog(() => `... but it's a wildcard import`); continue; // Jump to the next import. } @@ -77,12 +77,13 @@ export function maybeAddNamedImport( iSpec.name.getText() === importWhat); // import {foo} if (foundRightImport) { - debugLog(`"${iDecl.getFullText()}" imports ${importWhat} as we want.`); + debugLog( + () => `"${iDecl.getFullText()}" imports ${importWhat} as we want.`); return; // Our request is already imported under the right name. } // Else, insert our symbol in the list of imports from that file. - debugLog(`No named imports from that file, generating new fix`); + debugLog(() => `No named imports from that file, generating new fix`); return { start: parsedDecl.namedBindings.elements[0].getStart(), end: parsedDecl.namedBindings.elements[0].getStart(), @@ -125,18 +126,18 @@ export function maybeAddNamespaceImport( // Not an import from the right file, or couldn't understand the import. return false; } - debugLog(`"${iDecl.getFullText()}" is an import from the right file`); + debugLog(() => `"${iDecl.getFullText()}" is an import from the right file`); if (ts.isNamedImports(parsedDecl.namedBindings)) { - debugLog(`... but it's a named import`); + debugLog(() => `... but it's a named import`); return false; // irrelevant to our namespace imports } // Else, bindings is a NamespaceImport. if (parsedDecl.namedBindings.name.getText() !== importAs) { - debugLog(`... but not the right name, we need to reimport`); + debugLog(() => `... but not the right name, we need to reimport`); return false; } - debugLog(`... and the right name, no need to reimport`); + debugLog(() => `... and the right name, no need to reimport`); return true; }); @@ -167,7 +168,9 @@ function maybeParseImportNode(iDecl: ts.ImportDeclaration): { }|undefined { if (!iDecl.importClause) { // something like import "./file"; - debugLog(`Ignoring import without imported symbol: ${iDecl.getFullText()}`); + debugLog( + () => + `Ignoring import without imported symbol: ${iDecl.getFullText()}`); return; } if (iDecl.importClause.name || !iDecl.importClause.namedBindings) { @@ -175,11 +178,11 @@ function maybeParseImportNode(iDecl: ts.ImportDeclaration): { // Not much we can do with that when trying to get a hold of some symbols, // so just ignore that line (worst case, we'll suggest another import // style). - debugLog(`Ignoring import: ${iDecl.getFullText()}`); + debugLog(() => `Ignoring import: ${iDecl.getFullText()}`); return; } if (!ts.isStringLiteral(iDecl.moduleSpecifier)) { - debugLog(`Ignoring import whose module specifier is not literal`); + debugLog(() => `Ignoring import whose module specifier is not literal`); return; } return { diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/match_symbol.ts index 721ddec2..3d00d088 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/match_symbol.ts @@ -98,20 +98,20 @@ export class AbsoluteMatcher { // looking at. const s = dealias(tc.getSymbolAtLocation(n), tc); if (!s) { - debugLog(`cannot get symbol`); + debugLog(() => `cannot get symbol`); return false; } // The TS-provided FQN tells us the full identifier, and the origin file // in some circumstances. const fqn = tc.getFullyQualifiedName(s); - debugLog(`got FQN ${fqn}`); + debugLog(() => `got FQN ${fqn}`); // Name-based check: `getFullyQualifiedName` returns `"filename".foo.bar` or // just `foo.bar` if the symbol is ambient. The check here should consider // both cases. if (!(fqn.endsWith('".' + this.bannedName) || fqn === this.bannedName)) { - debugLog(`FQN ${fqn} doesn't match name ${this.bannedName}`); + debugLog(() => `FQN ${fqn} doesn't match name ${this.bannedName}`); return false; // not a use of the symbols we want } @@ -121,7 +121,7 @@ export class AbsoluteMatcher { // and bad fixes. const p = n.parent; if (isNameInDeclaration(n) || (p && isPartOfImportStatement(p))) { - debugLog(`We don't flag symbol declarations`); + debugLog(() => `We don't flag symbol declarations`); return false; } @@ -137,20 +137,20 @@ export class AbsoluteMatcher { // local symbol or ambient symbol), it is not a match. if (this.filePath !== GLOBAL && this.filePath !== ANY_SYMBOL) { debugLog( - `The symbol has no file path and one is specified by the ` + - `matcher`); + () => + `The symbol has no file path and one is specified by the matcher`); return false; } // We need to trace things back, so get declarations of the symbol. const declarations = s.getDeclarations(); if (!declarations) { - debugLog(`Symbol never declared?`); + debugLog(() => `Symbol never declared?`); return false; } if (!declarations.some(isAmbientDeclaration) && !declarations.some(isInStockLibraries)) { - debugLog(`Symbol neither ambient nor from the stock libraries`); + debugLog(() => `Symbol neither ambient nor from the stock libraries`); return false; } } @@ -163,17 +163,17 @@ export class AbsoluteMatcher { throw new Error('Malformed fully-qualified name.'); } const sympath = fqn.substring(1, last); - debugLog(`The file path of the symbol is ${sympath}`); + debugLog(() => `The file path of the symbol is ${sympath}`); if (!sympath.match(this.filePath) || this.filePath === GLOBAL) { debugLog( - `The file path of the symbol does not match the ` + - `file path of the matcher`); + () => + `The file path of the symbol does not match the file path of the matcher`); return false; } } } - debugLog(`all clear, report finding`); + debugLog(() => `all clear, report finding`); return true; } } diff --git a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts index 48cf99b6..3f6863e1 100644 --- a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts +++ b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts @@ -25,23 +25,25 @@ function parseSpec(value: string): [AbsoluteMatcher, number] { function checkCallExpr( tc: ts.TypeChecker, n: ts.CallExpression, matcher: AbsoluteMatcher, position: number): ts.CallExpression|undefined { - debugLog(`inspecting ${n.getText().trim()}`); + debugLog(() => `inspecting ${n.getText().trim()}`); if (!matcher.matches(n.expression, tc)) { - debugLog(`Wrong symbol, not ${matcher.bannedName}`); + debugLog(() => `Wrong symbol, not ${matcher.bannedName}`); return; } if (n.arguments.length < position) { - debugLog(`Good symbol, not enough arguments to match (got ${ - n.arguments.length}, want ${position})`); + debugLog( + () => `Good symbol, not enough arguments to match (got ${ + n.arguments.length}, want ${position})`); return; } if (isLiteral(tc, n.arguments[position])) { - debugLog(`Good symbol, argument literal`); + debugLog(() => `Good symbol, argument literal`); return; } - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); + debugLog( + () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); return n; // No match. diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index 07742a4b..0731d715 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -11,9 +11,9 @@ import {PatternEngine} from './pattern_engine'; function checkId( tc: ts.TypeChecker, n: ts.Identifier, matcher: AbsoluteMatcher): ts.Identifier|undefined { - debugLog(`inspecting ${n.getText().trim()}`); + debugLog(() => `inspecting ${n.getText().trim()}`); if (!matcher.matches(n, tc)) { - debugLog('Not the right global name.'); + debugLog(() => 'Not the right global name.'); return; } return n; diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts index 2476a6b2..8f0bbe6d 100644 --- a/internal/tsetse/util/pattern_engines/property_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -11,7 +11,7 @@ import {PatternEngine} from '../pattern_engines/pattern_engine'; function checkPropAccessExpr( tc: ts.TypeChecker, n: ts.PropertyAccessExpression, matcher: PropertyMatcher): ts.Node|undefined { - debugLog(`inspecting ${n.getText().trim()}`); + debugLog(() => `inspecting ${n.getText().trim()}`); if (!matcher.matches(n, tc)) { return; } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index dca8503d..0496f0c6 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -14,14 +14,15 @@ function checkBinExpr( if (!isPropertyWriteExpression(n)) { return; } - debugLog(`inspecting ${n.getFullText().trim()}`); + debugLog(() => `inspecting ${n.getFullText().trim()}`); if (!matcher.matches(n.left, tc)) { - debugLog('Not an assignment to the right property'); + debugLog(() => 'Not an assignment to the right property'); return; } if (isLiteral(tc, n.right)) { - debugLog(`Assigned value (${ - n.right.getFullText()}) is a compile-time constant.`); + debugLog( + () => `Assigned value (${ + n.right.getFullText()}) is a compile-time constant.`); return; } return n; diff --git a/internal/tsetse/util/pattern_engines/property_read_engine.ts b/internal/tsetse/util/pattern_engines/property_read_engine.ts index f6f71124..9b129390 100644 --- a/internal/tsetse/util/pattern_engines/property_read_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_read_engine.ts @@ -17,10 +17,11 @@ function checkVarStmt( for (const declaration of n.declarationList.declarations) { if (declaration.initializer !== undefined && ts.isPropertyAccessExpression(declaration.initializer)) { - debugLog(`Inspecting ${n.getText().trim()}`); + debugLog(() => `Inspecting ${n.getText().trim()}`); if (matcher.matches(declaration.initializer, tc)) { - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); + debugLog( + () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); return n; } } @@ -35,14 +36,15 @@ function checkVarStmt( function checkBinExpr( tc: ts.TypeChecker, n: ts.BinaryExpression, matcher: PropertyMatcher): ts.Node|undefined { - debugLog(`inspecting ${n.getText().trim()}`); + debugLog(() => `inspecting ${n.getText().trim()}`); // If the expression is an assignment, then the property must appear // at the right-hand side of the expression. if (n.operatorToken.getText().trim() === '=') { if (ts.isPropertyAccessExpression(n.right) && matcher.matches(n.right, tc)) { - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); + debugLog( + () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); return n; } } @@ -53,8 +55,9 @@ function checkBinExpr( matcher.matches(n.right, tc)) || (ts.isPropertyAccessExpression(n.left) && matcher.matches(n.left, tc))) { - debugLog(`Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); + debugLog( + () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ + n.getEnd()}] on node [${n.getText()}]`); return n; } } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 9145a8b3..30cd443d 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -22,7 +22,7 @@ function checkPropAccessExpr( return; } - debugLog(`inspecting ${n.parent.getText().trim()}`); + debugLog(() => `inspecting ${n.parent.getText().trim()}`); if (!matcher.matches(n, tc)) { return; } From 186fc50b3194c9a80f6e7de0429def1ee717f48b Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 28 Apr 2020 17:52:12 -0700 Subject: [PATCH 284/316] Clean up file organization and tests for tsetse matchers: * Split AbsoluteMatcher and PropertyMatcher into two separate files. * Move unit tests from a combined file to multiple files with names matching the source under test. * Update Jasmine test names to describe expected behavior. PiperOrigin-RevId: 308933530 --- .../{match_symbol.ts => absolute_matcher.ts} | 59 --- internal/tsetse/util/absolute_matcher_test.ts | 283 ++++++++++++++ internal/tsetse/util/ast_tools_test.ts | 32 ++ internal/tsetse/util/is_literal_test.ts | 63 +++ .../name_call_non_constant_argument.ts | 4 +- .../util/pattern_engines/name_engine.ts | 3 +- .../util/pattern_engines/property_engine.ts | 2 +- .../pattern_engines/property_engine_test.ts | 89 +---- .../property_non_constant_write_engine.ts | 4 +- .../pattern_engines/property_read_engine.ts | 3 +- .../pattern_engines/property_write_engine.ts | 3 +- internal/tsetse/util/property_matcher.ts | 70 ++++ internal/tsetse/util/property_matcher_test.ts | 111 ++++++ internal/tsetse/util/util_test.ts | 365 ------------------ 14 files changed, 572 insertions(+), 519 deletions(-) rename internal/tsetse/util/{match_symbol.ts => absolute_matcher.ts} (76%) create mode 100644 internal/tsetse/util/absolute_matcher_test.ts create mode 100644 internal/tsetse/util/ast_tools_test.ts create mode 100644 internal/tsetse/util/is_literal_test.ts create mode 100644 internal/tsetse/util/property_matcher.ts create mode 100644 internal/tsetse/util/property_matcher_test.ts delete mode 100644 internal/tsetse/util/util_test.ts diff --git a/internal/tsetse/util/match_symbol.ts b/internal/tsetse/util/absolute_matcher.ts similarity index 76% rename from internal/tsetse/util/match_symbol.ts rename to internal/tsetse/util/absolute_matcher.ts index 3d00d088..e1501598 100644 --- a/internal/tsetse/util/match_symbol.ts +++ b/internal/tsetse/util/absolute_matcher.ts @@ -177,62 +177,3 @@ export class AbsoluteMatcher { return true; } } - -// TODO: Export the matched node kinds here. -/** - * This class matches a property access node, based on a property holder type - * (through its name), i.e. a class, and a property name. - * - * The logic is voluntarily simple: if a matcher for `a.b` tests a `x.y` node, - * it will return true if: - * - `x` is of type `a` either directly (name-based) or through inheritance - * (ditto), - * - and, textually, `y` === `b`. - * - * Note that the logic is different from TS's type system: this matcher doesn't - * have any knowledge of structural typing. - */ -export class PropertyMatcher { - static fromSpec(spec: string): PropertyMatcher { - if (spec.indexOf('.prototype.') === -1) { - throw new Error(`BANNED_PROPERTY expects a .prototype in your query.`); - } - const requestParser = /^([\w\d_.-]+)\.prototype\.([\w\d_.-]+)$/; - const matches = requestParser.exec(spec); - if (!matches) { - throw new Error('Cannot understand the BannedProperty spec' + spec); - } - const [bannedType, bannedProperty] = matches.slice(1); - return new PropertyMatcher(bannedType, bannedProperty); - } - - constructor(readonly bannedType: string, readonly bannedProperty: string) {} - - /** - * @param n The PropertyAccessExpression we're looking at. - */ - matches(n: ts.PropertyAccessExpression, tc: ts.TypeChecker) { - return n.name.text === this.bannedProperty && - this.typeMatches(tc.getTypeAtLocation(n.expression)); - } - - private exactTypeMatches(inspectedType: ts.Type): boolean { - const typeSymbol = inspectedType.getSymbol() || false; - return typeSymbol && typeSymbol.getName() === this.bannedType; - } - - // TODO: Account for unknown types/ '?', and 'loose type matches', i.e. if the - // actual type is a supertype of the prohibited type. - private typeMatches(inspectedType: ts.Type): boolean { - if (this.exactTypeMatches(inspectedType)) { - return true; - } - // If the type is an intersection/union, check if any of the component matches - if (inspectedType.isUnionOrIntersection()) { - return inspectedType.types.some(comp => this.typeMatches(comp)); - } - - const baseTypes = inspectedType.getBaseTypes() || []; - return baseTypes.some(base => this.exactTypeMatches(base)); - } -} diff --git a/internal/tsetse/util/absolute_matcher_test.ts b/internal/tsetse/util/absolute_matcher_test.ts new file mode 100644 index 00000000..cfc25652 --- /dev/null +++ b/internal/tsetse/util/absolute_matcher_test.ts @@ -0,0 +1,283 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from './testing/test_support'; + +describe('AbsoluteMatcher', () => { + beforeEach(() => { + jasmine.addMatchers(customMatchers); + }); + + it('requires a matcher scope', () => { + const config = { + errorMessage: 'banned name with no scope', + kind: PatternKind.BANNED_NAME, + values: ['exec'] + }; + const sources = [`eval('alert("hi");');`]; + + const check = () => + compileAndCheck(new ConformancePatternRule(config), ...sources); + + expect(check).toThrowError('Malformed matcher selector.'); + }); + + describe('file scope', () => { + it('matches a file path', () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_0'; + var a = Foo.bar("123");` + ]; + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + + expect(results).toHaveFailuresMatching( + {matchedCode: `bar`, messageText: 'banned name with file path'}); + }); + + it('ignores an unmatched file path', () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_1'; + var a = Foo.bar("123");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('matches a local exported definition', () => { + // This is a match because Foo.bar is an exported symbol. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = + [`export class Foo { static bar(s: string) {return s + "abc";} } + var a = Foo.bar("123");`]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `bar`, messageText: 'banned name with file path'}); + }); + }); + + describe('global scope', () => { + it('matches an in-stock library method', () => { + const config = { + errorMessage: 'banned ambient name', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|eval'] + }; + const sources = [`eval('alert("hi");');`]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `eval`, messageText: 'banned ambient name'}); + }); + + it('does not match a custom method with the same name', () => { + const config = { + errorMessage: 'banned ambient name', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|eval'] + }; + const sources = + [`export class Foo { static eval(s: string) { return s + "abc";} } + var a = Foo.eval("123");`]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('matches an initializer in a named declaration', () => { + const config = { + errorMessage: 'banned ambient name', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|open'], + }; + const sources = ['const op = open;']; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: 'open', messageText: 'banned ambient name'}); + }); + + it('does not match a local non-exported definition', () => { + // This is not a match because Foo.bar is a non-exported locally defined + // symbol. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [`class Foo { static bar(s: string) {return s + "abc";} } + var a = Foo.bar("123");`]; + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + }); + + describe('properties', () => { + it('matches a static property', () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.s'] + }; + const sources = [ + `export class Foo { static s : string; }`, + `import {Foo} from './file_0'; + var a = Foo.s;`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `s`, messageText: 'banned name with file path'}); + }); + + it('does not match a property with a name overlapping an in-stock library', + () => { + const config = { + errorMessage: 'banned name without file path', + kind: PatternKind.BANNED_NAME, + values: ['GLOBAL|open'] + }; + const sources = [ + 'const elem = new XMLHttpRequest();', + 'elem.open("get", "url");', // FQN of elem.open is + // XMLHttpRequest.open and shouldn't be + // banned + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + }); + + describe('inheritance', () => { + it('matches an inherited static property', () => { + // This is a match because Moo inherits s from Foo. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.s'] + }; + const sources = [ + `export class Foo { static s : string; }`, + `import {Foo} from './file_0'; + export class Moo extends Foo { static t : string; }`, + `import {Moo} from './file_1'; + var a = Moo.s;`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `s`, messageText: 'banned name with file path'}); + }); + + it('matches an inherited static method', () => { + // This is a match because Moo inherits bar from Foo. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_0'; + export class Moo extends Foo { static far(s: string) {return s + "def";} }`, + `import {Moo} from './file_1'; + Moo.bar("abc");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `bar`, messageText: 'banned name with file path'}); + }); + + it('does not match a redefined inherited static property', () => { + // This is not a match because Moo redefines s. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.s'] + }; + const sources = [ + `export class Foo { static s : string; }`, + `import {Foo} from './file_0'; + export class Moo extends Foo { static s : string; }`, + `import {Moo} from './file_1'; + var a = Moo.s;`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('does not match a redefined inherited static method', () => { + // This is not a match because Moo redefines bar. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} } + export class Moo extends Foo { static bar(s: string) {return s + "def";} }`, + `import {Foo, Moo} from './file_0'; + Moo.bar("abc");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + + it('does not match an interface\'s static method', () => { + // This is not a match because even though bar specified is interface Moo, + // its actual definition is in class Boo. + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_1|Moo.bar'] + }; + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `import {Foo} from './file_0'; + export interface Moo extends Foo { }`, + `import {Moo} from './file_1'; + export class Boo implements Moo { static bar(s: string) {return s + "def";} }`, + `import {Boo} from './file_2'; + Boo.bar("abc");`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveNoFailures(); + }); + }); +}); diff --git a/internal/tsetse/util/ast_tools_test.ts b/internal/tsetse/util/ast_tools_test.ts new file mode 100644 index 00000000..7ce34206 --- /dev/null +++ b/internal/tsetse/util/ast_tools_test.ts @@ -0,0 +1,32 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {setDebug} from './ast_tools'; +import {compileAndCheck} from './testing/test_support'; + +describe('Debug output', () => { + it('turns on and off', () => { + const source = `location.href = 'foo';`; + const rule = new ConformancePatternRule({ + errorMessage: 'does not matter', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['Location.prototype.href'] + }); + + const logs: string[] = []; + const realConsoleLog = console.log; + spyOn(console, 'log').and.callFake((s: string) => { + logs.push(s); + realConsoleLog(s); + }); + setDebug(true); + compileAndCheck(rule, source); + + expect(logs).toEqual([`inspecting location.href = 'foo'`]); + + setDebug(false); + compileAndCheck(rule, source); + + // Nothing more appended: debug was false + expect(logs).toEqual([`inspecting location.href = 'foo'`]); + }); +}); diff --git a/internal/tsetse/util/is_literal_test.ts b/internal/tsetse/util/is_literal_test.ts new file mode 100644 index 00000000..c3dfa7a6 --- /dev/null +++ b/internal/tsetse/util/is_literal_test.ts @@ -0,0 +1,63 @@ +import 'jasmine'; +import {isInStockLibraries} from './ast_tools'; +import {isLiteral} from './is_literal'; +import {compile} from './testing/test_support'; + +describe('isLiteral', () => { + it('understands constants', () => { + // Keep these to single-expression programs. + const constantExpressionsSources = [ + `'hello'`, + `'hello' + 'hi'`, + `1`, + `1 + 1`, + '`abcdef`', + '`abcd${"ef"}`', + '`abcd${1+1}`+`hi`', + `1 ? 'hi' : 'hello'`, + `window.name ? 'hi' : 'hello'`, + ]; + + // We don't bother with a rule for this one. + const constantProgram = compile(...constantExpressionsSources); + const constantCompiledSources = constantProgram.getSourceFiles(); + const constantTc = constantProgram.getTypeChecker(); + const constantExpressions = + constantCompiledSources.filter(s => !isInStockLibraries(s)) + .map(s => s.statements[0].getChildren()[0]); + + for (const expr of constantExpressions) { + expect(isLiteral(constantTc, expr)) + .toBe( + true, + `Expected "${expr.getFullText()}" to be considered constant.`); + } + }); + + + it('understands non-constants', () => { + const nonconstantExpressionsSources = [ + `window.name`, + `'hello' + window.name`, + `window.name + 'hello'`, + '`abcd${window.name}`', + `1 ? window.name : 'hello'`, + `1 ? 'hello' : window.name`, + ]; + + const nonconstantProgram = compile(...nonconstantExpressionsSources); + const nonconstantCompiledSources = nonconstantProgram.getSourceFiles(); + const nonconstantTc = nonconstantProgram.getTypeChecker(); + const nonconstantExpressions = + nonconstantCompiledSources.filter(s => !isInStockLibraries(s)) + .map(s => s.statements[0].getChildren()[0]); + + for (const expr of nonconstantExpressions) { + expect(isLiteral(nonconstantTc, expr)) + .toBe( + false, + `Expected "${ + expr.getFullText()}" not to be considered constant.`); + } + }); +}); diff --git a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts index 3f6863e1..5a7a7ffb 100644 --- a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts +++ b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts @@ -1,11 +1,13 @@ import * as ts from 'typescript'; + import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; +import {AbsoluteMatcher} from '../absolute_matcher'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; import {isLiteral} from '../is_literal'; -import {AbsoluteMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; + import {PatternEngine} from './pattern_engine'; function parseSpec(value: string): [AbsoluteMatcher, number] { diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index 0731d715..aac2a9cf 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -1,10 +1,9 @@ import * as ts from 'typescript'; - import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; +import {AbsoluteMatcher} from '../absolute_matcher'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {AbsoluteMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts index 8f0bbe6d..922ac255 100644 --- a/internal/tsetse/util/pattern_engines/property_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -4,9 +4,9 @@ import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; +import {PropertyMatcher} from '../property_matcher'; function checkPropAccessExpr( tc: ts.TypeChecker, n: ts.PropertyAccessExpression, diff --git a/internal/tsetse/util/pattern_engines/property_engine_test.ts b/internal/tsetse/util/pattern_engines/property_engine_test.ts index 1fcd0a6f..7993415e 100644 --- a/internal/tsetse/util/pattern_engines/property_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_engine_test.ts @@ -7,7 +7,7 @@ describe('BANNED_PROPERTY', () => { jasmine.addMatchers(customMatchers); }); - it('matches simple property access on dom properties', () => { + it('matches a trivial example', () => { const config = { errorMessage: 'No Location#href access', kind: PatternKind.BANNED_PROPERTY, @@ -21,91 +21,4 @@ describe('BANNED_PROPERTY', () => { messageText: 'No Location#href access', }); }); - - it('matches simple property access on properties of TS built-in types', - () => { - const config = { - errorMessage: 'No Array#map access', - kind: PatternKind.BANNED_PROPERTY, - values: ['Array.prototype.map'], - }; - const source = '[].map(() => 1);'; - - const results = - compileAndCheck(new ConformancePatternRule(config), source); - - expect(results).toHaveFailuresMatching({ - matchedCode: '[].map', - messageText: 'No Array#map access', - }); - }); - - it('matches simple property access on properties of user-defined global types', - () => { - const config = { - errorMessage: 'No Ty#foo access', - kind: PatternKind.BANNED_PROPERTY, - values: ['Ty.prototype.foo'], - }; - const funcPropAccess = `class Ty { - foo() {} - bar: number = 1; - } - new Ty().foo(); - `; - let results = - compileAndCheck(new ConformancePatternRule(config), funcPropAccess); - - expect(results).toHaveFailuresMatching({ - matchedCode: 'new Ty().foo', - messageText: 'No Ty#foo access', - }); - - const nonFuncPropAccess = `class Ty { - foo: number = 1; - bar() {} - } - new Ty().foo; - `; - results = compileAndCheck( - new ConformancePatternRule(config), nonFuncPropAccess); - - expect(results).toHaveFailuresMatching({ - matchedCode: 'new Ty().foo', - messageText: 'No Ty#foo access', - }); - }); - - it('does not match in-module defined type', () => { - const config = { - errorMessage: 'No Location#replace access', - kind: PatternKind.BANNED_PROPERTY, - values: ['Location.prototype.location'], - }; - const source = `export {}; // export makes the file a module - class Location { replace(x: string) {} } - new Location().replace('a');` - const results = compileAndCheck(new ConformancePatternRule(config), source); - - expect(results).toHaveNoFailures(); - }); - - it('does not match properties after fancy type casts', () => { - const config = { - errorMessage: 'No Location#href access', - kind: PatternKind.BANNED_PROPERTY, - values: ['Location.prototype.replace'], - }; - const source = [ - // Grey area of tests that don't trigger, but probably could - '(location as unknown as {replace: (url: string) => void}).replace(\'\');', - // We don't trigger on any, since it's not the right type. - 'const locationAsAny: any = location;', - 'locationAsAny.replace(\'https://example.com/script.js\');', - ]; - const results = - compileAndCheck(new ConformancePatternRule(config), ...source); - - expect(results).toHaveNoFailures(); - }); }); diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index 0496f0c6..0a672147 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -1,11 +1,13 @@ import * as ts from 'typescript'; + import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; import {isLiteral} from '../is_literal'; -import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; +import {PropertyMatcher} from '../property_matcher'; + import {PatternEngine} from './pattern_engine'; function checkBinExpr( diff --git a/internal/tsetse/util/pattern_engines/property_read_engine.ts b/internal/tsetse/util/pattern_engines/property_read_engine.ts index 9b129390..7923120d 100644 --- a/internal/tsetse/util/pattern_engines/property_read_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_read_engine.ts @@ -1,11 +1,12 @@ import * as ts from 'typescript'; + import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; +import {PropertyMatcher} from '../property_matcher'; /** * Check property read in variable initializations. For example, var a = diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 30cd443d..d0a9e2bb 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -1,11 +1,12 @@ import * as ts from 'typescript'; + import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; -import {PropertyMatcher} from '../match_symbol'; import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; +import {PropertyMatcher} from '../property_matcher'; function checkPropAccessExpr( tc: ts.TypeChecker, n: ts.PropertyAccessExpression, diff --git a/internal/tsetse/util/property_matcher.ts b/internal/tsetse/util/property_matcher.ts new file mode 100644 index 00000000..1fb67945 --- /dev/null +++ b/internal/tsetse/util/property_matcher.ts @@ -0,0 +1,70 @@ +import * as ts from 'typescript'; +import {dealias, debugLog, isAmbientDeclaration, isInStockLibraries, isNameInDeclaration, isPartOfImportStatement} from './ast_tools'; + +const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; +const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; +const FQN_FORMAT = `(${JS_IDENTIFIER_FORMAT}\.)*${JS_IDENTIFIER_FORMAT}`; +// A fqn made out of a dot-separated chain of JS identifiers. +const ABSOLUTE_RE = new RegExp(`^${PATH_NAME_FORMAT}\\|${FQN_FORMAT}$`); +const GLOBAL = 'GLOBAL'; +const ANY_SYMBOL = 'ANY_SYMBOL'; + + +// TODO: Export the matched node kinds here. +/** + * This class matches a property access node, based on a property holder type + * (through its name), i.e. a class, and a property name. + * + * The logic is voluntarily simple: if a matcher for `a.b` tests a `x.y` node, + * it will return true if: + * - `x` is of type `a` either directly (name-based) or through inheritance + * (ditto), + * - and, textually, `y` === `b`. + * + * Note that the logic is different from TS's type system: this matcher doesn't + * have any knowledge of structural typing. + */ +export class PropertyMatcher { + static fromSpec(spec: string): PropertyMatcher { + if (spec.indexOf('.prototype.') === -1) { + throw new Error(`BANNED_PROPERTY expects a .prototype in your query.`); + } + const requestParser = /^([\w\d_.-]+)\.prototype\.([\w\d_.-]+)$/; + const matches = requestParser.exec(spec); + if (!matches) { + throw new Error('Cannot understand the BannedProperty spec' + spec); + } + const [bannedType, bannedProperty] = matches.slice(1); + return new PropertyMatcher(bannedType, bannedProperty); + } + + constructor(readonly bannedType: string, readonly bannedProperty: string) {} + + /** + * @param n The PropertyAccessExpression we're looking at. + */ + matches(n: ts.PropertyAccessExpression, tc: ts.TypeChecker) { + return n.name.text === this.bannedProperty && + this.typeMatches(tc.getTypeAtLocation(n.expression)); + } + + private exactTypeMatches(inspectedType: ts.Type): boolean { + const typeSymbol = inspectedType.getSymbol() || false; + return typeSymbol && typeSymbol.getName() === this.bannedType; + } + + // TODO: Account for unknown types/ '?', and 'loose type matches', i.e. if the + // actual type is a supertype of the prohibited type. + private typeMatches(inspectedType: ts.Type): boolean { + if (this.exactTypeMatches(inspectedType)) { + return true; + } + // If the type is an intersection/union, check if any of the component matches + if (inspectedType.isUnionOrIntersection()) { + return inspectedType.types.some(comp => this.typeMatches(comp)); + } + + const baseTypes = inspectedType.getBaseTypes() || []; + return baseTypes.some(base => this.exactTypeMatches(base)); + } +} diff --git a/internal/tsetse/util/property_matcher_test.ts b/internal/tsetse/util/property_matcher_test.ts new file mode 100644 index 00000000..e4fea908 --- /dev/null +++ b/internal/tsetse/util/property_matcher_test.ts @@ -0,0 +1,111 @@ +import 'jasmine'; +import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {compileAndCheck, customMatchers} from './testing/test_support'; + +describe('PropertyMatcher', () => { + beforeEach(() => { + jasmine.addMatchers(customMatchers); + }); + + it('matches simple property access on dom properties', () => { + const config = { + errorMessage: 'No Location#href access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.href'], + }; + const source = 'const href = location.href;'; + const results = compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'location.href', + messageText: 'No Location#href access', + }); + }); + + it('matches simple property access on properties of TS built-in types', + () => { + const config = { + errorMessage: 'No Array#map access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Array.prototype.map'], + }; + const source = '[].map(() => 1);'; + + const results = + compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveFailuresMatching({ + matchedCode: '[].map', + messageText: 'No Array#map access', + }); + }); + + it('matches simple property access on properties of user-defined global types', + () => { + const config = { + errorMessage: 'No Ty#foo access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Ty.prototype.foo'], + }; + const funcPropAccess = `class Ty { + foo() {} + bar: number = 1; + } + new Ty().foo(); + `; + let results = + compileAndCheck(new ConformancePatternRule(config), funcPropAccess); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'new Ty().foo', + messageText: 'No Ty#foo access', + }); + + const nonFuncPropAccess = `class Ty { + foo: number = 1; + bar() {} + } + new Ty().foo; + `; + results = compileAndCheck( + new ConformancePatternRule(config), nonFuncPropAccess); + + expect(results).toHaveFailuresMatching({ + matchedCode: 'new Ty().foo', + messageText: 'No Ty#foo access', + }); + }); + + it('does not match in-module defined type', () => { + const config = { + errorMessage: 'No Location#replace access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.location'], + }; + const source = `export {}; // export makes the file a module + class Location { replace(x: string) {} } + new Location().replace('a');` + const results = compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveNoFailures(); + }); + + it('does not match properties after fancy type casts', () => { + const config = { + errorMessage: 'No Location#href access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.replace'], + }; + const source = [ + // Grey area of tests that don't trigger, but probably could + '(location as unknown as {replace: (url: string) => void}).replace(\'\');', + // We don't trigger on any, since it's not the right type. + 'const locationAsAny: any = location;', + 'locationAsAny.replace(\'https://example.com/script.js\');', + ]; + const results = + compileAndCheck(new ConformancePatternRule(config), ...source); + + expect(results).toHaveNoFailures(); + }); +}); diff --git a/internal/tsetse/util/util_test.ts b/internal/tsetse/util/util_test.ts deleted file mode 100644 index 166299e2..00000000 --- a/internal/tsetse/util/util_test.ts +++ /dev/null @@ -1,365 +0,0 @@ -/** - * @fileoverview Tests for the various utilities that are not tied to a single - * rule. - */ - -import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; -import {isInStockLibraries, setDebug} from './ast_tools'; -import {isLiteral} from './is_literal'; -import {compile, compileAndCheck} from './testing/test_support'; - -describe('Debug output', () => { - it('turns on and off', () => { - const source = `location.href = 'foo';`; - const rule = new ConformancePatternRule({ - errorMessage: 'does not matter', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['Location.prototype.href'] - }); - - const logs: string[] = []; - const realConsoleLog = console.log; - spyOn(console, 'log').and.callFake((s: string) => { - logs.push(s); - realConsoleLog(s); - }); - setDebug(true); - compileAndCheck(rule, source); - - expect(logs).toEqual([`inspecting location.href = 'foo'`]); - - setDebug(false); - compileAndCheck(rule, source); - - // Nothing more appended: debug was false - expect(logs).toEqual([`inspecting location.href = 'foo'`]); - }); -}); - -describe('The constant-ness logic', () => { - it('understands constants', () => { - // Keep these to single-expression programs. - const constantExpressionsSources = [ - `'hello'`, - `'hello' + 'hi'`, - `1`, - `1 + 1`, - '`abcdef`', - '`abcd${"ef"}`', - '`abcd${1+1}`+`hi`', - `1 ? 'hi' : 'hello'`, - `window.name ? 'hi' : 'hello'`, - ]; - - // We don't bother with a rule for this one. - const constantProgram = compile(...constantExpressionsSources); - const constantCompiledSources = constantProgram.getSourceFiles(); - const constantTc = constantProgram.getTypeChecker(); - const constantExpressions = - constantCompiledSources.filter(s => !isInStockLibraries(s)) - .map(s => s.statements[0].getChildren()[0]); - - for (const expr of constantExpressions) { - expect(isLiteral(constantTc, expr)) - .toBe( - true, - `Expected "${expr.getFullText()}" to be considered constant.`); - } - }); - - - it('understands non-constants', () => { - const nonconstantExpressionsSources = [ - `window.name`, - `'hello' + window.name`, - `window.name + 'hello'`, - '`abcd${window.name}`', - `1 ? window.name : 'hello'`, - `1 ? 'hello' : window.name`, - ]; - - const nonconstantProgram = compile(...nonconstantExpressionsSources); - const nonconstantCompiledSources = nonconstantProgram.getSourceFiles(); - const nonconstantTc = nonconstantProgram.getTypeChecker(); - const nonconstantExpressions = - nonconstantCompiledSources.filter(s => !isInStockLibraries(s)) - .map(s => s.statements[0].getChildren()[0]); - - for (const expr of nonconstantExpressions) { - expect(isLiteral(nonconstantTc, expr)) - .toBe( - false, - `Expected "${ - expr.getFullText()}" not to be considered constant.`); - } - }); -}); - -describe('test AbsoluteMatcher', () => { - it('requires a scope', () => { - const config = { - errorMessage: 'banned name with no scope', - kind: PatternKind.BANNED_NAME, - values: ['exec'] - }; - const sources = [`eval('alert("hi");');`]; - - const check = () => - compileAndCheck(new ConformancePatternRule(config), ...sources); - - expect(check).toThrowError('Malformed matcher selector.'); - }); - - it('matched path', () => { - - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] - }; - const sources = [ - `export class Foo { static bar(s: string) {return s + "abc";} }`, - `import {Foo} from './file_0'; - var a = Foo.bar("123");` - ]; - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - - expect(results).toHaveFailuresMatching( - {matchedCode: `bar`, messageText: 'banned name with file path'}); - }); - - it('unmatched path', () => { - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] - }; - const sources = [ - `export class Foo { static bar(s: string) {return s + "abc";} }`, - `export class Foo { static bar(s: string) {return s + "abc";} }`, - `import {Foo} from './file_1'; - var a = Foo.bar("123");` - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); - - it('local exported definition', () => { - // This is a match because Foo.bar is an exported symbol. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] - }; - const sources = - [`export class Foo { static bar(s: string) {return s + "abc";} } - var a = Foo.bar("123");`]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: `bar`, messageText: 'banned name with file path'}); - }); - - it('global definition', () => { - const config = { - errorMessage: 'banned ambient name', - kind: PatternKind.BANNED_NAME, - values: ['GLOBAL|eval'] - }; - const sources = [`eval('alert("hi");');`]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: `eval`, messageText: 'banned ambient name'}); - }); - - it('global definition with the same name as a custom method', () => { - const config = { - errorMessage: 'banned ambient name', - kind: PatternKind.BANNED_NAME, - values: ['GLOBAL|eval'] - }; - const sources = - [`export class Foo { static eval(s: string) { return s + "abc";} } - var a = Foo.eval("123");`]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); - - it('In-stock lib symbol used as part of the initializer in named declaration', - () => { - const config = { - errorMessage: 'banned ambient name', - kind: PatternKind.BANNED_NAME, - values: ['GLOBAL|open'], - }; - const sources = ['const op = open;']; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: 'open', messageText: 'banned ambient name'}); - }); - - it('local non-exported definition', () => { - // This is not a match because Foo.bar is a non-exported locally defined - // symbol. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] - }; - const sources = [`class Foo { static bar(s: string) {return s + "abc";} } - var a = Foo.bar("123");`]; - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); - - it('property test 1', () => { - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.s'] - }; - const sources = [ - `export class Foo { static s : string; }`, - `import {Foo} from './file_0'; - var a = Foo.s;`, - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: `s`, messageText: 'banned name with file path'}); - }); - - it('property test 2', () => { - // This is a match because Moo inherits s from Foo. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.s'] - }; - const sources = [ - `export class Foo { static s : string; }`, - `import {Foo} from './file_0'; - export class Moo extends Foo { static t : string; }`, - `import {Moo} from './file_1'; - var a = Moo.s;`, - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: `s`, messageText: 'banned name with file path'}); - }); - - it('property test 3', () => { - // This is not a match because Moo redefines s. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.s'] - }; - const sources = [ - `export class Foo { static s : string; }`, - `import {Foo} from './file_0'; - export class Moo extends Foo { static s : string; }`, - `import {Moo} from './file_1'; - var a = Moo.s;`, - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); - - it('Property of type defined in in-stock library', () => { - const config = { - errorMessage: 'banned name without file path', - kind: PatternKind.BANNED_NAME, - values: ['GLOBAL|open'] - }; - const sources = [ - 'const elem = new XMLHttpRequest();', - 'elem.open("get", "url");', // FQN of elem.open is XMLHttpRequest.open - // and shouldn't be banned - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); - - it('inheritance test 1', () => { - // This is a match because Moo inherits bar from Foo. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] - }; - const sources = [ - `export class Foo { static bar(s: string) {return s + "abc";} }`, - `import {Foo} from './file_0'; - export class Moo extends Foo { static far(s: string) {return s + "def";} }`, - `import {Moo} from './file_1'; - Moo.bar("abc");` - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: `bar`, messageText: 'banned name with file path'}); - }); - - it('inheritance test 2', () => { - // This is not a match because Moo redefines bar. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] - }; - const sources = [ - `export class Foo { static bar(s: string) {return s + "abc";} } - export class Moo extends Foo { static bar(s: string) {return s + "def";} }`, - `import {Foo, Moo} from './file_0'; - Moo.bar("abc");` - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); - - it('interface', () => { - // This is not a match because even though bar specified is interface Moo, - // its actual definition is in class Boo. - const config = { - errorMessage: 'banned name with file path', - kind: PatternKind.BANNED_NAME, - values: ['./file_1|Moo.bar'] - }; - const sources = [ - `export class Foo { static bar(s: string) {return s + "abc";} }`, - `import {Foo} from './file_0'; - export interface Moo extends Foo { }`, - `import {Moo} from './file_1'; - export class Boo implements Moo { static bar(s: string) {return s + "def";} }`, - `import {Boo} from './file_2'; - Boo.bar("abc");`, - ]; - - const results = - compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); - }); -}); From 93d73deb0b021dcf653807de28ae1093b0f07246 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 29 Apr 2020 12:56:14 -0700 Subject: [PATCH 285/316] Fix BazelCI failure on Windows due to different in-stock lib file path. PiperOrigin-RevId: 309079472 --- internal/tsetse/util/is_literal_test.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/tsetse/util/is_literal_test.ts b/internal/tsetse/util/is_literal_test.ts index c3dfa7a6..92b49d6b 100644 --- a/internal/tsetse/util/is_literal_test.ts +++ b/internal/tsetse/util/is_literal_test.ts @@ -4,6 +4,11 @@ import {isLiteral} from './is_literal'; import {compile} from './testing/test_support'; describe('isLiteral', () => { + // Different platforms pull in different files (or from different + // paths) when compiling a .ts file. We only want to inspect source + // defined in the tests. This pattern is determinted by `compile`. + const testSrcNamePattern = /file_\d+.ts$/; + it('understands constants', () => { // Keep these to single-expression programs. const constantExpressionsSources = [ @@ -21,11 +26,12 @@ describe('isLiteral', () => { // We don't bother with a rule for this one. const constantProgram = compile(...constantExpressionsSources); const constantCompiledSources = constantProgram.getSourceFiles(); - const constantTc = constantProgram.getTypeChecker(); + const constantExpressions = - constantCompiledSources.filter(s => !isInStockLibraries(s)) + constantCompiledSources.filter(s => testSrcNamePattern.test(s.fileName)) .map(s => s.statements[0].getChildren()[0]); + const constantTc = constantProgram.getTypeChecker(); for (const expr of constantExpressions) { expect(isLiteral(constantTc, expr)) .toBe( @@ -34,7 +40,6 @@ describe('isLiteral', () => { } }); - it('understands non-constants', () => { const nonconstantExpressionsSources = [ `window.name`, @@ -49,7 +54,8 @@ describe('isLiteral', () => { const nonconstantCompiledSources = nonconstantProgram.getSourceFiles(); const nonconstantTc = nonconstantProgram.getTypeChecker(); const nonconstantExpressions = - nonconstantCompiledSources.filter(s => !isInStockLibraries(s)) + nonconstantCompiledSources + .filter(s => testSrcNamePattern.test(s.fileName)) .map(s => s.statements[0].getChildren()[0]); for (const expr of nonconstantExpressions) { From 099e5099d8d7b55d62c06103c8e5636237179710 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 29 Apr 2020 17:17:00 -0700 Subject: [PATCH 286/316] Remove isAmbientDeclaration that causes false positives. PiperOrigin-RevId: 309129473 --- internal/tsetse/util/absolute_matcher.ts | 7 +++---- internal/tsetse/util/ast_tools.ts | 9 --------- internal/tsetse/util/property_matcher.ts | 10 ---------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/internal/tsetse/util/absolute_matcher.ts b/internal/tsetse/util/absolute_matcher.ts index e1501598..05816297 100644 --- a/internal/tsetse/util/absolute_matcher.ts +++ b/internal/tsetse/util/absolute_matcher.ts @@ -1,5 +1,5 @@ import * as ts from 'typescript'; -import {dealias, debugLog, isAmbientDeclaration, isInStockLibraries, isNameInDeclaration, isPartOfImportStatement} from './ast_tools'; +import {dealias, debugLog, isInStockLibraries, isNameInDeclaration, isPartOfImportStatement} from './ast_tools'; const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; @@ -148,9 +148,8 @@ export class AbsoluteMatcher { debugLog(() => `Symbol never declared?`); return false; } - if (!declarations.some(isAmbientDeclaration) && - !declarations.some(isInStockLibraries)) { - debugLog(() => `Symbol neither ambient nor from the stock libraries`); + if (!declarations.some(isInStockLibraries)) { + debugLog(() => `Symbol not from the stock libraries`); return false; } } diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index 748d1b66..191e854d 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -69,15 +69,6 @@ export function shouldExamineNode(n: ts.Node) { ts.isJSDoc(n) || isInStockLibraries(n)); } -/** - * Return whether the given declaration is ambient. - */ -export function isAmbientDeclaration(d: ts.Declaration): boolean { - return Boolean( - d.modifiers && - d.modifiers.some(m => m.kind === ts.SyntaxKind.DeclareKeyword)); -} - /** * Return whether the given Node is (or is in) a library included as default. * We currently look for a node_modules/typescript/ prefix, but this could diff --git a/internal/tsetse/util/property_matcher.ts b/internal/tsetse/util/property_matcher.ts index 1fb67945..8ab1f067 100644 --- a/internal/tsetse/util/property_matcher.ts +++ b/internal/tsetse/util/property_matcher.ts @@ -1,14 +1,4 @@ import * as ts from 'typescript'; -import {dealias, debugLog, isAmbientDeclaration, isInStockLibraries, isNameInDeclaration, isPartOfImportStatement} from './ast_tools'; - -const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; -const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; -const FQN_FORMAT = `(${JS_IDENTIFIER_FORMAT}\.)*${JS_IDENTIFIER_FORMAT}`; -// A fqn made out of a dot-separated chain of JS identifiers. -const ABSOLUTE_RE = new RegExp(`^${PATH_NAME_FORMAT}\\|${FQN_FORMAT}$`); -const GLOBAL = 'GLOBAL'; -const ANY_SYMBOL = 'ANY_SYMBOL'; - // TODO: Export the matched node kinds here. /** From c4b325859b8d2c0579b094c67f449f1c3143271e Mon Sep 17 00:00:00 2001 From: evanm Date: Mon, 4 May 2020 08:52:53 -0700 Subject: [PATCH 287/316] add licenses attribute This causes ts_library() to inherit the licenses() attribute of the BUILD file. This attribute is used for tracking license compliance. PiperOrigin-RevId: 309752152 --- internal/common/compilation.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index 0bee98e2..c9d76d12 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -44,6 +44,7 @@ COMMON_ATTRIBUTES = { "expected_diagnostics": attr.string_list(), # Whether to generate externs.js from any "declare" statement. "generate_externs": attr.bool(default = True), + "licenses": attr.license(), # Used to determine module mappings "module_name": attr.string(), "module_root": attr.string(), From 597b388ad13673ac636846d1113cf5737344ad53 Mon Sep 17 00:00:00 2001 From: evanm Date: Wed, 6 May 2020 08:49:25 -0700 Subject: [PATCH 288/316] drop needless gc in tsc_wrapped When running as a worker, we garbage collect between each compilation so that our memory statistics make sense over time. But when running an individual compilation, there's little point in running garbage collection right before we're gonna exit anyway. The code I deleted in this CL is executed in both paths (worker and not), and there's a separate call to gc in the worker codepath (not in this CL), so there's no reason to have also gc'd here. I suspect this was a mistake during some refactor. While I'm at it, also rearrange a bit of the code to remove some random duplication. PiperOrigin-RevId: 310159657 --- internal/tsc_wrapped/tsc_wrapped.ts | 52 +++++++++-------------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 71ca1eea..4104d9b3 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -15,14 +15,6 @@ import {Plugin as StrictDepsPlugin} from './strict_deps'; import {BazelOptions, parseTsconfig, resolveNormalizedPath} from './tsconfig'; import {debug, log, runAsWorker, runWorkerLoop} from './worker'; -// Equivalent of running node with --expose-gc -// but easier to write tooling since we don't need to inject that arg to -// nodejs_binary -if (typeof global.gc !== 'function') { - require('v8').setFlagsFromString('--expose_gc'); - global.gc = require('vm').runInNewContext('gc'); -} - /** * Top-level entry point for tsc_wrapped. */ @@ -247,37 +239,23 @@ function runOneBuild( fileLoader = new UncachedFileLoader(); } - const perfTracePath = bazelOpts.perfTracePath; - if (!perfTracePath) { - const {diagnostics} = createProgramAndEmit( - fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules); - if (diagnostics.length > 0) { - console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); - return false; - } - return true; - } - - log('Writing trace to', perfTracePath); - const success = perfTrace.wrap('runOneBuild', () => { - const {diagnostics} = createProgramAndEmit( - fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules); - if (diagnostics.length > 0) { - console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); - return false; - } - return true; + const diagnostics = perfTrace.wrap('createProgramAndEmit', () => { + return createProgramAndEmit( + fileLoader, options, bazelOpts, sourceFiles, disabledTsetseRules) + .diagnostics; }); - if (!success) return false; - // Force a garbage collection pass. This keeps our memory usage - // consistent across multiple compilations, and allows the file - // cache to use the current memory usage as a guideline for expiring - // data. Note: this is intentionally not within runFromOptions(), as - // we want to gc only after all its locals have gone out of scope. - global.gc(); - perfTrace.snapshotMemoryUsage(); - perfTrace.write(perfTracePath); + if (diagnostics.length > 0) { + console.error(bazelDiagnostics.format(bazelOpts.target, diagnostics)); + return false; + } + + const perfTracePath = bazelOpts.perfTracePath; + if (perfTracePath) { + log('Writing trace to', perfTracePath); + perfTrace.snapshotMemoryUsage(); + perfTrace.write(perfTracePath); + } return true; } From cb665144ab246ac2f2337d4e1f5e26b9746f58ee Mon Sep 17 00:00:00 2001 From: evanm Date: Wed, 6 May 2020 12:05:05 -0700 Subject: [PATCH 289/316] use tslib.d.ts, not tslib_closure.d.ts The only reason we use the name 'tslib_closure' is for the Closure .js implementation. There's no reason to have a separate tslib_closure.d.ts. The changes here to tslib.d.ts are copying the changes in tslib_closure.d.ts to it. I'm not sure why we diverged from upstream here, but using the same filename as upstream will make this easier to track in the future. PiperOrigin-RevId: 310200260 --- internal/tsc_wrapped/tsc_wrapped_test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/tsc_wrapped/tsc_wrapped_test.ts b/internal/tsc_wrapped/tsc_wrapped_test.ts index ccb4eee0..fa77e965 100644 --- a/internal/tsc_wrapped/tsc_wrapped_test.ts +++ b/internal/tsc_wrapped/tsc_wrapped_test.ts @@ -85,8 +85,7 @@ const COMPILER_OPTIONS: ts.CompilerOptions = { const defaultBazelOpts = { googmodule: true, workspaceName: 'google3', - prelude: - `goog.require('google3.third_party.javascript.tslib.tslib_closure');`, + prelude: `goog.require('google3.third_party.javascript.tslib.tslib');`, } as BazelOptions; describe('compiler host', () => { From 6003d0a0f5f0f3ba39737667876d3f9033d59c48 Mon Sep 17 00:00:00 2001 From: pwng Date: Mon, 11 May 2020 19:24:58 -0700 Subject: [PATCH 290/316] Revise AbsoluteMatcher to support matching Closure APIs. PiperOrigin-RevId: 311043276 --- internal/tsetse/util/absolute_matcher.ts | 122 +++++++++--------- internal/tsetse/util/absolute_matcher_test.ts | 79 +++++++++--- 2 files changed, 124 insertions(+), 77 deletions(-) diff --git a/internal/tsetse/util/absolute_matcher.ts b/internal/tsetse/util/absolute_matcher.ts index 05816297..1ba885d9 100644 --- a/internal/tsetse/util/absolute_matcher.ts +++ b/internal/tsetse/util/absolute_matcher.ts @@ -4,11 +4,16 @@ import {dealias, debugLog, isInStockLibraries, isNameInDeclaration, isPartOfImpo const PATH_NAME_FORMAT = '[/\\.\\w\\d_-]+'; const JS_IDENTIFIER_FORMAT = '[\\w\\d_-]+'; const FQN_FORMAT = `(${JS_IDENTIFIER_FORMAT}\.)*${JS_IDENTIFIER_FORMAT}`; -// A fqn made out of a dot-separated chain of JS identifiers. -const ABSOLUTE_RE = new RegExp(`^${PATH_NAME_FORMAT}\\|${FQN_FORMAT}$`); const GLOBAL = 'GLOBAL'; const ANY_SYMBOL = 'ANY_SYMBOL'; - +const CLOSURE = 'CLOSURE'; +/** A fqn made out of a dot-separated chain of JS identifiers. */ +const ABSOLUTE_RE = new RegExp(`^${PATH_NAME_FORMAT}\\|${FQN_FORMAT}$`); +/** + * Clutz glues js symbols to ts namespace by prepending "ಠ_ಠ.clutz.". + * We need to include this prefix when the banned name is from Closure. + */ +const CLUTZ_SYM_PREFIX = 'ಠ_ಠ.clutz.'; /** * This class matches symbols given a "foo.bar.baz" name, where none of the @@ -19,8 +24,10 @@ const ANY_SYMBOL = 'ANY_SYMBOL'; * name on which the symbol was initially defined. * * This matcher requires a scope for the symbol, which may be `GLOBAL`, - * `ANY_SCOPE`, or a file path filter. The matcher begins with this scope, then - * the separator "|", followed by the symbol name. For example, "GLOBAL|eval". + * `ANY_SYMBOL`, `CLOSURE` or a file path filter. `CLOSURE` indicates that the + * symbol is from the JS Closure library processed by clutz. The matcher begins + * with this scope, then the separator "|", followed by the symbol name. For + * example, "GLOBAL|eval". * * The file filter specifies * (part of) the path of the file in which the symbol of interest is defined. @@ -91,9 +98,29 @@ export class AbsoluteMatcher { // Split spec by the separator "|". [this.filePath, this.bannedName] = spec.split('|', 2); + + if (this.filePath === CLOSURE) { + this.bannedName = CLUTZ_SYM_PREFIX + this.bannedName; + } } matches(n: ts.Node, tc: ts.TypeChecker): boolean { + debugLog(() => `start matching ${n.getText()} in ${n.parent.getText()}`); + + // Check if the node is being declared. Declaration may be imported without + // programmer being aware of. We should not alert them about that. + // Since import statments are also declarations, this have two notable + // consequences. + // - Match is negative for imports without renaming + // - Match is positive for imports with renaming, when the imported name + // is the target. Since Tsetse is flow insensitive and we don't track + // symbol aliases, the import statement is the only place we can match + // bad symbols if they get renamed. + if (isNameInDeclaration(n)) { + debugLog(() => `We don't flag symbol declarations`); + return false; + } + // Get the symbol (or the one at the other end of this alias) that we're // looking at. const s = dealias(tc.getSymbolAtLocation(n), tc); @@ -110,69 +137,44 @@ export class AbsoluteMatcher { // Name-based check: `getFullyQualifiedName` returns `"filename".foo.bar` or // just `foo.bar` if the symbol is ambient. The check here should consider // both cases. - if (!(fqn.endsWith('".' + this.bannedName) || fqn === this.bannedName)) { + if (!fqn.endsWith('".' + this.bannedName) && fqn !== this.bannedName) { debugLog(() => `FQN ${fqn} doesn't match name ${this.bannedName}`); - return false; // not a use of the symbols we want + return false; } - // Check if it's part of a declaration or import. The check is cheap. If - // we're looking for the uses of a symbol, we don't alert on the imports, to - // avoid flooding users with warnings (as the actual use will be alerted) - // and bad fixes. - const p = n.parent; - if (isNameInDeclaration(n) || (p && isPartOfImportStatement(p))) { - debugLog(() => `We don't flag symbol declarations`); - return false; + // If `ANY_SYMBOL` or `CLOSURE` is specified, it's sufficient to conclude we + // have a match. + if (this.filePath === ANY_SYMBOL || this.filePath === CLOSURE) { + return true; } - // No file info in the FQN means it's not explicitly imported. - // That must therefore be a local variable, or an ambient symbol - // (and we only care about ambients here). Those could come from - // either a declare somewhere, or one of the core libraries that - // are loaded by default. - if (!fqn.startsWith('"')) { - // If this matcher includes a non-empty file path, it means that the - // targeted symbol is defined and explicitly exported in some file. If the - // current symbol is not associated with a specific file (because it is a - // local symbol or ambient symbol), it is not a match. - if (this.filePath !== GLOBAL && this.filePath !== ANY_SYMBOL) { - debugLog( - () => - `The symbol has no file path and one is specified by the matcher`); - return false; - } + // If there is no declaration, the symbol is a language built-in object. + // This is a match only if `GLOBAL` is specified. + const declarations = s.getDeclarations(); + if (declarations === undefined) { + return this.filePath === GLOBAL; + } - // We need to trace things back, so get declarations of the symbol. - const declarations = s.getDeclarations(); - if (!declarations) { - debugLog(() => `Symbol never declared?`); - return false; + // No file info in the FQN means it's imported from a .d.ts declaration + // file. This can be from a core library, a JS library, or an exported local + // symbol defined in another TS target. We need to extract the name of the + // declaration file. + if (!fqn.startsWith('"')) { + if (this.filePath === GLOBAL) { + return declarations.some(isInStockLibraries); + } else { + return declarations.some((d) => { + const srcFilePath = d.getSourceFile()?.fileName; + return srcFilePath && srcFilePath.match(this.filePath); + }) } - if (!declarations.some(isInStockLibraries)) { - debugLog(() => `Symbol not from the stock libraries`); - return false; + } else { + const last = fqn.indexOf('"', 1); + if (last === -1) { + throw new Error('Malformed fully-qualified name.'); } + const filePath = fqn.substring(1, last); + return filePath.match(this.filePath) !== null; } - // If we know the file info of the symbol, and this matcher includes a file - // path, we check if they match. - else { - if (this.filePath !== ANY_SYMBOL) { - const last = fqn.indexOf('"', 1); - if (last === -1) { - throw new Error('Malformed fully-qualified name.'); - } - const sympath = fqn.substring(1, last); - debugLog(() => `The file path of the symbol is ${sympath}`); - if (!sympath.match(this.filePath) || this.filePath === GLOBAL) { - debugLog( - () => - `The file path of the symbol does not match the file path of the matcher`); - return false; - } - } - } - - debugLog(() => `all clear, report finding`); - return true; } } diff --git a/internal/tsetse/util/absolute_matcher_test.ts b/internal/tsetse/util/absolute_matcher_test.ts index cfc25652..3617aad7 100644 --- a/internal/tsetse/util/absolute_matcher_test.ts +++ b/internal/tsetse/util/absolute_matcher_test.ts @@ -40,12 +40,14 @@ describe('AbsoluteMatcher', () => { {matchedCode: `bar`, messageText: 'banned name with file path'}); }); - it('ignores an unmatched file path', () => { + it('ignores an exported symbol defined in an unmatched file path', () => { const config = { errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] }; + + // test exported symbols const sources = [ `export class Foo { static bar(s: string) {return s + "abc";} }`, `export class Foo { static bar(s: string) {return s + "abc";} }`, @@ -58,6 +60,27 @@ describe('AbsoluteMatcher', () => { expect(results).toHaveNoFailures(); }); + it('ignores an un-exported symbol defined in an unmatched file path', + () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|Foo.bar'] + }; + + // test non-exported symbols + const sources = [ + `export class Foo { static bar(s: string) {return s + "abc";} }`, + `class Foo { static bar(s: string) {return s + "abc";} } + var a = Foo.bar("123");` + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + + expect(results).toHaveNoFailures(); + }); + it('matches a local exported definition', () => { // This is a match because Foo.bar is an exported symbol. const config = { @@ -74,6 +97,30 @@ describe('AbsoluteMatcher', () => { expect(results).toHaveFailuresMatching( {matchedCode: `bar`, messageText: 'banned name with file path'}); }); + + it('matches names in import statement', () => { + const config = { + errorMessage: 'banned name with file path', + kind: PatternKind.BANNED_NAME, + values: ['./file_0|foo', 'ANY_SYMBOL|bar'] + }; + const sources = [ + `export function foo(s: string) {return s + "abc";} + function bar() {} + export {bar};`, + `import {foo} from './file_0'; + import {bar} from './file_0';`, + `import {foo as okFoo} from './file_0'; + import {bar as okBar} from './file_0';`, + ]; + + const results = + compileAndCheck(new ConformancePatternRule(config), ...sources); + expect(results).toHaveFailuresMatching( + {matchedCode: `foo`, messageText: 'banned name with file path'}, + {matchedCode: `bar`, messageText: 'banned name with file path'}, + ); + }); }); describe('global scope', () => { @@ -91,7 +138,7 @@ describe('AbsoluteMatcher', () => { {matchedCode: `eval`, messageText: 'banned ambient name'}); }); - it('does not match a custom method with the same name', () => { + it('does not match a custom exported method with the same name', () => { const config = { errorMessage: 'banned ambient name', kind: PatternKind.BANNED_NAME, @@ -106,33 +153,31 @@ describe('AbsoluteMatcher', () => { expect(results).toHaveNoFailures(); }); - it('matches an initializer in a named declaration', () => { + it('does not match a custom non-exported method with the same name', () => { const config = { - errorMessage: 'banned ambient name', + errorMessage: 'banned global name', kind: PatternKind.BANNED_NAME, - values: ['GLOBAL|open'], + values: ['GLOBAL|Foo.bar'] }; - const sources = ['const op = open;']; - + const sources = [`class Foo { static bar(s: string) {return s + "abc";} } + var a = Foo.bar("123");`]; const results = compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveFailuresMatching( - {matchedCode: 'open', messageText: 'banned ambient name'}); + expect(results).toHaveNoFailures(); }); - it('does not match a local non-exported definition', () => { - // This is not a match because Foo.bar is a non-exported locally defined - // symbol. + it('matches an initializer in a named declaration', () => { const config = { - errorMessage: 'banned name with file path', + errorMessage: 'banned ambient name', kind: PatternKind.BANNED_NAME, - values: ['./file_0|Foo.bar'] + values: ['GLOBAL|open'], }; - const sources = [`class Foo { static bar(s: string) {return s + "abc";} } - var a = Foo.bar("123");`]; + const sources = ['const op = open;']; + const results = compileAndCheck(new ConformancePatternRule(config), ...sources); - expect(results).toHaveNoFailures(); + expect(results).toHaveFailuresMatching( + {matchedCode: 'open', messageText: 'banned ambient name'}); }); }); From e8c0c4cd3d32d2201225e69efd815d5ca1eaaa0b Mon Sep 17 00:00:00 2001 From: lucassloan Date: Tue, 2 Jun 2020 11:07:25 -0700 Subject: [PATCH 291/316] Make the position based diagnostic constructor public. Fix a bug where expected diagnostics on line 1, character 1 never matched. PiperOrigin-RevId: 314365731 --- internal/tsc_wrapped/diagnostics.ts | 2 +- internal/tsetse/checker.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/tsc_wrapped/diagnostics.ts b/internal/tsc_wrapped/diagnostics.ts index 32fbfe0f..53f29280 100644 --- a/internal/tsc_wrapped/diagnostics.ts +++ b/internal/tsc_wrapped/diagnostics.ts @@ -79,7 +79,7 @@ export function filterExpected( const unmatchedDiags = diagnostics.filter(diag => { let line = -1; let character = -1; - if (diag.file && diag.start) { + if (diag.file !== undefined && diag.start !== undefined) { ({line, character} = ts.getLineAndCharacterOfPosition(diag.file, diag.start)); } diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 9d5c1d28..2f606f45 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -107,11 +107,9 @@ export class Checker { } /** - * Add a failure with a span. addFailure() is currently private because - * `addFailureAtNode` is preferred. + * Add a failure with a span. */ - private addFailure( - start: number, end: number, failureText: string, fix?: Fix) { + addFailure(start: number, end: number, failureText: string, fix?: Fix) { if (!this.currentSourceFile) { throw new Error('Source file not defined'); } From daa08b45983241315a4ea26aac66d1a98f19dfcb Mon Sep 17 00:00:00 2001 From: pwng Date: Mon, 8 Jun 2020 17:01:16 -0700 Subject: [PATCH 292/316] Remove the deprecated and unused BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT pattern from Tsetse checker. PiperOrigin-RevId: 315383297 --- .../tsetse/rules/conformance_pattern_rule.ts | 4 - internal/tsetse/util/pattern_config.ts | 2 - .../name_call_non_constant_argument.ts | 81 ------------- .../name_call_non_constant_argument_test.ts | 113 ------------------ 4 files changed, 200 deletions(-) delete mode 100644 internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts delete mode 100644 internal/tsetse/util/pattern_engines/name_call_non_constant_argument_test.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index f1188943..666501b8 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -3,7 +3,6 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; import {Fixer} from '../util/fixer'; import {Config, PatternKind} from '../util/pattern_config'; -import {CallNonConstantArgumentEngine} from '../util/pattern_engines/name_call_non_constant_argument'; import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyEngine} from '../util/pattern_engines/property_engine'; @@ -39,9 +38,6 @@ export class ConformancePatternRule implements AbstractRule { case PatternKind.BANNED_NAME: this.engine = new NameEngine(config, fixer); break; - case PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT: - this.engine = new CallNonConstantArgumentEngine(config, fixer); - break; case PatternKind.BANNED_PROPERTY_READ: this.engine = new PropertyReadEngine(config, fixer); break; diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 3c78c8f2..52262190 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -21,8 +21,6 @@ export enum PatternKind { * property are allowed. */ BANNED_PROPERTY_READ = 'banned-property-read', - /** @deprecated use `BANNED_PROPERTY` instead */ - BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT = 'banned-call-non-constant-argument' } /** diff --git a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts deleted file mode 100644 index 5a7a7ffb..00000000 --- a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument.ts +++ /dev/null @@ -1,81 +0,0 @@ -import * as ts from 'typescript'; - -import {Checker} from '../../checker'; -import {ErrorCode} from '../../error_code'; -import {AbsoluteMatcher} from '../absolute_matcher'; -import {debugLog} from '../ast_tools'; -import {Fixer} from '../fixer'; -import {isLiteral} from '../is_literal'; -import {Config} from '../pattern_config'; - -import {PatternEngine} from './pattern_engine'; - -function parseSpec(value: string): [AbsoluteMatcher, number] { - const [matcherSpec, strPosition] = value.split(':', 2); - if (!matcherSpec || !strPosition.match('^\\d+$')) { - throw new Error(`Couldn\'t parse value '${value}'`); - } - const position = Number(strPosition); - return [new AbsoluteMatcher(matcherSpec), position]; -} - -/** - * Inspects a particular CallExpression to see if it calls the target - * function with a non-literal parameter in the target position. Returns - * that CallExpression if `n` matches the search, undefined otherwise. - */ -function checkCallExpr( - tc: ts.TypeChecker, n: ts.CallExpression, matcher: AbsoluteMatcher, - position: number): ts.CallExpression|undefined { - debugLog(() => `inspecting ${n.getText().trim()}`); - - if (!matcher.matches(n.expression, tc)) { - debugLog(() => `Wrong symbol, not ${matcher.bannedName}`); - return; - } - if (n.arguments.length < position) { - debugLog( - () => `Good symbol, not enough arguments to match (got ${ - n.arguments.length}, want ${position})`); - return; - } - if (isLiteral(tc, n.arguments[position])) { - debugLog(() => `Good symbol, argument literal`); - return; - } - debugLog( - () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - - // No match. - return; -} - -/** - * The engine for BANNED_CALL_NON_CONSTANT_ARGUMENT. - * - * This takes any amount of (functionName, argument) position pairs, separated - * by a colon. The first part matches symbols that were defined on the global - * scope, and their fields, without going through a prototype chain. - * - * For instance, "URL.createObjectURL:0" will target any createObjectURL-named - * call on a URL-named object (like the ambient URL declared in lib.dom.d.ts), - * or "Car.buildFromParts:1" will match any buildFromParts reached from a - * Car-named symbol, including a hypothetical class with a static member - * function "buildFromParts" that lives in its own module. - */ -export class CallNonConstantArgumentEngine extends PatternEngine { - register(checker: Checker) { - for (const value of this.config.values) { - const [matcher, position] = parseSpec(value); - - checker.on( - ts.SyntaxKind.CallExpression, - this.wrapCheckWithWhitelistingAndFixer( - (tc, n: ts.CallExpression) => - checkCallExpr(tc, n, matcher, position)), - ErrorCode.CONFORMANCE_PATTERN); - } - } -} diff --git a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument_test.ts b/internal/tsetse/util/pattern_engines/name_call_non_constant_argument_test.ts deleted file mode 100644 index b4b24cfc..00000000 --- a/internal/tsetse/util/pattern_engines/name_call_non_constant_argument_test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; - -describe('BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT', () => { - const config = { - errorMessage: 'do not call bar.foo with non-literal 1st arg', - kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['ANY_SYMBOL|bar:0'] - }; - const rule = new ConformancePatternRule(config); - - it('matches simple examples', () => { - const sources = [ - `export function bar(x:any, y:any) {}`, - `import * as foo from './file_0'; ` + - `foo.bar(1, 1); foo.bar(window.name, 1);`, - ]; - const results = compileAndCheck(rule, ...sources); - - expect(results).toHaveFailuresMatching({ - matchedCode: `foo.bar(window.name, 1)`, - messageText: 'do not call bar.foo with non-literal 1st arg' - }); - }); - - it('looks at the right position', () => { - const sources = [ - `export function bar(x:any, y:any) {}`, - `import * as foo from './file_0'; foo.bar(1, window.name);`, - ]; - const results = compileAndCheck(rule, ...sources); - - expect(results).toHaveNoFailures(); - }); - - it('looks at the right position', () => { - const rule = new ConformancePatternRule({ - errorMessage: 'non-literal arg', - kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['ANY_SYMBOL|aaa:1', 'ANY_SYMBOL|bbb:0'] - }); - - const sources = [ - `export function aaa(x:any, y:any) {}; export function bbb(x:any) {}`, - `import * as foo from './file_0'; ` + - `foo.aaa(1, window.name); foo.bbb(window.name);`, - ]; - const results = compileAndCheck(rule, ...sources); - - expect(results).toHaveFailuresMatching( - { - matchedCode: `foo.aaa(1, window.name)`, - }, - { - matchedCode: `foo.bbb(window.name)`, - }); - }); - - it('supports static methods', () => { - const rule = new ConformancePatternRule({ - errorMessage: 'non-literal arg', - kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['ANY_SYMBOL|Car.buildFromParts:0'] - }); - - const sources = [ - `export class Car { static buildFromParts(name:string):void {}; }`, - `import {Car} from './file_0';\n` + - `Car.buildFromParts(window.name);\n` + - `Car.buildFromParts('hello');`, - ]; - const results = compileAndCheck(rule, ...sources); - - expect(results).toHaveFailuresMatching({ - matchedCode: `Car.buildFromParts(window.name)`, - }); - }); - - it('supports ambient global methods', () => { - const rule = new ConformancePatternRule({ - errorMessage: 'non-literal arg', - kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['GLOBAL|URL.createObjectURL:0'] - }); - - const sources = [`URL.createObjectURL(window.name);\n`]; - const results = compileAndCheck(rule, ...sources); - - expect(results).toHaveFailuresMatching({ - matchedCode: `URL.createObjectURL(window.name)`, - }); - }); - - it('supports ambient global methods', () => { - const rule = new ConformancePatternRule({ - errorMessage: 'non-literal arg', - kind: PatternKind.BANNED_NAME_CALL_NON_CONSTANT_ARGUMENT, - values: ['GLOBAL|eval:0'] - }); - - const sources = [`eval(window.name);\n`]; - const results = compileAndCheck(rule, ...sources); - - expect(results).toHaveFailuresMatching({ - matchedCode: `eval(window.name)`, - }); - }); -}); - -beforeEach(() => { - jasmine.addMatchers(customMatchers); -}); From d23ce0c6675687442d5d946d30095a7aeaa08645 Mon Sep 17 00:00:00 2001 From: lucassloan Date: Wed, 10 Jun 2020 14:42:47 -0700 Subject: [PATCH 293/316] Add the option to entirely disable type checking. PiperOrigin-RevId: 315771891 --- internal/common/tsconfig.bzl | 4 +++- internal/tsc_wrapped/tsc_wrapped.ts | 3 +++ internal/tsc_wrapped/tsconfig.ts | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index 8df9ff48..ac14b4dc 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -32,7 +32,8 @@ def create_tsconfig( extra_root_dirs = [], module_path_prefixes = None, module_roots = None, - node_modules_root = None): + node_modules_root = None, + type_check = True): """Creates an object representing the TypeScript configuration to run the compiler under Bazel. Args: @@ -156,6 +157,7 @@ def create_tsconfig( "addDtsClutzAliases": getattr(ctx.attr, "add_dts_clutz_aliases", False), "typeCheckDependencies": getattr(ctx.attr, "internal_testing_type_check_dependencies", False), "expectedDiagnostics": getattr(ctx.attr, "expected_diagnostics", []), + "typeCheck": True, } if getattr(ctx.attr, "use_angular_plugin", False): diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index 4104d9b3..f17aebe9 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -59,6 +59,9 @@ export function gatherDiagnostics( const diagnostics: ts.Diagnostic[] = []; perfTrace.wrap('type checking', () => { + if (!bazelOpts.typeCheck) { + return; + } // These checks mirror ts.getPreEmitDiagnostics, with the important // exception of avoiding b/30708240, which is that if you call // program.getDeclarationDiagnostics() it somehow corrupts the emit. diff --git a/internal/tsc_wrapped/tsconfig.ts b/internal/tsc_wrapped/tsconfig.ts index be964ebc..1117ea89 100644 --- a/internal/tsc_wrapped/tsconfig.ts +++ b/internal/tsc_wrapped/tsconfig.ts @@ -201,6 +201,12 @@ export interface BazelOptions { * future. */ devmodeTargetOverride?: string; + + /** + * Whether to type check. Differs from typeCheckDependencies in that this + * avoids type checking the srcs in addition to the dependencies. + */ + typeCheck: boolean; } export interface ParsedTsConfig { From 0abda48e38460c1bbc16e03a8f426bf2a783f398 Mon Sep 17 00:00:00 2001 From: pwng Date: Thu, 11 Jun 2020 18:17:55 -0700 Subject: [PATCH 294/316] Undo the deprecation of `BANNED_PROPERTY_NON_CONSTANT_WRITE` PiperOrigin-RevId: 316017056 --- internal/tsetse/util/pattern_config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 52262190..3e82e342 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -14,7 +14,10 @@ export enum PatternKind { * property are allowed. */ BANNED_PROPERTY_WRITE = 'banned-property-write', - /** @deprecated use `BANNED_PROPERTY_WRITE` instead */ + /** + * Ban instance property write unless the property is assigned a constant + * literal. + */ BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', /** * Ban instance property, like BANNED_PROPERTY but where writes of the From 4074d411d7d6155a4f3d883ed89e4784a6df5a8a Mon Sep 17 00:00:00 2001 From: martinprobst Date: Fri, 12 Jun 2020 11:02:32 -0700 Subject: [PATCH 295/316] Document why this code is serving 404s with useful content (and not 200s). PiperOrigin-RevId: 316136597 --- devserver/devserver/devserver.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devserver/devserver/devserver.go b/devserver/devserver/devserver.go index 9bd3a866..3ed5d88c 100644 --- a/devserver/devserver/devserver.go +++ b/devserver/devserver/devserver.go @@ -160,6 +160,9 @@ func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) // When a file is not found, serve a 404 code but serve the index.html from above as its body. // This allows applications to use html5 routing and reload the page at /some/sub/path, but still // get their web app served. + // The responses is marked as an error (404) so that requests that are genuinely wrong (e.g. + // incorrect URLs for CSS, images, etc) are marked as such. Otherwise they'd seem to succeed but + // then fail to process correctly, which makes for a bad debugging experience. writer = &customNotFoundResponseWriter{ResponseWriter: writer, request: request, notFound: indexHandler} fileHandler(writer, request) } @@ -170,7 +173,7 @@ func CreateFileHandler(servingPath, manifest string, pkgs []string, base string) // dirHTTPFileSystem implements http.FileSystem by looking in the list of dirs one after each other. type dirHTTPFileSystem struct { packageDirs []string - base string + base string } func (fs dirHTTPFileSystem) Open(name string) (http.File, error) { @@ -211,7 +214,6 @@ func (fs dirHTTPFileSystem) Open(name string) (http.File, error) { } } - // We can assume that the file is present, if it's listed in the runfile manifest. Though, we // return the error, in case something prevented the read-access. return os.Open(realFilePath) From 6bb71601fc981d12ff5c060d947ba75f38193b79 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 15 Jun 2020 11:57:44 -0700 Subject: [PATCH 296/316] Allow validation outputs to be registered in OutputGroupInfo. PiperOrigin-RevId: 316514294 --- internal/common/compilation.bzl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl index c9d76d12..2947e81b 100644 --- a/internal/common/compilation.bzl +++ b/internal/common/compilation.bzl @@ -193,7 +193,8 @@ def compile_ts( jsx_factory = None, tsc_wrapped_tsconfig = None, tsconfig = None, - outputs = _outputs): + outputs = _outputs, + validation_outputs = None): """Creates actions to compile TypeScript code. This rule is shared between ts_library and ts_declaration. @@ -205,11 +206,13 @@ def compile_ts( declaration_infos: list of DeclarationInfo. Explicit list of declarations to be used instead of those on ctx.attr.deps. compile_action: function. Creates the compilation action. devmode_compile_action: function. Creates the compilation action - for devmode. + for devmode. jsx_factory: optional string. Enables overriding jsx pragma. tsc_wrapped_tsconfig: function that produces a tsconfig object. tsconfig: The tsconfig file to output, if other than ctx.outputs.tsconfig. outputs: function from a ctx to the expected compilation outputs. + validation_outputs: Actions that produce validation outputs will be run whenever any part of + a rule is run, even if its outputs are not used. This is useful for things like strict deps check. Returns: struct that will be returned by the rule implementation. @@ -458,6 +461,7 @@ def compile_ts( files = depset(transitive = files_depsets), ), OutputGroupInfo( + _validation = depset(validation_outputs if validation_outputs else []), es5_sources = es5_sources, es6_sources = es6_sources, ), From 3d5933acf0ee570777d27f62464554cae1000904 Mon Sep 17 00:00:00 2001 From: pwng Date: Tue, 16 Jun 2020 10:33:31 -0700 Subject: [PATCH 297/316] Make whitelisting-related code visible outside `PatternEngine`. PiperOrigin-RevId: 316709323 --- internal/tsetse/util/pattern_config.ts | 49 +--------- .../util/pattern_engines/pattern_engine.ts | 44 ++------- internal/tsetse/util/whitelist.ts | 96 +++++++++++++++++++ internal/tsetse/util/whitelist_test.ts | 44 ++++++++- 4 files changed, 146 insertions(+), 87 deletions(-) create mode 100644 internal/tsetse/util/whitelist.ts diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 3e82e342..ab1becb0 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -1,3 +1,4 @@ +import {WhitelistEntry} from './whitelist'; /** * The list of supported patterns useable in ConformancePatternRule. The @@ -52,51 +53,3 @@ export interface Config { */ name?: string; } - -/** - * A whitelist entry, corresponding to a logical whitelisting rule. Use these - * to distinguish between various logical reasons for whitelisting something: - * for instance, tie these to particular bugs that needed whitelisting, per - * legacy project, manually reviewed entries, and so on. - * - * Whitelists are based on the file paths provided by the TS compiler, with - * both regexp-based checks and prefix-based checks. - * - * - * Follows the logic in - * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/conformance.proto. - */ -export interface WhitelistEntry { - /** The category corresponding to this entry. */ - reason: WhitelistReason; - /** Why is this okay to whitelist. */ - explanation?: string; - - /** - * Regexps for the paths of files that will be ignored by the - * ConformancePattern. Beware, escaping can be tricky. - */ - regexp?: string[]; - /** - * Prefixes for the paths of files that will be ignored by the - * ConformancePattern. - */ - prefix?: string[]; -} - -/** - * The categories of whitelist entries. - */ -export enum WhitelistReason { - /** No reason. */ - UNSPECIFIED, - /** Code that has to be grandfathered in (no guarantees). */ - LEGACY, - /** - * Code that does not enter the scope of this particular check (no - * guarantees). - */ - OUT_OF_SCOPE, - /** Manually reviewed exceptions (supposedly okay). */ - MANUALLY_REVIEWED -} diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index f0f1d66d..a53fae44 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -4,30 +4,18 @@ import {Checker} from '../../checker'; import {Fix} from '../../failure'; import {Fixer} from '../../util/fixer'; import {Config} from '../../util/pattern_config'; +import {Whitelist} from '../../util/whitelist'; import {shouldExamineNode} from '../ast_tools'; /** * A patternEngine is the logic that handles a specific PatternKind. */ export abstract class PatternEngine { - private readonly whitelistedPrefixes: string[] = []; - private readonly whitelistedRegExps: RegExp[] = []; - private readonly whitelistMemoizer: Map = new Map(); + private readonly whitelist: Whitelist; constructor( protected readonly config: Config, protected readonly fixer?: Fixer) { - if (config.whitelistEntries) { - for (const e of config.whitelistEntries) { - if (e.prefix) { - this.whitelistedPrefixes = - this.whitelistedPrefixes.concat(...e.prefix); - } - if (e.regexp) { - this.whitelistedRegExps = this.whitelistedRegExps.concat( - ...e.regexp.map(r => new RegExp(r))); - } - } - } + this.whitelist = new Whitelist(config.whitelistEntries); } /** @@ -47,11 +35,12 @@ export abstract class PatternEngine { checkFunction: (tc: ts.TypeChecker, n: T) => ts.Node | undefined): (c: Checker, n: T) => void { return (c: Checker, n: T) => { - if (!shouldExamineNode(n) || n.getSourceFile().isDeclarationFile) { + const sf = n.getSourceFile(); + if (!shouldExamineNode(n) || sf.isDeclarationFile) { return; } const matchedNode = checkFunction(c.typeChecker, n); - if (matchedNode && !this.isWhitelisted(matchedNode)) { + if (matchedNode && !this.whitelist.isWhitelisted(sf.fileName)) { const fix: Fix|undefined = this.fixer ? this.fixer.getFixForFlaggedNode(matchedNode) : undefined; @@ -59,25 +48,4 @@ export abstract class PatternEngine { } } } - - isWhitelisted(n: ts.Node): boolean { - const name: string = n.getSourceFile().fileName; - if (this.whitelistMemoizer.has(name)) { - return this.whitelistMemoizer.get(name)!; - } - for (const p of this.whitelistedPrefixes) { - if (name.indexOf(p) == 0) { - this.whitelistMemoizer.set(name, true); - return true; - } - } - for (const re of this.whitelistedRegExps) { - if (re.test(name)) { - this.whitelistMemoizer.set(name, true); - return true; - } - } - this.whitelistMemoizer.set(name, false); - return false; - } } diff --git a/internal/tsetse/util/whitelist.ts b/internal/tsetse/util/whitelist.ts new file mode 100644 index 00000000..6bedc157 --- /dev/null +++ b/internal/tsetse/util/whitelist.ts @@ -0,0 +1,96 @@ +/** + * A whitelist entry, corresponding to a logical whitelisting rule. Use these + * to distinguish between various logical reasons for whitelisting something: + * for instance, tie these to particular bugs that needed whitelisting, per + * legacy project, manually reviewed entries, and so on. + * + * Whitelists are based on the file paths provided by the TS compiler, with + * both regexp-based checks and prefix-based checks. + * + * + * Follows the logic in + * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/conformance.proto. + */ +export interface WhitelistEntry { + /** The category corresponding to this entry. */ + readonly reason: WhitelistReason; + /** Why is this okay to whitelist. */ + readonly explanation?: string; + + /** + * Regexps for the paths of files that will be ignored by the + * ConformancePattern. Beware, escaping can be tricky. + */ + readonly regexp?: readonly string[]; + /** + * Prefixes for the paths of files that will be ignored by the + * ConformancePattern. + */ + readonly prefix?: readonly string[]; +} + +/** + * The categories of whitelist entries. + */ +export enum WhitelistReason { + /** No reason. */ + UNSPECIFIED, + /** Code that has to be grandfathered in (no guarantees). */ + LEGACY, + /** + * Code that does not enter the scope of this particular check (no + * guarantees). + */ + OUT_OF_SCOPE, + /** Manually reviewed exceptions (supposedly okay). */ + MANUALLY_REVIEWED +} + +/** + * A complete whitelist with all related WhitelistEntry grouped together, with + * WhitelistReason ignored since it is purely for documentary purposes. + */ +export class Whitelist { + private readonly whitelistedPrefixes: readonly string[] = []; + private readonly whitelistedRegExps: readonly RegExp[] = []; + // To avoid repeated computation for whitelisting queries with the same file + // path, create a memoizer to cache known results. This is useful in watch + // mode (and possible in language service) when the same files can be compiled + // repeatedly. + private readonly whitelistMemoizer: Map = new Map(); + + constructor(whitelistEntries?: WhitelistEntry[]) { + if (whitelistEntries) { + for (const e of whitelistEntries) { + if (e.prefix) { + this.whitelistedPrefixes = + this.whitelistedPrefixes.concat(...e.prefix); + } + if (e.regexp) { + this.whitelistedRegExps = this.whitelistedRegExps.concat( + ...e.regexp.map(r => new RegExp(r))); + } + } + } + } + + isWhitelisted(filePath: string): boolean { + if (this.whitelistMemoizer.has(filePath)) { + return this.whitelistMemoizer.get(filePath)!; + } + for (const p of this.whitelistedPrefixes) { + if (filePath.startsWith(p)) { + this.whitelistMemoizer.set(filePath, true); + return true; + } + } + for (const re of this.whitelistedRegExps) { + if (re.test(filePath)) { + this.whitelistMemoizer.set(filePath, true); + return true; + } + } + this.whitelistMemoizer.set(filePath, false); + return false; + } +} diff --git a/internal/tsetse/util/whitelist_test.ts b/internal/tsetse/util/whitelist_test.ts index 475c6203..b94ea805 100644 --- a/internal/tsetse/util/whitelist_test.ts +++ b/internal/tsetse/util/whitelist_test.ts @@ -1,7 +1,9 @@ import 'jasmine'; + import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; -import {WhitelistReason} from './pattern_config'; + import {compileAndCheck, customMatchers, getTempDirForWhitelist} from './testing/test_support'; +import {WhitelistReason} from './whitelist'; const tmpPrefixForWhitelist = getTempDirForWhitelist(); const tmpRegexpForWhitelist = @@ -115,6 +117,46 @@ describe('ConformancePatternRule', () => { new ConformancePatternRule(config); }).toThrowError(/Invalid regular expression/); }); + + it('test memoizer hit', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + regexp: [ + `${tmpRegexpForWhitelist}.+/file_0\\.ts`, + ] + }] + }; + const rule = new ConformancePatternRule(config); + // Compile the same file twice to make sure memoizer doesn't + // break things. + let results = compileAndCheck(rule, source); + results = results.concat(compileAndCheck(rule, source)); + + expect(results).toHaveNoFailures(); + }); + + it('test memoizer miss', () => { + const config = { + ...baseConfig, + whitelistEntries: [{ + reason: WhitelistReason.UNSPECIFIED, + regexp: [ + `${tmpRegexpForWhitelist}.+/file_1\\.ts`, + ], + prefix: ['###PrefixNotExist###'], + }] + }; + const rule = new ConformancePatternRule(config); + // Compile the same file twice to make sure memoizer doesn't + // break things. + let results = compileAndCheck(rule, source); + expect(results).toHaveNFailures(1); + + results = compileAndCheck(rule, source); + expect(results).toHaveNFailures(1); + }); }); }); From c88400b411dcd01955673c61bf0165df993f48fd Mon Sep 17 00:00:00 2001 From: pwng Date: Wed, 17 Jun 2020 19:03:13 -0700 Subject: [PATCH 298/316] Remove never used BANNED_PROPERTY_READ pattern. PiperOrigin-RevId: 317013155 --- .../tsetse/rules/conformance_pattern_rule.ts | 4 - internal/tsetse/util/pattern_config.ts | 5 - .../pattern_engines/property_read_engine.ts | 89 --------------- .../property_read_engine_test.ts | 104 ------------------ 4 files changed, 202 deletions(-) delete mode 100644 internal/tsetse/util/pattern_engines/property_read_engine.ts delete mode 100644 internal/tsetse/util/pattern_engines/property_read_engine_test.ts diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index 666501b8..714c0e74 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -7,7 +7,6 @@ import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyEngine} from '../util/pattern_engines/property_engine'; import {PropertyNonConstantWriteEngine} from '../util/pattern_engines/property_non_constant_write_engine'; -import {PropertyReadEngine} from '../util/pattern_engines/property_read_engine'; import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine'; @@ -38,9 +37,6 @@ export class ConformancePatternRule implements AbstractRule { case PatternKind.BANNED_NAME: this.engine = new NameEngine(config, fixer); break; - case PatternKind.BANNED_PROPERTY_READ: - this.engine = new PropertyReadEngine(config, fixer); - break; default: throw new Error('Config type not recognized, or not implemented yet.'); } diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index ab1becb0..041fd9d5 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -20,11 +20,6 @@ export enum PatternKind { * literal. */ BANNED_PROPERTY_NON_CONSTANT_WRITE = 'banned-property-non-constant-write', - /** - * Ban instance property, like BANNED_PROPERTY but where writes of the - * property are allowed. - */ - BANNED_PROPERTY_READ = 'banned-property-read', } /** diff --git a/internal/tsetse/util/pattern_engines/property_read_engine.ts b/internal/tsetse/util/pattern_engines/property_read_engine.ts deleted file mode 100644 index 7923120d..00000000 --- a/internal/tsetse/util/pattern_engines/property_read_engine.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as ts from 'typescript'; - -import {Checker} from '../../checker'; -import {ErrorCode} from '../../error_code'; -import {debugLog} from '../ast_tools'; -import {Fixer} from '../fixer'; -import {Config} from '../pattern_config'; -import {PatternEngine} from '../pattern_engines/pattern_engine'; -import {PropertyMatcher} from '../property_matcher'; - -/** - * Check property read in variable initializations. For example, var a = - * object.property. - */ -function checkVarStmt( - tc: ts.TypeChecker, n: ts.VariableStatement, - matcher: PropertyMatcher): ts.Node|undefined { - for (const declaration of n.declarationList.declarations) { - if (declaration.initializer !== undefined && - ts.isPropertyAccessExpression(declaration.initializer)) { - debugLog(() => `Inspecting ${n.getText().trim()}`); - if (matcher.matches(declaration.initializer, tc)) { - debugLog( - () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - } - } - } - return; -} - -/** - * Check property read in binary expressions. If it is an assignment, it is a - * match if the property access appears at the RHS of the assignment. - */ -function checkBinExpr( - tc: ts.TypeChecker, n: ts.BinaryExpression, - matcher: PropertyMatcher): ts.Node|undefined { - debugLog(() => `inspecting ${n.getText().trim()}`); - // If the expression is an assignment, then the property must appear - // at the right-hand side of the expression. - if (n.operatorToken.getText().trim() === '=') { - if (ts.isPropertyAccessExpression(n.right) && - matcher.matches(n.right, tc)) { - debugLog( - () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - } - } - // If it is a non-assignment binary expression, - // the property access may appear either side of the expression. - else { - if ((ts.isPropertyAccessExpression(n.right) && - matcher.matches(n.right, tc)) || - (ts.isPropertyAccessExpression(n.left) && - matcher.matches(n.left, tc))) { - debugLog( - () => `Match. Reporting failure (boundaries: ${n.getStart()}, ${ - n.getEnd()}] on node [${n.getText()}]`); - return n; - } - } - return; -} - -/** - * The engine for BANNED_PROPERTY_READ. - */ -export class PropertyReadEngine extends PatternEngine { - register(checker: Checker) { - for (const value of this.config.values) { - const matcher = PropertyMatcher.fromSpec(value); - - checker.on( - ts.SyntaxKind.VariableStatement, - this.wrapCheckWithWhitelistingAndFixer( - (tc, n: ts.VariableStatement) => checkVarStmt(tc, n, matcher)), - ErrorCode.CONFORMANCE_PATTERN); - - checker.on( - ts.SyntaxKind.BinaryExpression, - this.wrapCheckWithWhitelistingAndFixer( - (tc, n: ts.BinaryExpression) => checkBinExpr(tc, n, matcher)), - ErrorCode.CONFORMANCE_PATTERN); - } - } -} diff --git a/internal/tsetse/util/pattern_engines/property_read_engine_test.ts b/internal/tsetse/util/pattern_engines/property_read_engine_test.ts deleted file mode 100644 index d0fbee77..00000000 --- a/internal/tsetse/util/pattern_engines/property_read_engine_test.ts +++ /dev/null @@ -1,104 +0,0 @@ -import 'jasmine'; - -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; -import {setDebug} from '../../util/ast_tools'; -import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; - -describe('BANNED_PROPERTY_READ', () => { - describe('simpler matcher tests', () => { - const config = { - errorMessage: 'do not read location.href', - kind: PatternKind.BANNED_PROPERTY_READ, - values: ['Location.prototype.href'] - }; - const rule = new ConformancePatternRule(config); - - setDebug(true); - - it('check property access from the RHS of an assignment', () => { - const source = [ - `var x;`, - `x = location.href;`, - ]; - const results = compileAndCheck(rule, ...source); - - expect(results).toHaveFailuresMatching({ - matchedCode: `x = location.href`, - messageText: 'do not read location.href' - }); - }); - - it('check property access from the LHS of an assignment', () => { - const source = [ - `location.href = 'abc';`, - ]; - const results = compileAndCheck(rule, ...source); - - expect(results).toHaveNoFailures(); - }); - - it('check property access from the LHS of a non-assignment binary operation', - () => { - const source = [ - `var x = (location.href == "abc");`, - ]; - const results = compileAndCheck(rule, ...source); - - expect(results).toHaveFailuresMatching({ - matchedCode: `location.href == "abc"`, - messageText: 'do not read location.href' - }); - }); - - it('check property access from the RHS of a non-assignment binary operation', - () => { - const source = [ - `var x = ("abc" == location.href);`, - ]; - const results = compileAndCheck(rule, ...source); - - expect(results).toHaveFailuresMatching({ - matchedCode: `"abc" == location.href`, - messageText: 'do not read location.href' - }); - }); - - it('check property read from variable initializations', () => { - const source = [ - `var x = location.href;`, - ]; - const results = compileAndCheck(rule, ...source); - - expect(results).toHaveFailuresMatching({ - matchedCode: `var x = location.href;`, - messageText: 'do not read location.href' - }); - }); - }); - - describe('advanced type property tests', () => { - const config = { - errorMessage: 'do not read window.location', - kind: PatternKind.BANNED_PROPERTY_READ, - // global variable `window` is of type `Window & typeof globalThis`, - // but we can only specify `Window` here. PropertyMatcher should be - // able to resolve intersection types by itself. See lib.dom.d.ts. - values: ['Window.prototype.location'] - }; - const rule = new ConformancePatternRule(config); - - it('check property read from variable initializations', () => { - const source = 'var l = window.location;'; - const results = compileAndCheck(rule, source); - - expect(results).toHaveFailuresMatching({ - matchedCode: 'var l = window.location;', - messageText: 'do not read window.location' - }); - }); - }); -}); - -beforeEach(() => { - jasmine.addMatchers(customMatchers); -}); From 156f0d4d5ff3cd05c14024523477eb14f9438324 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 18 Jun 2020 12:52:32 -0700 Subject: [PATCH 299/316] `tsc_wrapped` contains an experimental integration with the Angular `NgTscPlugin`. This integration is not quite correct: the Angular plugin's `setupCompilation` step returns two important pieces of information that are currently ignored by `tsc_wrapped`: * `ignoreForDiagnostics`: a `Set` of files which should be skipped during the generation of diagnostics. Errors in these files should never be reported to the user or cause the build to fail. * `ignoreForEmit`: a `Set` of files which should not be emitted to JS. Emitting these isn't harmful, just expensive (and they're not declared outputs). This CL modifies `tsc_wrapped` to honor `ignoreForDiagnostics`. `ignoreForEmit` is unnecessary for this context as `tsc_wrapped` already limits the files it emits to the user's compilation inputs (and any Angular shims recognized by `isAngularFile`). PiperOrigin-RevId: 317161735 --- internal/tsc_wrapped/plugin_api.ts | 7 +++- internal/tsc_wrapped/tsc_wrapped.ts | 62 +++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/internal/tsc_wrapped/plugin_api.ts b/internal/tsc_wrapped/plugin_api.ts index 2bcfa210..5dbf497d 100644 --- a/internal/tsc_wrapped/plugin_api.ts +++ b/internal/tsc_wrapped/plugin_api.ts @@ -54,10 +54,13 @@ export interface EmitPlugin { */ wrapHost?(compilerHost: ts.CompilerHost, inputFiles: string[], options: ts.CompilerOptions): PluginCompilerHost; - setupCompilation(program: ts.Program, oldProgram?: ts.Program): void; + setupCompilation(program: ts.Program, oldProgram?: ts.Program): { + ignoreForDiagnostics: Set, + ignoreForEmit: Set + }; getNextProgram?(): ts.Program; - + /** * Allow plugins to contribute additional TypeScript CustomTransformers. * These can modify the TS AST, JS AST, or .d.ts output AST. diff --git a/internal/tsc_wrapped/tsc_wrapped.ts b/internal/tsc_wrapped/tsc_wrapped.ts index f17aebe9..a18c0439 100644 --- a/internal/tsc_wrapped/tsc_wrapped.ts +++ b/internal/tsc_wrapped/tsc_wrapped.ts @@ -54,9 +54,8 @@ function isCompilationTarget( */ export function gatherDiagnostics( options: ts.CompilerOptions, bazelOpts: BazelOptions, program: ts.Program, - disabledTsetseRules: string[], - plugins: DiagnosticPlugin[] = []): ts.Diagnostic[] { - + disabledTsetseRules: string[], plugins: DiagnosticPlugin[] = [], + ignoreForDiagnostics: Set = new Set()): ts.Diagnostic[] { const diagnostics: ts.Diagnostic[] = []; perfTrace.wrap('type checking', () => { if (!bazelOpts.typeCheck) { @@ -69,13 +68,14 @@ export function gatherDiagnostics( diagnostics.push(...program.getOptionsDiagnostics()); diagnostics.push(...program.getGlobalDiagnostics()); }); - let sourceFilesToCheck: ReadonlyArray; - if (bazelOpts.typeCheckDependencies) { - sourceFilesToCheck = program.getSourceFiles(); - } else { - sourceFilesToCheck = program.getSourceFiles().filter( - f => isCompilationTarget(bazelOpts, f)); - } + + // Check if `f` is a target for type-checking. + let isTypeCheckTarget = (f: ts.SourceFile) => + bazelOpts.typeCheckDependencies || isCompilationTarget(bazelOpts, f); + + let sourceFilesToCheck: ReadonlyArray = + program.getSourceFiles().filter( + f => isTypeCheckTarget(f) && !ignoreForDiagnostics.has(f)); for (const sf of sourceFilesToCheck) { perfTrace.wrap(`check ${sf.fileName}`, () => { diagnostics.push(...program.getSyntacticDiagnostics(sf)); @@ -366,8 +366,40 @@ export function createProgramAndEmit( after: [], afterDeclarations: [], }; + + let ignoreForDiagnostics = new Set(); + if (angularPlugin) { - angularPlugin.setupCompilation(program); + // The Angular plugin (via the `wrapHost` call above) inserts additional + // "shim" files into the `ts.Program`, beyond the user's .ts files. For + // proper operation, the plugin requires two modifications to the standard + // flow of TypeScript compilation, relating to which files are either + // type-checked or emitted. + // + // In tsc_wrapped, there is already a concept of which files should be + // emitted (which is calculated from the compilation inputs, as well as any + // paths that match expected Angular shims such as ngfactory files for those + // inputs). So the `ignoreForEmit` set produced by the plugin can be + // ignored here. + + const angularSetup = angularPlugin.setupCompilation(program); + + // Shims generated by the plugin do not benefit from normal type-checking, + // for a few reasons. + // 1) for emitted shims like ngfactory files, their proper contents are + // programmatically added via TypeScript transforms, so checking their + // initial contents is pointless and inefficient. + // 2) for non-emitted shims like the ngtypecheck files used in template + // type-checking, they are managed and checked internally via the plugin + // `getDiagnostics` method. Checking them as part of the normal + // diagnostics flow will at best produce spurious, duplicate errors that + // are not reported in the correct context, and at worst can produce + // incorrect errors. + // + // The `ignoreForDiagnostics` set informs tsc_wrapped which Angular shim + // files should be skipped when gathering diagnostics. + ignoreForDiagnostics = angularSetup.ignoreForDiagnostics; + transformers = angularPlugin.createTransformers(); } @@ -389,7 +421,8 @@ export function createProgramAndEmit( // messages refer to the original source. After any subsequent passes // (decorator downleveling or tsickle) we do not type check. let diagnostics = gatherDiagnostics( - options, bazelOpts, program, disabledTsetseRules, diagnosticPlugins); + options, bazelOpts, program, disabledTsetseRules, diagnosticPlugins, + ignoreForDiagnostics); if (!expectDiagnosticsWhitelist.length || expectDiagnosticsWhitelist.some(p => bazelOpts.target.startsWith(p))) { diagnostics = bazelDiagnostics.filterExpected( @@ -426,6 +459,11 @@ export function createProgramAndEmit( } as ts.SourceFile); } + // If the Angular plugin is in use, this list of files to emit should exclude + // any files defined in the `ignoreForEmit` set returned by the plugin. + // However limiting the outputs to the set of compilation target files (plus + // any Angular shims defined by `isAngularFile`) already has that effect, so + // `ignoreForEmit` does not need to be factored in here. const compilationTargets = program.getSourceFiles().filter( sf => isCompilationTarget(bazelOpts, sf) || isAngularFile(sf)); From fda411fe2f50b2cd55a44c433a71890720088171 Mon Sep 17 00:00:00 2001 From: pwng Date: Mon, 22 Jun 2020 16:48:29 -0700 Subject: [PATCH 300/316] Make error code of `ConformancePatternRule` configurable. PiperOrigin-RevId: 317762152 --- .../tsetse/rules/conformance_pattern_rule.ts | 13 ++++++++----- .../rules/conformance_pattern_rule_test.ts | 4 +++- internal/tsetse/util/absolute_matcher_test.ts | 19 ++++++++++++++++++- internal/tsetse/util/ast_tools_test.ts | 3 ++- internal/tsetse/util/fixer_test.ts | 3 ++- internal/tsetse/util/pattern_config.ts | 16 ++++++++++++---- .../util/pattern_engines/name_engine.ts | 4 ++-- .../util/pattern_engines/name_engine_test.ts | 5 ++++- .../util/pattern_engines/pattern_engine.ts | 9 +++++---- .../util/pattern_engines/property_engine.ts | 3 +-- .../pattern_engines/property_engine_test.ts | 4 +++- .../property_non_constant_write_engine.ts | 3 +-- ...property_non_constant_write_engine_test.ts | 3 ++- .../pattern_engines/property_write_engine.ts | 3 +-- .../property_write_engine_test.ts | 5 ++++- internal/tsetse/util/property_matcher_test.ts | 9 +++++++-- internal/tsetse/util/whitelist_test.ts | 3 ++- 17 files changed, 77 insertions(+), 32 deletions(-) diff --git a/internal/tsetse/rules/conformance_pattern_rule.ts b/internal/tsetse/rules/conformance_pattern_rule.ts index 714c0e74..d620b872 100644 --- a/internal/tsetse/rules/conformance_pattern_rule.ts +++ b/internal/tsetse/rules/conformance_pattern_rule.ts @@ -2,7 +2,7 @@ import {Checker} from '../checker'; import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; import {Fixer} from '../util/fixer'; -import {Config, PatternKind} from '../util/pattern_config'; +import {PatternKind, PatternRuleConfig} from '../util/pattern_config'; import {NameEngine} from '../util/pattern_engines/name_engine'; import {PatternEngine} from '../util/pattern_engines/pattern_engine'; import {PropertyEngine} from '../util/pattern_engines/property_engine'; @@ -19,11 +19,14 @@ import {PropertyWriteEngine} from '../util/pattern_engines/property_write_engine */ export class ConformancePatternRule implements AbstractRule { readonly ruleName: string; - readonly code = ErrorCode.CONFORMANCE_PATTERN; - + readonly code: number; private readonly engine: PatternEngine; - constructor(config: Config, fixer?: Fixer) { + constructor(config: PatternRuleConfig, fixer?: Fixer) { + this.code = config.errorCode; + // Avoid empty rule names. + this.ruleName = config.name || `conformance-pattern-${config.kind}`; + switch (config.kind) { case PatternKind.BANNED_PROPERTY: this.engine = new PropertyEngine(config, fixer); @@ -40,7 +43,6 @@ export class ConformancePatternRule implements AbstractRule { default: throw new Error('Config type not recognized, or not implemented yet.'); } - this.ruleName = config.name || `conformance-pattern-${config.kind}`; } register(checker: Checker) { @@ -55,3 +57,4 @@ export class ConformancePatternRule implements AbstractRule { * https://github.com/google/closure-compiler/wiki/JS-Conformance-Framework). */ export {PatternKind}; +export {ErrorCode}; diff --git a/internal/tsetse/rules/conformance_pattern_rule_test.ts b/internal/tsetse/rules/conformance_pattern_rule_test.ts index 9d7eaa08..15508124 100644 --- a/internal/tsetse/rules/conformance_pattern_rule_test.ts +++ b/internal/tsetse/rules/conformance_pattern_rule_test.ts @@ -1,10 +1,12 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from './conformance_pattern_rule'; + import {customMatchers} from '../util/testing/test_support'; +import {ConformancePatternRule, ErrorCode, PatternKind} from './conformance_pattern_rule'; describe('ConformancePatternRule creation', () => { describe('naming', () => { const baseConfig = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'do not cite', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['HTMLQuoteElement.prototype.cite'], diff --git a/internal/tsetse/util/absolute_matcher_test.ts b/internal/tsetse/util/absolute_matcher_test.ts index 3617aad7..9f612c60 100644 --- a/internal/tsetse/util/absolute_matcher_test.ts +++ b/internal/tsetse/util/absolute_matcher_test.ts @@ -1,5 +1,5 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers} from './testing/test_support'; describe('AbsoluteMatcher', () => { @@ -9,6 +9,7 @@ describe('AbsoluteMatcher', () => { it('requires a matcher scope', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with no scope', kind: PatternKind.BANNED_NAME, values: ['exec'] @@ -24,6 +25,7 @@ describe('AbsoluteMatcher', () => { describe('file scope', () => { it('matches a file path', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] @@ -42,6 +44,7 @@ describe('AbsoluteMatcher', () => { it('ignores an exported symbol defined in an unmatched file path', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] @@ -63,6 +66,7 @@ describe('AbsoluteMatcher', () => { it('ignores an un-exported symbol defined in an unmatched file path', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] @@ -84,6 +88,7 @@ describe('AbsoluteMatcher', () => { it('matches a local exported definition', () => { // This is a match because Foo.bar is an exported symbol. const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] @@ -100,6 +105,7 @@ describe('AbsoluteMatcher', () => { it('matches names in import statement', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|foo', 'ANY_SYMBOL|bar'] @@ -126,6 +132,7 @@ describe('AbsoluteMatcher', () => { describe('global scope', () => { it('matches an in-stock library method', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned ambient name', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|eval'] @@ -140,6 +147,7 @@ describe('AbsoluteMatcher', () => { it('does not match a custom exported method with the same name', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned ambient name', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|eval'] @@ -155,6 +163,7 @@ describe('AbsoluteMatcher', () => { it('does not match a custom non-exported method with the same name', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned global name', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|Foo.bar'] @@ -168,6 +177,7 @@ describe('AbsoluteMatcher', () => { it('matches an initializer in a named declaration', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned ambient name', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|open'], @@ -184,6 +194,7 @@ describe('AbsoluteMatcher', () => { describe('properties', () => { it('matches a static property', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.s'] @@ -203,6 +214,7 @@ describe('AbsoluteMatcher', () => { it('does not match a property with a name overlapping an in-stock library', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name without file path', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|open'] @@ -224,6 +236,7 @@ describe('AbsoluteMatcher', () => { it('matches an inherited static property', () => { // This is a match because Moo inherits s from Foo. const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.s'] @@ -245,6 +258,7 @@ describe('AbsoluteMatcher', () => { it('matches an inherited static method', () => { // This is a match because Moo inherits bar from Foo. const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] @@ -266,6 +280,7 @@ describe('AbsoluteMatcher', () => { it('does not match a redefined inherited static property', () => { // This is not a match because Moo redefines s. const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.s'] @@ -286,6 +301,7 @@ describe('AbsoluteMatcher', () => { it('does not match a redefined inherited static method', () => { // This is not a match because Moo redefines bar. const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_0|Foo.bar'] @@ -306,6 +322,7 @@ describe('AbsoluteMatcher', () => { // This is not a match because even though bar specified is interface Moo, // its actual definition is in class Boo. const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'banned name with file path', kind: PatternKind.BANNED_NAME, values: ['./file_1|Moo.bar'] diff --git a/internal/tsetse/util/ast_tools_test.ts b/internal/tsetse/util/ast_tools_test.ts index 7ce34206..6b0a62ec 100644 --- a/internal/tsetse/util/ast_tools_test.ts +++ b/internal/tsetse/util/ast_tools_test.ts @@ -1,5 +1,5 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; import {setDebug} from './ast_tools'; import {compileAndCheck} from './testing/test_support'; @@ -7,6 +7,7 @@ describe('Debug output', () => { it('turns on and off', () => { const source = `location.href = 'foo';`; const rule = new ConformancePatternRule({ + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'does not matter', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['Location.prototype.href'] diff --git a/internal/tsetse/util/fixer_test.ts b/internal/tsetse/util/fixer_test.ts index 8ad3eb99..470ffce4 100644 --- a/internal/tsetse/util/fixer_test.ts +++ b/internal/tsetse/util/fixer_test.ts @@ -1,7 +1,7 @@ import 'jasmine'; import * as ts from 'typescript'; import {Failure, Fix} from '../failure'; -import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; import {buildReplacementFixer, Fixer, maybeAddNamedImport, maybeAddNamespaceImport} from './fixer'; import {compile, compileAndCheck, customMatchers} from './testing/test_support'; @@ -24,6 +24,7 @@ const uppercaseFixerBuilt: Fixer = buildReplacementFixer((node: ts.Node) => { // The initial config and source off which we run those checks. const baseConfig = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'found citation', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['HTMLQuoteElement.prototype.cite'], diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 041fd9d5..49e884b5 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -23,11 +23,9 @@ export enum PatternKind { } /** - * A config for ConformancePatternRule. + * A config for `PatternEngine`. */ -export interface Config { - kind: PatternKind; - +export interface PatternEngineConfig { /** * Values have a pattern-specific syntax. * @@ -36,11 +34,21 @@ export interface Config { */ values: string[]; + /** The error code assigned to this pattern. */ + errorCode: number; + /** The error message this pattern will create. */ errorMessage: string; /** A list of whitelist blocks. */ whitelistEntries?: WhitelistEntry[]; +} + +/** + * A config for `ConformancePatternRule`. + */ +export interface PatternRuleConfig extends PatternEngineConfig { + kind: PatternKind; /** * An optional name for that rule, which will be the rule's `ruleName`. diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index aac2a9cf..43cf527e 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -4,7 +4,6 @@ import {ErrorCode} from '../../error_code'; import {AbsoluteMatcher} from '../absolute_matcher'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {Config} from '../pattern_config'; import {PatternEngine} from './pattern_engine'; function checkId( @@ -18,6 +17,7 @@ function checkId( return n; } +/** Engine for the BANNED_NAME pattern */ export class NameEngine extends PatternEngine { register(checker: Checker) { for (const value of this.config.values) { @@ -31,7 +31,7 @@ export class NameEngine extends PatternEngine { bannedIdName, this.wrapCheckWithWhitelistingAndFixer( (tc, n: ts.Identifier) => checkId(tc, n, matcher)), - ErrorCode.CONFORMANCE_PATTERN); + this.config.errorCode); } } } diff --git a/internal/tsetse/util/pattern_engines/name_engine_test.ts b/internal/tsetse/util/pattern_engines/name_engine_test.ts index 0a0eeaf5..ce398754 100644 --- a/internal/tsetse/util/pattern_engines/name_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/name_engine_test.ts @@ -1,10 +1,11 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_NAME', () => { it('matches simple example of globals', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'no Infinity', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|Infinity'] @@ -18,6 +19,7 @@ describe('BANNED_NAME', () => { it('matches namespaced globals', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'no blob url', kind: PatternKind.BANNED_NAME, values: ['GLOBAL|URL.createObjectURL'] @@ -37,6 +39,7 @@ describe('BANNED_NAME', () => { // not acceptable (the typechecker will throw). const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'should not trigger', kind: PatternKind.BANNED_NAME, values: ['ANY_SYMBOL|whatever'] diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index a53fae44..d6f6a97f 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -3,7 +3,7 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {Fix} from '../../failure'; import {Fixer} from '../../util/fixer'; -import {Config} from '../../util/pattern_config'; +import {PatternEngineConfig} from '../../util/pattern_config'; import {Whitelist} from '../../util/whitelist'; import {shouldExamineNode} from '../ast_tools'; @@ -14,15 +14,16 @@ export abstract class PatternEngine { private readonly whitelist: Whitelist; constructor( - protected readonly config: Config, protected readonly fixer?: Fixer) { + protected readonly config: PatternEngineConfig, + protected readonly fixer?: Fixer) { this.whitelist = new Whitelist(config.whitelistEntries); } /** * `register` will be called by the ConformanceRule to tell Tsetse the * PatternEngine will handle matching. Implementations should use - *`checkAndFilterResults` as a wrapper for `check`. - **/ + * `checkAndFilterResults` as a wrapper for `check`. + */ abstract register(checker: Checker): void; /** diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts index 922ac255..5fb280bc 100644 --- a/internal/tsetse/util/pattern_engines/property_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -4,7 +4,6 @@ import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; import {PropertyMatcher} from '../property_matcher'; @@ -35,7 +34,7 @@ export class PropertyEngine extends PatternEngine { this.wrapCheckWithWhitelistingAndFixer( (tc, n: ts.PropertyAccessExpression) => checkPropAccessExpr(tc, n, matcher)), - ErrorCode.CONFORMANCE_PATTERN); + this.config.errorCode); } } } diff --git a/internal/tsetse/util/pattern_engines/property_engine_test.ts b/internal/tsetse/util/pattern_engines/property_engine_test.ts index 7993415e..e3dcd3cb 100644 --- a/internal/tsetse/util/pattern_engines/property_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_engine_test.ts @@ -1,5 +1,6 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; + +import {ConformancePatternRule, ErrorCode, PatternKind} from '../../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_PROPERTY', () => { @@ -9,6 +10,7 @@ describe('BANNED_PROPERTY', () => { it('matches a trivial example', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'No Location#href access', kind: PatternKind.BANNED_PROPERTY, values: ['Location.prototype.href'], diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index 0a672147..ece4044f 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -5,7 +5,6 @@ import {ErrorCode} from '../../error_code'; import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; import {isLiteral} from '../is_literal'; -import {Config} from '../pattern_config'; import {PropertyMatcher} from '../property_matcher'; import {PatternEngine} from './pattern_engine'; @@ -42,7 +41,7 @@ export class PropertyNonConstantWriteEngine extends PatternEngine { ts.SyntaxKind.BinaryExpression, this.wrapCheckWithWhitelistingAndFixer( (tc, n: ts.BinaryExpression) => checkBinExpr(tc, n, matcher)), - ErrorCode.CONFORMANCE_PATTERN); + this.config.errorCode); } } } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts index 753e08a4..fcfabe19 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts @@ -1,5 +1,5 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { @@ -8,6 +8,7 @@ describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { `q.cite = 'some example string';\n` + // literal `q.cite = window.name;\n`; // non-literal const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'do not cite dynamically', kind: PatternKind.BANNED_PROPERTY_NON_CONSTANT_WRITE, values: ['HTMLQuoteElement.prototype.cite'] diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index d0a9e2bb..58f230e0 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -4,7 +4,6 @@ import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog, isPropertyWriteExpression} from '../ast_tools'; import {Fixer} from '../fixer'; -import {Config} from '../pattern_config'; import {PatternEngine} from '../pattern_engines/pattern_engine'; import {PropertyMatcher} from '../property_matcher'; @@ -43,7 +42,7 @@ export class PropertyWriteEngine extends PatternEngine { this.wrapCheckWithWhitelistingAndFixer( (tc, n: ts.PropertyAccessExpression) => checkPropAccessExpr(tc, n, matcher)), - ErrorCode.CONFORMANCE_PATTERN); + this.config.errorCode); } } } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine_test.ts b/internal/tsetse/util/pattern_engines/property_write_engine_test.ts index 5aa9f564..6956025c 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine_test.ts @@ -1,10 +1,11 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_PROPERTY_WRITE', () => { describe('simpler matcher tests', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'do not cite', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['HTMLQuoteElement.prototype.cite'] @@ -99,6 +100,7 @@ describe('BANNED_PROPERTY_WRITE', () => { it('banning Parent.x matches (instance of Child).x', () => { const configOnParent = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'found write to x', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['Parent.prototype.x'] @@ -111,6 +113,7 @@ describe('BANNED_PROPERTY_WRITE', () => { it('banning Child.x matches x defined on Parent', () => { const configOnChild = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'found write to x', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['Child.prototype.x'] diff --git a/internal/tsetse/util/property_matcher_test.ts b/internal/tsetse/util/property_matcher_test.ts index e4fea908..4fa55aa5 100644 --- a/internal/tsetse/util/property_matcher_test.ts +++ b/internal/tsetse/util/property_matcher_test.ts @@ -1,5 +1,5 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers} from './testing/test_support'; describe('PropertyMatcher', () => { @@ -9,6 +9,7 @@ describe('PropertyMatcher', () => { it('matches simple property access on dom properties', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'No Location#href access', kind: PatternKind.BANNED_PROPERTY, values: ['Location.prototype.href'], @@ -25,6 +26,7 @@ describe('PropertyMatcher', () => { it('matches simple property access on properties of TS built-in types', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'No Array#map access', kind: PatternKind.BANNED_PROPERTY, values: ['Array.prototype.map'], @@ -43,6 +45,7 @@ describe('PropertyMatcher', () => { it('matches simple property access on properties of user-defined global types', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'No Ty#foo access', kind: PatternKind.BANNED_PROPERTY, values: ['Ty.prototype.foo'], @@ -78,13 +81,14 @@ describe('PropertyMatcher', () => { it('does not match in-module defined type', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'No Location#replace access', kind: PatternKind.BANNED_PROPERTY, values: ['Location.prototype.location'], }; const source = `export {}; // export makes the file a module class Location { replace(x: string) {} } - new Location().replace('a');` + new Location().replace('a');`; const results = compileAndCheck(new ConformancePatternRule(config), source); expect(results).toHaveNoFailures(); @@ -92,6 +96,7 @@ describe('PropertyMatcher', () => { it('does not match properties after fancy type casts', () => { const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'No Location#href access', kind: PatternKind.BANNED_PROPERTY, values: ['Location.prototype.replace'], diff --git a/internal/tsetse/util/whitelist_test.ts b/internal/tsetse/util/whitelist_test.ts index b94ea805..5ed51f60 100644 --- a/internal/tsetse/util/whitelist_test.ts +++ b/internal/tsetse/util/whitelist_test.ts @@ -1,6 +1,6 @@ import 'jasmine'; -import {ConformancePatternRule, PatternKind} from '../rules/conformance_pattern_rule'; +import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; import {compileAndCheck, customMatchers, getTempDirForWhitelist} from './testing/test_support'; import {WhitelistReason} from './whitelist'; @@ -18,6 +18,7 @@ describe('ConformancePatternRule', () => { // The initial config off which we run those checks. const baseConfig = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'do not cite', kind: PatternKind.BANNED_PROPERTY_WRITE, values: ['HTMLQuoteElement.prototype.cite'], From 4e0734c5ab609c96d17ea79f0428170459a81166 Mon Sep 17 00:00:00 2001 From: pwng Date: Wed, 24 Jun 2020 14:52:24 -0700 Subject: [PATCH 301/316] Rename whitelist -> allowlist. PiperOrigin-RevId: 318146166 --- internal/tsetse/util/allowlist.ts | 96 +++++++++++++++++++ .../{whitelist_test.ts => allowlist_test.ts} | 70 +++++++------- internal/tsetse/util/ast_tools.ts | 4 +- internal/tsetse/util/pattern_config.ts | 6 +- .../util/pattern_engines/name_engine.ts | 2 +- .../util/pattern_engines/pattern_engine.ts | 10 +- .../util/pattern_engines/property_engine.ts | 2 +- .../property_non_constant_write_engine.ts | 2 +- .../pattern_engines/property_write_engine.ts | 2 +- internal/tsetse/util/testing/test_support.ts | 2 +- internal/tsetse/util/whitelist.ts | 96 ------------------- 11 files changed, 146 insertions(+), 146 deletions(-) create mode 100644 internal/tsetse/util/allowlist.ts rename internal/tsetse/util/{whitelist_test.ts => allowlist_test.ts} (67%) delete mode 100644 internal/tsetse/util/whitelist.ts diff --git a/internal/tsetse/util/allowlist.ts b/internal/tsetse/util/allowlist.ts new file mode 100644 index 00000000..07f64e94 --- /dev/null +++ b/internal/tsetse/util/allowlist.ts @@ -0,0 +1,96 @@ +/** + * An exemption list entry, corresponding to a logical exemption rule. Use these + * to distinguish between various logical reasons for exempting something: + * for instance, tie these to particular bugs that needed to be exempted, per + * legacy project, manually reviewed entries, and so on. + * + * Exemption lists are based on the file paths provided by the TS compiler, with + * both regexp-based checks and prefix-based checks. + * + * + * Follows the logic in + * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/conformance.proto. + */ +export interface AllowlistEntry { + /** The category corresponding to this entry. */ + readonly reason: ExemptionReason; + /** Why is this okay to be exempted?. */ + readonly explanation?: string; + + /** + * Regexps for the paths of files that will be ignored by the + * ConformancePattern. Beware, escaping can be tricky. + */ + readonly regexp?: readonly string[]; + /** + * Prefixes for the paths of files that will be ignored by the + * ConformancePattern. + */ + readonly prefix?: readonly string[]; +} + +/** + * The categories of exemption entries. + */ +export enum ExemptionReason { + /** No reason. */ + UNSPECIFIED, + /** Code that has to be grandfathered in (no guarantees). */ + LEGACY, + /** + * Code that does not enter the scope of this particular check (no + * guarantees). + */ + OUT_OF_SCOPE, + /** Manually reviewed exceptions (supposedly okay). */ + MANUALLY_REVIEWED +} + +/** + * A complete allowlist with all related AllowlistEntry grouped together, with + * ExemptionReason ignored since it is purely for documentary purposes. + */ +export class Allowlist { + private readonly allowlistedPrefixes: readonly string[] = []; + private readonly allowlistedRegExps: readonly RegExp[] = []; + // To avoid repeated computation for allowlisting queries with the same file + // path, create a memoizer to cache known results. This is useful in watch + // mode (and possible in language service) when the same files can be compiled + // repeatedly. + private readonly allowlistMemoizer = new Map(); + + constructor(allowlistEntries?: AllowlistEntry[]) { + if (allowlistEntries) { + for (const e of allowlistEntries) { + if (e.prefix) { + this.allowlistedPrefixes = + this.allowlistedPrefixes.concat(...e.prefix); + } + if (e.regexp) { + this.allowlistedRegExps = this.allowlistedRegExps.concat( + ...e.regexp.map(r => new RegExp(r))); + } + } + } + } + + isAllowlisted(filePath: string): boolean { + if (this.allowlistMemoizer.has(filePath)) { + return this.allowlistMemoizer.get(filePath)!; + } + for (const p of this.allowlistedPrefixes) { + if (filePath.startsWith(p)) { + this.allowlistMemoizer.set(filePath, true); + return true; + } + } + for (const re of this.allowlistedRegExps) { + if (re.test(filePath)) { + this.allowlistMemoizer.set(filePath, true); + return true; + } + } + this.allowlistMemoizer.set(filePath, false); + return false; + } +} diff --git a/internal/tsetse/util/whitelist_test.ts b/internal/tsetse/util/allowlist_test.ts similarity index 67% rename from internal/tsetse/util/whitelist_test.ts rename to internal/tsetse/util/allowlist_test.ts index 5ed51f60..8324c078 100644 --- a/internal/tsetse/util/whitelist_test.ts +++ b/internal/tsetse/util/allowlist_test.ts @@ -2,16 +2,16 @@ import 'jasmine'; import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; -import {compileAndCheck, customMatchers, getTempDirForWhitelist} from './testing/test_support'; -import {WhitelistReason} from './whitelist'; +import {ExemptionReason} from './allowlist'; +import {compileAndCheck, customMatchers, getTempDirForAllowlist} from './testing/test_support'; -const tmpPrefixForWhitelist = getTempDirForWhitelist(); -const tmpRegexpForWhitelist = - `^(?:${getTempDirForWhitelist().replace(/\\/g, '\\\\')})`; +const tmpPrefixForAllowlist = getTempDirForAllowlist(); +const tmpRegexpForAllowlist = + `^(?:${getTempDirForAllowlist().replace(/\\/g, '\\\\')})`; describe('ConformancePatternRule', () => { - describe('whitelist handling', () => { + describe('allowlist handling', () => { const source = `export {};\n` + `const q = document.createElement('q');\n` + `q.cite = 'some example string';\n`; @@ -24,19 +24,19 @@ describe('ConformancePatternRule', () => { values: ['HTMLQuoteElement.prototype.cite'], }; - it('matches if no whitelist (sanity check)', () => { - const config = {...baseConfig, whitelistEntries: []}; + it('matches if no allowlist (sanity check)', () => { + const config = {...baseConfig, allowlistEntries: []}; const rule = new ConformancePatternRule(config); const results = compileAndCheck(rule, source); expect(results).toHaveNFailures(1); }); - it('matches if there is an empty whitelist group', () => { + it('matches if there is an empty allowlist group', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, }] }; const rule = new ConformancePatternRule(config); @@ -45,12 +45,12 @@ describe('ConformancePatternRule', () => { expect(results).toHaveNFailures(1); }); - it('respects prefix-based whitelists (matching test)', () => { + it('respects prefix-based allowlists (matching test)', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, - prefix: [tmpPrefixForWhitelist], + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + prefix: [tmpPrefixForAllowlist], }] }; const rule = new ConformancePatternRule(config); @@ -59,11 +59,11 @@ describe('ConformancePatternRule', () => { expect(results).toHaveNoFailures(); }); - it('respects prefix-based whitelists (non-matching test)', () => { + it('respects prefix-based allowlists (non-matching test)', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, prefix: ['/nowhere in particular/'], }] }; @@ -73,12 +73,12 @@ describe('ConformancePatternRule', () => { expect(results).toHaveNFailures(1); }); - it('respects regex-based whitelists', () => { + it('respects regex-based allowlists', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, - regexp: [`${tmpRegexpForWhitelist}.+/file_0\\.ts`] + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + regexp: [`${tmpRegexpForAllowlist}.+/file_0\\.ts`] }] }; const rule = new ConformancePatternRule(config); @@ -87,14 +87,14 @@ describe('ConformancePatternRule', () => { expect(results).toHaveNoFailures(); }); - it('accepts several regex-based whitelists', () => { + it('accepts several regex-based allowlists', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, regexp: [ - `${tmpRegexpForWhitelist}.+/file_0\\.ts`, - `${tmpRegexpForWhitelist}.+/file_1\\.ts` + `${tmpRegexpForAllowlist}.+/file_0\\.ts`, + `${tmpRegexpForAllowlist}.+/file_1\\.ts` ] }] }; @@ -108,8 +108,8 @@ describe('ConformancePatternRule', () => { it('throws on creation of invalid regexps', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, regexp: ['(', '/tmp/', 'foo'], }] }; @@ -122,10 +122,10 @@ describe('ConformancePatternRule', () => { it('test memoizer hit', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, regexp: [ - `${tmpRegexpForWhitelist}.+/file_0\\.ts`, + `${tmpRegexpForAllowlist}.+/file_0\\.ts`, ] }] }; @@ -141,10 +141,10 @@ describe('ConformancePatternRule', () => { it('test memoizer miss', () => { const config = { ...baseConfig, - whitelistEntries: [{ - reason: WhitelistReason.UNSPECIFIED, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, regexp: [ - `${tmpRegexpForWhitelist}.+/file_1\\.ts`, + `${tmpRegexpForAllowlist}.+/file_1\\.ts`, ], prefix: ['###PrefixNotExist###'], }] diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index 191e854d..1118699b 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -119,7 +119,7 @@ export function isPartOfImportStatement(n: ts.Node) { p => p.kind === ts.SyntaxKind.ImportDeclaration); } -function isWhitelistedNamedDeclaration(n: ts.Node): +function isAllowlistedNamedDeclaration(n: ts.Node): n is ts.VariableDeclaration|ts.ClassDeclaration|ts.FunctionDeclaration| ts.MethodDeclaration|ts.PropertyDeclaration|ts.InterfaceDeclaration| ts.TypeAliasDeclaration|ts.EnumDeclaration|ts.ModuleDeclaration| @@ -140,7 +140,7 @@ export function isNameInDeclaration(n: ts.Node): boolean { const p = n.parent; if (p === undefined) return false; - return (isWhitelistedNamedDeclaration(p) && p.name === n) || + return (isAllowlistedNamedDeclaration(p) && p.name === n) || // TODO(pwng) Double-check if these two cases are needed ts.isVariableDeclarationList(p) || ts.isImportDeclaration(p); } diff --git a/internal/tsetse/util/pattern_config.ts b/internal/tsetse/util/pattern_config.ts index 49e884b5..7d0aa398 100644 --- a/internal/tsetse/util/pattern_config.ts +++ b/internal/tsetse/util/pattern_config.ts @@ -1,4 +1,4 @@ -import {WhitelistEntry} from './whitelist'; +import {AllowlistEntry} from './allowlist'; /** * The list of supported patterns useable in ConformancePatternRule. The @@ -40,8 +40,8 @@ export interface PatternEngineConfig { /** The error message this pattern will create. */ errorMessage: string; - /** A list of whitelist blocks. */ - whitelistEntries?: WhitelistEntry[]; + /** A list of allowlist blocks. */ + allowlistEntries?: AllowlistEntry[]; } /** diff --git a/internal/tsetse/util/pattern_engines/name_engine.ts b/internal/tsetse/util/pattern_engines/name_engine.ts index 43cf527e..27c97c2d 100644 --- a/internal/tsetse/util/pattern_engines/name_engine.ts +++ b/internal/tsetse/util/pattern_engines/name_engine.ts @@ -29,7 +29,7 @@ export class NameEngine extends PatternEngine { const bannedIdName = matcher.bannedName.split('.').pop()!; checker.onNamedIdentifier( bannedIdName, - this.wrapCheckWithWhitelistingAndFixer( + this.wrapCheckWithAllowlistingAndFixer( (tc, n: ts.Identifier) => checkId(tc, n, matcher)), this.config.errorCode); } diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index d6f6a97f..1b61df20 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -2,21 +2,21 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {Fix} from '../../failure'; +import {Allowlist} from '../../util/allowlist'; import {Fixer} from '../../util/fixer'; import {PatternEngineConfig} from '../../util/pattern_config'; -import {Whitelist} from '../../util/whitelist'; import {shouldExamineNode} from '../ast_tools'; /** * A patternEngine is the logic that handles a specific PatternKind. */ export abstract class PatternEngine { - private readonly whitelist: Whitelist; + private readonly allowlist: Allowlist; constructor( protected readonly config: PatternEngineConfig, protected readonly fixer?: Fixer) { - this.whitelist = new Whitelist(config.whitelistEntries); + this.allowlist = new Allowlist(config.allowlistEntries); } /** @@ -32,7 +32,7 @@ export abstract class PatternEngine { * subclass-specific logic afterwards. Subclasses should transform their * checking logic with this composer before registered on the checker. */ - protected wrapCheckWithWhitelistingAndFixer( + protected wrapCheckWithAllowlistingAndFixer( checkFunction: (tc: ts.TypeChecker, n: T) => ts.Node | undefined): (c: Checker, n: T) => void { return (c: Checker, n: T) => { @@ -41,7 +41,7 @@ export abstract class PatternEngine { return; } const matchedNode = checkFunction(c.typeChecker, n); - if (matchedNode && !this.whitelist.isWhitelisted(sf.fileName)) { + if (matchedNode && !this.allowlist.isAllowlisted(sf.fileName)) { const fix: Fix|undefined = this.fixer ? this.fixer.getFixForFlaggedNode(matchedNode) : undefined; diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts index 5fb280bc..adef087b 100644 --- a/internal/tsetse/util/pattern_engines/property_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -31,7 +31,7 @@ export class PropertyEngine extends PatternEngine { // requires refactoring `PropertyMatcher` or adding new types of matchers. checker.onNamedPropertyAccess( matcher.bannedProperty, - this.wrapCheckWithWhitelistingAndFixer( + this.wrapCheckWithAllowlistingAndFixer( (tc, n: ts.PropertyAccessExpression) => checkPropAccessExpr(tc, n, matcher)), this.config.errorCode); diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index ece4044f..e89a0790 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -39,7 +39,7 @@ export class PropertyNonConstantWriteEngine extends PatternEngine { checker.on( ts.SyntaxKind.BinaryExpression, - this.wrapCheckWithWhitelistingAndFixer( + this.wrapCheckWithAllowlistingAndFixer( (tc, n: ts.BinaryExpression) => checkBinExpr(tc, n, matcher)), this.config.errorCode); } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 58f230e0..56654e1c 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -39,7 +39,7 @@ export class PropertyWriteEngine extends PatternEngine { checker.onNamedPropertyAccess( matcher.bannedProperty, - this.wrapCheckWithWhitelistingAndFixer( + this.wrapCheckWithAllowlistingAndFixer( (tc, n: ts.PropertyAccessExpression) => checkPropAccessExpr(tc, n, matcher)), this.config.errorCode); diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index ece3695f..f80b7a7c 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -77,7 +77,7 @@ export function toFileName(f: Failure) { * Returns the location the temp directory for that platform (with forward * slashes). */ -export function getTempDirForWhitelist() { +export function getTempDirForAllowlist() { // TS uses forward slashes on Windows ¯\_(ツ)_/¯ return os.platform() === 'win32' ? os.tmpdir().replace(/\\/g, '/') : os.tmpdir(); diff --git a/internal/tsetse/util/whitelist.ts b/internal/tsetse/util/whitelist.ts deleted file mode 100644 index 6bedc157..00000000 --- a/internal/tsetse/util/whitelist.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * A whitelist entry, corresponding to a logical whitelisting rule. Use these - * to distinguish between various logical reasons for whitelisting something: - * for instance, tie these to particular bugs that needed whitelisting, per - * legacy project, manually reviewed entries, and so on. - * - * Whitelists are based on the file paths provided by the TS compiler, with - * both regexp-based checks and prefix-based checks. - * - * - * Follows the logic in - * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/conformance.proto. - */ -export interface WhitelistEntry { - /** The category corresponding to this entry. */ - readonly reason: WhitelistReason; - /** Why is this okay to whitelist. */ - readonly explanation?: string; - - /** - * Regexps for the paths of files that will be ignored by the - * ConformancePattern. Beware, escaping can be tricky. - */ - readonly regexp?: readonly string[]; - /** - * Prefixes for the paths of files that will be ignored by the - * ConformancePattern. - */ - readonly prefix?: readonly string[]; -} - -/** - * The categories of whitelist entries. - */ -export enum WhitelistReason { - /** No reason. */ - UNSPECIFIED, - /** Code that has to be grandfathered in (no guarantees). */ - LEGACY, - /** - * Code that does not enter the scope of this particular check (no - * guarantees). - */ - OUT_OF_SCOPE, - /** Manually reviewed exceptions (supposedly okay). */ - MANUALLY_REVIEWED -} - -/** - * A complete whitelist with all related WhitelistEntry grouped together, with - * WhitelistReason ignored since it is purely for documentary purposes. - */ -export class Whitelist { - private readonly whitelistedPrefixes: readonly string[] = []; - private readonly whitelistedRegExps: readonly RegExp[] = []; - // To avoid repeated computation for whitelisting queries with the same file - // path, create a memoizer to cache known results. This is useful in watch - // mode (and possible in language service) when the same files can be compiled - // repeatedly. - private readonly whitelistMemoizer: Map = new Map(); - - constructor(whitelistEntries?: WhitelistEntry[]) { - if (whitelistEntries) { - for (const e of whitelistEntries) { - if (e.prefix) { - this.whitelistedPrefixes = - this.whitelistedPrefixes.concat(...e.prefix); - } - if (e.regexp) { - this.whitelistedRegExps = this.whitelistedRegExps.concat( - ...e.regexp.map(r => new RegExp(r))); - } - } - } - } - - isWhitelisted(filePath: string): boolean { - if (this.whitelistMemoizer.has(filePath)) { - return this.whitelistMemoizer.get(filePath)!; - } - for (const p of this.whitelistedPrefixes) { - if (filePath.startsWith(p)) { - this.whitelistMemoizer.set(filePath, true); - return true; - } - } - for (const re of this.whitelistedRegExps) { - if (re.test(filePath)) { - this.whitelistMemoizer.set(filePath, true); - return true; - } - } - this.whitelistMemoizer.set(filePath, false); - return false; - } -} From 9e14225f3283b0732341d70b2ad43d03300216ee Mon Sep 17 00:00:00 2001 From: pwng Date: Fri, 26 Jun 2020 10:41:14 -0700 Subject: [PATCH 302/316] Normalize source file paths before querying the whitelist. PiperOrigin-RevId: 318500332 --- internal/tsetse/util/allowlist_test.ts | 289 +++++++++--------- .../util/pattern_engines/pattern_engine.ts | 4 +- internal/tsetse/util/testing/test_support.ts | 3 +- 3 files changed, 147 insertions(+), 149 deletions(-) diff --git a/internal/tsetse/util/allowlist_test.ts b/internal/tsetse/util/allowlist_test.ts index 8324c078..d451c766 100644 --- a/internal/tsetse/util/allowlist_test.ts +++ b/internal/tsetse/util/allowlist_test.ts @@ -9,155 +9,152 @@ const tmpPrefixForAllowlist = getTempDirForAllowlist(); const tmpRegexpForAllowlist = `^(?:${getTempDirForAllowlist().replace(/\\/g, '\\\\')})`; +describe('ConformancePatternRule allowlist handling', () => { + const source = `export {};\n` + + `const q = document.createElement('q');\n` + + `q.cite = 'some example string';\n`; + + // The initial config off which we run those checks. + const baseConfig = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, + errorMessage: 'do not cite', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['HTMLQuoteElement.prototype.cite'], + }; + + it('matches if no allowlist (sanity check)', () => { + const config = {...baseConfig, allowlistEntries: []}; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1); + }); + + it('matches if there is an empty allowlist group', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1); + }); + + it('respects prefix-based allowlists (matching test)', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + prefix: [tmpPrefixForAllowlist], + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); -describe('ConformancePatternRule', () => { - describe('allowlist handling', () => { - const source = `export {};\n` + - `const q = document.createElement('q');\n` + - `q.cite = 'some example string';\n`; - - // The initial config off which we run those checks. - const baseConfig = { - errorCode: ErrorCode.CONFORMANCE_PATTERN, - errorMessage: 'do not cite', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['HTMLQuoteElement.prototype.cite'], + expect(results).toHaveNoFailures(); + }); + + it('respects prefix-based allowlists (non-matching test)', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + prefix: ['/nowhere in particular/'], + }] }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNFailures(1); + }); - it('matches if no allowlist (sanity check)', () => { - const config = {...baseConfig, allowlistEntries: []}; - const rule = new ConformancePatternRule(config); - const results = compileAndCheck(rule, source); - - expect(results).toHaveNFailures(1); - }); - - it('matches if there is an empty allowlist group', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - }] - }; - const rule = new ConformancePatternRule(config); - const results = compileAndCheck(rule, source); - - expect(results).toHaveNFailures(1); - }); - - it('respects prefix-based allowlists (matching test)', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - prefix: [tmpPrefixForAllowlist], - }] - }; - const rule = new ConformancePatternRule(config); - const results = compileAndCheck(rule, source); - - expect(results).toHaveNoFailures(); - }); - - it('respects prefix-based allowlists (non-matching test)', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - prefix: ['/nowhere in particular/'], - }] - }; - const rule = new ConformancePatternRule(config); - const results = compileAndCheck(rule, source); - - expect(results).toHaveNFailures(1); - }); - - it('respects regex-based allowlists', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - regexp: [`${tmpRegexpForAllowlist}.+/file_0\\.ts`] - }] - }; - const rule = new ConformancePatternRule(config); - const results = compileAndCheck(rule, source); - - expect(results).toHaveNoFailures(); - }); - - it('accepts several regex-based allowlists', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - regexp: [ - `${tmpRegexpForAllowlist}.+/file_0\\.ts`, - `${tmpRegexpForAllowlist}.+/file_1\\.ts` - ] - }] - }; - const rule = new ConformancePatternRule(config); - // Testing two times the same file so that both regexps match. - const results = compileAndCheck(rule, source, source); - - expect(results).toHaveNoFailures(); - }); - - it('throws on creation of invalid regexps', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - regexp: ['(', '/tmp/', 'foo'], - }] - }; - expect(() => { - // tslint:disable-next-line:no-unused-expression - new ConformancePatternRule(config); - }).toThrowError(/Invalid regular expression/); - }); - - it('test memoizer hit', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - regexp: [ - `${tmpRegexpForAllowlist}.+/file_0\\.ts`, - ] - }] - }; - const rule = new ConformancePatternRule(config); - // Compile the same file twice to make sure memoizer doesn't - // break things. - let results = compileAndCheck(rule, source); - results = results.concat(compileAndCheck(rule, source)); - - expect(results).toHaveNoFailures(); - }); - - it('test memoizer miss', () => { - const config = { - ...baseConfig, - allowlistEntries: [{ - reason: ExemptionReason.UNSPECIFIED, - regexp: [ - `${tmpRegexpForAllowlist}.+/file_1\\.ts`, - ], - prefix: ['###PrefixNotExist###'], - }] - }; - const rule = new ConformancePatternRule(config); - // Compile the same file twice to make sure memoizer doesn't - // break things. - let results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1); - - results = compileAndCheck(rule, source); - expect(results).toHaveNFailures(1); - }); + it('respects regex-based allowlists', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + regexp: [`${tmpRegexpForAllowlist}.+[\\\\/]file_0\\.ts`] + }] + }; + const rule = new ConformancePatternRule(config); + const results = compileAndCheck(rule, source); + + expect(results).toHaveNoFailures(); + }); + + it('accepts several regex-based allowlists', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + regexp: [ + `${tmpRegexpForAllowlist}.+[\\\\/]file_0\\.ts`, + `${tmpRegexpForAllowlist}.+[\\\\/]file_1\\.ts` + ] + }] + }; + const rule = new ConformancePatternRule(config); + // Testing two times the same file so that both regexps match. + const results = compileAndCheck(rule, source, source); + + expect(results).toHaveNoFailures(); + }); + + it('throws on creation of invalid regexps', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + regexp: ['(', '/tmp/', 'foo'], + }] + }; + expect(() => { + // tslint:disable-next-line:no-unused-expression + new ConformancePatternRule(config); + }).toThrowError(/Invalid regular expression/); + }); + + it('test memoizer hit', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + regexp: [ + `${tmpRegexpForAllowlist}.+[\\\\/]file_0\\.ts`, + ] + }] + }; + const rule = new ConformancePatternRule(config); + // Compile the same file twice to make sure memoizer doesn't + // break things. + let results = compileAndCheck(rule, source); + results = results.concat(compileAndCheck(rule, source)); + + expect(results).toHaveNoFailures(); + }); + + it('test memoizer miss', () => { + const config = { + ...baseConfig, + allowlistEntries: [{ + reason: ExemptionReason.UNSPECIFIED, + regexp: [ + `${tmpRegexpForAllowlist}.+[\\\\/]file_1\\.ts`, + ], + prefix: ['###PrefixNotExist###'], + }] + }; + const rule = new ConformancePatternRule(config); + // Compile the same file twice to make sure memoizer doesn't + // break things. + let results = compileAndCheck(rule, source); + expect(results).toHaveNFailures(1); + + results = compileAndCheck(rule, source); + expect(results).toHaveNFailures(1); }); }); diff --git a/internal/tsetse/util/pattern_engines/pattern_engine.ts b/internal/tsetse/util/pattern_engines/pattern_engine.ts index 1b61df20..df15ab5d 100644 --- a/internal/tsetse/util/pattern_engines/pattern_engine.ts +++ b/internal/tsetse/util/pattern_engines/pattern_engine.ts @@ -1,3 +1,4 @@ +import * as path from 'path'; import * as ts from 'typescript'; import {Checker} from '../../checker'; @@ -41,7 +42,8 @@ export abstract class PatternEngine { return; } const matchedNode = checkFunction(c.typeChecker, n); - if (matchedNode && !this.allowlist.isAllowlisted(sf.fileName)) { + if (matchedNode && + !this.allowlist.isAllowlisted(path.resolve(sf.fileName))) { const fix: Fix|undefined = this.fixer ? this.fixer.getFixForFlaggedNode(matchedNode) : undefined; diff --git a/internal/tsetse/util/testing/test_support.ts b/internal/tsetse/util/testing/test_support.ts index f80b7a7c..a3c32d39 100644 --- a/internal/tsetse/util/testing/test_support.ts +++ b/internal/tsetse/util/testing/test_support.ts @@ -79,8 +79,7 @@ export function toFileName(f: Failure) { */ export function getTempDirForAllowlist() { // TS uses forward slashes on Windows ¯\_(ツ)_/¯ - return os.platform() === 'win32' ? os.tmpdir().replace(/\\/g, '/') : - os.tmpdir(); + return os.platform() === 'win32' ? os.tmpdir() : os.tmpdir(); } interface FailureExpectations { From a167ebdc587d383a3ed5a0e9e5e2802d87dde948 Mon Sep 17 00:00:00 2001 From: pwng Date: Tue, 30 Jun 2020 11:12:34 -0700 Subject: [PATCH 303/316] Add a static property RULE_NAME to every rule class so that the rules can be refered to by names before an instance is created. PiperOrigin-RevId: 319058760 --- internal/tsetse/rules/ban_expect_truthy_promise_rule.ts | 3 ++- internal/tsetse/rules/ban_mutable_exports_rule.ts | 3 ++- internal/tsetse/rules/ban_promise_as_condition_rule.ts | 3 ++- internal/tsetse/rules/ban_string_initialized_sets_rule.ts | 3 ++- internal/tsetse/rules/check_return_value_rule.ts | 3 ++- internal/tsetse/rules/equals_nan_rule.ts | 3 ++- internal/tsetse/rules/must_use_promises_rule.ts | 3 ++- internal/tsetse/rules/property_renaming_safe.ts | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts b/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts index d1e79c02..6bee2641 100644 --- a/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts +++ b/internal/tsetse/rules/ban_expect_truthy_promise_rule.ts @@ -12,7 +12,8 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; export class Rule extends AbstractRule { - readonly ruleName = 'ban-expect-truthy-promise'; + static readonly RULE_NAME = 'ban-expect-truthy-promise'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.BAN_EXPECT_TRUTHY_PROMISE; register(checker: Checker) { diff --git a/internal/tsetse/rules/ban_mutable_exports_rule.ts b/internal/tsetse/rules/ban_mutable_exports_rule.ts index a4dc132c..df9de966 100644 --- a/internal/tsetse/rules/ban_mutable_exports_rule.ts +++ b/internal/tsetse/rules/ban_mutable_exports_rule.ts @@ -10,7 +10,8 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; export class Rule extends AbstractRule { - readonly ruleName = 'ban-mutable-exports'; + static readonly RULE_NAME = 'ban-mutable-exports'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.BAN_MUTABLE_EXPORTS; register(checker: Checker) { diff --git a/internal/tsetse/rules/ban_promise_as_condition_rule.ts b/internal/tsetse/rules/ban_promise_as_condition_rule.ts index a58461a8..a9da23e3 100644 --- a/internal/tsetse/rules/ban_promise_as_condition_rule.ts +++ b/internal/tsetse/rules/ban_promise_as_condition_rule.ts @@ -12,7 +12,8 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; export class Rule extends AbstractRule { - readonly ruleName = 'ban-promise-as-condition'; + static readonly RULE_NAME = 'ban-promise-as-condition'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.BAN_PROMISE_AS_CONDITION; register(checker: Checker) { diff --git a/internal/tsetse/rules/ban_string_initialized_sets_rule.ts b/internal/tsetse/rules/ban_string_initialized_sets_rule.ts index 44087baf..dfef1b88 100644 --- a/internal/tsetse/rules/ban_string_initialized_sets_rule.ts +++ b/internal/tsetse/rules/ban_string_initialized_sets_rule.ts @@ -16,7 +16,8 @@ const errorMsg = 'Value passed to Set constructor is a string. This will' + ' create an Iterable, eg: new Set(myStr as Iterable).'; export class Rule extends AbstractRule { - readonly ruleName = 'ban-string-initialized-sets'; + static readonly RULE_NAME = 'ban-string-initialized-sets'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.BAN_STRING_INITIALIZED_SETS; register(checker: Checker) { diff --git a/internal/tsetse/rules/check_return_value_rule.ts b/internal/tsetse/rules/check_return_value_rule.ts index 7863cf5e..35e6b195 100644 --- a/internal/tsetse/rules/check_return_value_rule.ts +++ b/internal/tsetse/rules/check_return_value_rule.ts @@ -42,7 +42,8 @@ const METHODS_TO_CHECK = new Set([ /** A rule to ensure required return values from common functions are used. */ export class Rule extends AbstractRule { - readonly ruleName = 'check-return-value'; + static readonly RULE_NAME = 'check-return-value'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.CHECK_RETURN_VALUE; // registers checkCallExpression() function on ts.CallExpression node. diff --git a/internal/tsetse/rules/equals_nan_rule.ts b/internal/tsetse/rules/equals_nan_rule.ts index 38b01d50..ea6d8e88 100644 --- a/internal/tsetse/rules/equals_nan_rule.ts +++ b/internal/tsetse/rules/equals_nan_rule.ts @@ -10,7 +10,8 @@ import {ErrorCode} from '../error_code'; import {AbstractRule} from '../rule'; export class Rule extends AbstractRule { - readonly ruleName = 'equals-nan'; + static readonly RULE_NAME = 'equals-nan'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.EQUALS_NAN; register(checker: Checker) { diff --git a/internal/tsetse/rules/must_use_promises_rule.ts b/internal/tsetse/rules/must_use_promises_rule.ts index f5835744..293ea4ba 100644 --- a/internal/tsetse/rules/must_use_promises_rule.ts +++ b/internal/tsetse/rules/must_use_promises_rule.ts @@ -16,7 +16,8 @@ const FAILURE_STRING = /** A rule to ensure promises in async functions are awaited or used. */ export class Rule extends AbstractRule { - readonly ruleName = 'must-use-promises'; + static readonly RULE_NAME = 'must-use-promises'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.MUST_USE_PROMISES; register(checker: Checker) { diff --git a/internal/tsetse/rules/property_renaming_safe.ts b/internal/tsetse/rules/property_renaming_safe.ts index 7b842442..ce8b95df 100644 --- a/internal/tsetse/rules/property_renaming_safe.ts +++ b/internal/tsetse/rules/property_renaming_safe.ts @@ -12,7 +12,8 @@ import {AbstractRule} from '../rule'; * Note: This rule can have false positives. */ export class Rule extends AbstractRule { - readonly ruleName = 'property-renaming-safe'; + static readonly RULE_NAME = 'property-renaming-safe'; + readonly ruleName = Rule.RULE_NAME; readonly code = ErrorCode.PROPERTY_RENAMING_SAFE; register(checker: Checker) { From 66ee793471dc5f81b75391e106d8edd714e8f532 Mon Sep 17 00:00:00 2001 From: Minko Gechev Date: Tue, 31 Mar 2020 09:03:35 -0700 Subject: [PATCH 304/316] Remove @mgechev from codeowners --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index b1485d04..eb75e738 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @mgechev @kyliau @alexeagle \ No newline at end of file +* @kyliau @alexeagle From 5893f5f8e87f4f23ce2d90235bedf4d39e368d6d Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Mon, 13 Jul 2020 10:16:32 -0700 Subject: [PATCH 305/316] Purely Google refactor PiperOrigin-RevId: 320980427 --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index eb75e738..b1485d04 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @kyliau @alexeagle +* @mgechev @kyliau @alexeagle \ No newline at end of file From 6a1591b8728f0adb0bda02116801b9b992475035 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Wed, 22 Jul 2020 11:44:14 -0700 Subject: [PATCH 306/316] Add rule which requires the user to cast the result of JSON.parse. PiperOrigin-RevId: 322620340 --- internal/tsetse/error_code.ts | 1 + .../rules/must_type_assert_json_parse_rule.ts | 71 +++++++++++++++++++ internal/tsetse/runner.ts | 2 + .../must_type_assert_json_parse/negatives.ts | 27 +++++++ .../must_type_assert_json_parse/positives.ts | 9 +++ 5 files changed, 110 insertions(+) create mode 100644 internal/tsetse/rules/must_type_assert_json_parse_rule.ts create mode 100644 internal/tsetse/tests/must_type_assert_json_parse/negatives.ts create mode 100644 internal/tsetse/tests/must_type_assert_json_parse/positives.ts diff --git a/internal/tsetse/error_code.ts b/internal/tsetse/error_code.ts index 10d36c55..7b85b712 100644 --- a/internal/tsetse/error_code.ts +++ b/internal/tsetse/error_code.ts @@ -15,4 +15,5 @@ export enum ErrorCode { CONFORMANCE_PATTERN = 21228, BAN_MUTABLE_EXPORTS = 21229, BAN_STRING_INITIALIZED_SETS = 21230, + MUST_TYPE_ASSERT_JSON_PARSE = 21231, } diff --git a/internal/tsetse/rules/must_type_assert_json_parse_rule.ts b/internal/tsetse/rules/must_type_assert_json_parse_rule.ts new file mode 100644 index 00000000..45ee772f --- /dev/null +++ b/internal/tsetse/rules/must_type_assert_json_parse_rule.ts @@ -0,0 +1,71 @@ +/** + * @fileoverview Bans `JSON.parse(...)` that is not wrapped in a type assertion. + * See http://tsetse.info/must-type-assert-json-parse + */ + + +import * as ts from 'typescript'; + +import {Checker} from '../checker'; +import {ErrorCode} from '../error_code'; +import {AbstractRule} from '../rule'; + +const FAILURE_STRING = + 'type assert `JSON.parse() as SomeExplicitType` for type & optimization safety.\n\t' + + 'See http://tsetse.info/must-type-assert-json-parse.'; + +/** + * Ensures that all calls to JSON.parse are wrapped in an `as` expression. + */ +export class Rule extends AbstractRule { + static readonly RULE_NAME = 'must-type-assert-json-parse'; + readonly ruleName = Rule.RULE_NAME; + readonly code = ErrorCode.MUST_TYPE_ASSERT_JSON_PARSE; + + register(checker: Checker) { + checker.on(ts.SyntaxKind.CallExpression, checkCallExpression, this.code); + } +} + +/** + * Checks whether a given `parse` symbol is the JSON.parse symbol declared in + * lib.es5.d.ts. + */ +function isEcmascriptJsonParse( + checker: Checker, node: ts.LeftHandSideExpression): boolean { + const parseSymbol = checker.typeChecker.getSymbolAtLocation(node); + if (parseSymbol === undefined) return false; + + const declaration = parseSymbol.valueDeclaration; + if (declaration === undefined) return false; + + const fileName = declaration.getSourceFile().fileName; + if (!fileName.includes('typescript')) return false; + if (!fileName.endsWith('lib.es5.d.ts')) return false; + + // Narrow the node type so we can get `name`. + if (!ts.isMethodSignature(declaration)) return false; + if (declaration.name.getText() !== 'parse') return false; + + if (!ts.isInterfaceDeclaration(declaration.parent)) return false; + if (declaration.parent.name.getText() !== 'JSON') return false; + + return true; +} + +function checkCallExpression(checker: Checker, node: ts.CallExpression) { + const funcexpr = node.expression; + if (!ts.isPropertyAccessExpression(funcexpr)) { + return; + } + + // We're inside a type assert expression (JSON.parse as SomeExplicitType) so + // this is an acceptable use. Don't add a failure. + if (node.parent != null && node.parent.kind === ts.SyntaxKind.AsExpression) { + return; + } + + if (!isEcmascriptJsonParse(checker, funcexpr)) return; + + checker.addFailureAtNode(node, FAILURE_STRING); +} diff --git a/internal/tsetse/runner.ts b/internal/tsetse/runner.ts index 8e2926aa..cbe85cda 100644 --- a/internal/tsetse/runner.ts +++ b/internal/tsetse/runner.ts @@ -14,6 +14,7 @@ import {Rule as BanPromiseAsConditionRule} from './rules/ban_promise_as_conditio import {Rule as BanStringInitializedSetsRule} from './rules/ban_string_initialized_sets_rule'; import {Rule as CheckReturnValueRule} from './rules/check_return_value_rule'; import {Rule as EqualsNanRule} from './rules/equals_nan_rule'; +import {Rule as MustTypeAssertJsonParseRule} from './rules/must_type_assert_json_parse_rule'; import {Rule as MustUsePromisesRule} from './rules/must_use_promises_rule'; /** @@ -27,6 +28,7 @@ const ENABLED_RULES: AbstractRule[] = [ new MustUsePromisesRule(), new BanPromiseAsConditionRule(), new BanStringInitializedSetsRule(), + new MustTypeAssertJsonParseRule(), ]; /** diff --git a/internal/tsetse/tests/must_type_assert_json_parse/negatives.ts b/internal/tsetse/tests/must_type_assert_json_parse/negatives.ts new file mode 100644 index 00000000..6c8e7c3d --- /dev/null +++ b/internal/tsetse/tests/must_type_assert_json_parse/negatives.ts @@ -0,0 +1,27 @@ +// tslint:disable +if (JSON.parse('false') as boolean) { + alert('never happens'); +} + +if (JSON.parse('null') as null) { + alert('never happens'); +} + +declare interface MyInterface { + attr: string; +} + +const a = JSON.parse('{}') as any; +const b = JSON.parse('{}') as unknown; +const c = JSON.parse('{}') as MyInterface; + +let d = JSON.parse('{}') as any; +let e = JSON.parse('{}') as unknown; +let f = JSON.parse('{}') as MyInterface; + +{ + const JSON = {parse: (a: any) => a}; + let g = JSON.parse('{}'); // User defined JSON, so no error. +} + +export {}; // Make this file a module. diff --git a/internal/tsetse/tests/must_type_assert_json_parse/positives.ts b/internal/tsetse/tests/must_type_assert_json_parse/positives.ts new file mode 100644 index 00000000..ce013ef8 --- /dev/null +++ b/internal/tsetse/tests/must_type_assert_json_parse/positives.ts @@ -0,0 +1,9 @@ +// tslint:disable + +const a = JSON.parse('{}'); +let b = JSON.parse('{}'); +if (JSON.parse('false')) { + alert('never happens'); +} + +export {}; // Make this file a module. From b4d5683eacf3cbb96b408511272991b0f66dcffc Mon Sep 17 00:00:00 2001 From: pwng Date: Mon, 27 Jul 2020 11:55:55 -0700 Subject: [PATCH 307/316] Cover code patterns where property accesses are done through element access with string literals in Tsetse. PiperOrigin-RevId: 323409240 --- internal/tsetse/checker.ts | 63 +++++++++++++++---- internal/tsetse/util/ast_tools.ts | 23 ------- internal/tsetse/util/ast_tools_test.ts | 33 ---------- .../util/pattern_engines/property_engine.ts | 32 ++++++---- .../pattern_engines/property_engine_test.ts | 17 +++-- .../property_non_constant_write_engine.ts | 34 ++++------ ...property_non_constant_write_engine_test.ts | 19 ++++-- .../pattern_engines/property_write_engine.ts | 48 ++++++-------- .../property_write_engine_test.ts | 18 ++++-- internal/tsetse/util/property_matcher.ts | 2 +- 10 files changed, 139 insertions(+), 150 deletions(-) delete mode 100644 internal/tsetse/util/ast_tools_test.ts diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index 2f606f45..ac153408 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -24,19 +24,25 @@ interface Handler { export class Checker { /** Node to handlers mapping for all enabled rules. */ private readonly nodeHandlersMap = - new Map[]>(); + new Map>>(); /** * Mapping from identifier name to handlers for all rules inspecting property * names. */ private readonly namedIdentifierHandlersMap = - new Map[]>(); + new Map>>(); /** * Mapping from property name to handlers for all rules inspecting property * accesses expressions. */ private readonly namedPropertyAccessHandlersMap = - new Map[]>(); + new Map>>(); + /** + * Mapping from string literal value to handlers for all rules inspecting + * string literals. + */ + private readonly stringLiteralElementAccessHandlersMap = + new Map>>(); private failures: Failure[] = []; private currentSourceFile: ts.SourceFile|undefined; @@ -106,6 +112,26 @@ export class Checker { } } + /** + * Similar to `on`, but registers handlers on more specific node type, i.e., + * element access expressions with string literals as keys. + */ + onStringLiteralElementAccess( + key: string, + handlerFunction: + (checker: Checker, node: ts.ElementAccessExpression) => void, + code: number) { + const newHandler: + Handler = {handlerFunction, code}; + const registeredHandlers = + this.stringLiteralElementAccessHandlersMap.get(key); + if (registeredHandlers === undefined) { + this.stringLiteralElementAccessHandlersMap.set(key, [newHandler]); + } else { + registeredHandlers.push(newHandler); + } + } + /** * Add a failure with a span. */ @@ -135,9 +161,7 @@ export class Checker { /** Dispatch general handlers registered via `on` */ dispatchNodeHandlers(node: ts.Node) { const handlers = this.nodeHandlersMap.get(node.kind); - if (handlers === undefined) { - return; - } + if (handlers === undefined) return; for (const handler of handlers) { this.currentCode = handler.code; @@ -148,9 +172,7 @@ export class Checker { /** Dispatch identifier handlers registered via `onNamedIdentifier` */ dispatchNamedIdentifierHandlers(id: ts.Identifier) { const handlers = this.namedIdentifierHandlersMap.get(id.text); - if (handlers === undefined) { - return; - } + if (handlers === undefined) return; for (const handler of handlers) { this.currentCode = handler.code; @@ -163,9 +185,7 @@ export class Checker { */ dispatchNamedPropertyAccessHandlers(prop: ts.PropertyAccessExpression) { const handlers = this.namedPropertyAccessHandlersMap.get(prop.name.text); - if (handlers === undefined) { - return; - } + if (handlers === undefined) return; for (const handler of handlers) { this.currentCode = handler.code; @@ -173,6 +193,23 @@ export class Checker { } } + /** + * Dispatch string literal handlers registered via + * `onStringLiteralElementAccess`. + */ + dispatchStringLiteralElementAccessHandlers(elem: ts.ElementAccessExpression) { + const arg = elem.argumentExpression; + if (!ts.isStringLiteral(arg)) return; + + const handlers = this.stringLiteralElementAccessHandlersMap.get(arg.text); + if (handlers === undefined) return; + + for (const handler of handlers) { + this.currentCode = handler.code; + handler.handlerFunction(this, elem); + } + } + /** * Walk `sourceFile`, invoking registered handlers with Checker as the first * argument and current node as the second argument. Return failures if there @@ -194,6 +231,8 @@ export class Checker { thisChecker.dispatchNamedIdentifierHandlers(node); } else if (ts.isPropertyAccessExpression(node)) { thisChecker.dispatchNamedPropertyAccessHandlers(node); + } else if (ts.isElementAccessExpression(node)) { + thisChecker.dispatchStringLiteralElementAccessHandlers(node); } ts.forEachChild(node, run); diff --git a/internal/tsetse/util/ast_tools.ts b/internal/tsetse/util/ast_tools.ts index 1118699b..57505cf0 100644 --- a/internal/tsetse/util/ast_tools.ts +++ b/internal/tsetse/util/ast_tools.ts @@ -145,29 +145,6 @@ export function isNameInDeclaration(n: ts.Node): boolean { ts.isVariableDeclarationList(p) || ts.isImportDeclaration(p); } -/** Type guard for expressions that looks like property writes. */ -export function isPropertyWriteExpression(node: ts.Node): - node is(ts.BinaryExpression & { - left: ts.PropertyAccessExpression; - }) { - if (!ts.isBinaryExpression(node)) { - return false; - } - if (node.operatorToken.getText().trim() !== '=') { - return false; - } - if (!ts.isPropertyAccessExpression(node.left) || - node.left.expression.getFullText().trim() === '') { - return false; - } - - // TODO: Destructuring assigments aren't covered. This would be a potential - // bypass, but I doubt we'd catch bugs, so fixing it seems low priority - // overall. - - return true; -} - /** * If verbose, logs the given error that happened while walking n, with a * stacktrace. diff --git a/internal/tsetse/util/ast_tools_test.ts b/internal/tsetse/util/ast_tools_test.ts deleted file mode 100644 index 6b0a62ec..00000000 --- a/internal/tsetse/util/ast_tools_test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import 'jasmine'; -import {ConformancePatternRule, ErrorCode, PatternKind} from '../rules/conformance_pattern_rule'; -import {setDebug} from './ast_tools'; -import {compileAndCheck} from './testing/test_support'; - -describe('Debug output', () => { - it('turns on and off', () => { - const source = `location.href = 'foo';`; - const rule = new ConformancePatternRule({ - errorCode: ErrorCode.CONFORMANCE_PATTERN, - errorMessage: 'does not matter', - kind: PatternKind.BANNED_PROPERTY_WRITE, - values: ['Location.prototype.href'] - }); - - const logs: string[] = []; - const realConsoleLog = console.log; - spyOn(console, 'log').and.callFake((s: string) => { - logs.push(s); - realConsoleLog(s); - }); - setDebug(true); - compileAndCheck(rule, source); - - expect(logs).toEqual([`inspecting location.href = 'foo'`]); - - setDebug(false); - compileAndCheck(rule, source); - - // Nothing more appended: debug was false - expect(logs).toEqual([`inspecting location.href = 'foo'`]); - }); -}); diff --git a/internal/tsetse/util/pattern_engines/property_engine.ts b/internal/tsetse/util/pattern_engines/property_engine.ts index adef087b..5cfc7af6 100644 --- a/internal/tsetse/util/pattern_engines/property_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_engine.ts @@ -4,16 +4,17 @@ import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {PatternEngine} from '../pattern_engines/pattern_engine'; import {PropertyMatcher} from '../property_matcher'; -function checkPropAccessExpr( - tc: ts.TypeChecker, n: ts.PropertyAccessExpression, +import {PatternEngine} from './pattern_engine'; + +/** Match an AST node with a property matcher. */ +export function matchProperty( + tc: ts.TypeChecker, + n: ts.PropertyAccessExpression|ts.ElementAccessExpression, matcher: PropertyMatcher): ts.Node|undefined { debugLog(() => `inspecting ${n.getText().trim()}`); - if (!matcher.matches(n, tc)) { - return; - } + if (!matcher.typeMatches(tc.getTypeAtLocation(n.expression))) return; return n; } @@ -22,19 +23,24 @@ function checkPropAccessExpr( * matching the spec regardless whether it's a read or write. */ export class PropertyEngine extends PatternEngine { - register(checker: Checker) { + protected registerWith(checker: Checker, matchNode: typeof matchProperty) { for (const value of this.config.values) { const matcher = PropertyMatcher.fromSpec(value); - // TODO(b/154675140): only plain property access expressions are supported - // for now. In the future, support more patterns including - // `location['href']` and `const {href} = location;`. That possibly - // requires refactoring `PropertyMatcher` or adding new types of matchers. checker.onNamedPropertyAccess( matcher.bannedProperty, this.wrapCheckWithAllowlistingAndFixer( - (tc, n: ts.PropertyAccessExpression) => - checkPropAccessExpr(tc, n, matcher)), + (tc, n) => matchNode(tc, n, matcher)), + this.config.errorCode); + + checker.onStringLiteralElementAccess( + matcher.bannedProperty, + this.wrapCheckWithAllowlistingAndFixer( + (tc, n) => matchNode(tc, n, matcher)), this.config.errorCode); } } + + register(checker: Checker) { + this.registerWith(checker, matchProperty); + } } diff --git a/internal/tsetse/util/pattern_engines/property_engine_test.ts b/internal/tsetse/util/pattern_engines/property_engine_test.ts index e3dcd3cb..a88b2920 100644 --- a/internal/tsetse/util/pattern_engines/property_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_engine_test.ts @@ -1,7 +1,7 @@ import 'jasmine'; import {ConformancePatternRule, ErrorCode, PatternKind} from '../../rules/conformance_pattern_rule'; -import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; +import {compileAndCheck, customMatchers} from '../testing/test_support'; describe('BANNED_PROPERTY', () => { beforeEach(() => { @@ -15,12 +15,17 @@ describe('BANNED_PROPERTY', () => { kind: PatternKind.BANNED_PROPERTY, values: ['Location.prototype.href'], }; - const source = 'const href = location.href;'; + const source = `const href = location.href + location['href'];`; const results = compileAndCheck(new ConformancePatternRule(config), source); - expect(results).toHaveFailuresMatching({ - matchedCode: 'location.href', - messageText: 'No Location#href access', - }); + expect(results).toHaveFailuresMatching( + { + matchedCode: 'location.href', + messageText: 'No Location#href access', + }, + { + matchedCode: `location['href']`, + messageText: 'No Location#href access', + }); }); }); diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts index e89a0790..d8f2f135 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine.ts @@ -2,46 +2,36 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; -import {debugLog, isPropertyWriteExpression} from '../ast_tools'; +import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; import {isLiteral} from '../is_literal'; import {PropertyMatcher} from '../property_matcher'; -import {PatternEngine} from './pattern_engine'; +import {matchPropertyWrite, PropertyWriteEngine} from './property_write_engine'; -function checkBinExpr( - tc: ts.TypeChecker, n: ts.BinaryExpression, +function matchPropertyNonConstantWrite( + tc: ts.TypeChecker, + n: ts.PropertyAccessExpression|ts.ElementAccessExpression, matcher: PropertyMatcher): ts.Node|undefined { - if (!isPropertyWriteExpression(n)) { - return; - } debugLog(() => `inspecting ${n.getFullText().trim()}`); - if (!matcher.matches(n.left, tc)) { - debugLog(() => 'Not an assignment to the right property'); + if (matchPropertyWrite(tc, n, matcher) === undefined) { return; } - if (isLiteral(tc, n.right)) { + const rval = (n.parent as ts.BinaryExpression).right; + if (isLiteral(tc, rval)) { debugLog( () => `Assigned value (${ - n.right.getFullText()}) is a compile-time constant.`); + rval.getFullText()}) is a compile-time constant.`); return; } - return n; + return n.parent; } /** * The engine for BANNED_PROPERTY_NON_CONSTANT_WRITE. */ -export class PropertyNonConstantWriteEngine extends PatternEngine { +export class PropertyNonConstantWriteEngine extends PropertyWriteEngine { register(checker: Checker) { - for (const value of this.config.values) { - const matcher = PropertyMatcher.fromSpec(value); - - checker.on( - ts.SyntaxKind.BinaryExpression, - this.wrapCheckWithAllowlistingAndFixer( - (tc, n: ts.BinaryExpression) => checkBinExpr(tc, n, matcher)), - this.config.errorCode); - } + this.registerWith(checker, matchPropertyNonConstantWrite); } } diff --git a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts index fcfabe19..6d2f4fa9 100644 --- a/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_non_constant_write_engine_test.ts @@ -4,9 +4,13 @@ import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { it('matches a trivial example', () => { - const source = `const q = document.createElement('q');\n` + - `q.cite = 'some example string';\n` + // literal - `q.cite = window.name;\n`; // non-literal + const source = [ + `const q = document.createElement('q');`, + `q.cite = 'some example string';`, + `q['cite'] = 'some example string';`, + `q.cite = window.name;`, + `q['cite'] = window.name;`, + ].join('\n'); const config = { errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'do not cite dynamically', @@ -16,7 +20,14 @@ describe('BANNED_PROPERTY_NON_CONSTANT_WRITE', () => { const results = compileAndCheck(new ConformancePatternRule(config), source); expect(results).toHaveFailuresMatching( - {start: 71, end: 91, messageText: 'do not cite dynamically'}); + { + matchedCode: `q.cite = window.name`, + messageText: 'do not cite dynamically', + }, + { + matchedCode: `q['cite'] = window.name`, + messageText: 'do not cite dynamically', + }); }); }); diff --git a/internal/tsetse/util/pattern_engines/property_write_engine.ts b/internal/tsetse/util/pattern_engines/property_write_engine.ts index 56654e1c..b640ce39 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine.ts @@ -2,47 +2,35 @@ import * as ts from 'typescript'; import {Checker} from '../../checker'; import {ErrorCode} from '../../error_code'; -import {debugLog, isPropertyWriteExpression} from '../ast_tools'; +import {debugLog} from '../ast_tools'; import {Fixer} from '../fixer'; -import {PatternEngine} from '../pattern_engines/pattern_engine'; import {PropertyMatcher} from '../property_matcher'; -function checkPropAccessExpr( - tc: ts.TypeChecker, n: ts.PropertyAccessExpression, - matcher: PropertyMatcher): ts.Node|undefined { - if (!ts.isBinaryExpression(n.parent)) { - return; - } +import {matchProperty, PropertyEngine} from './property_engine'; - if (n.parent.operatorToken.getText().trim() !== '=') { - return; - } +/** Test if an AST node is a matched property write. */ +export function matchPropertyWrite( + tc: ts.TypeChecker, + n: ts.PropertyAccessExpression|ts.ElementAccessExpression, + matcher: PropertyMatcher): ts.BinaryExpression|undefined { + debugLog(() => `inspecting ${n.parent.getText().trim()}`); - if (n.parent.left !== n) { - return; - } + if (matchProperty(tc, n, matcher) === undefined) return; - debugLog(() => `inspecting ${n.parent.getText().trim()}`); - if (!matcher.matches(n, tc)) { - return; - } - return n.parent; + const assignment = n.parent; + + if (!ts.isBinaryExpression(assignment)) return; + if (assignment.operatorToken.kind !== ts.SyntaxKind.EqualsToken) return; + if (assignment.left !== n) return; + + return assignment; } /** * The engine for BANNED_PROPERTY_WRITE. */ -export class PropertyWriteEngine extends PatternEngine { +export class PropertyWriteEngine extends PropertyEngine { register(checker: Checker) { - for (const value of this.config.values) { - const matcher = PropertyMatcher.fromSpec(value); - - checker.onNamedPropertyAccess( - matcher.bannedProperty, - this.wrapCheckWithAllowlistingAndFixer( - (tc, n: ts.PropertyAccessExpression) => - checkPropAccessExpr(tc, n, matcher)), - this.config.errorCode); - } + this.registerWith(checker, matchPropertyWrite); } } diff --git a/internal/tsetse/util/pattern_engines/property_write_engine_test.ts b/internal/tsetse/util/pattern_engines/property_write_engine_test.ts index 6956025c..eec8771f 100644 --- a/internal/tsetse/util/pattern_engines/property_write_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_write_engine_test.ts @@ -1,9 +1,9 @@ import 'jasmine'; import {ConformancePatternRule, ErrorCode, PatternKind} from '../../rules/conformance_pattern_rule'; -import {compileAndCheck, customMatchers} from '../../util/testing/test_support'; +import {compileAndCheck, customMatchers} from '../testing/test_support'; describe('BANNED_PROPERTY_WRITE', () => { - describe('simpler matcher tests', () => { + describe('simple matcher tests', () => { const config = { errorCode: ErrorCode.CONFORMANCE_PATTERN, errorMessage: 'do not cite', @@ -16,13 +16,19 @@ describe('BANNED_PROPERTY_WRITE', () => { const source = [ `const q = document.createElement('q');`, `q.cite = 'some example string';`, + `q['cite'] = 'some example string';`, ].join('\n'); const results = compileAndCheck(rule, source); - expect(results).toHaveFailuresMatching({ - matchedCode: `q.cite = 'some example string'`, - messageText: 'do not cite' - }); + expect(results).toHaveFailuresMatching( + { + matchedCode: `q.cite = 'some example string'`, + messageText: 'do not cite' + }, + { + matchedCode: `q['cite'] = 'some example string'`, + messageText: 'do not cite' + }); }); it('matches precisely, even with whitespace or comments', () => { diff --git a/internal/tsetse/util/property_matcher.ts b/internal/tsetse/util/property_matcher.ts index 8ab1f067..a8b3a4ba 100644 --- a/internal/tsetse/util/property_matcher.ts +++ b/internal/tsetse/util/property_matcher.ts @@ -45,7 +45,7 @@ export class PropertyMatcher { // TODO: Account for unknown types/ '?', and 'loose type matches', i.e. if the // actual type is a supertype of the prohibited type. - private typeMatches(inspectedType: ts.Type): boolean { + typeMatches(inspectedType: ts.Type): boolean { if (this.exactTypeMatches(inspectedType)) { return true; } From 8d7b268a67b4fd1a55eb9b859a00ccedeaf16e39 Mon Sep 17 00:00:00 2001 From: pwng Date: Tue, 4 Aug 2020 10:18:42 -0700 Subject: [PATCH 308/316] Extend property checks to element access expressions with a non-literal key but with a string literal type. PiperOrigin-RevId: 324836998 --- internal/tsetse/checker.ts | 7 ++++--- .../util/pattern_engines/property_engine_test.ts | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/internal/tsetse/checker.ts b/internal/tsetse/checker.ts index ac153408..fcad3c71 100644 --- a/internal/tsetse/checker.ts +++ b/internal/tsetse/checker.ts @@ -198,10 +198,11 @@ export class Checker { * `onStringLiteralElementAccess`. */ dispatchStringLiteralElementAccessHandlers(elem: ts.ElementAccessExpression) { - const arg = elem.argumentExpression; - if (!ts.isStringLiteral(arg)) return; + const ty = this.typeChecker.getTypeAtLocation(elem.argumentExpression); - const handlers = this.stringLiteralElementAccessHandlersMap.get(arg.text); + if (!ty.isStringLiteral()) return; + + const handlers = this.stringLiteralElementAccessHandlersMap.get(ty.value); if (handlers === undefined) return; for (const handler of handlers) { diff --git a/internal/tsetse/util/pattern_engines/property_engine_test.ts b/internal/tsetse/util/pattern_engines/property_engine_test.ts index a88b2920..121e5e65 100644 --- a/internal/tsetse/util/pattern_engines/property_engine_test.ts +++ b/internal/tsetse/util/pattern_engines/property_engine_test.ts @@ -28,4 +28,18 @@ describe('BANNED_PROPERTY', () => { messageText: 'No Location#href access', }); }); + + it('matches element access expressions with string literal types', () => { + const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, + errorMessage: 'No Location#href access', + kind: PatternKind.BANNED_PROPERTY, + values: ['Location.prototype.href'], + }; + const source = `declare const key: 'href'; const href = location[key];`; + const results = compileAndCheck(new ConformancePatternRule(config), source); + + expect(results).toHaveFailuresMatching( + {matchedCode: 'location[key]', messageText: 'No Location#href access'}); + }); }); From 0d61a8a8ab810636427ef3fd3e160df785bebc46 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Tue, 18 Aug 2020 10:56:58 -0700 Subject: [PATCH 309/316] Remove useless parentheses from BUILD/bzl files. This is in preparation of a change in Buildifier. We first need to update the existing files before we can release a new Buildifier (to avoid spurious diffs when someone touches a file). A few unrelated changes have been made for files that were not well formatted. PiperOrigin-RevId: 327262788 --- internal/common/tsconfig.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl index ac14b4dc..0d597f32 100644 --- a/internal/common/tsconfig.bzl +++ b/internal/common/tsconfig.bzl @@ -87,7 +87,7 @@ def create_tsconfig( ]] node_modules_mappings = [] - if (hasattr(ctx.attr, "node_modules")): + if hasattr(ctx.attr, "node_modules"): node_modules_mappings.append("/".join([p for p in [ node_modules_root, "*", From 05ab3d3ccbfd14016296f6d405e6f54a03d7837b Mon Sep 17 00:00:00 2001 From: evanm Date: Fri, 21 Aug 2020 17:26:22 -0700 Subject: [PATCH 310/316] import declarations before using them This test file provides its own jasmine types, but never imports them. Add the import statement. PiperOrigin-RevId: 327901561 --- internal/tsetse/tests/ban_expect_truthy_promise/BUILD | 4 ++-- internal/tsetse/tests/ban_expect_truthy_promise/positives.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD index b92a83fd..f3cdd5be 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD +++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD @@ -34,13 +34,13 @@ ts_library( "positives.ts", ], expected_diagnostics = [ - "\\(29,5\\).*" + error_message, - "\\(30,5\\).*" + error_message, "\\(31,5\\).*" + error_message, "\\(32,5\\).*" + error_message, "\\(33,5\\).*" + error_message, "\\(34,5\\).*" + error_message, "\\(35,5\\).*" + error_message, + "\\(36,5\\).*" + error_message, + "\\(37,5\\).*" + error_message, ], tsconfig = "//internal:tsetse/tsconfig.json", deps = [ diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/positives.ts b/internal/tsetse/tests/ban_expect_truthy_promise/positives.ts index 6ec611f3..1dfe40f0 100644 --- a/internal/tsetse/tests/ban_expect_truthy_promise/positives.ts +++ b/internal/tsetse/tests/ban_expect_truthy_promise/positives.ts @@ -1,3 +1,5 @@ +import './jasmine_types'; + function returnsPromise() { return Promise.resolve(true); } From 63e5fe1a28449747566a5fda7108ecaaf5f70b65 Mon Sep 17 00:00:00 2001 From: TypeScript Team Date: Thu, 3 Sep 2020 07:06:12 -0700 Subject: [PATCH 311/316] Update outdated comment about how to build tsetse language service plugin. PiperOrigin-RevId: 329912085 --- internal/tsetse/tsconfig.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/tsetse/tsconfig.json b/internal/tsetse/tsconfig.json index f83ea7ff..abc0d839 100644 --- a/internal/tsetse/tsconfig.json +++ b/internal/tsetse/tsconfig.json @@ -11,7 +11,12 @@ "es2015.promise" ], "plugins": [ - // Run `bazel build internal/tsetse:language_service_plugin` for this to work. + // Run `bazel build internal:tsc_wrapped` from root folder + // (rules_typescript) to build the plugin. + // + // If you are using VSCode make sure you are using the workspace version + // of TS, otherwise the plugin won't be loaded. Also, make sure you have + // opened the repo as workspace (from the root folder). { "name": "../../bazel-bin/internal/tsetse/language_service_plugin.js" } From 53ed984075d6d8fb0bc6b9bf51528457054626c2 Mon Sep 17 00:00:00 2001 From: pwng Date: Mon, 7 Sep 2020 10:19:49 -0700 Subject: [PATCH 312/316] Fix the type matching bug in Tsetse property matcher. PiperOrigin-RevId: 330396496 --- internal/tsetse/util/property_matcher.ts | 2 +- internal/tsetse/util/property_matcher_test.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/internal/tsetse/util/property_matcher.ts b/internal/tsetse/util/property_matcher.ts index a8b3a4ba..0caea62f 100644 --- a/internal/tsetse/util/property_matcher.ts +++ b/internal/tsetse/util/property_matcher.ts @@ -55,6 +55,6 @@ export class PropertyMatcher { } const baseTypes = inspectedType.getBaseTypes() || []; - return baseTypes.some(base => this.exactTypeMatches(base)); + return baseTypes.some(base => this.typeMatches(base)); } } diff --git a/internal/tsetse/util/property_matcher_test.ts b/internal/tsetse/util/property_matcher_test.ts index 4fa55aa5..74fded8f 100644 --- a/internal/tsetse/util/property_matcher_test.ts +++ b/internal/tsetse/util/property_matcher_test.ts @@ -79,6 +79,27 @@ describe('PropertyMatcher', () => { }); }); + it('matches property on indirect base types', () => { + const config = { + errorCode: ErrorCode.CONFORMANCE_PATTERN, + errorMessage: 'No Element#innerHTML access', + kind: PatternKind.BANNED_PROPERTY_WRITE, + values: ['Element.prototype.innerHTML'], + }; + // Element is an indirect base of HTMLDivElement (HTMLDivElement extends + // HTMLElement, which extends Element). + const proprAcessOnIndirectBaseType = + `declare var div: HTMLDivElement; div.innerHTML = 'foo'`; + + const results = compileAndCheck( + new ConformancePatternRule(config), proprAcessOnIndirectBaseType); + + expect(results).toHaveFailuresMatching({ + matchedCode: `div.innerHTML = 'foo'`, + messageText: 'No Element#innerHTML access', + }); + }); + it('does not match in-module defined type', () => { const config = { errorCode: ErrorCode.CONFORMANCE_PATTERN, From 25392e3410989e2252d15feb0c634827aaaf3efa Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 8 Sep 2020 16:22:09 -0700 Subject: [PATCH 313/316] -- Change 1 of 1 by Paul Gschwendtner : fix(tsc_wrapped): do not leak generated module name from previous compilations Currently, the compiler host in `@bazel/typescript` assigns a `moduleName` to source files when the module format is AMD or UMD. It does that so that devmode compilations (which by default use the module kinds as mentioned above), have unique module names for all compilation source files. This is necessary so that the JS output can run inside browsers and node in a concatenated way. The update of the `moduleName` for source files is critical though, because source files are re-used/cached across compilations. For example, an initial compilation might be for AMD devmode where the module name is computed and set to the source file. In a followed compilation in _devmode_, the module name will be still set by accident and the compilation output could unexpectedly be based on the module name that does not work in the prodmode output (where for example relative paths are expected). Another scenario would be that the `moduleName` has changed in the second compilation through an update to the `module_name` rule attribute. The host will now throw an error because it _thinks_ that there are conflicting module names for the source file. This results in the commonly known error looking as followed: ``` Compiling Angular templates (Ivy - devmode) <..> failed (Exit 1) Error: ERROR: <..>/index.ts contains a module name declaration @angular/in-memory-web-api which would be overwritten with angular-in-memory-web-api by Bazel's TypeScript compiler. ``` We can fix this by not permanently persisting the `moduleName` in the source file files. We do this by reseting the module name when the compilation module kind changes (to a format where the generated AMD module names are no longer desired). Ideally we'd create recursive clones for source files when returning them from the file loader, so that the actual cache is never invalidated accidentally (e.g. through the module name change). It seems that this is not achievable in a reasonable way as it complicates and slows-down the cache significantly (due to a recursive clone & increased memory consumption). Additionally, the idea of using a `Proxy` has been considered, but it seems that a proxy is slightly behaving different than an actual property on the source file object (most likely due to scope binding when the module name is not directly part of the source file; I wasn't able to get it work reliably in _all_ cases; the proxy would be more complex than initially anticipated too as TS relies on enumeration for source file objects; and more). Regardless of that though, it seems like cloning the full source file is not necessarily needed though. We can assume that TypeScript will not modify/invalidate essential information for cached source files through an emit. ds Closes #504 PiperOrigin-RevId: 330609958 --- CODEOWNERS | 2 +- internal/tsc_wrapped/compiler_host.ts | 24 +++++++++++++-- internal/tsc_wrapped/compiler_host_test.ts | 34 ++++++++++++++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index b1485d04..eb75e738 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @mgechev @kyliau @alexeagle \ No newline at end of file +* @kyliau @alexeagle diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts index 2b7113b1..dba7de30 100644 --- a/internal/tsc_wrapped/compiler_host.ts +++ b/internal/tsc_wrapped/compiler_host.ts @@ -443,7 +443,9 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { fileName: string, languageVersion: ts.ScriptTarget, onError?: (message: string) => void) { return perfTrace.wrap(`getSourceFile ${fileName}`, () => { - const sf = this.fileLoader.loadFile(fileName, fileName, languageVersion); + const sf = this.fileLoader.loadFile(fileName, fileName, languageVersion) as + ts.SourceFile&{_hasGeneratedAmdModuleName?: boolean}; + if (!/\.d\.tsx?$/.test(fileName) && (this.options.module === ts.ModuleKind.AMD || this.options.module === ts.ModuleKind.UMD)) { @@ -456,10 +458,26 @@ export class CompilerHost implements ts.CompilerHost, tsickle.TsickleHost { `which would be overwritten with ${moduleName} ` + `by Bazel's TypeScript compiler.`); } - // Setting the moduleName is equivalent to the original source having a - // /// directive + // Setting the moduleName is equivalent to the original source having the triple + // slash `///` directive. Also note that we tag + // source files for which we assigned a generated module name. This is necessary + // so that we can reset the module name when the same source file is loaded from + // a cache, but with a different module format where the auto-generated module + // names are not desirable. The module name should not leak from previous + // compilations through a potential source file cache. + sf._hasGeneratedAmdModuleName = true; sf.moduleName = moduleName; + return sf; + } + + // If the loaded source file has a generated amd module name applied from + // previous compilations (in worker mode), reset the file module name + // as neither the UMD or AMD module format is used (for which we generate + // the AMD module names automatically). + if (sf._hasGeneratedAmdModuleName) { + sf.moduleName = undefined; } + return sf; }); } diff --git a/internal/tsc_wrapped/compiler_host_test.ts b/internal/tsc_wrapped/compiler_host_test.ts index 6eab46ed..93bc096f 100644 --- a/internal/tsc_wrapped/compiler_host_test.ts +++ b/internal/tsc_wrapped/compiler_host_test.ts @@ -4,6 +4,7 @@ import * as ts from 'typescript'; import {CompilerHost} from './compiler_host'; import {BazelOptions} from './tsconfig'; +import { FileLoader } from './cache'; describe('compiler host', () => { describe('computes the amd module name of a .ts source file', () => { @@ -78,4 +79,37 @@ describe('compiler host', () => { }); }); }); + + describe('#getSourceFile', () => { + + it('should not leak generated AMD module name between compilations with cache', () => { + const compilerOpts: ts.CompilerOptions = { + rootDirs: ['.'], + rootDir: '.', + outDir: './dist', + module: ts.ModuleKind.AMD, + }; + const bazelOptions = { + workspaceName: 'my_wksp', + package: 'src/test', + compilationTargetSrc: ["test.ts"] + }; + const originalFile = ts.createSourceFile('test.ts', 'export const X = 1;', + ts.ScriptTarget.ES2015, true); + const fileLoader: FileLoader = { + fileExists: () => true, + loadFile: () => originalFile, + }; + const tsHost = ts.createCompilerHost(compilerOpts, true); + const umdBuildHost = new CompilerHost([], compilerOpts, + bazelOptions as any, tsHost, fileLoader); + const es2015BuildHost = new CompilerHost([], {...compilerOpts, module: ts.ModuleKind.ES2015}, + bazelOptions as any, tsHost, fileLoader); + + expect(umdBuildHost.getSourceFile('test.ts', ts.ScriptTarget.ES2015).moduleName) + .toBe('my_wksp/test'); + expect(es2015BuildHost.getSourceFile('test.ts', ts.ScriptTarget.ES2015).moduleName) + .toBe(undefined, 'Expected source file to not have module name from previous host.'); + }); + }); }); From d53a7d2ae26d7c23fcddfbf30f760a884f520a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=B9d=C5=8Dng=20Y=C3=A1ng?= Date: Tue, 8 Sep 2020 19:32:25 -0700 Subject: [PATCH 314/316] Remove deprecated flag from bazelrc --experimental_allow_incremental_repository_updates has been deleted in https://github.com/bazelbuild/bazel/commit/fdf10c34c82c563fb7fc7f262de32e1f7af59e2d Closes #503 PiperOrigin-RevId: 330637619 --- .bazelrc | 3 --- 1 file changed, 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index 01026c92..adf60bc7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -7,6 +7,3 @@ test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test # Turn off legacy external runfiles run --nolegacy_external_runfiles test --nolegacy_external_runfiles - -# Enable the "Managed Directories" feature -common --experimental_allow_incremental_repository_updates From 49876e174ca7e8edf11f828a3362d1167c933313 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Wed, 9 Sep 2020 10:44:01 -0700 Subject: [PATCH 315/316] fix: tsetse checker must be initialized with latest program Since ts.Program is an immutable data structure, the tsetse checker must get hold of a new instance of the ts.Program every time `getSemanticDiagnostics` is called. There is no way to do this currently, so just create a new tsetse Checker instance every time. Closes #506 PiperOrigin-RevId: 330752912 --- internal/tsetse/language_service_plugin.ts | 31 +++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/internal/tsetse/language_service_plugin.ts b/internal/tsetse/language_service_plugin.ts index 4969f4db..525241dd 100644 --- a/internal/tsetse/language_service_plugin.ts +++ b/internal/tsetse/language_service_plugin.ts @@ -10,26 +10,21 @@ function init() { return { create(info: ts.server.PluginCreateInfo) { const oldService = info.languageService; - const program = oldService.getProgram(); - - // Signature of `getProgram` is `getProgram(): Program | undefined;` in - // ts 3.1 so we must check if the return value is valid to compile with - // ts 3.1. - if (!program) { - throw new Error( - 'Failed to initialize tsetse language_service_plugin: program is undefined'); - } - - const checker = new Checker(program); - - // Add disabledRules to tsconfig to disable specific rules - // "plugins": [ - // {"name": "...", "disabledRules": ["equals-nan"]} - // ] - registerRules(checker, info.config.disabledRules || []); - const proxy = pluginApi.createProxy(oldService); proxy.getSemanticDiagnostics = (fileName: string) => { + const program = oldService.getProgram(); + if (!program) { + throw new Error( + 'Failed to initialize tsetse language_service_plugin: program is undefined'); + } + + const checker = new Checker(program); + + // Add disabledRules to tsconfig to disable specific rules + // "plugins": [ + // {"name": "...", "disabledRules": ["equals-nan"]} + // ] + registerRules(checker, info.config.disabledRules || []); const result = [...oldService.getSemanticDiagnostics(fileName)]; // Note that this ignores suggested fixes. result.push(...checker.execute(program.getSourceFile(fileName)!) From 5b33837b31d5f8c26852885c689a34aa2c7c63b3 Mon Sep 17 00:00:00 2001 From: Philipp Wollermann Date: Fri, 23 Oct 2020 16:43:10 +0200 Subject: [PATCH 316/316] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b1aceba..d1e0e064 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# build_bazel_rules_typescript +# Moved to rules_nodejs monorepo: https://github.com/bazelbuild/rules_nodejs/tree/3.x/third_party/github.com/bazelbuild/rules_typescript + +**Readme content is preserved below to avoid breaking links** This repo contains a mirror of some Google-internal bits that support TypeScript development under Bazel.