feat(packaging): move packaging to a single "@angular/material" (#1286)

This commit is contained in:
Hans
2016-09-22 13:24:12 -07:00
committed by Kara
parent 06a60766ac
commit b5c8c63a27
86 changed files with 347 additions and 1043 deletions
+10 -7
View File
@@ -29,7 +29,7 @@ const blocked_statements = [
];
const sourceFolders = ['./src', './e2e'];
const scopePackages = glob('src/lib/*');
const libRoot = 'src/lib';
const blockedRegex = new RegExp(blocked_statements.join('|'), 'g');
const importRegex = /from\s+'(.*)';/g;
@@ -58,7 +58,9 @@ findTestFiles()
lineCount++;
let matches = line.match(blockedRegex);
let scopeImport = isRelativeScopeImport(fileName, line);
let scopeImport = path.relative(libRoot, fileName).startsWith('..')
? isRelativeScopeImport(fileName, line)
: false;
if (matches || scopeImport) {
@@ -155,6 +157,10 @@ function findChangedFiles() {
* @param line Line to be checked.
*/
function isRelativeScopeImport(fileName, line) {
if (fileName.startsWith(libRoot)) {
return false;
}
let importMatch = importRegex.exec(line);
// We have to reset the last index of the import regex, otherwise we
@@ -184,8 +190,7 @@ function isRelativeScopeImport(fileName, line) {
if (fileScope.path !== importScope.path) {
// Creates a valid import statement, which uses the correct scope package.
let importFilePath = path.relative(importScope.path, importPath);
let validImportPath = `@angular2-material/${importScope.name}/${importFilePath}`;
let validImportPath = `@angular/material`;
return {
fileScope: fileScope.name,
@@ -200,9 +205,7 @@ function isRelativeScopeImport(fileName, line) {
filePath = path.normalize(filePath);
// Iterate through all scope paths and try to find them inside of the file path.
var scopePath = scopePackages
.filter(scope => filePath.indexOf(path.normalize(scope)) !== -1)
.pop();
var scopePath = filePath.indexOf(path.normalize(libRoot)) == -1 ? libRoot : filePath;
// Return an object containing the name of the scope and the associated path.
return {
+35 -16
View File
@@ -30,10 +30,14 @@ const writeFile = promiseify(fs.writeFile);
function inlineResources(globs) {
if (typeof globs == 'string') {
globs = [globs];
}
/**
* For every argument, inline the templates and styles under it and write the new file.
*/
for (let pattern of globs) {
return Promise.all(globs.map(pattern => {
if (pattern.indexOf('*') < 0) {
// Argument is a directory target, add glob patterns to include every files.
pattern = path.join(pattern, '**', '*');
@@ -43,17 +47,32 @@ function inlineResources(globs) {
.filter(name => /\.js$/.test(name)); // Matches only JavaScript files.
// Generate all files content with inlined templates.
files.forEach(filePath => {
readFile(filePath, 'utf-8')
.then(content => inlineTemplate(filePath, content))
.then(content => inlineStyle(filePath, content))
.then(content => removeModuleId(filePath, content))
return Promise.all(files.map(filePath => {
return readFile(filePath, 'utf-8')
.then(content => inlineResourcesFromString(content, url => {
return path.join(path.dirname(filePath), url);
}))
.then(content => writeFile(filePath, content))
.catch(err => {
console.error('An error occured: ', err);
});
});
}
}));
}));
}
/**
* Inline resources from a string content.
* @param content {string} The source file's content.
* @param urlResolver {Function} A resolver that takes a URL and return a path.
* @returns {string} The content with resources inlined.
*/
function inlineResourcesFromString(content, urlResolver) {
// Curry through the inlining functions.
return [
inlineTemplate,
inlineStyle,
removeModuleId
].reduce((content, fn) => fn(content, urlResolver), content);
}
if (require.main === module) {
@@ -64,13 +83,13 @@ if (require.main === module) {
/**
* Inline the templates for a source file. Simply search for instances of `templateUrl: ...` and
* replace with `template: ...` (with the content of the file included).
* @param filePath {string} The path of the source file.
* @param content {string} The source file's content.
* @param urlResolver {Function} A resolver that takes a URL and return a path.
* @return {string} The content with all templates inlined.
*/
function inlineTemplate(filePath, content) {
function inlineTemplate(content, urlResolver) {
return content.replace(/templateUrl:\s*'([^']+?\.html)'/g, function(m, templateUrl) {
const templateFile = path.join(path.dirname(filePath), templateUrl);
const templateFile = urlResolver(templateUrl);
const templateContent = fs.readFileSync(templateFile, 'utf-8');
const shortenedTemplate = templateContent
.replace(/([\n\r]\s*)+/gm, ' ')
@@ -83,16 +102,16 @@ function inlineTemplate(filePath, content) {
/**
* Inline the styles for a source file. Simply search for instances of `styleUrls: [...]` and
* replace with `styles: [...]` (with the content of the file included).
* @param filePath {string} The path of the source file.
* @param urlResolver {Function} A resolver that takes a URL and return a path.
* @param content {string} The source file's content.
* @return {string} The content with all styles inlined.
*/
function inlineStyle(filePath, content) {
function inlineStyle(content, urlResolver) {
return content.replace(/styleUrls:\s*(\[[\s\S]*?\])/gm, function(m, styleUrls) {
const urls = eval(styleUrls);
return 'styles: ['
+ urls.map(styleUrl => {
const styleFile = path.join(path.dirname(filePath), styleUrl);
const styleFile = urlResolver(styleUrl);
const styleContent = fs.readFileSync(styleFile, 'utf-8');
const shortenedStyle = styleContent
.replace(/([\n\r]\s*)+/gm, ' ')
@@ -107,13 +126,13 @@ function inlineStyle(filePath, content) {
/**
* Remove every mention of `moduleId: module.id`.
* @param _ {string} The file path of the source file, currently ignored.
* @param content {string} The source file's content.
* @returns {string} The content with all moduleId: mentions removed.
*/
function removeModuleId(_, content) {
function removeModuleId(content) {
return content.replace(/\s*moduleId:\s*module\.id\s*,?\s*/gm, '');
}
module.exports = inlineResources;
module.exports.inlineResourcesFromString = inlineResourcesFromString;
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {MdUniqueSelectionDispatcher} from '@angular2-material/core';
import {MdUniqueSelectionDispatcher} from '@angular/material';
@Component({
moduleId: module.id,
+1 -1
View File
@@ -4,7 +4,7 @@ import {HttpModule} from '@angular/http';
import {FormsModule} from '@angular/forms';
import {DemoApp, Home} from './demo-app/demo-app';
import {RouterModule} from '@angular/router';
import {MaterialModule} from '@angular2-material/all';
import {MaterialModule} from '@angular/material';
import {DEMO_APP_ROUTES} from './demo-app/routes';
import {ProgressBarDemo} from './progress-bar/progress-bar-demo';
import {JazzDialog, DialogDemo} from './dialog/dialog-demo';
+1 -1
View File
@@ -1,5 +1,5 @@
import {Component, ViewContainerRef} from '@angular/core';
import {MdDialog, MdDialogConfig, MdDialogRef} from '@angular2-material/dialog';
import {MdDialog, MdDialogConfig, MdDialogRef} from '@angular/material';
@Component({
moduleId: module.id,
+1 -1
View File
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {MdIconRegistry} from '@angular2-material/icon';
import {MdIconRegistry} from '@angular/material';
@Component({
+1 -1
View File
@@ -1,5 +1,5 @@
import {Component, ViewEncapsulation} from '@angular/core';
import {MdIconRegistry} from '@angular2-material/icon';
import {MdIconRegistry} from '@angular/material';
@Component({
moduleId: module.id,
+1 -1
View File
@@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="@angular2-material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
<link href="@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
<!-- FontAwesome for md-icon demo. -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {MdLiveAnnouncer} from '@angular2-material/core';
import {MdLiveAnnouncer} from '@angular/material';
@Component({
moduleId: module.id,
+1 -1
View File
@@ -13,7 +13,7 @@ import {
ComponentPortal,
Portal,
TemplatePortalDirective,
} from '@angular2-material/core';
} from '@angular/material';
@Component({
+1 -1
View File
@@ -3,7 +3,7 @@ import {
Portal,
ComponentPortal,
TemplatePortalDirective,
} from '@angular2-material/core';
} from '@angular/material';
@Component({
+1 -1
View File
@@ -1,5 +1,5 @@
import {Component, ViewChild} from '@angular/core';
import {MdRipple} from '@angular2-material/core';
import {MdRipple} from '@angular/material';
@Component({
+26 -96
View File
@@ -1,104 +1,34 @@
/***********************************************************************************************
* User Configuration.
**********************************************************************************************/
const components = [
'all',
'button',
'card',
'checkbox',
'dialog',
'grid-list',
'icon',
'input',
'list',
'menu',
'progress-bar',
'progress-circle',
'radio',
'select',
'sidenav',
'slider',
'slide-toggle',
'button-toggle',
'tabs',
'toolbar',
'tooltip',
];
/** User packages configuration. */
const packages: any = {
'@angular2-material/core': {
format: 'cjs',
main: 'core.umd.js'
},
// 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'
}
};
components.forEach(name => {
packages[`@angular2-material/${name}`] = {
format: 'cjs',
main: `${name}.umd.js`
};
});
////////////////////////////////////////////////////////////////////////////////////////////////
/***********************************************************************************************
* Everything underneath this line is managed by the CLI.
**********************************************************************************************/
const angularPackages = {
// Angular specific barrels.
'@angular/core': { main: 'bundles/core.umd.js'},
'@angular/core/testing': { main: 'bundles/core-testing.umd.js'},
'@angular/common': { main: 'bundles/common.umd.js'},
'@angular/compiler': { main: 'bundles/compiler.umd.js'},
'@angular/http': { main: 'bundles/http.umd.js'},
'@angular/forms': { main: 'bundles/forms.umd.js'},
'@angular/router': { main: 'bundles/router.umd.js'},
'@angular/platform-browser': { main: 'bundles/platform-browser.umd.js'},
'@angular/platform-browser-dynamic': { main: 'bundles/platform-browser-dynamic.umd.js'},
'@angular/platform-browser-dynamic/testing': {
main: 'bundles/platform-browser-dynamic-testing.umd.js'
},
};
const barrels: string[] = [
// Thirdparty barrels.
'rxjs',
// App specific barrels.
'demo-app',
'button-toggle',
'gestures',
'live-announcer',
'portal',
'overlay',
...components
/** @cli-barrel */
];
const _cliSystemConfig: any = angularPackages;
barrels.forEach((barrelName: string) => {
_cliSystemConfig[barrelName] = { main: 'index' };
});
/** Type declaration for ambient System. */
declare var System: any;
// Apply the CLI SystemJS configuration.
System.config({
map: {
'@angular': 'vendor/@angular',
'rxjs': 'vendor/rxjs',
'main': 'main.js'
},
packages: _cliSystemConfig
});
'main': 'main.js',
// Apply the user's configuration.
System.config({ packages });
// Angular specific mappings.
'@angular/core': 'vendor/@angular/core/bundles/core.umd.js',
'@angular/common': 'vendor/@angular/common/bundles/common.umd.js',
'@angular/compiler': 'vendor/@angular/compiler/bundles/compiler.umd.js',
'@angular/http': 'vendor/@angular/http/bundles/http.umd.js',
'@angular/forms': 'vendor/@angular/forms/bundles/forms.umd.js',
'@angular/router': 'vendor/@angular/router/bundles/router.umd.js',
'@angular/platform-browser': 'vendor/@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic':
'vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
},
packages: {
// Thirdparty barrels.
'rxjs': { main: 'index' },
'@angular/material': {
format: 'cjs',
main: 'material.umd.js'
},
// 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'
}
}
});
+1 -1
View File
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {TooltipPosition} from '@angular2-material/tooltip';
import {TooltipPosition} from '@angular/material';
@Component({
+3 -4
View File
@@ -15,12 +15,11 @@
"stripInternal": true,
"baseUrl": "",
"typeRoots": [
"../../node_modules/@types",
"../../node_modules"
"../../node_modules/@types"
],
"paths": {
"@angular2-material/*": [
"../../dist/@angular2-material/*"
"@angular/material": [
"../../dist/@angular/material"
]
},
"types": [
+1 -1
View File
@@ -6,7 +6,7 @@ import {IconE2E} from './icon/icon-e2e';
import {ButtonE2E} from './button/button-e2e';
import {MenuE2E} from './menu/menu-e2e';
import {BasicTabs} from './tabs/tabs-e2e';
import {MaterialModule} from '@angular2-material/all';
import {MaterialModule} from '@angular/material';
import {E2E_APP_ROUTES} from './e2e-app/routes';
+1 -1
View File
@@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="@angular2-material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
<link href="@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
<!-- FontAwesome for md-icon demo. -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
+26 -96
View File
@@ -1,104 +1,34 @@
/***********************************************************************************************
* User Configuration.
**********************************************************************************************/
const components = [
'all',
'button',
'card',
'checkbox',
'dialog',
'grid-list',
'icon',
'input',
'list',
'menu',
'progress-bar',
'progress-circle',
'radio',
'select',
'sidenav',
'slider',
'slide-toggle',
'button-toggle',
'tabs',
'toolbar',
'tooltip',
];
/** User packages configuration. */
const packages: any = {
'@angular2-material/core': {
format: 'cjs',
main: 'core.umd.js'
},
// 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'
}
};
components.forEach(name => {
packages[`@angular2-material/${name}`] = {
format: 'cjs',
main: `${name}.umd.js`
};
});
////////////////////////////////////////////////////////////////////////////////////////////////
/***********************************************************************************************
* Everything underneath this line is managed by the CLI.
**********************************************************************************************/
const angularPackages = {
// Angular specific barrels.
'@angular/core': { main: 'bundles/core.umd.js'},
'@angular/core/testing': { main: 'bundles/core-testing.umd.js'},
'@angular/common': { main: 'bundles/common.umd.js'},
'@angular/compiler': { main: 'bundles/compiler.umd.js'},
'@angular/http': { main: 'bundles/http.umd.js'},
'@angular/forms': { main: 'bundles/forms.umd.js'},
'@angular/router': { main: 'bundles/router.umd.js'},
'@angular/platform-browser': { main: 'bundles/platform-browser.umd.js'},
'@angular/platform-browser-dynamic': { main: 'bundles/platform-browser-dynamic.umd.js'},
'@angular/platform-browser-dynamic/testing': {
main: 'bundles/platform-browser-dynamic-testing.umd.js'
},
};
const barrels: string[] = [
// Thirdparty barrels.
'rxjs',
// App specific barrels.
'demo-app',
'button-toggle',
'gestures',
'live-announcer',
'portal',
'overlay',
...components
/** @cli-barrel */
];
const _cliSystemConfig = angularPackages;
barrels.forEach((barrelName: string) => {
(<any> _cliSystemConfig)[barrelName] = { main: 'index' };
});
/** Type declaration for ambient System. */
declare var System: any;
// Apply the CLI SystemJS configuration.
System.config({
map: {
'@angular': 'vendor/@angular',
'rxjs': 'vendor/rxjs',
'main': 'main.js'
},
packages: _cliSystemConfig
});
'main': 'main.js',
// Apply the user's configuration.
System.config({ packages });
// Angular specific mappings.
'@angular/core': 'vendor/@angular/core/bundles/core.umd.js',
'@angular/common': 'vendor/@angular/common/bundles/common.umd.js',
'@angular/compiler': 'vendor/@angular/compiler/bundles/compiler.umd.js',
'@angular/http': 'vendor/@angular/http/bundles/http.umd.js',
'@angular/forms': 'vendor/@angular/forms/bundles/forms.umd.js',
'@angular/router': 'vendor/@angular/router/bundles/router.umd.js',
'@angular/platform-browser': 'vendor/@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic':
'vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
},
packages: {
// Thirdparty barrels.
'rxjs': { main: 'index' },
'@angular/material': {
format: 'cjs',
main: 'material.umd.js'
},
// 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'
}
}
});
+2 -2
View File
@@ -19,8 +19,8 @@
"../../node_modules"
],
"paths": {
"@angular2-material/*": [
"../../dist/@angular2-material/*"
"@angular/material": [
"../../dist/@angular/material"
]
},
"types": [
-44
View File
@@ -1,44 +0,0 @@
@import '../core/core';
@import '../button/button-theme';
@import '../button-toggle/button-toggle-theme';
@import '../card/card-theme';
@import '../checkbox/checkbox-theme';
@import '../dialog/dialog-theme';
@import '../grid-list/grid-list-theme';
@import '../icon/icon-theme';
@import '../input/input-theme';
@import '../list/list-theme';
@import '../menu/menu-theme';
@import '../progress-bar/progress-bar-theme';
@import '../progress-circle/progress-circle-theme';
@import '../radio/radio-theme';
@import '../sidenav/sidenav-theme';
@import '../slide-toggle/slide-toggle-theme';
@import '../slider/slider-theme';
@import '../tabs/tabs-theme';
@import '../toolbar/toolbar-theme';
@import '../tooltip/tooltip-theme';
@mixin angular-material-theme($theme) {
@include md-core-theme($theme);
@include md-button-theme($theme);
@include md-button-toggle-theme($theme);
@include md-card-theme($theme);
@include md-checkbox-theme($theme);
@include md-dialog-theme($theme);
@include md-grid-list-theme($theme);
@include md-icon-theme($theme);
@include md-input-theme($theme);
@include md-list-theme($theme);
@include md-menu-theme($theme);
@include md-progress-bar-theme($theme);
@include md-progress-circle-theme($theme);
@include md-radio-theme($theme);
@include md-sidenav-theme($theme);
@include md-slide-toggle-theme($theme);
@include md-slider-theme($theme);
@include md-tabs-theme($theme);
@include md-toolbar-theme($theme);
@include md-tooltip-theme($theme);
}
-1
View File
@@ -1 +0,0 @@
export * from './all';
+1 -1
View File
@@ -21,7 +21,7 @@ import {
FormsModule,
} from '@angular/forms';
import {Observable} from 'rxjs/Observable';
import {BooleanFieldValue, MdUniqueSelectionDispatcher} from '@angular2-material/core';
import {BooleanFieldValue, MdUniqueSelectionDispatcher} from '../core';
export type ToggleType = 'checkbox' | 'radio';
-30
View File
@@ -1,30 +0,0 @@
{
"name": "@angular2-material/button-toggle",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material Button Toggle",
"main": "./button-toggle.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"button-toggle",
"button",
"toggle"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2",
"@angular/forms": "^2.0.0"
}
}
+1 -2
View File
@@ -10,8 +10,7 @@ import {
ModuleWithProviders,
} from '@angular/core';
import {CommonModule} from '@angular/common';
import {BooleanFieldValue} from '@angular2-material/core';
import {MdRippleModule} from '@angular2-material/core';
import {BooleanFieldValue, MdRippleModule} from '../core';
// TODO(jelbourn): Make the `isMouseDown` stuff done with one global listener.
// TODO(kara): Convert attribute selectors to classes when attr maps become available
-29
View File
@@ -1,29 +0,0 @@
{
"name": "@angular2-material/button",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material button",
"main": "./button.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"button",
"anchor",
"linkbutton"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
-27
View File
@@ -1,27 +0,0 @@
{
"name": "@angular2-material/card",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material card",
"main": "./card.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"card"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
-28
View File
@@ -1,28 +0,0 @@
{
"name": "@angular2-material/checkbox",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material checkbox",
"main": "./checkbox.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"checkbox"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2",
"@angular/forms": "^2.0.0"
}
}
+1
View File
@@ -0,0 +1 @@
export * from './core/index';
+46
View File
@@ -0,0 +1,46 @@
// Import all the theming functionality.
@import '../core';
@import '../../button/button-theme';
@import '../../button-toggle/button-toggle-theme';
@import '../../card/card-theme';
@import '../../checkbox/checkbox-theme';
@import '../../dialog/dialog-theme';
@import '../../grid-list/grid-list-theme';
@import '../../icon/icon-theme';
@import '../../input/input-theme';
@import '../../list/list-theme';
@import '../../menu/menu-theme';
@import '../../progress-bar/progress-bar-theme';
@import '../../progress-circle/progress-circle-theme';
@import '../../radio/radio-theme';
@import '../../sidenav/sidenav-theme';
@import '../../slide-toggle/slide-toggle-theme';
@import '../../slider/slider-theme';
@import '../../tabs/tabs-theme';
@import '../../toolbar/toolbar-theme';
@import '../../tooltip/tooltip-theme';
// Create a theme.
@mixin angular-material-theme($theme) {
@include md-core-theme($theme);
@include md-button-theme($theme);
@include md-button-toggle-theme($theme);
@include md-card-theme($theme);
@include md-checkbox-theme($theme);
@include md-dialog-theme($theme);
@include md-grid-list-theme($theme);
@include md-icon-theme($theme);
@include md-input-theme($theme);
@include md-list-theme($theme);
@include md-menu-theme($theme);
@include md-progress-bar-theme($theme);
@include md-progress-circle-theme($theme);
@include md-radio-theme($theme);
@include md-sidenav-theme($theme);
@include md-slide-toggle-theme($theme);
@include md-slider-theme($theme);
@include md-tabs-theme($theme);
@include md-toolbar-theme($theme);
@include md-tooltip-theme($theme);
}
@@ -1,7 +1,7 @@
@import '../theming';
@import '../all-theme';
@import '../palette';
@import '../../core';
@import '../../../all/all-theme';
$primary: md-palette($md-deep-purple);
@@ -1,8 +1,7 @@
@import '../theming';
@import '../all-theme';
@import '../palette';
@import '../../core';
@import '../../../all/all-theme';
$primary: md-palette($md-indigo);
@@ -1,7 +1,7 @@
@import '../theming';
@import '../all-theme';
@import '../palette';
@import '../../core';
@import '../../../all/all-theme';
$primary: md-palette($md-purple, 700, 500, 800);
+1 -1
View File
@@ -4,7 +4,7 @@ import {
ComponentPortal,
PortalHostDirective,
TemplatePortal
} from '@angular2-material/core';
} from '../core';
import {MdDialogConfig} from './dialog-config';
import {MdDialogContentAlreadyAttachedError} from './dialog-errors';
+1 -1
View File
@@ -1,4 +1,4 @@
import {MdError} from '@angular2-material/core';
import {MdError} from '../core';
/** Exception thrown when a ComponentPortal is attached to a DomPortalHost without an origin. */
export class MdDialogContentAlreadyAttachedError extends MdError {
+1 -1
View File
@@ -1,4 +1,4 @@
import {OverlayRef} from '@angular2-material/core';
import {OverlayRef} from '../core';
import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';
+1 -1
View File
@@ -1,7 +1,7 @@
import {inject, async, ComponentFixture, TestBed} from '@angular/core/testing';
import {NgModule, Component, Directive, ViewChild, ViewContainerRef} from '@angular/core';
import {MdDialog, MdDialogModule} from './dialog';
import {OverlayContainer} from '@angular2-material/core';
import {OverlayContainer} from '../core';
import {MdDialogConfig} from './dialog-config';
import {MdDialogRef} from './dialog-ref';
+2 -2
View File
@@ -7,8 +7,8 @@ import {
OverlayState,
ComponentPortal,
OVERLAY_PROVIDERS,
} from '@angular2-material/core';
import {ComponentType} from '@angular2-material/core';
} from '../core';
import {ComponentType} from '../core';
import {MdDialogConfig} from './dialog-config';
import {MdDialogRef} from './dialog-ref';
import {DialogInjector} from './dialog-injector';
+1 -1
View File
@@ -1,4 +1,4 @@
import {MdError} from '@angular2-material/core';
import {MdError} from '../core';
/**
* Exception thrown when cols property is missing from grid-list
+1 -1
View File
@@ -21,7 +21,7 @@ import {
FixedTileStyler
} from './tile-styler';
import {MdGridListColsError} from './grid-list-errors';
import {Dir, MdLineModule} from '@angular2-material/core';
import {Dir, MdLineModule} from '../core';
import {coerceToString, coerceToNumber} from './grid-list-measure';
// TODO(kara): Conditional (responsive) column count / row size.
+1 -1
View File
@@ -8,7 +8,7 @@ import {
QueryList,
AfterContentInit
} from '@angular/core';
import { MdLine, MdLineSetter } from '@angular2-material/core';
import { MdLine, MdLineSetter } from '../core';
import {coerceToNumber} from './grid-list-measure';
@Component({
-29
View File
@@ -1,29 +0,0 @@
{
"name": "@angular2-material/grid-list",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material grid list",
"main": "./grid-list.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"grid-list",
"list",
"tiles"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
import {Injectable} from '@angular/core';
import {Http} from '@angular/http';
import {MdError} from '@angular2-material/core';
import {MdError} from '../core';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/observable/forkJoin';
import 'rxjs/add/observable/of';
+1 -1
View File
@@ -13,7 +13,7 @@ import {
AfterViewChecked
} from '@angular/core';
import {HttpModule} from '@angular/http';
import {MdError} from '@angular2-material/core';
import {MdError} from '../core';
import {MdIconRegistry} from './icon-registry';
export {MdIconRegistry} from './icon-registry';
-28
View File
@@ -1,28 +0,0 @@
{
"name": "@angular2-material/icon",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material icon",
"main": "./icon.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"icon"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular/http": "^2.0.0",
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+23
View File
@@ -0,0 +1,23 @@
export * from './core';
export * from './module';
export * from './button/index';
export * from './button-toggle/index';
export * from './card/index';
export * from './checkbox/index';
export * from './dialog/index';
export * from './grid-list/index';
export * from './icon/index';
export * from './input/index';
export * from './list/index';
export * from './menu/index';
export * from './progress-bar/index';
export * from './progress-circle/index';
export * from './radio/index';
export * from './select/index';
export * from './sidenav/index';
export * from './slider/index';
export * from './slide-toggle/index';
export * from './tabs/index';
export * from './toolbar/index';
export * from './tooltip/index';
+1 -1
View File
@@ -24,7 +24,7 @@ import {
FormsModule,
} from '@angular/forms';
import {CommonModule} from '@angular/common';
import {BooleanFieldValue, MdError} from '@angular2-material/core';
import {BooleanFieldValue, MdError} from '../core';
import {Observable} from 'rxjs/Observable';
-30
View File
@@ -1,30 +0,0 @@
{
"name": "@angular2-material/input",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material input",
"main": "./input.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"input",
"text",
"textarea"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2",
"@angular/forms": "^2.0.0"
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ import {
NgModule,
ModuleWithProviders,
} from '@angular/core';
import {MdLine, MdLineSetter, MdLineModule} from '@angular2-material/core';
import {MdLine, MdLineSetter, MdLineModule} from '../core';
@Directive({
selector: 'md-divider'
-27
View File
@@ -1,27 +0,0 @@
{
"name": "@angular2-material/list",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material list",
"main": "./list.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"list"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ import {
import {MenuPositionX, MenuPositionY} from './menu-positions';
import {MdMenuInvalidPositionX, MdMenuInvalidPositionY} from './menu-errors';
import {MdMenuItem} from './menu-item';
import {UP_ARROW, DOWN_ARROW, TAB} from '@angular2-material/core';
import {UP_ARROW, DOWN_ARROW, TAB} from '../core';
@Component({
moduleId: module.id,
+1 -1
View File
@@ -1,4 +1,4 @@
import {MdError} from '@angular2-material/core';
import {MdError} from '../core';
/**
* Exception thrown when menu trigger doesn't have a valid md-menu instance
+1 -1
View File
@@ -21,7 +21,7 @@ import {
ConnectedPositionStrategy,
HorizontalConnectionPos,
VerticalConnectionPos
} from '@angular2-material/core';
} from '../core';
/**
* This directive is intended to be used in conjunction with an md-menu tag. It is
+1 -1
View File
@@ -1,6 +1,6 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';
import {OverlayModule, OVERLAY_PROVIDERS} from '@angular2-material/core';
import {OverlayModule, OVERLAY_PROVIDERS} from '../core';
import {MdMenu} from './menu-directive';
import {MdMenuItem} from './menu-item';
import {MdMenuTrigger} from './menu-trigger';
-27
View File
@@ -1,27 +0,0 @@
{
"name": "@angular2-material/menu",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material menu",
"main": "./menu.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"menu"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
-1
View File
@@ -1 +0,0 @@
declare var module: {id: string};
+23 -21
View File
@@ -1,31 +1,33 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {MdButtonToggleModule} from '@angular2-material/button-toggle';
import {MdButtonModule} from '@angular2-material/button';
import {MdCheckboxModule} from '@angular2-material/checkbox';
import {MdRadioModule} from '@angular2-material/radio';
import {MdSelectModule} from '@angular2-material/select';
import {MdSlideToggleModule} from '@angular2-material/slide-toggle';
import {MdSliderModule} from '@angular2-material/slider';
import {MdSidenavModule} from '@angular2-material/sidenav';
import {MdListModule} from '@angular2-material/list';
import {MdGridListModule} from '@angular2-material/grid-list';
import {MdCardModule} from '@angular2-material/card';
import {MdIconModule} from '@angular2-material/icon';
import {MdProgressCircleModule} from '@angular2-material/progress-circle';
import {MdProgressBarModule} from '@angular2-material/progress-bar';
import {MdInputModule} from '@angular2-material/input';
import {MdTabsModule} from '@angular2-material/tabs';
import {MdToolbarModule} from '@angular2-material/toolbar';
import {MdTooltipModule} from '@angular2-material/tooltip';
import {
MdLiveAnnouncer,
MdRippleModule,
RtlModule,
PortalModule,
OverlayModule
} from '@angular2-material/core';
import {MdMenuModule} from '@angular2-material/menu';
import {MdDialogModule} from '@angular2-material/dialog';
} from './core/index';
import {MdButtonToggleModule} from './button-toggle/index';
import {MdButtonModule} from './button/index';
import {MdCheckboxModule} from './checkbox/index';
import {MdRadioModule} from './radio/index';
import {MdSelectModule} from './select/index';
import {MdSlideToggleModule} from './slide-toggle/index';
import {MdSliderModule} from './slider/index';
import {MdSidenavModule} from './sidenav/index';
import {MdListModule} from './list/index';
import {MdGridListModule} from './grid-list/index';
import {MdCardModule} from './card/index';
import {MdIconModule} from './icon/index';
import {MdProgressCircleModule} from './progress-circle/index';
import {MdProgressBarModule} from './progress-bar/index';
import {MdInputModule} from './input/index';
import {MdTabsModule} from './tabs/index';
import {MdToolbarModule} from './toolbar/index';
import {MdTooltipModule} from './tooltip/index';
import {MdMenuModule} from './menu/index';
import {MdDialogModule} from './dialog/index';
const MATERIAL_MODULES = [
@@ -1,8 +1,8 @@
{
"name": "@angular2-material/core",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material core",
"main": "./core.umd.js",
"name": "@angular/material",
"version": "2.0.0-alpha.9",
"description": "Angular 2 Material",
"main": "./material.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
-29
View File
@@ -1,29 +0,0 @@
{
"name": "@angular2-material/progress-bar",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material progress-bar",
"main": "./progress-bar.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"progress",
"progressbar",
"loading"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
-28
View File
@@ -1,28 +0,0 @@
{
"name": "@angular2-material/progress-circle",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material progress-circle",
"main": "./progress-circle.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"progress",
"spinner"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
-28
View File
@@ -1,28 +0,0 @@
{
"name": "@angular2-material/radio",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material radio",
"main": "./radio.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"radio"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2",
"@angular/forms": "^2.0.0"
}
}
+1 -5
View File
@@ -19,11 +19,7 @@ import {
NG_VALUE_ACCESSOR,
ControlValueAccessor
} from '@angular/forms';
import {MdUniqueSelectionDispatcher} from '@angular2-material/core';
// Re-exports.
export {MdUniqueSelectionDispatcher} from '@angular2-material/core';
import {MdUniqueSelectionDispatcher} from '../core';
-30
View File
@@ -1,30 +0,0 @@
{
"name": "@angular2-material/sidenav",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material sidenav",
"main": "./sidenav.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"sidenav",
"sidepane",
"navigation",
"drawer"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ import {
ViewEncapsulation,
} from '@angular/core';
import {CommonModule} from '@angular/common';
import {Dir, MdError} from '@angular2-material/core';
import {Dir, MdError} from '../core';
/** Exception thrown when two MdSidenav are matching the same side. */
export class MdDuplicatedSidenavError extends MdError {
-30
View File
@@ -1,30 +0,0 @@
{
"name": "@angular2-material/slide-toggle",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material Slide Toggle",
"main": "./slide-toggle.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"slide-toggle",
"switch",
"toggle"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2",
"@angular/forms": "^2.0.0"
}
}
+2 -2
View File
@@ -17,9 +17,9 @@ import {
ControlValueAccessor,
NG_VALUE_ACCESSOR
} from '@angular/forms';
import {BooleanFieldValue, applyCssTransform} from '@angular2-material/core';
import {BooleanFieldValue, applyCssTransform} from '../core';
import {Observable} from 'rxjs/Observable';
import {MdGestureConfig} from '@angular2-material/core';
import {MdGestureConfig} from '../core';
export const MD_SLIDE_TOGGLE_VALUE_ACCESSOR: any = {
-27
View File
@@ -1,27 +0,0 @@
{
"name": "@angular2-material/slider",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material Slider",
"main": "./slider.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"slider"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ import {
FormsModule,
} from '@angular/forms';
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
import {BooleanFieldValue, MdGestureConfig, applyCssTransform} from '@angular2-material/core';
import {BooleanFieldValue, MdGestureConfig, applyCssTransform} from '../core';
import {Input as HammerInput} from 'hammerjs';
/**
+1 -1
View File
@@ -1,5 +1,5 @@
import {Injectable} from '@angular/core';
import {MdGestureConfig} from '@angular2-material/core';
import {MdGestureConfig} from '../core';
/**
* An extension of MdGestureConfig that exposes the underlying HammerManager instances.
+36 -101
View File
@@ -1,109 +1,44 @@
/***********************************************************************************************
* User Configuration.
**********************************************************************************************/
const components = [
'all',
'button',
'card',
'checkbox',
'dialog',
'grid-list',
'icon',
'input',
'list',
'menu',
'progress-bar',
'progress-circle',
'radio',
'select',
'sidenav',
'slider',
'slide-toggle',
'button-toggle',
'tabs',
'toolbar',
'tooltip',
];
/** User packages configuration. */
const packages: any = {
'@angular2-material/core': {
format: 'cjs',
defaultExtension: 'js',
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'
}
};
components.forEach(name => {
packages[`@angular2-material/${name}`] = {
format: 'cjs',
defaultExtension: 'js',
main: 'index'
};
});
////////////////////////////////////////////////////////////////////////////////////////////////
/***********************************************************************************************
* Everything underneath this line is managed by the CLI.
**********************************************************************************************/
const angularPackages = {
// Angular specific barrels.
'@angular/core': { main: 'bundles/core.umd.js'},
'@angular/core/testing': { main: '../bundles/core-testing.umd.js'},
'@angular/common': { main: 'bundles/common.umd.js'},
'@angular/compiler': { main: 'bundles/compiler.umd.js'},
'@angular/compiler/testing': { main: '../bundles/compiler-testing.umd.js'},
'@angular/http': { main: 'bundles/http.umd.js'},
'@angular/http/testing': { main: '../bundles/http-testing.umd.js'},
'@angular/forms': { main: 'bundles/forms.umd.js'},
'@angular/router': { main: 'bundles/router.umd.js'},
'@angular/platform-browser': { main: 'bundles/platform-browser.umd.js'},
'@angular/platform-browser/testing': { main: '../bundles/platform-browser-testing.umd.js'},
'@angular/platform-browser-dynamic': { main: 'bundles/platform-browser-dynamic.umd.js'},
'@angular/platform-browser-dynamic/testing': {
main: '../bundles/platform-browser-dynamic-testing.umd.js'
},
};
const barrels: string[] = [
// Thirdparty barrels.
'rxjs',
// App specific barrels.
'demo-app',
'button-toggle',
'gestures',
'live-announcer',
'portal',
'overlay',
...components
/** @cli-barrel */
];
const _cliSystemConfig = angularPackages;
barrels.forEach((barrelName: string) => {
(<any> _cliSystemConfig)[barrelName] = { main: 'index' };
});
/** Type declaration for ambient System. */
declare var System: any;
// Apply the CLI SystemJS configuration.
System.config({
map: {
'@angular': 'vendor/@angular',
'rxjs': 'vendor/rxjs',
'main': 'main.js'
},
packages: _cliSystemConfig
});
'main': 'main.js',
// Apply the user's configuration.
System.config({ packages });
// Angular specific mappings.
'@angular/core': 'vendor/@angular/core/bundles/core.umd.js',
'@angular/core/testing': 'vendor/@angular/core/bundles/core-testing.umd.js',
'@angular/common': 'vendor/@angular/common/bundles/common.umd.js',
'@angular/common/testing': 'vendor/@angular/common/bundles/common-testing.umd.js',
'@angular/compiler': 'vendor/@angular/compiler/bundles/compiler.umd.js',
'@angular/compiler/testing': 'vendor/@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/http': 'vendor/@angular/http/bundles/http.umd.js',
'@angular/http/testing': 'vendor/@angular/http/bundles/http-testing.umd.js',
'@angular/forms': 'vendor/@angular/forms/bundles/forms.umd.js',
'@angular/forms/testing': 'vendor/@angular/forms/bundles/forms-testing.umd.js',
'@angular/router': 'vendor/@angular/router/bundles/router.umd.js',
'@angular/router/testing': 'vendor/@angular/router/bundles/router-testing.umd.js',
'@angular/platform-browser': 'vendor/@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser/testing':
'vendor/@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic':
'vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/platform-browser-dynamic/testing':
'vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
},
packages: {
// Thirdparty barrels.
'rxjs': { main: 'index' },
'@angular/material': {
format: 'cjs',
main: 'material.umd.js'
},
// 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'
}
}
});
-27
View File
@@ -1,27 +0,0 @@
{
"name": "@angular2-material/tabs",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material Tabs",
"main": "./tabs.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"tabs"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
import {Directive, TemplateRef, ViewContainerRef} from '@angular/core';
import {TemplatePortalDirective} from '@angular2-material/core';
import {TemplatePortalDirective} from '../core';
/** Used to flag tab contents for use with the portal directive */
@Directive({
+1 -1
View File
@@ -1,5 +1,5 @@
import {Directive, TemplateRef, ViewContainerRef} from '@angular/core';
import {TemplatePortalDirective} from '@angular2-material/core';
import {TemplatePortalDirective} from '../core';
/** Used to flag tab labels for use with the portal directive */
@Directive({
+2 -2
View File
@@ -13,14 +13,14 @@ import {
ContentChildren
} from '@angular/core';
import {CommonModule} from '@angular/common';
import {PortalModule} from '@angular2-material/core';
import {PortalModule} from '../core';
import {MdTabLabel} from './tab-label';
import {MdTabContent} from './tab-content';
import {MdTabLabelWrapper} from './tab-label-wrapper';
import {MdInkBar} from './ink-bar';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import {RIGHT_ARROW, LEFT_ARROW, ENTER} from '@angular2-material/core';
import {RIGHT_ARROW, LEFT_ARROW, ENTER} from '../core';
/** Used to generate unique ID's for each tab component */
let nextId = 0;
-28
View File
@@ -1,28 +0,0 @@
{
"name": "@angular2-material/toolbar",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material toolbar",
"main": "./toolbar.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"toolbar",
"header"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
-27
View File
@@ -1,27 +0,0 @@
{
"name": "@angular2-material/tooltip",
"version": "2.0.0-alpha.8-2",
"description": "Angular 2 Material tooltip",
"main": "./tooltip.umd.js",
"module": "./index.js",
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components",
"tooltip"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"@angular2-material/core": "2.0.0-alpha.8-2"
}
}
+2 -2
View File
@@ -1,8 +1,8 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {Component, DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
import {TooltipPosition, MdTooltip} from '@angular2-material/tooltip';
import {OverlayContainer} from '@angular2-material/core';
import {TooltipPosition, MdTooltip} from './tooltip';
import {OverlayContainer} from '../core';
import {MdTooltipModule} from './tooltip';
+1 -1
View File
@@ -17,7 +17,7 @@ import {
OverlayConnectionPosition,
OriginConnectionPosition,
OVERLAY_PROVIDERS,
} from '@angular2-material/core';
} from '../core';
export type TooltipPosition = 'before' | 'after' | 'above' | 'below';
+1 -4
View File
@@ -9,7 +9,7 @@
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"outDir": "../../dist/@angular2-material",
"outDir": "../../dist/@angular/material",
"rootDir": ".",
"sourceMap": true,
"target": "es5",
@@ -17,9 +17,6 @@
"stripInternal": true,
"baseUrl": "",
"paths": {
"@angular2-material/*": [
"./*"
]
},
"typeRoots": [
"../../node_modules/@types"
+3 -9
View File
@@ -9,18 +9,12 @@
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"outDir": "../../dist/@angular2-material",
"outDir": "../../dist/@angular/material",
"rootDir": ".",
"sourceMap": true,
"target": "es5",
"inlineSources": true,
"stripInternal": true,
"baseUrl": "",
"paths": {
"@angular2-material/*": [
"./*"
]
},
"typeRoots": [
"../../node_modules/@types"
],
@@ -29,10 +23,10 @@
},
"exclude": [
"**/*.spec.*",
"system-config-spec"
"system-config-spec.ts"
],
"angularCompilerOptions": {
"genDir": "../../dist",
"genDir": "../../dist/@angular/material",
"skipTemplateCodegen": true,
"debug": true
}
+1
View File
@@ -0,0 +1 @@
declare const module: {id: string};
+1 -1
View File
@@ -28,7 +28,7 @@ System.config({
baseURL: distPath
});
System.import(distPath + '@angular2-material/system-config-spec.js').then(function() {
System.import(distPath + '@angular/material/system-config-spec.js').then(function() {
// Load and configure the TestComponentBuilder.
return Promise.all([
System.import('@angular/core/testing'),
+1 -1
View File
@@ -4,7 +4,7 @@ export const PROJECT_ROOT = join(__dirname, '../..');
export const SOURCE_ROOT = join(PROJECT_ROOT, 'src');
export const DIST_ROOT = join(PROJECT_ROOT, 'dist');
export const DIST_COMPONENTS_ROOT = join(DIST_ROOT, '@angular2-material');
export const DIST_COMPONENTS_ROOT = join(DIST_ROOT, '@angular/material');
export const NPM_VENDOR_FILES = [
+35 -45
View File
@@ -1,9 +1,10 @@
import {task, watch} from 'gulp';
import {readdirSync, statSync, writeFileSync} from 'fs';
import {readdirSync, statSync, readFileSync} from 'fs';
import * as path from 'path';
import {SOURCE_ROOT, DIST_COMPONENTS_ROOT, PROJECT_ROOT} from '../constants';
import {sassBuildTask, tsBuildTask, execNodeTask, copyTask, sequenceTask} from '../task_helpers';
import {writeFileSync} from 'fs';
// No typings for these.
const inlineResources = require('../../../scripts/release/inline-resources');
@@ -12,13 +13,6 @@ const rollup = require('rollup').rollup;
const componentsDir = path.join(SOURCE_ROOT, 'lib');
function camelCase(str: string) {
return str.replace(/-(\w)/g, (_: any, letter: string) => {
return letter.toUpperCase();
})
}
task(':watch:components', () => {
watch(path.join(componentsDir, '**/*.ts'), [':build:components:ts']);
watch(path.join(componentsDir, '**/*.scss'), [':build:components:scss']);
@@ -39,10 +33,7 @@ task(':build:components:assets',
task(':build:components:scss', sassBuildTask(
DIST_COMPONENTS_ROOT, componentsDir, [path.join(componentsDir, 'core/style')]
));
task(':build:components:rollup', [':build:components:ts'], () => {
const components = readdirSync(componentsDir)
.filter(componentName => (statSync(path.join(componentsDir, componentName))).isDirectory());
task(':build:components:rollup', [':build:components:inline'], () => {
const globals: {[name: string]: string} = {
// Angular dependencies
'@angular/core': 'ng.core',
@@ -65,46 +56,45 @@ task(':build:components:rollup', [':build:components:ts'], () => {
'rxjs/add/operator/catch': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx'
};
components.forEach(name => {
globals[`@angular2-material/${name}`] = `md.${camelCase(name)}`
});
// Build all of them asynchronously.
return components.reduce((previous, name) => {
return previous
.then(() => {
return rollup({
entry: path.join(DIST_COMPONENTS_ROOT, name, 'index.js'),
context: 'window',
external: [
...Object.keys(globals),
...components.map(name => `@angular2-material/${name}`)
]
});
})
.then((bundle: any) => {
const result = bundle.generate({
moduleName: `md.${camelCase(name)}`,
format: 'umd',
globals
});
const outputPath = path.join(DIST_COMPONENTS_ROOT, name, `${name}.umd.js`);
writeFileSync( outputPath, result.code );
});
}, Promise.resolve());
// Rollup the @angular/material UMD bundle from all ES5 + imports JavaScript files built.
return rollup({
entry: path.join(DIST_COMPONENTS_ROOT, 'index.js'),
context: 'this',
external: Object.keys(globals)
}).then((bundle: { generate: any }) => {
const result = bundle.generate({
moduleName: 'ng.material',
format: 'umd',
globals,
sourceMap: true,
dest: path.join(DIST_COMPONENTS_ROOT, 'material.umd.js')
});
// Add source map URL to the code.
result.code += '\n\n//# sourceMappingURL=./material.umd.js.map\n';
// Format mapping to show properly in the browser. Rollup by default will put the path
// as relative to the file, and since that path is in src/lib and the file is in
// dist/@angular/material, we need to kill a few `../`.
result.map.sources = result.map.sources.map((s: string) => s.replace(/^(\.\.\/)+/, ''));
writeFileSync(path.join(DIST_COMPONENTS_ROOT, 'material.umd.js'), result.code, 'utf8');
writeFileSync(path.join(DIST_COMPONENTS_ROOT, 'material.umd.js.map'), result.map, 'utf8');
});
});
task(':build:components:inline', [
':build:components:ts',
':build:components:scss',
':build:components:assets'
], () => {
return inlineResources(DIST_COMPONENTS_ROOT);
});
task('build:components', sequenceTask(
':build:components:rollup',
':build:components:assets',
':build:components:scss',
':inline-resources',
));
task(':build:components:ngc', ['build:components'], execNodeTask(
'@angular/compiler-cli', 'ngc', ['-p', path.relative(PROJECT_ROOT, path.join(componentsDir, 'tsconfig.json'))]
));
task(':inline-resources', () => {
inlineResources([DIST_COMPONENTS_ROOT]);
});
-1
View File
@@ -41,7 +41,6 @@ let stopE2eServer: () => void = null;
task(':serve:e2eapp', serverTask(false, (stream) => { stopE2eServer = () => stream.emit('kill') }));
task(':serve:e2eapp:stop', () => stopE2eServer());
task('serve:e2eapp', ['build:e2eapp'], sequenceTask([
':inline-resources',
':serve:e2eapp',
':watch:components',
]));
+17 -17
View File
@@ -34,40 +34,41 @@ task(':publish:whoami', execTask('npm', ['whoami'], {
task(':publish:logout', execTask('npm', ['logout']));
function _execNpmPublish(componentName: string, label: string): Promise<void> {
const componentPath = path.join(DIST_COMPONENTS_ROOT, componentName);
const stat = statSync(componentPath);
if (!stat.isDirectory()) {
function _execNpmPublish(label: string): Promise<void> {
const packageDir = DIST_COMPONENTS_ROOT;
if (!statSync(packageDir).isDirectory()) {
return;
}
if (!existsSync(path.join(componentPath, 'package.json'))) {
console.log(`Skipping ${componentPath} as it does not have a package.json.`);
return;
if (!existsSync(path.join(packageDir, 'package.json'))) {
throw new Error(`"${packageDir}" does not have a package.json.`);
}
process.chdir(componentPath);
console.log(`Publishing ${componentName}...`);
process.chdir(packageDir);
console.log(`Publishing material...`);
const command = 'npm';
const args = ['publish', '--access', 'public', label ? `--tag` : undefined, label || undefined];
return new Promise((resolve, reject) => {
console.log(`Executing "${command} ${args.join(' ')}"...`);
console.log(` Executing "${command} ${args.join(' ')}"...`);
if (argv['dry']) {
resolve();
return;
}
const childProcess = spawn(command, args);
childProcess.stdout.on('data', (data: Buffer) => {
console.log(`stdout: ${data.toString().split(/[\n\r]/g).join('\n ')}`);
console.log(` stdout: ${data.toString().split(/[\n\r]/g).join('\n ')}`);
});
childProcess.stderr.on('data', (data: Buffer) => {
console.error(`stderr: ${data.toString().split(/[\n\r]/g).join('\n ')}`);
console.error(` stderr: ${data.toString().split(/[\n\r]/g).join('\n ')}`);
});
childProcess.on('close', (code: number) => {
if (code == 0) {
resolve();
} else {
reject(new Error(`Component ${componentName} did not publish, status: ${code}.`));
reject(new Error(`Material did not publish, status: ${code}.`));
}
});
});
@@ -85,9 +86,8 @@ task(':publish', function(done: (err?: any) => void) {
}
console.log('\n\n');
// Build a promise chain that publish each component.
readdirSync(DIST_COMPONENTS_ROOT)
.reduce((prev, dirName) => prev.then(() => _execNpmPublish(dirName, label)), Promise.resolve())
// Publish only the material package.
return _execNpmPublish(label)
.then(() => done())
.catch((err: Error) => done(err))
.then(() => process.chdir(currentDir));
+5 -9
View File
@@ -26,8 +26,8 @@ gulp.task(':test:deps', sequenceTask(
[
':build:test:vendor',
':build:components:assets',
':build:components:scss',
':build:components:spec',
':build:components:inline',
':watch:components:spec',
]
));
@@ -39,12 +39,8 @@ gulp.task('test', [':test:deps'], (done: () => void) => {
});
gulp.task('test:single-run', [':test:deps'], (done: () => void) => {
runSequence(
':inline-resources',
() => {
new karma.Server({
configFile: path.join(PROJECT_ROOT, 'test/karma.conf.js'),
singleRun: true
}, done).start();
});
new karma.Server({
configFile: path.join(PROJECT_ROOT, 'test/karma.conf.js'),
singleRun: true
}, done).start();
});