Skip to content

Commit a8c2cab

Browse files
committed
build: create example package
* Initial refactoring that allows Material to build multiple packages using a shared logic.
1 parent 9d719c5 commit a8c2cab

19 files changed

+299
-163
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ High level items planned for next few months:
112112
[16]: https://material.angular.io/components/component/slider
113113
[17]: https://material.angular.io/components/component/menu
114114
[18]: https://material.angular.io/components/component/tooltip
115-
[19]: https://github.com/angular/material2/blob/master/src/lib/core/ripple/README.md
115+
[19]: https://github.com/angular/material2/blob/master/src/material/core/ripple/README.md
116116
[20]: https://github.com/angular/material2/blob/master/guides/theming.md
117117
[21]: https://material.angular.io/components/component/snack-bar
118118
[22]: https://material.angular.io/components/component/dialog

scripts/closure-compiler/build-devapp-bundle.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ OPTS=(
3939

4040
# List of path prefixes to be removed from ES6 & CommonJS modules.
4141
"--js_module_root=dist/packages"
42-
"--js_module_root=dist/release"
42+
"--js_module_root=dist/releases/material"
4343
"--js_module_root=node_modules/@angular/core"
4444
"--js_module_root=node_modules/@angular/common"
4545
"--js_module_root=node_modules/@angular/compiler"
@@ -57,7 +57,7 @@ OPTS=(
5757
"--debug"
5858

5959
# Include the Material FESM bundle
60-
dist/release/@angular/material.js
60+
dist/releases/material/@angular/material.js
6161

6262
# Include all Angular FESM bundles.
6363
node_modules/@angular/core/@angular/core.js

scripts/release/publish-build-artifacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e -o pipefail
88
# Go to the project root directory
99
cd $(dirname $0)/../..
1010

11-
buildDir="dist/release"
11+
buildDir="dist/releases/material"
1212
buildVersion=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)
1313

1414
commitSha=$(git rev-parse --short HEAD)
File renamed without changes.

src/examples/autocomplete-overview/autocomplete-overview-example.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {Component} from '@angular/core';
22
import {FormControl} from '@angular/forms';
3+
34
import 'rxjs/add/operator/startWith';
5+
import 'rxjs/add/operator/map';
46

57
@Component({
68
selector: 'autocomplete-overview-example',

src/examples/package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@angular/material-examples",
3+
"version": "2.0.0-beta.3",
4+
"description": "Angular Material",
5+
"main": "./bundles/examples.umd.js",
6+
"module": "./@angular/examples.es5.js",
7+
"es2015": "./@angular/examples.js",
8+
"typings": "./examples.d.ts",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/angular/material2.git"
12+
},
13+
"keywords": [
14+
"angular",
15+
"material",
16+
"material design",
17+
"components"
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+
"@angular/core": "^4.0.0",
26+
"@angular/common": "^4.0.0",
27+
"@angular/http": "^4.0.0"
28+
}
29+
}

src/examples/public_api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './example-data';
2+
export * from './example-module';

src/examples/tsconfig-build.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// TypeScript config file that is used to compile the examples. Target environment needs to be
2+
// ES2015 since the build process will create FESM bundles using rollup.
3+
{
4+
"compilerOptions": {
5+
"baseUrl": ".",
6+
"declaration": true,
7+
"stripInternal": false,
8+
"experimentalDecorators": true,
9+
"module": "es2015",
10+
"moduleResolution": "node",
11+
"outDir": "../../dist/packages/examples",
12+
"paths": {
13+
"@angular/material": [
14+
"../../dist/packages/material"
15+
]
16+
},
17+
"rootDir": ".",
18+
"sourceMap": true,
19+
"inlineSources": true,
20+
"target": "es2015",
21+
"lib": ["es2015", "dom"],
22+
"skipLibCheck": true,
23+
"types": []
24+
},
25+
"files": [
26+
"public_api.ts"
27+
],
28+
"angularCompilerOptions": {
29+
"annotateForClosureCompiler": true,
30+
"strictMetadataEmit": true,
31+
"flatModuleOutFile": "index.js",
32+
"skipTemplateCodegen": true
33+
}
34+
}

src/tsconfig.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"inlineSources": true,
1111
"target": "es2015",
1212
"lib": ["es2015", "dom"],
13-
"types": ["jasmine"]
13+
"types": ["jasmine"],
14+
"paths": {
15+
"@angular/material": [
16+
"../../dist/packages/material"
17+
]
18+
}
1419
}
1520
}

tools/gulp/constants.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ export const DIST_BUNDLES = join(DIST_ROOT, 'bundles');
1313

1414
/** Output subdirectory where all library artifacts will be written (compiled JS, CSS, etc.) */
1515
export const DIST_MATERIAL = join(DIST_ROOT, 'packages', 'material');
16-
17-
/** Output subdirectory where the npm package will be staged for publish */
18-
export const DIST_RELEASE = join(DIST_ROOT, 'release');
19-
2016
export const DIST_DEMOAPP = join(DIST_ROOT, 'packages', 'demo-app');
2117
export const DIST_E2EAPP = join(DIST_ROOT, 'packages', 'e2e-app');
18+
export const DIST_EXAMPLES = join(DIST_ROOT, 'packages', 'examples');
19+
20+
export const DIST_RELEASES = join(DIST_ROOT, 'releases');
2221

2322
export const COVERAGE_RESULT_FILE = join(DIST_ROOT, 'coverage', 'coverage-summary.json');
2423

0 commit comments

Comments
 (0)