diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index 9f769c9afc..96a19da513 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -43,7 +43,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage]) readTypeScriptModules.ignoreExportsMatching = [/^[_ɵ]|^VERSION$/]; readTypeScriptModules.hidePrivateMembers = true; - // NOTE: This list shold be in sync with tools/gulp-tasks/public-api.js + // NOTE: This list shold be in sync with tools/public_api_guard/BUILD.bazel readTypeScriptModules.sourceFiles = [ 'animations/index.ts', 'animations/browser/index.ts', diff --git a/gulpfile.js b/gulpfile.js index 2a907f23ab..eea57c01d8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,8 +31,6 @@ gulp.task('format:enforce', loadTask('format', 'enforce')); gulp.task('format', loadTask('format', 'format')); gulp.task('build.sh', loadTask('build', 'all')); gulp.task('build.sh:no-bundle', loadTask('build', 'no-bundle')); -gulp.task('public-api:enforce', loadTask('public-api', 'enforce')); -gulp.task('public-api:update', ['build.sh'], loadTask('public-api', 'update')); gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']); gulp.task('tslint', ['tools:build'], loadTask('lint')); gulp.task('validate-commit-messages', loadTask('validate-commit-message')); diff --git a/package.json b/package.json index 305b714513..cf0b9249f4 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,6 @@ "source-map": "0.5.7", "source-map-support": "0.4.18", "systemjs": "0.18.10", - "ts-api-guardian": "^0.3.0", "tsickle": "0.26.0", "tslint": "5.7.0", "tslint-eslint-rules": "4.1.1", diff --git a/packages/animations/BUILD.bazel b/packages/animations/BUILD.bazel index a74e45e04a..6e0c207299 100644 --- a/packages/animations/BUILD.bazel +++ b/packages/animations/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "animations", @@ -15,3 +15,18 @@ ng_module( "//packages/core", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/animations/index.js", + secondary_entry_points = [ + "browser", + "browser/testing", + ], + deps = [ + ":animations", + "//packages/animations/browser", + "//packages/animations/browser/testing", + ], +) diff --git a/packages/animations/browser/src/private_export.ts b/packages/animations/browser/src/private_export.ts index 9c6de25c98..697fd889eb 100644 --- a/packages/animations/browser/src/private_export.ts +++ b/packages/animations/browser/src/private_export.ts @@ -8,9 +8,11 @@ export {Animation as ɵAnimation} from './dsl/animation'; export {AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer} from './dsl/style_normalization/animation_style_normalizer'; export {WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer} from './dsl/style_normalization/web_animations_style_normalizer'; -export {NoopAnimationDriver as ɵNoopAnimationDriver} from './render/animation_driver'; +export {AnimationDriver as ɵAnimationDriver, NoopAnimationDriver as ɵNoopAnimationDriver} from './render/animation_driver'; export {AnimationEngine as ɵAnimationEngine} from './render/animation_engine_next'; export {CssKeyframesDriver as ɵCssKeyframesDriver} from './render/css_keyframes/css_keyframes_driver'; export {CssKeyframesPlayer as ɵCssKeyframesPlayer} from './render/css_keyframes/css_keyframes_player'; +export {containsElement as ɵcontainsElement, invokeQuery as ɵinvokeQuery, matchesElement as ɵmatchesElement, validateStyleProperty as ɵvalidateStyleProperty} from './render/shared'; export {WebAnimationsDriver as ɵWebAnimationsDriver, supportsWebAnimations as ɵsupportsWebAnimations} from './render/web_animations/web_animations_driver'; export {WebAnimationsPlayer as ɵWebAnimationsPlayer} from './render/web_animations/web_animations_player'; +export {allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge} from './util'; diff --git a/packages/animations/browser/testing/BUILD.bazel b/packages/animations/browser/testing/BUILD.bazel index 7c7a9e8963..8db6f707bc 100644 --- a/packages/animations/browser/testing/BUILD.bazel +++ b/packages/animations/browser/testing/BUILD.bazel @@ -4,7 +4,6 @@ load("//tools:defaults.bzl", "ng_module") ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/animations/browser/testing", deps = [ diff --git a/packages/animations/browser/testing/rollup.config.js b/packages/animations/browser/testing/rollup.config.js index edfdfb43fd..a0d9187840 100644 --- a/packages/animations/browser/testing/rollup.config.js +++ b/packages/animations/browser/testing/rollup.config.js @@ -12,6 +12,7 @@ const sourcemaps = require('rollup-plugin-sourcemaps'); const globals = { '@angular/core': 'ng.core', '@angular/animations': 'ng.animations', + '@angular/animations/browser': 'ng.animations.browser', 'rxjs/Observable': 'Rx', 'rxjs/Subject': 'Rx', }; diff --git a/packages/animations/browser/testing/src/mock_animation_driver.ts b/packages/animations/browser/testing/src/mock_animation_driver.ts index 9e05ab0476..ae58ca494b 100644 --- a/packages/animations/browser/testing/src/mock_animation_driver.ts +++ b/packages/animations/browser/testing/src/mock_animation_driver.ts @@ -6,10 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ import {AUTO_STYLE, AnimationPlayer, NoopAnimationPlayer, ɵStyleData} from '@angular/animations'; - -import {AnimationDriver} from '../../src/render/animation_driver'; -import {containsElement, invokeQuery, matchesElement, validateStyleProperty} from '../../src/render/shared'; -import {allowPreviousPlayerStylesMerge} from '../../src/util'; +import {ɵAnimationDriver as AnimationDriver, ɵallowPreviousPlayerStylesMerge as allowPreviousPlayerStylesMerge, ɵcontainsElement as containsElement, ɵinvokeQuery as invokeQuery, ɵmatchesElement as matchesElement, ɵvalidateStyleProperty as validateStyleProperty} from '@angular/animations/browser'; /** diff --git a/packages/animations/browser/testing/tsconfig-build.json b/packages/animations/browser/testing/tsconfig-build.json index 7243eb7bae..1b8d6a779b 100644 --- a/packages/animations/browser/testing/tsconfig-build.json +++ b/packages/animations/browser/testing/tsconfig-build.json @@ -6,6 +6,7 @@ "rootDir": "../../", "paths": { "@angular/animations": ["../../../../dist/packages/animations"], + "@angular/animations/browser": ["../../../../dist/packages/animations/browser"], "@angular/core": ["../../../../dist/packages/core"] }, "outDir": "../../../../dist/packages/animations" diff --git a/packages/bazel/src/ng_package/ng_package.bzl b/packages/bazel/src/ng_package/ng_package.bzl index 808261a528..3e57a5d3b2 100644 --- a/packages/bazel/src/ng_package/ng_package.bzl +++ b/packages/bazel/src/ng_package/ng_package.bzl @@ -16,28 +16,41 @@ load("//packages/bazel/src:esm5.bzl", "esm5_outputs_aspect", "ESM5Info") # TODO(alexeagle): this list is incomplete, add more as material ramps up WELL_KNOWN_GLOBALS = { "@angular/core": "ng.core", + "@angular/core/testing": "ng.core.testing", "@angular/common": "ng.common", + "@angular/compiler": "ng.compiler", + "@angular/compiler/testing": "ng.compiler.testing", "@angular/platform-browser": "ng.platformBrowser", + "@angular/platform-browser/testing": "ng.platformBrowser.testing", + "@angular/platform-browser-dynamic": "ng.platformBrowserDynamic", } WELL_KNOWN_GLOBALS.update({"rxjs/%s" % s: "Rx" for s in [ "BehaviorSubject", + "ConnectableObservable", "Observable", "Observer", "Subject", "Subscription", + "ReplaySubject", "util/EmptyError", ]}) WELL_KNOWN_GLOBALS.update({"rxjs/observable/%s" % s: "Rx.Observable" for s in [ + "concat", + "defer", "from", + "fromEvent", "fromPromise", "forkJoin", "merge", + "never", "of", + "throw", ]}) WELL_KNOWN_GLOBALS.update({"rxjs/operator/%s" % s: "Rx.Observable.prototype" for s in [ "catch", "concatAll", "concatMap", + "do", "every", "first", "filter", @@ -45,8 +58,12 @@ WELL_KNOWN_GLOBALS.update({"rxjs/operator/%s" % s: "Rx.Observable.prototype" for "map", "mergeAll", "mergeMap", + "publish", "reduce", "share", + "startWith", + "switchMap", + "take", "toPromise", ]}) @@ -238,7 +255,7 @@ def ng_package_outputs(name, entry_point): # we assume the files should be named "package.*.js" basename = entry_point.split("/")[-2] if entry_point.find("/") >=0 else name return { - "fesm5": "%s.js" % basename, + "fesm5": "fesm5/%s.js" % basename, "fesm2015": "fesm2015/%s.js" % basename, "umd": "%s.umd.js" % basename, "umd_min": "%s.umd.min.js" % basename, diff --git a/packages/common/BUILD.bazel b/packages/common/BUILD.bazel index 4766fa872f..0bf58d7937 100644 --- a/packages/common/BUILD.bazel +++ b/packages/common/BUILD.bazel @@ -19,6 +19,7 @@ ng_module( ng_package( name = "npm_package", + srcs = ["package.json"], entry_point = "packages/common/index.js", secondary_entry_points = [ "testing", diff --git a/packages/compiler/BUILD.bazel b/packages/compiler/BUILD.bazel index d3344f6307..1dd7381ddf 100644 --- a/packages/compiler/BUILD.bazel +++ b/packages/compiler/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ts_library", "ng_package") ts_library( name = "compiler", @@ -12,3 +12,16 @@ ts_library( ), module_name = "@angular/compiler", ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/compiler/compiler.js", + secondary_entry_points = [ + "testing", + ], + deps = [ + ":compiler", + "//packages/compiler/testing", + ], +) diff --git a/packages/compiler/testing/BUILD.bazel b/packages/compiler/testing/BUILD.bazel index 0161c326a9..d92b478373 100644 --- a/packages/compiler/testing/BUILD.bazel +++ b/packages/compiler/testing/BUILD.bazel @@ -4,7 +4,6 @@ load("//tools:defaults.bzl", "ts_library") ts_library( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/compiler/testing", deps = [ diff --git a/packages/forms/BUILD.bazel b/packages/forms/BUILD.bazel index 4b0e914e19..2917e0e8a2 100644 --- a/packages/forms/BUILD.bazel +++ b/packages/forms/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "forms", @@ -17,3 +17,12 @@ ng_module( "@rxjs", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/forms/index.js", + deps = [ + ":forms", + ], +) diff --git a/packages/http/BUILD.bazel b/packages/http/BUILD.bazel index deeb113944..c75d728b27 100644 --- a/packages/http/BUILD.bazel +++ b/packages/http/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "http", @@ -17,3 +17,16 @@ ng_module( "@rxjs", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/http/index.js", + secondary_entry_points = [ + "testing", + ], + deps = [ + ":http", + "//packages/http/testing", + ], +) diff --git a/packages/http/testing/BUILD.bazel b/packages/http/testing/BUILD.bazel index afff4d3b71..d5c96d14ef 100644 --- a/packages/http/testing/BUILD.bazel +++ b/packages/http/testing/BUILD.bazel @@ -4,7 +4,6 @@ load("//tools:defaults.bzl", "ng_module") ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/http/testing", deps = [ diff --git a/packages/platform-browser-dynamic/BUILD.bazel b/packages/platform-browser-dynamic/BUILD.bazel index 7b5628cbe5..8bdf0bbdd3 100644 --- a/packages/platform-browser-dynamic/BUILD.bazel +++ b/packages/platform-browser-dynamic/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "platform-browser-dynamic", @@ -19,3 +19,16 @@ ng_module( "//packages/platform-browser", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/platform-browser-dynamic/index.js", + secondary_entry_points = [ + "testing", + ], + deps = [ + ":platform-browser-dynamic", + "//packages/platform-browser-dynamic/testing", + ], +) diff --git a/packages/platform-browser-dynamic/testing/BUILD.bazel b/packages/platform-browser-dynamic/testing/BUILD.bazel index f68e10de15..c66d9122a9 100644 --- a/packages/platform-browser-dynamic/testing/BUILD.bazel +++ b/packages/platform-browser-dynamic/testing/BUILD.bazel @@ -4,7 +4,6 @@ load("//tools:defaults.bzl", "ng_module") ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/platform-browser-dynamic/testing", deps = [ diff --git a/packages/platform-browser/BUILD.bazel b/packages/platform-browser/BUILD.bazel index 108a954320..2608c480c4 100644 --- a/packages/platform-browser/BUILD.bazel +++ b/packages/platform-browser/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "platform-browser", @@ -17,3 +17,18 @@ ng_module( "//packages/core", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/platform-browser/index.js", + secondary_entry_points = [ + "animations", + "testing", + ], + deps = [ + ":platform-browser", + "//packages/platform-browser/animations", + "//packages/platform-browser/testing", + ], +) diff --git a/packages/platform-browser/testing/BUILD.bazel b/packages/platform-browser/testing/BUILD.bazel index 53776c89a2..9aed06791d 100644 --- a/packages/platform-browser/testing/BUILD.bazel +++ b/packages/platform-browser/testing/BUILD.bazel @@ -4,7 +4,6 @@ load("//tools:defaults.bzl", "ng_module") ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/platform-browser/testing", deps = [ diff --git a/packages/platform-server/BUILD.bazel b/packages/platform-server/BUILD.bazel index 71320e0bee..2762d92648 100644 --- a/packages/platform-server/BUILD.bazel +++ b/packages/platform-server/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "platform-server", @@ -24,3 +24,16 @@ ng_module( "@rxjs", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/platform-server/index.js", + secondary_entry_points = [ + "testing", + ], + deps = [ + ":platform-server", + "//packages/platform-server/testing", + ], +) diff --git a/packages/platform-server/testing/BUILD.bazel b/packages/platform-server/testing/BUILD.bazel index 46ee14572a..b313414a29 100644 --- a/packages/platform-server/testing/BUILD.bazel +++ b/packages/platform-server/testing/BUILD.bazel @@ -4,7 +4,6 @@ load("//tools:defaults.bzl", "ng_module") ng_module( name = "testing", - testonly = 1, srcs = glob(["**/*.ts"]), module_name = "@angular/platform-server/testing", deps = [ diff --git a/packages/platform-webworker-dynamic/BUILD.bazel b/packages/platform-webworker-dynamic/BUILD.bazel index 8cfe8dd186..a4a9d86cd6 100644 --- a/packages/platform-webworker-dynamic/BUILD.bazel +++ b/packages/platform-webworker-dynamic/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module", "ng_package") -ts_library( +ng_module( name = "platform-webworker-dynamic", srcs = glob( [ @@ -19,3 +19,10 @@ ts_library( "//packages/platform-browser-dynamic", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/platform-webworker-dynamic/index.js", + deps = [":platform-webworker-dynamic"], +) diff --git a/packages/platform-webworker/BUILD.bazel b/packages/platform-webworker/BUILD.bazel index 348b78fc35..cd2eaa7293 100644 --- a/packages/platform-webworker/BUILD.bazel +++ b/packages/platform-webworker/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "platform-webworker", @@ -19,3 +19,12 @@ ng_module( "//packages/platform-browser", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/platform-webworker/index.js", + deps = [ + ":platform-webworker", + ], +) diff --git a/packages/service-worker/BUILD.bazel b/packages/service-worker/BUILD.bazel index 0db379062b..b7a476a75f 100644 --- a/packages/service-worker/BUILD.bazel +++ b/packages/service-worker/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "service-worker", @@ -17,3 +17,14 @@ ng_module( "@rxjs", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/service-worker/index.js", + secondary_entry_points = ["config"], + deps = [ + ":service-worker", + "//packages/service-worker/config", + ], +) diff --git a/packages/service-worker/config/BUILD.bazel b/packages/service-worker/config/BUILD.bazel new file mode 100644 index 0000000000..c7dbd6cdb6 --- /dev/null +++ b/packages/service-worker/config/BUILD.bazel @@ -0,0 +1,12 @@ +package(default_visibility = ["//visibility:public"]) + +load("//tools:defaults.bzl", "ng_module") + +ng_module( + name = "config", + srcs = glob([ + "*.ts", + "src/**/*.ts", + ]), + deps = ["//packages/core"], +) diff --git a/packages/upgrade/BUILD.bazel b/packages/upgrade/BUILD.bazel index ac09be5935..f3b7936d4f 100644 --- a/packages/upgrade/BUILD.bazel +++ b/packages/upgrade/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ng_module") +load("//tools:defaults.bzl", "ng_module", "ng_package") ng_module( name = "upgrade", @@ -17,3 +17,16 @@ ng_module( "//packages/platform-browser-dynamic", ], ) + +ng_package( + name = "npm_package", + srcs = ["package.json"], + entry_point = "packages/upgrade/index.js", + secondary_entry_points = [ + "static", + ], + deps = [ + ":upgrade", + "//packages/upgrade/static", + ], +) diff --git a/packages/upgrade/static/BUILD.bazel b/packages/upgrade/static/BUILD.bazel index 1b5d8028e8..c264ae4fef 100644 --- a/packages/upgrade/static/BUILD.bazel +++ b/packages/upgrade/static/BUILD.bazel @@ -1,8 +1,8 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ng_module") -ts_library( +ng_module( name = "static", srcs = glob(["**/*.ts"]), module_name = "@angular/upgrade/static", diff --git a/scripts/ci/test-e2e.sh b/scripts/ci/test-e2e.sh index 0bc0df825a..40c889578d 100755 --- a/scripts/ci/test-e2e.sh +++ b/scripts/ci/test-e2e.sh @@ -13,12 +13,6 @@ travisFoldStart "test.e2e.buildPackages" ./build.sh travisFoldEnd "test.e2e.buildPackages" - -travisFoldStart "test.e2e.publicApi" - $(npm bin)/gulp public-api:enforce -travisFoldEnd "test.e2e.publicApi" - - travisFoldStart "test.e2e.check-cycle" $(npm bin)/gulp check-cycle travisFoldEnd "test.e2e.check-cycle" diff --git a/tools/gulp-tasks/public-api.js b/tools/gulp-tasks/public-api.js deleted file mode 100644 index 68520276cc..0000000000 --- a/tools/gulp-tasks/public-api.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @license - * 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 - */ - -// NOTE: This list shold be in sync with aio/tools/transforms/angular-api-package/index.js -// NOTE: Some packages have moved to Bazel; these are tested in tools/public_api_guard/BUILD.bazel -const entrypoints = [ - 'dist/packages-dist/animations/animations.d.ts', - 'dist/packages-dist/animations/browser.d.ts', - 'dist/packages-dist/animations/browser/testing.d.ts', - // The API surface of the compiler is currently unstable - all of the important APIs are exposed - // via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead. - //'dist/packages-dist/compiler/index.d.ts', - //'dist/packages-dist/compiler/testing.d.ts', - 'dist/packages-dist/forms/forms.d.ts', - 'dist/packages-dist/http/http.d.ts', - 'dist/packages-dist/http/testing.d.ts', - 'dist/packages-dist/platform-browser/platform-browser.d.ts', - 'dist/packages-dist/platform-browser/animations.d.ts', - 'dist/packages-dist/platform-browser/testing.d.ts', - 'dist/packages-dist/platform-browser-dynamic/platform-browser-dynamic.d.ts', - 'dist/packages-dist/platform-browser-dynamic/testing.d.ts', - 'dist/packages-dist/platform-webworker/platform-webworker.d.ts', - 'dist/packages-dist/platform-webworker-dynamic/platform-webworker-dynamic.d.ts', - 'dist/packages-dist/platform-server/platform-server.d.ts', - 'dist/packages-dist/platform-server/testing.d.ts', - 'dist/packages-dist/service-worker/service-worker.d.ts', - 'dist/packages-dist/service-worker/config.d.ts', - 'dist/packages-dist/upgrade/upgrade.d.ts', - 'dist/packages-dist/upgrade/static.d.ts', -]; - -const publicApiDir = 'tools/public_api_guard'; -const publicApiArgs = [ - '--rootDir', - 'dist/packages-dist', - '--stripExportPattern', - '^(__|ɵ)', - '--allowModuleIdentifiers', - 'jasmine', - '--allowModuleIdentifiers', - 'protractor', - '--allowModuleIdentifiers', - 'angular', - '--onStabilityMissing', - 'error', -].concat(entrypoints); - -module.exports = { - - // Enforce that the public API matches the golden files - // Note that these two commands work on built d.ts files instead of the source - enforce: (gulp) => (done) => { - const platformScriptPath = require('./platform-script-path'); - const childProcess = require('child_process'); - const path = require('path'); - - childProcess - .spawn( - path.join(__dirname, platformScriptPath(`../../node_modules/.bin/ts-api-guardian`)), - ['--verifyDir', path.normalize(publicApiDir)].concat(publicApiArgs), {stdio: 'inherit'}) - .on('close', (errorCode) => { - if (errorCode !== 0) { - done(new Error( - 'Public API differs from golden file. Please run `gulp public-api:update`.')); - } else { - done(); - } - }); - }, - - // Generate the public API golden files - update: (gulp) => (done) => { - const platformScriptPath = require('./platform-script-path'); - const childProcess = require('child_process'); - const path = require('path'); - - childProcess - .spawn( - path.join(__dirname, platformScriptPath(`../../node_modules/.bin/ts-api-guardian`)), - ['--outDir', path.normalize(publicApiDir)].concat(publicApiArgs), {stdio: 'inherit'}) - .on('close', done); - } -}; diff --git a/tools/public_api_guard/BUILD.bazel b/tools/public_api_guard/BUILD.bazel index 22a1f74f90..fbcae7fd1e 100644 --- a/tools/public_api_guard/BUILD.bazel +++ b/tools/public_api_guard/BUILD.bazel @@ -1,62 +1,26 @@ load("//tools/ts-api-guardian:index.bzl", "ts_api_guardian_test") -[ - ts_api_guardian_test( - name = "%s_%s_api" % ( - bundle[0], - bundle[1].replace("/", "_"), - ), - actual = "packages/%s/npm_package/%s.d.ts" % ( - bundle[0], - bundle[1], - ), - data = glob([ - "%s/**/*.d.ts" % bundle[0], - ]) + [ - "//packages/%s:npm_package" % bundle[0], - ], - golden = "tools/public_api_guard/%s/%s.d.ts" % ( - bundle[0], - bundle[1], - ), - ) - for bundle in [ - [ - "core", - "core", - ], - [ - "core", - "testing", - ], - [ - "common", - "http/testing", - ], - [ - "common", - "common", - ], - [ - "common", - "http", - ], - [ - "common", - "testing", - ], - [ - "router", - "router", - ], - [ - "router", - "testing", - ], - [ - "router", - "upgrade", - ], - # TODO(alexeagle): add remaining packages here once they have ng_package's - ] -] +[ts_api_guardian_test( + name = "%s_%s_api" % ( + bundle[0], + bundle[1].replace("/", "_"), + ), + actual = "packages/%s/npm_package/%s.d.ts" % ( + bundle[0], + bundle[1], + ), + data = glob([ + "%s/**/*.d.ts" % bundle[0], + ]) + [ + "//packages/%s:npm_package" % bundle[0], + ], + golden = "tools/public_api_guard/%s/%s.d.ts" % ( + bundle[0], + bundle[1], + ), +) for bundle in [b[:-len(".d.ts")].split("/", 1) for b in glob( + ["**/*.d.ts"], + # The API surface of the compiler is currently unstable - all of the important APIs are exposed + # via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead. + exclude = ["compiler/*"], +)]] diff --git a/tools/public_api_guard/platform-browser/animations/testing.d.ts b/tools/public_api_guard/platform-browser/animations/testing.d.ts deleted file mode 100644 index ac0800ff6e..0000000000 --- a/tools/public_api_guard/platform-browser/animations/testing.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** @experimental */ -export declare class BrowserAnimationsTestingModule { -} - -/** @experimental */ -export declare class NoopAnimationsTestingModule { -} diff --git a/yarn.lock b/yarn.lock index 9d16aa9bab..3f58f8a07b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -288,12 +288,6 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - dependencies: - color-convert "^1.9.0" - any-promise@^1.0.0, any-promise@^1.1.0, any-promise@~1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -1007,14 +1001,6 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - char-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/char-spinner/-/char-spinner-1.0.1.tgz#e6ea67bd247e107112983b7ab0479ed362800081" @@ -1175,16 +1161,6 @@ coffee-script@1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.3.3.tgz#150d6b4cb522894369efed6a2101c20bc7f4a4f4" -color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" - dependencies: - color-name "^1.1.1" - -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - colors@0.6.0-1: version "0.6.0-1" resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.0-1.tgz#6dbb68ceb8bc60f2b313dcc5ce1599f06d19e67a" @@ -1975,10 +1951,6 @@ diff@^3.2.0: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" -diff@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c" - doctrine@^0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523" @@ -3392,10 +3364,6 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - has-gulplog@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" @@ -6871,12 +6839,6 @@ supports-color@^3.1.0: dependencies: has-flag "^1.0.0" -supports-color@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" - dependencies: - has-flag "^3.0.0" - symbol-observable@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" @@ -7139,14 +7101,6 @@ try-require@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/try-require/-/try-require-1.2.1.tgz#34489a2cac0c09c1cc10ed91ba011594d4333be2" -ts-api-guardian@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/ts-api-guardian/-/ts-api-guardian-0.3.0.tgz#c5fbba9991840328f5ed0c89765a23e707645aa3" - dependencies: - chalk "^2.3.1" - diff "^3.4.0" - minimist "^1.2.0" - tsickle@0.26.0: version "0.26.0" resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.26.0.tgz#40b30a2dd6abcb33b182e37596674bd1cfe4039c"