build(): add release staging script.

This commit is contained in:
Jeremy Elbourn
2016-03-14 16:50:45 -07:00
parent 07136f1458
commit 3557839190
13 changed files with 252 additions and 4 deletions
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -ex
# Stages a release by putting everything that should be packaged and released
# into the ./deploy folder. This script should be run from the root of the
# material2 repo.
# Make sure you are not running `ng serve` or `ng build --watch` when running this.
# Clear dist/ and deploy/ so that we guarantee there are no stale artifacts.
rm -rf ./dist
rm -rf ./deploy
# For packaging for npm only, replace the TypeScript module format to commonjs.
# Creates a tscongig.json.backup with the original file that we'll use to restore after building.
sed -i.backup 's|"module": ".+"|"module": "commonjs"|g' ./src/tsconfig.json
# Perform a build with the modified tsconfig.json.
ng build
# Return tsconfig.json to its original state.
mv -f ./src/tsconfig.json.backup ./src/tsconfig.json
# Inline the css and html into the component ts files.
./node_modules/gulp/bin/gulp.js inline-resources
# deploy/ serves as a working directory to stage the release.
mkdir deploy
# Copy all components/ to deploy/ and replace "../core" with just "core" since each
# component directory will now live as a sibling to core/.
# Use a `.bak` extension for sed backup because `sed` on OSX will not work without a backup
# extension. Delete the backups immediately after.
cp -R ./dist/components/* ./deploy/
find ./deploy -type f \( -name "*.js" -o -name "*.ts" \) -exec sed -i.bak 's|\.\./core|core|g' {} \;
find ./deploy -type f -name "*.bak" | xargs rm
# Copy the core/ directory directly into ./deploy
cp -R ./dist/core/ ./deploy/core/
# To test the packages, use `npm link` in the package directories.
# See https://docs.npmjs.com/cli/link
+29
View File
@@ -0,0 +1,29 @@
{
"name": "@angular2-material/button",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material button",
"main": "./button.js",
"typings": "./button.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": "^2.0.0-beta.8",
"@angular2-material/core": "2.0.0-alpha.0"
}
}
+27
View File
@@ -0,0 +1,27 @@
{
"name": "@angular2-material/card",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material card",
"main": "./card.js",
"typings": "./card.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": "^2.0.0-beta.8",
"@angular2-material/core": "2.0.0-alpha.0"
}
}
+27
View File
@@ -0,0 +1,27 @@
{
"name": "@angular2-material/checkbox",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material checkbox",
"main": "./checkbox.js",
"typings": "./checkbox.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": "^2.0.0-beta.8",
"@angular2-material/core": "2.0.0-alpha.0"
}
}
@@ -0,0 +1,28 @@
{
"name": "@angular2-material/progress-circle",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material progress-circle",
"main": "./progress-circle.js",
"typings": "./progress-circle.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": "^2.0.0-beta.8",
"@angular2-material/core": "2.0.0-alpha.0"
}
}

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

@@ -9,7 +9,7 @@ import {
} from '../../core/facade/testing';
import {Component, DebugElement} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {MdProgressCircle} from './progress_circle';
import {MdProgressCircle} from './progress-circle';
export function main() {
@@ -29,7 +29,7 @@ class ProgressMode {
'aria-valuemin': '0',
'aria-valuemax': '100',
},
templateUrl: './components/progress-circle/progress_circle.html',
templateUrl: './components/progress-circle/progress-circle.html',
styleUrls: ['./components/progress-circle/progress-circle.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
@@ -106,7 +106,7 @@ export class MdProgressCircle {
host: {
'role': 'progressbar',
},
templateUrl: './components/progress-circle/progress_circle.html',
templateUrl: './components/progress-circle/progress-circle.html',
styleUrls: ['./components/progress-circle/progress-circle.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
+30
View File
@@ -0,0 +1,30 @@
{
"name": "@angular2-material/sidenav",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material sidenav",
"main": "./sidenav.js",
"typings": "./sidenav.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": "^2.0.0-beta.8",
"@angular2-material/core": "2.0.0-alpha.0"
}
}
+27
View File
@@ -0,0 +1,27 @@
{
"name": "@angular2-material/toolbar",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material toolbar",
"main": "./toolbar.js",
"typings": "./toolbar.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": "^2.0.0-beta.8"
}
}
+12
View File
@@ -0,0 +1,12 @@
// RTL
export * from './rtl/dir';
// Annotations
export {OneOf} from './annotations/one-of';
// Portals
export * from './portal/portal';
export * from './portal/portal-directives';
// Facades
export * from './facade/html';
+25
View File
@@ -0,0 +1,25 @@
{
"name": "@angular2-material/core",
"version": "2.0.0-alpha.0",
"description": "Angular 2 Material core",
"main": "./core.js",
"typings": "./core.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/angular/material2.git"
},
"keywords": [
"angular",
"material",
"material design",
"components"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/material2/issues"
},
"homepage": "https://github.com/angular/material2#readme",
"peerDependencies": {
"angular2": "^2.0.0-beta.8"
}
}
@@ -1,6 +1,6 @@
import {Component} from 'angular2/core';
import {MdButton} from '../../components/button/button';
import {MdProgressCircle, MdSpinner} from '../../components/progress-circle/progress_circle';
import {MdProgressCircle, MdSpinner} from '../../components/progress-circle/progress-circle';
@Component({
selector: 'progress-circle-demo',