build: build cdk package (#4111)

* Introduces another package called `@angular/cdk`. This package is
currently empty but all the logic for SASS, HTML, TypeScript and tests
is ready.
This commit is contained in:
Paul Gschwendtner
2017-04-18 00:18:16 +02:00
committed by Jeremy Elbourn
parent b2ca0f5d84
commit a7ca7c1f24
23 changed files with 252 additions and 112 deletions
+52 -7
View File
@@ -5,15 +5,60 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 3000;
__karma__.loaded = function () {};
var baseDir = '/base';
var configFile = baseDir + '/dist/packages/material/system-config-spec.js';
var specFiles = Object.keys(window.__karma__.files).filter(isMaterialSpecFile);
// Configure the base path for dist/
System.config({ baseURL: baseDir });
// Configure the base path and map the different node packages.
System.config({
baseURL: baseDir,
paths: {
'node:*': 'node_modules/*'
},
map: {
'rxjs': 'node:rxjs',
'main': 'main.js',
// Load the spec SystemJS configuration file.
System.import(configFile)
.then(configureTestBed)
// Angular specific mappings.
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser/animations':
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
'@angular/platform-browser':
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser/testing':
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/platform-browser-dynamic/testing':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
// Path mappings for local packages that can be imported inside of tests.
'@angular/material': 'dist/bundles/material.umd.js',
'@angular/cdk': 'dist/bundles/cdk.umd.js',
},
packages: {
// Thirdparty barrels.
'rxjs': {main: 'index'},
// Set the default extension for the root package, because otherwise the demo-app can't
// be built within the production mode. Due to missing file extensions.
'.': {
defaultExtension: 'js'
}
}
});
// Configure the Angular test bed and run all specs once configured.
configureTestBed()
.then(runMaterialSpecs)
.then(__karma__.start, __karma__.error);
@@ -47,4 +92,4 @@ function configureTestBed() {
testingBrowser.platformBrowserDynamicTesting()
);
});
}
}
+7 -9
View File
@@ -33,20 +33,18 @@ module.exports = (config) => {
{pattern: 'test/karma-test-shim.js', included: true, watched: false},
// Include a Material theme in the test suite.
{pattern: 'dist/**/core/theming/prebuilt/indigo-pink.css', included: true, watched: true},
{pattern: 'dist/packages/**/core/theming/prebuilt/indigo-pink.css', included: true, watched: true},
// Includes Material spec and source files into karma. Those files will be watched.
{pattern: 'dist/packages/material/**/*.js', included: false, watched: true},
// Paths to support debugging with source maps in dev tools
{pattern: 'dist/**/*.ts', included: false, watched: false},
{pattern: 'dist/**/*.js.map', included: false, watched: false}
// Includes all package tests and source files into karma. Those files will be watched.
// This pattern also matches all all sourcemap files and TypeScript files for debugging.
{pattern: 'dist/packages/**/*', included: false, watched: true},
{pattern: 'dist/bundles/*.umd.js', included: false, watched: true},
],
customLaunchers: customLaunchers,
preprocessors: {
'dist/**/*.js': ['sourcemap']
'dist/packages/**/*.js': ['sourcemap']
},
reporters: ['dots'],
@@ -103,7 +101,7 @@ module.exports = (config) => {
if (process.env['TRAVIS_PULL_REQUEST'] === 'false' &&
process.env['MODE'] === "browserstack_required") {
config.preprocessors['dist/@angular/material/**/!(*+(.|-)spec).js'] = ['coverage'];
config.preprocessors['dist/packages/**/!(*+(.|-)spec).js'] = ['coverage'];
config.reporters.push('coverage');
}