fix(schematics): do not publish testing utilities to npm (#13633)

This commit is contained in:
Paul Gschwendtner
2018-10-16 21:40:53 +02:00
committed by Joey Perrott
parent 240acf6a57
commit ef429c44a8
15 changed files with 35 additions and 17 deletions
+4 -5
View File
@@ -19,7 +19,8 @@ ts_library(
srcs = glob(["**/*.ts"], exclude=[ srcs = glob(["**/*.ts"], exclude=[
"**/files/**/*.ts", "**/files/**/*.ts",
"**/*.spec.ts", "**/*.spec.ts",
"ng-update/test-cases/**/*", "ng-update/test-cases/**/*.ts",
"testing/**/*.ts"
]), ]),
tsconfig = ":tsconfig.json", tsconfig = ":tsconfig.json",
deps = [ deps = [
@@ -28,11 +29,8 @@ ts_library(
# TODO(devversion): Only include jasmine for test sources (See: tsconfig types). # TODO(devversion): Only include jasmine for test sources (See: tsconfig types).
"@npm//@types/jasmine", "@npm//@types/jasmine",
"@npm//@types/node", "@npm//@types/node",
# TODO(devversion): Similarly to "jasmine", we need to extract these into testing only.
"@npm//fs-extra",
"@npm//glob", "@npm//glob",
"@npm//parse5", "@npm//parse5",
"@npm//rxjs",
"@npm//tslint", "@npm//tslint",
"@npm//typescript" "@npm//typescript"
], ],
@@ -58,7 +56,7 @@ ts_library(
name = "schematics_test_sources", name = "schematics_test_sources",
srcs = glob(["**/*.spec.ts"], exclude = ["**/files/**/*.spec.ts"]), srcs = glob(["**/*.spec.ts"], exclude = ["**/files/**/*.spec.ts"]),
deps = [ deps = [
":schematics", "//src/cdk/schematics/testing",
"@npm//@schematics/angular", "@npm//@schematics/angular",
"@npm//@angular-devkit/schematics", "@npm//@angular-devkit/schematics",
"@npm//@types/jasmine", "@npm//@types/jasmine",
@@ -66,6 +64,7 @@ ts_library(
"@npm//mock-fs", "@npm//mock-fs",
"@npm//tslint", "@npm//tslint",
"@npm//typescript", "@npm//typescript",
":schematics",
], ],
tsconfig = ":tsconfig.json", tsconfig = ":tsconfig.json",
testonly = True, testonly = True,
-1
View File
@@ -7,5 +7,4 @@
*/ */
export * from './utils'; export * from './utils';
export * from './testing';
export * from './ng-update/public-api'; export * from './ng-update/public-api';
+18
View File
@@ -0,0 +1,18 @@
package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
ts_library(
name = "testing",
module_name = "@angular/cdk/schematics/testing",
srcs = glob(["**/*.ts"]),
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//@schematics/angular",
"@npm//@types/node",
"@npm//@types/fs-extra",
"@npm//fs-extra",
"@npm//rxjs",
],
)
+2 -1
View File
@@ -20,7 +20,8 @@
"exclude": [ "exclude": [
"**/files/**/*", "**/files/**/*",
"**/*.spec.ts", "**/*.spec.ts",
"ng-update/test-cases/**/*" "ng-update/test-cases/**/*",
"testing/**/*.ts"
], ],
"bazelOptions": { "bazelOptions": {
"suppressTsconfigOverrideWarnings": true "suppressTsconfigOverrideWarnings": true
+1
View File
@@ -53,6 +53,7 @@ ts_library(
deps = [ deps = [
":schematics", ":schematics",
"//src/cdk/schematics", "//src/cdk/schematics",
"//src/cdk/schematics/testing",
"@npm//@schematics/angular", "@npm//@schematics/angular",
"@npm//@angular-devkit/schematics", "@npm//@angular-devkit/schematics",
"@npm//@types/jasmine", "@npm//@types/jasmine",
@@ -1,5 +1,5 @@
import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {SchematicTestRunner} from '@angular-devkit/schematics/testing';
import {createTestApp} from '@angular/cdk/schematics'; import {createTestApp} from '@angular/cdk/schematics/testing';
import {getFileContent} from '@schematics/angular/utility/test'; import {getFileContent} from '@schematics/angular/utility/test';
import {Schema} from './schema'; import {Schema} from './schema';
+1 -1
View File
@@ -1,5 +1,5 @@
import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {SchematicTestRunner} from '@angular-devkit/schematics/testing';
import {createTestApp} from '@angular/cdk/schematics'; import {createTestApp} from '@angular/cdk/schematics/testing';
import {getFileContent} from '@schematics/angular/utility/test'; import {getFileContent} from '@schematics/angular/utility/test';
import {Schema} from './schema'; import {Schema} from './schema';
+1 -1
View File
@@ -1,7 +1,7 @@
import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {SchematicTestRunner} from '@angular-devkit/schematics/testing';
import {Schema} from './schema'; import {Schema} from './schema';
import {getFileContent} from '@schematics/angular/utility/test'; import {getFileContent} from '@schematics/angular/utility/test';
import {createTestApp} from '@angular/cdk/schematics'; import {createTestApp} from '@angular/cdk/schematics/testing';
describe('material-nav-schematic', () => { describe('material-nav-schematic', () => {
let runner: SchematicTestRunner; let runner: SchematicTestRunner;
+1 -1
View File
@@ -4,11 +4,11 @@ import {Tree} from '@angular-devkit/schematics';
import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {SchematicTestRunner} from '@angular-devkit/schematics/testing';
import { import {
addModuleImportToRootModule, addModuleImportToRootModule,
createTestApp,
getProjectFromWorkspace, getProjectFromWorkspace,
getProjectStyleFile, getProjectStyleFile,
getProjectTargetOptions, getProjectTargetOptions,
} from '@angular/cdk/schematics'; } from '@angular/cdk/schematics';
import {createTestApp} from '@angular/cdk/schematics/testing';
import {getWorkspace} from '@schematics/angular/utility/config'; import {getWorkspace} from '@schematics/angular/utility/config';
import {getFileContent} from '@schematics/angular/utility/test'; import {getFileContent} from '@schematics/angular/utility/test';
import {getIndexHtmlPath} from './fonts/project-index-html'; import {getIndexHtmlPath} from './fonts/project-index-html';
@@ -1,5 +1,5 @@
import {migrationCollection} from '../index.spec'; import {migrationCollection} from '../index.spec';
import {runTestCases} from '@angular/cdk/schematics'; import {runTestCases} from '@angular/cdk/schematics/testing';
describe('constructor checks', () => { describe('constructor checks', () => {
@@ -1,4 +1,4 @@
import {runTestCases} from '@angular/cdk/schematics'; import {runTestCases} from '@angular/cdk/schematics/testing';
import {migrationCollection} from '../index.spec'; import {migrationCollection} from '../index.spec';
describe('v6 import misc checks', () => { describe('v6 import misc checks', () => {
@@ -1,5 +1,5 @@
import {join} from 'path'; import {join} from 'path';
import {readFileContent, runTestCases} from '@angular/cdk/schematics'; import {readFileContent, runTestCases} from '@angular/cdk/schematics/testing';
import {migrationCollection} from './index.spec'; import {migrationCollection} from './index.spec';
describe('v6 upgrade test cases', () => { describe('v6 upgrade test cases', () => {
@@ -1,5 +1,5 @@
import {join} from 'path'; import {join} from 'path';
import {readFileContent, runTestCases} from '@angular/cdk/schematics'; import {readFileContent, runTestCases} from '@angular/cdk/schematics/testing';
import {migrationCollection} from './index.spec'; import {migrationCollection} from './index.spec';
describe('v7 upgrade test cases', () => { describe('v7 upgrade test cases', () => {
+1 -1
View File
@@ -1,5 +1,5 @@
import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {SchematicTestRunner} from '@angular-devkit/schematics/testing';
import {createTestApp} from '@angular/cdk/schematics'; import {createTestApp} from '@angular/cdk/schematics/testing';
import {getFileContent} from '@schematics/angular/utility/test'; import {getFileContent} from '@schematics/angular/utility/test';
import {Schema} from './schema'; import {Schema} from './schema';
+1 -1
View File
@@ -1,5 +1,5 @@
import {SchematicTestRunner} from '@angular-devkit/schematics/testing'; import {SchematicTestRunner} from '@angular-devkit/schematics/testing';
import {createTestApp} from '@angular/cdk/schematics'; import {createTestApp} from '@angular/cdk/schematics/testing';
import {getFileContent} from '@schematics/angular/utility/test'; import {getFileContent} from '@schematics/angular/utility/test';
import {Schema} from './schema'; import {Schema} from './schema';