diff --git a/.circleci/config.yml b/.circleci/config.yml index 865710df5eb3..c02a15a576f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,19 +1,38 @@ -version: 2 +# Configuration file for https://circleci.com/gh/angular/angular-cli + +# 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/ + +# Variables + +## IMPORTANT +# If you change the `docker_image` version, also change the `cache_key` suffix and the version of +# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file. +var_1: &docker_image angular/ngcontainer:0.3.3 +var_2: &cache_key angular_devkit-{{ checksum "yarn.lock" }}-0.3.3-2 -_defaults: &defaults +# Settings common to each job +anchor_1: &defaults working_directory: ~/ng docker: - - image: angular/ngcontainer:0.3.3 + - image: *docker_image -_post_checkout: &post_checkout +# 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" - -_root_package_lock_key: &root_package_lock_key - key: angular_devkit-{{ checksum "yarn.lock" }}-0.3.3-2 - -_attach_options: &attach_options +anchor_3: &root_package_lock_key + key: *cache_key +anchor_4: &attach_options at: . +# Job definitions +version: 2 jobs: install: <<: *defaults @@ -80,7 +99,7 @@ jobs: steps: - attach_workspace: *attach_options - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - - run: bazel build //packages/... + - run: bazel test //packages/... snapshot_publish: <<: *defaults diff --git a/BUILD b/BUILD index 64f2b78d0ee5..5b9205d3eef1 100644 --- a/BUILD +++ b/BUILD @@ -15,6 +15,24 @@ exports_files([ # @external_begin filegroup( name = "node_modules", - srcs = glob(["node_modules/**/*"]), + srcs = glob( + # Only include files we might use, to reduce the file count and surface size of + # filename problems. + [ + "node_modules/**/*.js", + "node_modules/**/*.json", + "node_modules/**/*.d.ts", + ], + exclude = [ + # e.g. node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt + "node_modules/**/test/**", + # e.g. node_modules/xpath/docs/function resolvers.md + "node_modules/**/docs/**", + # e.g. node_modules/puppeteer/.local-chromium/mac-536395/chrome-mac/Chromium.app/Contents/Versions/66.0.3347.0/Chromium Framework.framework/Chromium Framework + "node_modules/**/.*/**", + # Ignore paths with spaces. + "node_modules/**/* *", + ], + ) + glob(["node_modules/.bin/*"]), ) # @external_end diff --git a/WORKSPACE b/WORKSPACE index 794f4f95a035..3647c4e935d3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,52 +1,66 @@ workspace(name = "angular_devkit") +# We get Buildifier from here. http_archive( - name = "build_bazel_rules_nodejs", - url = "https://github.com/bazelbuild/rules_nodejs/archive/0.4.1.zip", - strip_prefix = "rules_nodejs-0.4.1", - sha256 = "e9bc013417272b17f302dc169ad597f05561bb277451f010043f4da493417607", + name = "com_github_bazelbuild_buildtools", + url = "https://github.com/bazelbuild/buildtools/archive/0.15.0.zip", + strip_prefix = "buildtools-0.15.0", + sha256 = "76d1837a86fa6ef5b4a07438f8489f00bfa1b841e5643b618e01232ba884b1fe", ) -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories") +load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies") +buildifier_dependencies() -check_bazel_version("0.9.0") -node_repositories(package_json = ["//:package.json"]) +# The Go toolchain is used for Buildifier. +# rules_typescript_dependencies() also tries to load it but we add it explicitely so we +# don't have hidden dependencies. +# This also means we need to load it before rules_typescript_dependencies(). +http_archive( + name = "io_bazel_rules_go", + url = "https://github.com/bazelbuild/rules_go/archive/0.14.0.zip", + strip_prefix = "rules_go-0.14.0", + sha256 = "9bd7c2743f014e4e112b671098ba1da6aec036fe07093b10ca39a9f81ec5cc33", +) -local_repository( - name = "rxjs", - path = "node_modules/rxjs/src", +load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies") +go_rules_dependencies() +go_register_toolchains() + +# We need a minimum of this version to include https://github.com/bazelbuild/rules_nodejs/pull/281. +http_archive( + name = "build_bazel_rules_nodejs", + url = "https://github.com/bazelbuild/rules_nodejs/archive/c75e3dd0571b0937e3ce0c4f0e6b6b50d90468f0.zip", + strip_prefix = "rules_nodejs-c75e3dd0571b0937e3ce0c4f0e6b6b50d90468f0", + sha256 = "b78506ddaed7c682027f873d2bd50086a28570b3187da9fa16fe1672eed3015e", ) -# Pick up the fix for source-map typings -RULES_TYPESCRIPT_VERSION = "00f8fd5467f2b12ac2fbb8d74ea81d2dd5636d31" +# Load the TypeScript rules, its dependencies, and setup the workspace. http_archive( name = "build_bazel_rules_typescript", - url = "https://github.com/bazelbuild/rules_typescript/archive/%s.zip" % RULES_TYPESCRIPT_VERSION, - strip_prefix = "rules_typescript-%s" % RULES_TYPESCRIPT_VERSION, - sha256 = "3606b97a4859cc3f73b47888618b14290cf4b93c411b1bedd821e8bb39b3442b", + url = "https://github.com/bazelbuild/rules_typescript/archive/0.16.1.zip", + strip_prefix = "rules_typescript-0.16.1", + sha256 = "5b2b0bc63cfcffe7bf97cad2dad3b26a73362f806de66207051f66c87956a995", ) -load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") +load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies") +# build_bazel_rules_nodejs is loaded transitively through rules_typescript_dependencies. +rules_typescript_dependencies() +load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace") ts_setup_workspace() -# We get tools like Buildifier from here -git_repository( - name = "com_github_bazelbuild_buildtools", - remote = "https://github.com/bazelbuild/buildtools.git", - commit = "b3b620e8bcff18ed3378cd3f35ebeb7016d71f71", -) +# Load the nodejs dependencies, check minimum Bazel version, and define the local node_modules. +load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies") +rules_nodejs_dependencies() -# The Go toolchain is used for Buildifier and some TypeScript tooling. -http_archive( - name = "io_bazel_rules_go", - url = "https://github.com/bazelbuild/rules_go/releases/download/0.7.1/rules_go-0.7.1.tar.gz", - sha256 = "341d5eacef704415386974bc82a1783a8b7ffbff2ab6ba02375e1ca20d9b031c", +load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories") +check_bazel_version("0.15.0") +node_repositories( + package_json = ["//:package.json"], + preserve_symlinks = True, ) -load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") - -go_rules_dependencies() - -go_register_toolchains() - +local_repository( + name = "rxjs", + path = "node_modules/rxjs/src", +) diff --git a/package.json b/package.json index f08145786504..4936df3a1966 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "typescript": "~2.9.2" }, "devDependencies": { + "@bazel/typescript": "0.16.1", "@ngtools/json-schema": "^1.1.0", "@types/copy-webpack-plugin": "^4.4.1", "@types/express": "^4.16.0", @@ -91,6 +92,7 @@ "license-checker": "^20.1.0", "minimatch": "^3.0.4", "minimist": "^1.2.0", + "rxjs": "^6.0.0", "semver": "^5.3.0", "source-map": "^0.5.6", "source-map-support": "^0.5.0", diff --git a/packages/angular/cli/BUILD b/packages/angular/cli/BUILD index 160577763c8e..471f0d42475a 100644 --- a/packages/angular/cli/BUILD +++ b/packages/angular/cli/BUILD @@ -5,7 +5,7 @@ licenses(["notice"]) # MIT -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) @@ -19,6 +19,7 @@ ts_library( ], ), data = glob(["**/*.json"]), + module_name = "@angular/cli", deps = [ "//packages/angular_devkit/architect", "//packages/angular_devkit/core", @@ -30,5 +31,4 @@ ts_library( # @typings: node # @typings: semver ], - tsconfig = "//:tsconfig.json" ) diff --git a/packages/angular/pwa/BUILD b/packages/angular/pwa/BUILD index 06a976adb0f5..80cc6f59bedf 100644 --- a/packages/angular/pwa/BUILD +++ b/packages/angular/pwa/BUILD @@ -5,7 +5,7 @@ licenses(["notice"]) # MIT -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) @@ -24,12 +24,11 @@ ts_library( "**/*_spec_large.ts", ], ), + # Borrow the compile-time deps of the typescript compiler + # Just to avoid an extra npm install action. + node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules", deps = [ "//packages/angular_devkit/core", "//packages/angular_devkit/schematics", ], - tsconfig = "//:tsconfig.json", - # Borrow the compile-time deps of the typescript compiler - # Just to avoid an extra npm install action. - node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules", ) diff --git a/packages/angular_devkit/architect/BUILD b/packages/angular_devkit/architect/BUILD index feb7cfc248f4..c7d7d97b98b1 100644 --- a/packages/angular_devkit/architect/BUILD +++ b/packages/angular_devkit/architect/BUILD @@ -5,24 +5,21 @@ licenses(["notice"]) # MIT -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) ts_library( name = "architect", srcs = glob( - ["src/**/*.ts"], - # Currently, this library is used only with the rollup plugin. - # To make it simpler for downstream repositories to compile this, we - # neither provide compile-time deps as an `npm_install` rule, nor do we - # expect the downstream repository to install @types/webpack[-*] - # So we exclude files that depend on webpack typings. + include = ["src/**/*.ts"], exclude = [ "**/*_spec.ts", "**/*_spec_large.ts", ], ), + module_name = "@angular-devkit/architect", + module_root = "src/index.d.ts", data = glob(["**/*.json"]), deps = [ "//packages/angular_devkit/core", @@ -30,10 +27,4 @@ ts_library( "@rxjs", "@rxjs//operators", ], - tsconfig = "//:tsconfig.json", - module_name = "@angular-devkit/architect", - module_root = "src", - # Borrow the compile-time deps of the typescript compiler - # Just to avoid an extra npm install action. - node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules", ) diff --git a/packages/angular_devkit/architect_cli/BUILD b/packages/angular_devkit/architect_cli/BUILD index 439d34191d33..8beaa43550fe 100644 --- a/packages/angular_devkit/architect_cli/BUILD +++ b/packages/angular_devkit/architect_cli/BUILD @@ -4,15 +4,16 @@ # found in the LICENSE file at https://angular.io/license package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # MIT ts_library( - name = "architect-cli", + name = "architect_cli", srcs = [ "bin/architect.ts", ], + module_name = "@angular-devkit/architect-cli", deps = [ "//packages/angular_devkit/architect", "//packages/angular_devkit/core", @@ -20,7 +21,4 @@ ts_library( "@rxjs", "@rxjs//operators", ], - tsconfig = "//:tsconfig.json", - module_name = "@angular-devkit/architect-cli", - module_root = "bin", ) diff --git a/packages/angular_devkit/build_optimizer/BUILD b/packages/angular_devkit/build_optimizer/BUILD index 054aef5dedf5..a733b2a06d36 100644 --- a/packages/angular_devkit/build_optimizer/BUILD +++ b/packages/angular_devkit/build_optimizer/BUILD @@ -5,29 +5,44 @@ licenses(["notice"]) # MIT -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") package(default_visibility = ["//visibility:public"]) ts_library( - name = "lib", + name = "build_optimizer", srcs = glob( - ["**/*.ts"], - # Currently, this library is used only with the rollup plugin. - # To make it simpler for downstream repositories to compile this, we - # neither provide compile-time deps as an `npm_install` rule, nor do we - # expect the downstream repository to install @types/webpack[-*] - # So we exclude files that depend on webpack typings. + include = ["src/**/*.ts"], exclude = [ - "src/build-optimizer/webpack-loader.ts", - "src/purify/**", - "src/index.ts", - "**/*_spec.ts", - "**/*_spec_large.ts", + # TODO(@filipesilva): shouldn't need to exclude the cli files but can't exclude them + # from jasmine_node_test. + "src/**/cli.ts", + "src/**/*_spec.ts", + "src/**/*_spec_large.ts", + "src/**/*_benchmark.ts", ], ), - tsconfig = "//:tsconfig.json", - # Borrow the compile-time deps of the typescript compiler - # Just to avoid an extra npm install action. - node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules", + deps = [], ) + +ts_library( + name = "build_optimizer_test_lib", + srcs = glob( + include = [ + "src/**/*_spec.ts", + "src/**/*_spec_large.ts", + ], + ), + deps = [ + ":build_optimizer", + "//packages/angular_devkit/core", + # @typings: jasmine + # @typings: node + ], +) + +jasmine_node_test( + name = "build_optimizer_test", + srcs = [":build_optimizer_test_lib"], +) \ No newline at end of file diff --git a/packages/angular_devkit/core/BUILD b/packages/angular_devkit/core/BUILD index 9e782d487d9b..770dcf3adc77 100644 --- a/packages/angular_devkit/core/BUILD +++ b/packages/angular_devkit/core/BUILD @@ -4,10 +4,13 @@ # found in the LICENSE file at https://angular.io/license package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") licenses(["notice"]) # MIT License +# @angular-devkit/core + ts_library( name = "core", srcs = glob( @@ -20,7 +23,7 @@ ts_library( ), data = glob(["**/*.json"]), module_name = "@angular-devkit/core", - module_root = "src", + module_root = "src/index.d.ts", deps = [ "@rxjs", "@rxjs//operators", @@ -33,20 +36,51 @@ ts_library( ], ) +ts_library( + name = "core_test_lib", + srcs = glob( + include = [ + "src/**/*_spec.ts", + "src/**/*_spec_large.ts", + ], + ), + deps = [ + ":core", + ":node", + "@rxjs", + "@rxjs//operators", + # @typings: jasmine + # @typings: node + ], + data = [ + "src/workspace/workspace-schema.json", + "src/workspace/test/test-workspace.json" + ], +) + +jasmine_node_test( + name = "core_test", + srcs = [":core_test_lib"], +) + + +# @angular-devkit/core/node + ts_library( name = "node", srcs = glob( include = ["node/**/*.ts"], exclude = [ + "node/testing/**/*.ts", "node/**/*_spec.ts", "node/**/*_spec_large.ts", - "tools/**/*_benchmark.ts", + "node/**/*_benchmark.ts", ], ), module_name = "@angular-devkit/core/node", - module_root = "node", + module_root = "node/index.d.ts", deps = [ - "//packages/angular_devkit/core", + ":core", "@rxjs", "@rxjs//operators", # @typings: node @@ -54,11 +88,11 @@ ts_library( ) ts_library( - name = "spec", + name = "node_test_lib", srcs = glob( include = [ - "**/*_spec.ts", - "**/*_spec_large.ts", + "node/**/*_spec.ts", + "node/**/*_spec_large.ts", ], ), deps = [ @@ -70,3 +104,32 @@ ts_library( # @typings: node ], ) + +jasmine_node_test( + name = "node_test", + srcs = [":node_test_lib"], +) + + +# @angular-devkit/core/node/testing + +ts_library( + name = "node_testing", + srcs = glob( + include = ["node/testing/**/*.ts"], + exclude = [ + "node/testing/**/*_spec.ts", + "node/testing/**/*_spec_large.ts", + "node/testing/**/*_benchmark.ts", + ], + ), + module_name = "@angular-devkit/core/node/testing", + module_root = "node/testing/index.d.ts", + deps = [ + ":core", + ":node", + "@rxjs", + "@rxjs//operators", + # @typings: node + ], +) \ No newline at end of file diff --git a/packages/angular_devkit/core/node/resolve_spec.ts b/packages/angular_devkit/core/node/resolve_spec.ts index 9ecf1dec3bef..03bed1baa803 100644 --- a/packages/angular_devkit/core/node/resolve_spec.ts +++ b/packages/angular_devkit/core/node/resolve_spec.ts @@ -8,15 +8,12 @@ // tslint:disable:no-any // tslint:disable-next-line:no-implicit-dependencies import { resolve } from '@angular-devkit/core/node'; -import * as path from 'path'; - -const devKitRoot = (global as any)._DevKitRoot; describe('resolve', () => { it('works', () => { - expect(resolve('tslint', { basedir: __dirname })) - .toBe(path.join(devKitRoot, 'node_modules/tslint/lib/index.js')); + const tslintRe = /[\\/]node_modules[\\/]tslint[\\/]lib[\\/]index.js$/; + expect(resolve('tslint', { basedir: __dirname })).toMatch(tslintRe); expect(() => resolve('npm', { basedir: '/' })).toThrow(); diff --git a/tests/angular_devkit/core/workspace/angular-workspace.json b/packages/angular_devkit/core/src/workspace/test/test-workspace.json similarity index 100% rename from tests/angular_devkit/core/workspace/angular-workspace.json rename to packages/angular_devkit/core/src/workspace/test/test-workspace.json diff --git a/packages/angular_devkit/core/src/workspace/workspace.ts b/packages/angular_devkit/core/src/workspace/workspace.ts index 25885d36a910..a4252a9ee5b7 100644 --- a/packages/angular_devkit/core/src/workspace/workspace.ts +++ b/packages/angular_devkit/core/src/workspace/workspace.ts @@ -56,7 +56,7 @@ export class AmbiguousProjectPathException extends BaseException { } export class Workspace { - private readonly _workspaceSchemaPath = join(normalize(__dirname), 'workspace-schema.json'); + private readonly _workspaceSchemaPath = normalize(require.resolve('./workspace-schema.json')); private _workspaceSchema: JsonObject; private _workspace: WorkspaceSchema; private _registry: schema.CoreSchemaRegistry; diff --git a/packages/angular_devkit/core/src/workspace/workspace_spec.ts b/packages/angular_devkit/core/src/workspace/workspace_spec.ts index ae98d2a012a8..534236bf7a23 100644 --- a/packages/angular_devkit/core/src/workspace/workspace_spec.ts +++ b/packages/angular_devkit/core/src/workspace/workspace_spec.ts @@ -10,7 +10,8 @@ import { tap } from 'rxjs/operators'; import { schema } from '..'; import { NodeJsSyncHost } from '../../node'; -import { join, normalize } from '../virtual-fs'; +import { AdditionalPropertiesValidatorError } from '../json/schema/interface'; +import { dirname, join, normalize } from '../virtual-fs'; import { ProjectNotFoundException, Workspace, @@ -115,10 +116,10 @@ describe('Workspace', () => { }); it('loads workspace from host', (done) => { - const devkitRoot = normalize((global as any)._DevKitRoot); // tslint:disable-line:no-any - const workspaceRoot = join(devkitRoot, 'tests/angular_devkit/core/workspace'); + const workspacePath = require.resolve('./test/test-workspace.json'); + const workspaceRoot = dirname(normalize(workspacePath)); const workspace = new Workspace(workspaceRoot, host); - workspace.loadWorkspaceFromHost(normalize('angular-workspace.json')).pipe( + workspace.loadWorkspaceFromHost(normalize('test-workspace.json')).pipe( tap((ws) => expect(ws.getProject('app').root).toEqual(workspaceJson.projects['app'].root)), ).toPromise().then(done, done.fail); }); @@ -127,7 +128,14 @@ describe('Workspace', () => { const workspace = new Workspace(root, host); workspace.loadWorkspaceFromJson({ foo: 'bar' }) .toPromise().then(() => done.fail, (err) => { - expect(err).toEqual(jasmine.any(schema.SchemaValidationException)); + const validationErrors = [{ + keyword: 'additionalProperties', + dataPath: '', + schemaPath: '#/additionalProperties', + params: { additionalProperty: 'foo' }, + message: 'should NOT have additional properties', + } as AdditionalPropertiesValidatorError]; + expect(err).toEqual(new schema.SchemaValidationException(validationErrors)); done(); }); }); diff --git a/packages/angular_devkit/schematics/BUILD b/packages/angular_devkit/schematics/BUILD index 0d953c153a99..db9835277204 100644 --- a/packages/angular_devkit/schematics/BUILD +++ b/packages/angular_devkit/schematics/BUILD @@ -4,21 +4,25 @@ # found in the LICENSE file at https://angular.io/license package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") licenses(["notice"]) # MIT License +# @angular-devkit/schematics + ts_library( name = "schematics", srcs = glob( include = ["src/**/*.ts"], exclude = [ "src/**/*_spec.ts", + "src/**/*_spec_large.ts", "src/**/*_benchmark.ts", ], ), module_name = "@angular-devkit/schematics", - module_root = "src", + module_root = "src/index.d.ts", deps = [ "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", # TODO: get rid of this for 6.0 @@ -28,6 +32,34 @@ ts_library( ], ) +ts_library( + name = "schematics_test_lib", + srcs = glob( + include = [ + "src/**/*_spec.ts", + "src/**/*_spec_large.ts", + ], + ), + deps = [ + ":schematics", + ":testing", + "//packages/angular_devkit/core", + "//packages/angular_devkit/core:node", + "@rxjs", + "@rxjs//operators", + # @typings: jasmine + # @typings: node + ], +) + +jasmine_node_test( + name = "schematics_test", + srcs = [":schematics_test_lib"], +) + + +# @angular-devkit/schematics/tasks + ts_library( name = "tasks", srcs = glob( @@ -35,11 +67,11 @@ ts_library( exclude = [ "tasks/**/*_spec.ts", "tasks/**/*_benchmark.ts", + "tasks/tslint-fix/test/**/*", ], ), module_name = "@angular-devkit/schematics/tasks", - module_root = "tasks", - tsconfig = "//:tsconfig.json", + module_root = "tasks/index.d.ts", deps = [ ":schematics", "//packages/angular_devkit/core", @@ -53,73 +85,109 @@ ts_library( ) ts_library( - name = "tools", + name = "tasks_test_lib", srcs = glob( - include = ["tools/**/*.ts"], - exclude = [ - "tools/**/*_spec.ts", - "tools/**/*_benchmark.ts", + include = [ + "tasks/**/*_spec.ts", + "tasks/**/*_spec_large.ts", + "tasks/tslint-fix/test/**/*.ts", ], ), - module_name = "@angular-devkit/schematics/tools", - module_root = "tools", + data = [ + "tasks/tslint-fix/test/collection.json", + "tasks/tslint-fix/test/rules/customRuleRule.js", + ], deps = [ - ":schematics", ":tasks", + ":testing", + ":schematics", "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", + "//packages/angular_devkit/core:node_testing", "@rxjs", "@rxjs//operators", + # @typings: jasmine # @typings: node ], ) + +jasmine_node_test( + name = "tasks_test", + srcs = [":tasks_test_lib"], +) + + +# @angular-devkit/schematics/tools + ts_library( - name = "testing", + name = "tools", srcs = glob( - include = ["testing/**/*.ts"], - exclude = [], + include = ["tools/**/*.ts"], + exclude = [ + "tools/**/*_spec.ts", + "tools/**/*_benchmark.ts", + "tools/test/**/*.ts", + ], ), - module_name = "@angular-devkit/schematics/testing", - module_root = "testing", + module_name = "@angular-devkit/schematics/tools", + module_root = "tools/index.d.ts", deps = [ ":schematics", ":tasks", - ":tools", "//packages/angular_devkit/core", + "//packages/angular_devkit/core:node", "@rxjs", "@rxjs//operators", + # @typings: node ], ) ts_library( - name = "spec", + name = "tools_test_lib", srcs = glob( - include = ["src/**/*_spec.ts"], + include = [ + "tools/**/*_spec.ts", + "tools/**/*_spec_large.ts", + "tools/test/**/*.ts", + ], ), deps = [ + ":tools", + ":tasks", ":schematics", ":testing", "//packages/angular_devkit/core", + "//packages/angular_devkit/core:node", + "//tests/angular_devkit/schematics/tools/file-system-engine-host:file_system_engine_host_test_lib", "@rxjs", "@rxjs//operators", # @typings: jasmine + # @typings: node ], ) +jasmine_node_test( + name = "tools_test", + srcs = [":tools_test_lib"], +) + + +# @angular-devkit/schematics/testing + ts_library( - name = "tools_spec", + name = "testing", srcs = glob( - include = ["tools/**/*_spec.ts"], + include = ["testing/**/*.ts"], ), + module_name = "@angular-devkit/schematics/testing", + module_root = "testing/index.d.ts", deps = [ ":schematics", + ":tasks", ":tools", "//packages/angular_devkit/core", - "//packages/angular_devkit/core:node", "@rxjs", "@rxjs//operators", - # @typings: jasmine - # @typings: node ], -) +) \ No newline at end of file diff --git a/packages/angular_devkit/schematics/src/rules/call_spec.ts b/packages/angular_devkit/schematics/src/rules/call_spec.ts index 4d97a21c2df0..ffb9896c271c 100644 --- a/packages/angular_devkit/schematics/src/rules/call_spec.ts +++ b/packages/angular_devkit/schematics/src/rules/call_spec.ts @@ -35,7 +35,7 @@ describe('callSource', () => { callSource(source0, context) .toPromise() .then(() => done.fail(), err => { - expect(err.constructor).toBe(InvalidSourceResultException); + expect(err).toEqual(new InvalidSourceResultException()); }) .then(done, done.fail); }); @@ -46,7 +46,7 @@ describe('callSource', () => { callSource(source0, context) .toPromise() .then(() => done.fail(), err => { - expect(err.constructor).toBe(InvalidSourceResultException); + expect(err).toEqual(new InvalidSourceResultException({})); }) .then(done, done.fail); }); @@ -57,7 +57,7 @@ describe('callSource', () => { callSource(source0, context) .toPromise() .then(() => done.fail(), err => { - expect(err.constructor).toBe(InvalidSourceResultException); + expect(err).toEqual(new InvalidSourceResultException({})); }) .then(done, done.fail); }); @@ -95,7 +95,7 @@ describe('callRule', () => { callRule(rule0, tree0, context) .toPromise() .then(() => done.fail(), err => { - expect(err.constructor).toBe(InvalidRuleResultException); + expect(err).toEqual(new InvalidRuleResultException({})); }) .then(done, done.fail); }); @@ -107,7 +107,7 @@ describe('callRule', () => { callRule(rule0, tree0, context) .toPromise() .then(() => done.fail(), err => { - expect(err.constructor).toBe(InvalidRuleResultException); + expect(err).toEqual(new InvalidRuleResultException({})); }) .then(done, done.fail); }); diff --git a/packages/angular_devkit/schematics/src/sink/host_spec.ts b/packages/angular_devkit/schematics/src/sink/host_spec.ts index d537f08bc6f7..be52dd477838 100644 --- a/packages/angular_devkit/schematics/src/sink/host_spec.ts +++ b/packages/angular_devkit/schematics/src/sink/host_spec.ts @@ -8,7 +8,6 @@ // tslint:disable:no-implicit-dependencies import { normalize, virtualFs } from '@angular-devkit/core'; import { HostSink } from '@angular-devkit/schematics'; -import { fileBufferToString } from '../../../core/src/virtual-fs/host'; import { HostCreateTree, HostTree } from '../tree/host-tree'; import { optimize } from '../tree/static'; @@ -133,7 +132,7 @@ describe('FileSystemSink', () => { .toPromise() .then(() => { expect(host.sync.read(normalize('/file0')).toString()).toBe('hello'); - expect(fileBufferToString(host.sync.read(normalize('/file1')))).toBe('world'); + expect(virtualFs.fileBufferToString(host.sync.read(normalize('/file1')))).toBe('world'); }) .then(done, done.fail); }); diff --git a/packages/angular_devkit/schematics/tasks/tslint-fix/executor_spec.ts b/packages/angular_devkit/schematics/tasks/tslint-fix/executor_spec.ts index 19d5644dfa23..a25497ec6a50 100644 --- a/packages/angular_devkit/schematics/tasks/tslint-fix/executor_spec.ts +++ b/packages/angular_devkit/schematics/tasks/tslint-fix/executor_spec.ts @@ -14,12 +14,15 @@ import * as path from 'path'; import { Observable, concat } from 'rxjs'; import { catchError } from 'rxjs/operators'; +const isWindowsBazel = process.env.RUNFILES_MANIFEST_ONLY === '1' + && process.env.RUNFILES_MANIFEST_FILE; + describe('TsLintTaskExecutor', () => { it('works with config object', done => { const testRunner = new SchematicTestRunner( '@_/test', - path.join(__dirname, 'test/collection.json'), + require.resolve('./test/collection.json'), ); const host = new TempScopedNodeJsSyncHost(); @@ -35,7 +38,7 @@ describe('TsLintTaskExecutor', () => { it('shows errors with config object', done => { const testRunner = new SchematicTestRunner( '@_/test', - path.join(__dirname, 'test/collection.json'), + require.resolve('./test/collection.json'), ); const host = new TempScopedNodeJsSyncHost(); @@ -71,9 +74,17 @@ describe('TsLintTaskExecutor', () => { }); it('supports custom rules in the project (pass)', done => { + // This test is disabled on Windows Bazel runs because it relies on TSLint custom rule + // loading behavior, which doesn't work with runfile resolution. + if (isWindowsBazel) { + done(); + + return; + } + const testRunner = new SchematicTestRunner( '@_/test', - path.join(__dirname, 'test/collection.json'), + require.resolve('./test/collection.json'), ); const host = new TempScopedNodeJsSyncHost(); @@ -95,6 +106,14 @@ describe('TsLintTaskExecutor', () => { }); it('supports custom rules in the project (fail)', done => { + // This test is disabled on Windows Bazel runs because it relies on TSLint custom rule + // loading behavior, which doesn't work with runfile resolution. + if (isWindowsBazel) { + done(); + + return; + } + const testRunner = new SchematicTestRunner( '@_/test', path.join(__dirname, 'test/collection.json'), diff --git a/packages/angular_devkit/schematics/tools/export-ref_spec.ts b/packages/angular_devkit/schematics/tools/export-ref_spec.ts index 2afb00dc919a..d522df6db103 100644 --- a/packages/angular_devkit/schematics/tools/export-ref_spec.ts +++ b/packages/angular_devkit/schematics/tools/export-ref_spec.ts @@ -11,12 +11,16 @@ import { ExportStringRef } from './export-ref'; describe('ExportStringRef', () => { + // Depending on how the package is built the module might be either .js or .ts. + // To make expectations easier, we strip the extension. + const stripExtension = (p: string) => p.replace(/\.(j|t)s$/, ''); + it('works', () => { // META const ref = new ExportStringRef('./export-ref#ExportStringRef', __dirname); expect(ref.ref).toBe(ExportStringRef); expect(ref.path).toBe(__dirname); - expect(ref.module).toBe(path.join(__dirname, 'export-ref.ts')); + expect(stripExtension(ref.module)).toBe(path.join(__dirname, 'export-ref')); }); it('works without an inner ref', () => { @@ -24,7 +28,7 @@ describe('ExportStringRef', () => { const ref = new ExportStringRef(path.join(__dirname, 'export-ref')); expect(ref.ref).toBe(undefined); expect(ref.path).toBe(__dirname); - expect(ref.module).toBe(path.join(__dirname, 'export-ref.ts')); + expect(stripExtension(ref.module)).toBe(path.join(__dirname, 'export-ref')); }); it('returns the exports', () => { @@ -32,7 +36,7 @@ describe('ExportStringRef', () => { const ref = new ExportStringRef('./export-ref#ExportStringRef', __dirname, false); expect(ref.ref).toEqual({ ExportStringRef }); expect(ref.path).toBe(__dirname); - expect(ref.module).toBe(path.join(__dirname, 'export-ref.ts')); + expect(stripExtension(ref.module)).toBe(path.join(__dirname, 'export-ref')); }); it('works on package names', () => { @@ -42,13 +46,13 @@ describe('ExportStringRef', () => { ); expect(ref.ref).toEqual(CollectionCannotBeResolvedException); expect(ref.path).toBe(__dirname); - expect(ref.module).toBe(path.join(__dirname, 'index.ts')); + expect(stripExtension(ref.module)).toBe(path.join(__dirname, 'index')); }); it('works on directory', () => { // META const ref = new ExportStringRef(__dirname); expect(ref.path).toBe(__dirname); - expect(ref.module).toBe(path.join(__dirname, 'index.ts')); + expect(stripExtension(ref.module)).toBe(path.join(__dirname, 'index')); }); }); diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts index c8e2dc09cdfe..bc5d19fac843 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts @@ -13,6 +13,7 @@ import { virtualFs, } from '@angular-devkit/core'; import { NodeJsSyncHost } from '@angular-devkit/core/node'; +import { existsSync, statSync } from 'fs'; import { dirname, isAbsolute, join, resolve } from 'path'; import { Observable, from as observableFrom, of as observableOf, throwError } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; @@ -220,7 +221,6 @@ export abstract class FileSystemEngineHostBase implements throw new FactoryCannotBeResolvedException(name); } - const { path } = resolvedRef; let schema = partialDesc.schema; let schemaJson: JsonObject | undefined = undefined; if (schema) { @@ -230,6 +230,15 @@ export abstract class FileSystemEngineHostBase implements schemaJson = readJsonFile(schema) as JsonObject; } + // The schematic path is used to resolve URLs. + // We should be able to just do `dirname(resolvedRef.path)` but for compatibility with + // Bazel under Windows this directory needs to be resolved from the collection instead. + // This is needed because on Bazel under Windows the data files (such as the collection or + // url files) are not in the same place as the compiled JS. + const maybePath = join(collectionPath, partialDesc.factory); + const path = existsSync(maybePath) && statSync(maybePath).isDirectory() + ? maybePath : dirname(maybePath); + return this._transformSchematicDescription(name, collection, { ...partialDesc, schema, @@ -248,9 +257,7 @@ export abstract class FileSystemEngineHostBase implements return (context: FileSystemSchematicContext) => { // Resolve all file:///a/b/c/d from the schematic's own path, and not the current // path. - const root = normalize( - resolve(dirname(context.schematic.description.path), url.path || ''), - ); + const root = normalize(resolve(context.schematic.description.path, url.path || '')); return new HostCreateTree(new virtualFs.ScopedHost(new NodeJsSyncHost(), root)); }; diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host.ts index a230fd660440..431090dd3d55 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host.ts @@ -26,15 +26,22 @@ export class FileSystemEngineHost extends FileSystemEngineHostBase { constructor(protected _root: string) { super(); } protected _resolveCollectionPath(name: string): string { - // Allow `${_root}/${name}.json` as a collection. - if (existsSync(join(this._root, name + '.json'))) { - return join(this._root, name + '.json'); - } + try { + // Allow `${_root}/${name}.json` as a collection. + const maybePath = require.resolve(join(this._root, name + '.json')); + if (existsSync(maybePath)) { + return maybePath; + } + } catch (error) { } + + try { + // Allow `${_root}/${name}/collection.json. + const maybePath = require.resolve(join(this._root, name, 'collection.json')); + if (existsSync(maybePath)) { + return maybePath; + } + } catch (error) { } - // Allow `${_root}/${name}/collection.json. - if (existsSync(join(this._root, name, 'collection.json'))) { - return join(this._root, name, 'collection.json'); - } throw new CollectionCannotBeResolvedException(name); } diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts index 0acb0f4fc6f7..be374c5ac934 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host_spec.ts @@ -14,11 +14,9 @@ import { of as observableOf } from 'rxjs'; describe('FileSystemEngineHost', () => { - const devkitRoot = (global as any)._DevKitRoot; - const root = path.join( - devkitRoot, - 'tests/angular_devkit/schematics/tools/file-system-engine-host', - ); + // We need to resolve a file that actually exists, and not just a folder. + // tslint:disable-next-line:max-line-length + const root = path.join(path.dirname(require.resolve(__filename)), '../../../../tests/angular_devkit/schematics/tools/file-system-engine-host'); it('works', () => { const engineHost = new FileSystemEngineHost(root); diff --git a/packages/angular_devkit/schematics/tools/node-module-engine-host.ts b/packages/angular_devkit/schematics/tools/node-module-engine-host.ts index bd976fdf1654..93aa34dbafe0 100644 --- a/packages/angular_devkit/schematics/tools/node-module-engine-host.ts +++ b/packages/angular_devkit/schematics/tools/node-module-engine-host.ts @@ -74,7 +74,7 @@ export class NodeModulesEngineHost extends FileSystemEngineHostBase { protected _resolveCollectionPath(name: string): string { let collectionPath: string | undefined = undefined; - if (name.split('/').length > (name[0] == '@' ? 2 : 1)) { + if (name.replace(/\\/, '/').split('/').length > (name[0] == '@' ? 2 : 1)) { try { collectionPath = this._resolvePath(name, process.cwd()); } catch (_) { diff --git a/packages/angular_devkit/schematics_cli/BUILD b/packages/angular_devkit/schematics_cli/BUILD index 6eaec4ee0a3e..d073108dddb4 100644 --- a/packages/angular_devkit/schematics_cli/BUILD +++ b/packages/angular_devkit/schematics_cli/BUILD @@ -4,12 +4,15 @@ # found in the LICENSE file at https://angular.io/license package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") licenses(["notice"]) # MIT License + +# @angular-devkit/schematics-cli + ts_library( - name = "schematics-cli", + name = "schematics_cli", srcs = glob( include = ["bin/**/*.ts"], exclude = [ @@ -20,7 +23,6 @@ ts_library( ), module_name = "@angular-devkit/schematics-cli", module_root = "bin", - tsconfig = "//:tsconfig.json", deps = [ "//packages/angular_devkit/core", "//packages/angular_devkit/core:node", @@ -31,4 +33,4 @@ ts_library( "@rxjs//operators", # @typings: minimist ], -) +) \ No newline at end of file diff --git a/packages/schematics/angular/BUILD b/packages/schematics/angular/BUILD index dff3834c5789..3613873f8215 100644 --- a/packages/schematics/angular/BUILD +++ b/packages/schematics/angular/BUILD @@ -5,23 +5,66 @@ licenses(["notice"]) # MIT -load("//tools:defaults.bzl", "ts_library") +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") + +package(default_visibility = ["//visibility:public"]) ts_library( - name = "utility", + name = "angular", srcs = glob( - include = ["utility/**/*.ts"], + include = ["**/*.ts"], exclude = [ - "utility/**/*_spec.ts", - "utility/test/**", + "**/*_spec.ts", + "**/*_spec_large.ts", + "**/*_benchmark.ts", + # Also exclude templated files. + "*/files/**/*.ts", + "*/other-files/**/*.ts", + # Exclude test helpers. + "utility/test/**/*.ts" ], ), - visibility = ["//visibility:public"], deps = [ "//packages/angular_devkit/core", "//packages/angular_devkit/schematics", "//packages/angular_devkit/schematics:tasks", + "@rxjs", + "@rxjs//operators", # @typings: typescript # @typings: node ], ) + +ts_library( + name = "angular_test_lib", + srcs = glob( + include = [ + "**/*_spec.ts", + "**/*_spec_large.ts", + "utility/test/**/*.ts" + ], + ), + data = glob( + include = [ + "**/*.json", + "*/files/**", + "*/other-files/**", + ] + ), + deps = [ + ":angular", + "//packages/angular_devkit/core", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics:testing", + "@rxjs", + "@rxjs//operators", + # @typings: jasmine + # @typings: node + ], +) + +jasmine_node_test( + name = "angular_test", + srcs = [":angular_test_lib"], +) diff --git a/packages/schematics/angular/app-shell/index_spec.ts b/packages/schematics/angular/app-shell/index_spec.ts index 50636c7b1199..d7ceb96785be 100644 --- a/packages/schematics/angular/app-shell/index_spec.ts +++ b/packages/schematics/angular/app-shell/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as AppShellOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as AppShellOptions } from './schema'; describe('App Shell Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: AppShellOptions = { name: 'foo', diff --git a/packages/schematics/angular/application/index_spec.ts b/packages/schematics/angular/application/index_spec.ts index 4bbd6b23f62c..aca5907287a2 100644 --- a/packages/schematics/angular/application/index_spec.ts +++ b/packages/schematics/angular/application/index_spec.ts @@ -7,7 +7,6 @@ */ // tslint:disable:no-big-function import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { latestVersions } from '../utility/latest-versions'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as ApplicationOptions } from './schema'; @@ -16,7 +15,7 @@ import { Schema as ApplicationOptions } from './schema'; describe('Application Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const workspaceOptions: WorkspaceOptions = { diff --git a/packages/schematics/angular/class/index_spec.ts b/packages/schematics/angular/class/index_spec.ts index 4bfaf6e087b7..2c2ec6faf9b0 100644 --- a/packages/schematics/angular/class/index_spec.ts +++ b/packages/schematics/angular/class/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as ClassOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as ClassOptions } from './schema'; describe('Class Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: ClassOptions = { name: 'foo', diff --git a/packages/schematics/angular/component/index_spec.ts b/packages/schematics/angular/component/index_spec.ts index f0961f2f2760..b73bd8aef7b2 100644 --- a/packages/schematics/angular/component/index_spec.ts +++ b/packages/schematics/angular/component/index_spec.ts @@ -7,7 +7,6 @@ */ // tslint:disable:no-big-function import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { createAppModule } from '../utility/test'; import { Schema as WorkspaceOptions } from '../workspace/schema'; @@ -17,7 +16,7 @@ import { Schema as ComponentOptions } from './schema'; describe('Component Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: ComponentOptions = { name: 'foo', diff --git a/packages/schematics/angular/directive/index_spec.ts b/packages/schematics/angular/directive/index_spec.ts index 32ace5f5fc03..dbd0dbc680e7 100644 --- a/packages/schematics/angular/directive/index_spec.ts +++ b/packages/schematics/angular/directive/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as DirectiveOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as DirectiveOptions } from './schema'; describe('Directive Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: DirectiveOptions = { name: 'foo', diff --git a/packages/schematics/angular/e2e/index_spec.ts b/packages/schematics/angular/e2e/index_spec.ts index 0da451c4f3e2..39bed6479f97 100644 --- a/packages/schematics/angular/e2e/index_spec.ts +++ b/packages/schematics/angular/e2e/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as E2eOptions } from './schema'; @@ -14,7 +13,7 @@ import { Schema as E2eOptions } from './schema'; describe('Application Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const workspaceOptions: WorkspaceOptions = { diff --git a/packages/schematics/angular/enum/index_spec.ts b/packages/schematics/angular/enum/index_spec.ts index 48d524bf6280..ec9bdd4c898c 100644 --- a/packages/schematics/angular/enum/index_spec.ts +++ b/packages/schematics/angular/enum/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as EnumOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as EnumOptions } from './schema'; describe('Enum Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: EnumOptions = { name: 'foo', diff --git a/packages/schematics/angular/guard/index_spec.ts b/packages/schematics/angular/guard/index_spec.ts index 82fcb8e0e0c6..59527dd5014f 100644 --- a/packages/schematics/angular/guard/index_spec.ts +++ b/packages/schematics/angular/guard/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as GuardOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as GuardOptions } from './schema'; describe('Guard Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: GuardOptions = { name: 'foo', diff --git a/packages/schematics/angular/interface/index_spec.ts b/packages/schematics/angular/interface/index_spec.ts index cc492329ea3a..9ce9e8b41cb0 100644 --- a/packages/schematics/angular/interface/index_spec.ts +++ b/packages/schematics/angular/interface/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as InterfaceOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as InterfaceOptions } from './schema'; describe('Interface Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: InterfaceOptions = { name: 'foo', diff --git a/packages/schematics/angular/library/index_spec.ts b/packages/schematics/angular/library/index_spec.ts index 76ff6a30930d..fe2d737128bf 100644 --- a/packages/schematics/angular/library/index_spec.ts +++ b/packages/schematics/angular/library/index_spec.ts @@ -7,7 +7,6 @@ */ // tslint:disable:no-big-function import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { getFileContent } from '../../angular/utility/test'; import { Schema as ComponentOptions } from '../component/schema'; import { latestVersions } from '../utility/latest-versions'; @@ -22,7 +21,7 @@ function getJsonFileContent(tree: UnitTestTree, path: string) { describe('Library Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/ng_packagr', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: GenerateLibrarySchema = { name: 'foo', diff --git a/packages/schematics/angular/migrations/update-6/index_spec.ts b/packages/schematics/angular/migrations/update-6/index_spec.ts index b8b291d563b5..1df2cd48932c 100644 --- a/packages/schematics/angular/migrations/update-6/index_spec.ts +++ b/packages/schematics/angular/migrations/update-6/index_spec.ts @@ -9,14 +9,13 @@ import { JsonObject } from '@angular-devkit/core'; import { EmptyTree } from '@angular-devkit/schematics'; import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { latestVersions } from '../../utility/latest-versions'; describe('Migration to v6', () => { const schematicRunner = new SchematicTestRunner( 'migrations', - path.join(__dirname, '../migration-collection.json'), + require.resolve('../migration-collection.json'), ); // tslint:disable-next-line:no-any diff --git a/packages/schematics/angular/module/index_spec.ts b/packages/schematics/angular/module/index_spec.ts index 00f8d698996f..13ff0c8f6a73 100644 --- a/packages/schematics/angular/module/index_spec.ts +++ b/packages/schematics/angular/module/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as ModuleOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as ModuleOptions } from './schema'; describe('Module Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: ModuleOptions = { name: 'foo', diff --git a/packages/schematics/angular/ng-new/index_spec.ts b/packages/schematics/angular/ng-new/index_spec.ts index 12ee5e92bfbf..268a3dd87508 100644 --- a/packages/schematics/angular/ng-new/index_spec.ts +++ b/packages/schematics/angular/ng-new/index_spec.ts @@ -6,14 +6,13 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as NgNewOptions } from './schema'; describe('Ng New Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: NgNewOptions = { name: 'foo', diff --git a/packages/schematics/angular/pipe/index_spec.ts b/packages/schematics/angular/pipe/index_spec.ts index 1a1fe1710d6c..4dee3b85f400 100644 --- a/packages/schematics/angular/pipe/index_spec.ts +++ b/packages/schematics/angular/pipe/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { createAppModule, getFileContent } from '../utility/test'; import { Schema as WorkspaceOptions } from '../workspace/schema'; @@ -16,7 +15,7 @@ import { Schema as PipeOptions } from './schema'; describe('Pipe Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: PipeOptions = { name: 'foo', diff --git a/packages/schematics/angular/service-worker/index_spec.ts b/packages/schematics/angular/service-worker/index_spec.ts index e6a6de9ffdcf..c64888f9248f 100644 --- a/packages/schematics/angular/service-worker/index_spec.ts +++ b/packages/schematics/angular/service-worker/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as ServiceWorkerOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as ServiceWorkerOptions } from './schema'; describe('Service Worker Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: ServiceWorkerOptions = { project: 'bar', diff --git a/packages/schematics/angular/service/index_spec.ts b/packages/schematics/angular/service/index_spec.ts index 2493d660ae28..3b00027eaeff 100644 --- a/packages/schematics/angular/service/index_spec.ts +++ b/packages/schematics/angular/service/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as ServiceOptions } from './schema'; @@ -15,7 +14,7 @@ import { Schema as ServiceOptions } from './schema'; describe('Service Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: ServiceOptions = { name: 'foo', diff --git a/packages/schematics/angular/universal/index_spec.ts b/packages/schematics/angular/universal/index_spec.ts index 262aa04882fd..7a5e3304172c 100644 --- a/packages/schematics/angular/universal/index_spec.ts +++ b/packages/schematics/angular/universal/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { Schema as ApplicationOptions } from '../application/schema'; import { Schema as WorkspaceOptions } from '../workspace/schema'; import { Schema as UniversalOptions } from './schema'; @@ -14,7 +13,7 @@ import { Schema as UniversalOptions } from './schema'; describe('Universal Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: UniversalOptions = { clientProject: 'bar', diff --git a/packages/schematics/angular/workspace/index_spec.ts b/packages/schematics/angular/workspace/index_spec.ts index 669403396c3c..6ddba08d3bea 100644 --- a/packages/schematics/angular/workspace/index_spec.ts +++ b/packages/schematics/angular/workspace/index_spec.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; -import * as path from 'path'; import { latestVersions } from '../utility/latest-versions'; import { Schema as WorkspaceOptions } from './schema'; @@ -14,7 +13,7 @@ import { Schema as WorkspaceOptions } from './schema'; describe('Workspace Schematic', () => { const schematicRunner = new SchematicTestRunner( '@schematics/angular', - path.join(__dirname, '../collection.json'), + require.resolve('../collection.json'), ); const defaultOptions: WorkspaceOptions = { name: 'foo', diff --git a/packages/schematics/update/BUILD b/packages/schematics/update/BUILD new file mode 100644 index 000000000000..2d2a7edfb953 --- /dev/null +++ b/packages/schematics/update/BUILD @@ -0,0 +1,61 @@ +# Copyright Google Inc. All Rights Reserved. +# +# Use of this source code is governed by an MIT-style license that can be +# found in the LICENSE file at https://angular.io/license + +licenses(["notice"]) # MIT + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") + +package(default_visibility = ["//visibility:public"]) + +ts_library( + name = "update", + srcs = glob( + include = ["**/*.ts"], + exclude = [ + "**/*_spec.ts", + "**/*_spec_large.ts", + "**/*_benchmark.ts", + ], + ), + deps = [ + "//packages/angular_devkit/core", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics:tasks", + "@rxjs", + "@rxjs//operators", + # @typings: node + ], +) + +ts_library( + name = "update_test_lib", + srcs = glob( + include = [ + "**/*_spec.ts", + "**/*_spec_large.ts", + ], + ), + data = glob( + include = [ + "**/*.json", + ] + ), + deps = [ + ":update", + "//packages/angular_devkit/core", + "//packages/angular_devkit/schematics", + "//packages/angular_devkit/schematics:testing", + "@rxjs", + "@rxjs//operators", + # @typings: jasmine + # @typings: node + ], +) + +jasmine_node_test( + name = "update_test", + srcs = [":update_test_lib"], +) \ No newline at end of file diff --git a/packages/schematics/update/migrate/index.ts b/packages/schematics/update/migrate/index.ts index db71a0b26ce8..d3db97b2ffc0 100644 --- a/packages/schematics/update/migrate/index.ts +++ b/packages/schematics/update/migrate/index.ts @@ -25,7 +25,6 @@ import { PostUpdateSchema } from './schema'; * 1-beta => 1.0.0-beta * * Exported for testing only. - * @internal */ export function _coerceVersionNumber(version: string): string | null { if (!version.match(/^\d{1,30}\.\d{1,30}\.\d{1,30}/)) { diff --git a/packages/schematics/update/migrate/index_spec.ts b/packages/schematics/update/migrate/index_spec.ts index fa9b3fd65593..ea5856f88e76 100644 --- a/packages/schematics/update/migrate/index_spec.ts +++ b/packages/schematics/update/migrate/index_spec.ts @@ -14,7 +14,8 @@ import { _coerceVersionNumber } from './index'; describe('@schematics/update:migrate', () => { const schematicRunner = new SchematicTestRunner( - '@schematics/update', __dirname + '/../collection.json', + '@schematics/update', + require.resolve('../collection.json'), ); let host: virtualFs.test.TestHost; let appTree: UnitTestTree = new UnitTestTree(new HostTree()); @@ -30,7 +31,7 @@ describe('@schematics/update:migrate', () => { // migrate schematic actually do work appropriately, in a separate test. schematicRunner.runSchematicAsync('migrate', { package: 'test', - collection: __dirname + '/test/migration.json', + collection: require.resolve('./test/migration.json'), from: '1.0.0', to: '2.0.0', }, appTree).pipe( diff --git a/packages/schematics/update/update/index_spec.ts b/packages/schematics/update/update/index_spec.ts index 7763642b47de..b1c7c936eba4 100644 --- a/packages/schematics/update/update/index_spec.ts +++ b/packages/schematics/update/update/index_spec.ts @@ -35,7 +35,8 @@ describe('angularMajorCompatGuarantee', () => { describe('@schematics/update', () => { const schematicRunner = new SchematicTestRunner( - '@schematics/update', __dirname + '/../collection.json', + '@schematics/update', + require.resolve('../collection.json'), ); let host: virtualFs.test.TestHost; let appTree: UnitTestTree = new UnitTestTree(new HostTree()); diff --git a/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD b/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD new file mode 100644 index 000000000000..dd3441d61396 --- /dev/null +++ b/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD @@ -0,0 +1,31 @@ +# Copyright Google Inc. All Rights Reserved. +# +# Use of this source code is governed by an MIT-style license that can be +# found in the LICENSE file at https://angular.io/license +package(default_visibility = ["//visibility:public"]) + +load("@build_bazel_rules_typescript//:defs.bzl", "ts_library") + +licenses(["notice"]) # MIT License + +ts_library( + name = "file_system_engine_host_test_lib", + srcs = glob( + include = [ + "**/*.ts", + ], + ), + data = glob( + include = ["**/collection.json"], + ), + deps = [ + "//packages/angular_devkit/schematics:schematics", + # ":testing", + # "//packages/angular_devkit/core", + # "//packages/angular_devkit/core:node", + # "@rxjs", + # "@rxjs//operators", + # @typings: jasmine + # @typings: node + ], +) \ No newline at end of file diff --git a/tools/defaults.bzl b/tools/defaults.bzl deleted file mode 100644 index ef30657b5401..000000000000 --- a/tools/defaults.bzl +++ /dev/null @@ -1,9 +0,0 @@ -"""Re-export of some bazel rules with repository-wide defaults.""" -load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library") - -DEFAULT_TSCONFIG = "//:tsconfig.json" - -def ts_library(tsconfig = None, **kwargs): - if not tsconfig: - tsconfig = DEFAULT_TSCONFIG - _ts_library(tsconfig = tsconfig, **kwargs) diff --git a/yarn.lock b/yarn.lock index b52027a1b6af..eb4c43fa21f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -87,6 +87,14 @@ dependencies: tslib "^1.9.0" +"@bazel/typescript@0.16.1": + version "0.16.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.16.1.tgz#5a5d145a17898bfadae8268cf942815424119412" + dependencies: + protobufjs "5.0.0" + tsickle "0.32.1" + tsutils "2.20.0" + "@ngtools/json-schema@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@ngtools/json-schema/-/json-schema-1.1.0.tgz#c3a0c544d62392acc2813a42c8a0dc6f58f86922" @@ -496,13 +504,6 @@ ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" -ajv@^4.9.1: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - ajv@^5.0.0, ajv@^5.1.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" @@ -686,6 +687,13 @@ asap@^2.0.0, asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" +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" + asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -704,10 +712,6 @@ 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" - assert@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" @@ -770,15 +774,11 @@ autoprefixer@^9.0.0: postcss "^7.0.2" postcss-value-parser "^3.2.3" -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.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" @@ -978,12 +978,6 @@ boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" -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" - bootstrap@^4.0.0: version "4.1.3" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be" @@ -1165,6 +1159,12 @@ builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" +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" @@ -1243,7 +1243,7 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0: +camelcase@^2.0.0, camelcase@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -1388,7 +1388,7 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" -cliui@^3.2.0: +cliui@^3.0.3, cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" dependencies: @@ -1496,13 +1496,17 @@ colorspace@1.1.x: color "3.0.x" text-hex "1.0.x" +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" -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: +combined-stream@1.0.6, combined-stream@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: @@ -1878,12 +1882,6 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" -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" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -2628,7 +2626,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: +extend@^3.0.0, extend@~3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -2836,14 +2834,6 @@ 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.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.12" - form-data@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" @@ -3055,7 +3045,7 @@ glob@7.0.x: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^5.0.15: +glob@^5.0.10, glob@^5.0.15: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" dependencies: @@ -3192,21 +3182,10 @@ handlebars@^4.0.1, handlebars@^4.0.2, handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" -har-schema@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" - 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@~4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" - dependencies: - ajv "^4.9.1" - har-schema "^1.0.5" - har-validator@~5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" @@ -3303,15 +3282,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -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" - he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -3324,10 +3294,6 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -3425,14 +3391,6 @@ http-proxy@^1.13.0, http-proxy@^1.16.2: 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" @@ -4104,12 +4062,6 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - 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" @@ -4128,10 +4080,6 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" @@ -4284,20 +4232,7 @@ less-plugin-npm-import@^2.1.0: promise "~7.0.1" resolve "~1.1.6" -less@^3.0.4: - version "3.8.0" - resolved "https://registry.yarnpkg.com/less/-/less-3.8.0.tgz#44785e40c23841c15ba3be741d36bd2775dd0596" - optionalDependencies: - errno "^0.1.1" - graceful-fs "^4.1.2" - image-size "~0.5.0" - mime "^1.4.1" - mkdirp "^0.5.0" - promise "^7.1.1" - request "^2.83.0" - source-map "~0.6.0" - -less@^3.8.0: +less@^3.7.1, less@^3.8.0: version "3.8.1" resolved "https://registry.yarnpkg.com/less/-/less-3.8.1.tgz#f31758598ef5a1930dd4caefa9e4340641e71e1d" dependencies: @@ -4482,7 +4417,7 @@ long@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" -long@^3.2.0: +long@^3.2.0, long@~3: version "3.2.0" resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" @@ -4680,7 +4615,7 @@ miller-rabin@^4.0.0: version "1.35.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" -mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18: version "2.1.19" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" dependencies: @@ -4910,23 +4845,6 @@ node-forge@0.7.5: version "0.7.5" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" -node-gyp@^3.3.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.7.0.tgz#789478e8f6c45e277aa014f3e28f958f286f9203" - dependencies: - fstream "^1.0.0" - glob "^7.0.3" - graceful-fs "^4.1.2" - mkdirp "^0.5.0" - nopt "2 || 3" - npmlog "0 || 1 || 2 || 3 || 4" - osenv "0" - request ">=2.9.0 <2.82.0" - rimraf "2" - semver "~5.3.0" - tar "^2.0.0" - which "1" - node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -4999,30 +4917,6 @@ node-sass-tilde-importer@^1.0.0: dependencies: find-parent-dir "^0.3.0" -node-sass@^4.9.1: - version "4.9.2" - resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.9.2.tgz#5e63fe6bd0f2ae3ac9d6c14ede8620e2b8bdb437" - dependencies: - async-foreach "^0.1.3" - chalk "^1.1.1" - cross-spawn "^3.0.0" - gaze "^1.0.0" - get-stdin "^4.0.1" - glob "^7.0.3" - in-publish "^2.0.0" - lodash.assign "^4.2.0" - lodash.clonedeep "^4.3.2" - lodash.mergewith "^4.6.0" - meow "^3.7.0" - mkdirp "^0.5.1" - nan "^2.10.0" - node-gyp "^3.3.1" - npmlog "^4.0.0" - request "2.87.0" - sass-graph "^2.2.4" - stdout-stream "^1.4.0" - "true-case-path" "^1.0.2" - node-sass@^4.9.3: version "4.9.3" resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.9.3.tgz#f407cf3d66f78308bb1e346b24fa428703196224" @@ -5162,7 +5056,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" -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" @@ -5269,6 +5163,10 @@ optionator@^0.8.1: 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" + original@>=0.0.5: version "1.0.1" resolved "https://registry.yarnpkg.com/original/-/original-1.0.1.tgz#b0a53ff42ba997a8c9cd1fb5daaeb42b9d693190" @@ -5515,10 +5413,6 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" -performance-now@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -5679,11 +5573,14 @@ promise@~7.0.1: dependencies: asap "~2.0.3" -promisify-call@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba" +protobufjs@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1" dependencies: - with-callback "^1.0.2" + ascli "~1" + bytebuffer "~5" + glob "^5.0.10" + yargs "^3.10.0" protractor@~5.4.0: version "5.4.0" @@ -5778,10 +5675,6 @@ 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.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" - query-string@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" @@ -6110,33 +6003,6 @@ request@2.87.0, request@^2.74.0, request@^2.83.0, request@^2.87.0: tunnel-agent "^0.6.0" uuid "^3.1.0" -"request@>=2.9.0 <2.82.0": - version "2.81.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~4.2.1" - 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" - oauth-sign "~0.8.1" - performance-now "^0.2.0" - qs "~6.4.0" - safe-buffer "^5.0.1" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "^0.6.0" - uuid "^3.0.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -6531,12 +6397,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" - dependencies: - hoek "2.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" @@ -6900,10 +6760,6 @@ string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -stringstream@~0.0.4: - 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" @@ -7114,7 +6970,7 @@ toposort@^1.0.0: version "1.0.7" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: +tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: @@ -7167,7 +7023,7 @@ ts-node@^5.0.0: source-map-support "^0.5.3" yn "^2.0.0" -tsickle@>=0.27.3, tsickle@^0.32.1: +tsickle@0.32.1, tsickle@>=0.27.3, tsickle@^0.32.1: version "0.32.1" resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5" dependencies: @@ -7208,6 +7064,12 @@ tslint@^5.11.0: tslib "^1.8.0" tsutils "^2.27.2" +tsutils@2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3" + dependencies: + tslib "^1.8.1" + tsutils@^2.27.2: version "2.29.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" @@ -7474,7 +7336,7 @@ 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.0.0, uuid@^3.0.1, uuid@^3.1.0: +uuid@^3.0.1, uuid@^3.1.0: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" @@ -7709,6 +7571,10 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + winston-transport@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.2.0.tgz#a20be89edf2ea2ca39ba25f3e50344d73e6520e5" @@ -7808,7 +7674,7 @@ xxhashjs@^0.2.1: dependencies: cuint "^0.2.2" -y18n@^3.2.1: +y18n@^3.2.0, y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -7859,6 +7725,18 @@ yargs@11.0.0: y18n "^3.2.1" yargs-parser "^9.0.2" +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/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" + yargs@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"