refactor(bazel): Remove bazel-workspace schematics (#29148)

`bazel-workspace` schematics is no longer needed now that the Bazel
files are injected into the project by the Bazel builder.

PR Close #29148
This commit is contained in:
Keen Yee Liau
2019-03-06 17:50:57 -08:00
committed by Kara Erickson
parent 36a1550e00
commit f4f20daee3
29 changed files with 127 additions and 663 deletions

View File

@ -0,0 +1,21 @@
// Workaround for https://github.com/angular/angular/issues/18810
// This file is required because when using the Angular NPM packages and building
// with AOT compilation, NGC needs the "ngsummary.json" files.
{
"compilerOptions": {
"lib": [
"dom",
"es2015"
],
"experimentalDecorators": true,
"types": []
},
"include": [
"node_modules/@angular/**/*"
],
"exclude": [
"node_modules/@angular/bazel/**",
"node_modules/@angular/compiler-cli/**",
"node_modules/@angular/**/testing/**"
]
}

View File

@ -0,0 +1,23 @@
// The function exported from this file is used by the protractor_web_test_suite.
// It is passed to the `onPrepare` configuration setting in protractor and executed
// before running tests.
//
// If the function returns a promise, as it does here, protractor will wait
// for the promise to resolve before running tests.
const protractorUtils = require('@angular/bazel/protractor-utils');
const protractor = require('protractor');
module.exports = function(config) {
// In this example, `@angular/bazel/protractor-utils` is used to run
// the server. protractorUtils.runServer() runs the server on a randomly
// selected port (given a port flag to pass to the server as an argument).
// The port used is returned in serverSpec and the protractor serverUrl
// is the configured.
const portFlag = config.server.endsWith('prodserver') ? '-p' : '-port';
return protractorUtils.runServer(config.workspace, config.server, portFlag, [])
.then(serverSpec => {
const serverUrl = `http://localhost:${serverSpec.port}`;
protractor.browser.baseUrl = serverUrl;
});
};

View File

@ -0,0 +1,9 @@
/**
* @fileoverview Provides a script to initialize TestBed before tests are run.
* This file should be included in the "runtime_deps" of a "ts_web_test_suite"
* rule.
*/
import {TestBed} from '@angular/core/testing';
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());

View File

@ -0,0 +1,32 @@
/**
* @fileoverview Provides named UMD shims for `rxjs/operators` and `rxjs/testing`.
* This file should be included in the "scripts" of a "ts_devserver"
* rule and the "deps" of a "ts_web_test_suite" rule.
*/
// rxjs/operators
(function(factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
} else if (typeof define === 'function' && define.amd) {
define('rxjs/operators', ['exports', 'rxjs'], factory);
}
})(function(exports, rxjs) {
'use strict';
Object.keys(rxjs.operators).forEach(function(key) { exports[key] = rxjs.operators[key]; });
Object.defineProperty(exports, '__esModule', {value: true});
});
// rxjs/testing
(function(factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
} else if (typeof define === 'function' && define.amd) {
define('rxjs/testing', ['exports', 'rxjs'], factory);
}
})(function(exports, rxjs) {
'use strict';
Object.keys(rxjs.testing).forEach(function(key) { exports[key] = rxjs.testing[key]; });
Object.defineProperty(exports, '__esModule', {value: true});
});