Skip to content

Commit 3557839

Browse files
committed
build(): add release staging script.
1 parent 07136f1 commit 3557839

File tree

13 files changed

+252
-4
lines changed

13 files changed

+252
-4
lines changed

scripts/release/stage-release.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
# Stages a release by putting everything that should be packaged and released
5+
# into the ./deploy folder. This script should be run from the root of the
6+
# material2 repo.
7+
8+
# Make sure you are not running `ng serve` or `ng build --watch` when running this.
9+
10+
11+
# Clear dist/ and deploy/ so that we guarantee there are no stale artifacts.
12+
rm -rf ./dist
13+
rm -rf ./deploy
14+
15+
# For packaging for npm only, replace the TypeScript module format to commonjs.
16+
# Creates a tscongig.json.backup with the original file that we'll use to restore after building.
17+
sed -i.backup 's|"module": ".+"|"module": "commonjs"|g' ./src/tsconfig.json
18+
19+
# Perform a build with the modified tsconfig.json.
20+
ng build
21+
22+
# Return tsconfig.json to its original state.
23+
mv -f ./src/tsconfig.json.backup ./src/tsconfig.json
24+
25+
# Inline the css and html into the component ts files.
26+
./node_modules/gulp/bin/gulp.js inline-resources
27+
28+
# deploy/ serves as a working directory to stage the release.
29+
mkdir deploy
30+
31+
# Copy all components/ to deploy/ and replace "../core" with just "core" since each
32+
# component directory will now live as a sibling to core/.
33+
# Use a `.bak` extension for sed backup because `sed` on OSX will not work without a backup
34+
# extension. Delete the backups immediately after.
35+
cp -R ./dist/components/* ./deploy/
36+
find ./deploy -type f \( -name "*.js" -o -name "*.ts" \) -exec sed -i.bak 's|\.\./core|core|g' {} \;
37+
find ./deploy -type f -name "*.bak" | xargs rm
38+
39+
# Copy the core/ directory directly into ./deploy
40+
cp -R ./dist/core/ ./deploy/core/
41+
42+
# To test the packages, use `npm link` in the package directories.
43+
# See https://docs.npmjs.com/cli/link

src/components/button/package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@angular2-material/button",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material button",
5+
"main": "./button.js",
6+
"typings": "./button.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"button",
17+
"anchor",
18+
"linkbutton"
19+
],
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/angular/material2/issues"
23+
},
24+
"homepage": "https://github.com/angular/material2#readme",
25+
"peerDependencies": {
26+
"angular2": "^2.0.0-beta.8",
27+
"@angular2-material/core": "2.0.0-alpha.0"
28+
}
29+
}

src/components/card/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@angular2-material/card",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material card",
5+
"main": "./card.js",
6+
"typings": "./card.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"card"
17+
],
18+
"license": "MIT",
19+
"bugs": {
20+
"url": "https://github.com/angular/material2/issues"
21+
},
22+
"homepage": "https://github.com/angular/material2#readme",
23+
"peerDependencies": {
24+
"angular2": "^2.0.0-beta.8",
25+
"@angular2-material/core": "2.0.0-alpha.0"
26+
}
27+
}

src/components/checkbox/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@angular2-material/checkbox",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material checkbox",
5+
"main": "./checkbox.js",
6+
"typings": "./checkbox.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"checkbox"
17+
],
18+
"license": "MIT",
19+
"bugs": {
20+
"url": "https://github.com/angular/material2/issues"
21+
},
22+
"homepage": "https://github.com/angular/material2#readme",
23+
"peerDependencies": {
24+
"angular2": "^2.0.0-beta.8",
25+
"@angular2-material/core": "2.0.0-alpha.0"
26+
}
27+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@angular2-material/progress-circle",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material progress-circle",
5+
"main": "./progress-circle.js",
6+
"typings": "./progress-circle.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"progress",
17+
"spinner"
18+
],
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/angular/material2/issues"
22+
},
23+
"homepage": "https://github.com/angular/material2#readme",
24+
"peerDependencies": {
25+
"angular2": "^2.0.0-beta.8",
26+
"@angular2-material/core": "2.0.0-alpha.0"
27+
}
28+
}

src/components/progress-circle/progress_circle.spec.ts renamed to src/components/progress-circle/progress-circle.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from '../../core/facade/testing';
1010
import {Component, DebugElement} from 'angular2/core';
1111
import {By} from 'angular2/platform/browser';
12-
import {MdProgressCircle} from './progress_circle';
12+
import {MdProgressCircle} from './progress-circle';
1313

1414

1515
export function main() {

src/components/progress-circle/progress_circle.ts renamed to src/components/progress-circle/progress-circle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ProgressMode {
2929
'aria-valuemin': '0',
3030
'aria-valuemax': '100',
3131
},
32-
templateUrl: './components/progress-circle/progress_circle.html',
32+
templateUrl: './components/progress-circle/progress-circle.html',
3333
styleUrls: ['./components/progress-circle/progress-circle.css'],
3434
changeDetection: ChangeDetectionStrategy.OnPush,
3535
})
@@ -106,7 +106,7 @@ export class MdProgressCircle {
106106
host: {
107107
'role': 'progressbar',
108108
},
109-
templateUrl: './components/progress-circle/progress_circle.html',
109+
templateUrl: './components/progress-circle/progress-circle.html',
110110
styleUrls: ['./components/progress-circle/progress-circle.css'],
111111
changeDetection: ChangeDetectionStrategy.OnPush,
112112
})

src/components/sidenav/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@angular2-material/sidenav",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material sidenav",
5+
"main": "./sidenav.js",
6+
"typings": "./sidenav.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"sidenav",
17+
"sidepane",
18+
"navigation",
19+
"drawer"
20+
],
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/angular/material2/issues"
24+
},
25+
"homepage": "https://github.com/angular/material2#readme",
26+
"peerDependencies": {
27+
"angular2": "^2.0.0-beta.8",
28+
"@angular2-material/core": "2.0.0-alpha.0"
29+
}
30+
}

src/components/toolbar/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@angular2-material/toolbar",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material toolbar",
5+
"main": "./toolbar.js",
6+
"typings": "./toolbar.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components",
16+
"toolbar",
17+
"header"
18+
],
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/angular/material2/issues"
22+
},
23+
"homepage": "https://github.com/angular/material2#readme",
24+
"peerDependencies": {
25+
"angular2": "^2.0.0-beta.8"
26+
}
27+
}

src/core/core.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RTL
2+
export * from './rtl/dir';
3+
4+
// Annotations
5+
export {OneOf} from './annotations/one-of';
6+
7+
// Portals
8+
export * from './portal/portal';
9+
export * from './portal/portal-directives';
10+
11+
// Facades
12+
export * from './facade/html';

src/core/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@angular2-material/core",
3+
"version": "2.0.0-alpha.0",
4+
"description": "Angular 2 Material core",
5+
"main": "./core.js",
6+
"typings": "./core.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/angular/material2.git"
10+
},
11+
"keywords": [
12+
"angular",
13+
"material",
14+
"material design",
15+
"components"
16+
],
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/angular/material2/issues"
20+
},
21+
"homepage": "https://github.com/angular/material2#readme",
22+
"peerDependencies": {
23+
"angular2": "^2.0.0-beta.8"
24+
}
25+
}

src/demo-app/progress-circle/progress-circle-demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Component} from 'angular2/core';
22
import {MdButton} from '../../components/button/button';
3-
import {MdProgressCircle, MdSpinner} from '../../components/progress-circle/progress_circle';
3+
import {MdProgressCircle, MdSpinner} from '../../components/progress-circle/progress-circle';
44

55
@Component({
66
selector: 'progress-circle-demo',

0 commit comments

Comments
 (0)