Skip to content

Commit a7ca7c1

Browse files
devversionjelbourn
authored andcommitted
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.
1 parent b2ca0f5 commit a7ca7c1

23 files changed

+253
-113
lines changed

src/cdk/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@angular/cdk",
3+
"version": "0.0.0-PLACEHOLDER",
4+
"description": "Angular Material Component Development Kit",
5+
"main": "./bundles/cdk.umd.js",
6+
"module": "./@angular/cdk.es5.js",
7+
"es2015": "./@angular/cdkjs",
8+
"typings": "./cdk.d.ts",
9+
"private": true,
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/angular/material2.git"
13+
},
14+
"keywords": [
15+
"angular",
16+
"cdk",
17+
"component",
18+
"development",
19+
"kit"
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+
"@angular/core": "^4.0.0",
28+
"@angular/common": "^4.0.0"
29+
}
30+
}

src/cdk/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const __TEMP__ = -1;

src/cdk/tsconfig-build.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// TypeScript config file that is used to compile the cdk package. 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/cdk",
12+
"paths": {},
13+
"rootDir": ".",
14+
"sourceMap": true,
15+
"inlineSources": true,
16+
"target": "es2015",
17+
"lib": ["es2015", "dom"],
18+
"skipLibCheck": true,
19+
"types": []
20+
},
21+
"files": [
22+
"public_api.ts"
23+
],
24+
"angularCompilerOptions": {
25+
"annotateForClosureCompiler": true,
26+
"strictMetadataEmit": true,
27+
"flatModuleOutFile": "index.js",
28+
"flatModuleId": "@angular/cdk",
29+
"skipTemplateCodegen": true
30+
}
31+
}

src/cdk/tsconfig-tests.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// TypeScript config file that extends the default tsconfig file for the cdk. This config is
2+
// used to compile the tests for Karma. Since the code will run inside of the browser, the target
3+
// needs to be ES5. The format needs to be CommonJS since Karma only supports that module format.
4+
{
5+
"extends": "./tsconfig-build",
6+
"compilerOptions": {
7+
"module": "commonjs",
8+
"target": "es5",
9+
"types": ["jasmine"],
10+
"experimentalDecorators": true
11+
},
12+
"include": [
13+
"**/*.spec.ts"
14+
],
15+
"files": null
16+
}

src/demo-app/system-config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ System.config({
2424
'node:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
2525
'@angular/platform-browser-dynamic':
2626
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
27-
'@angular/material': 'dist/bundles/material.umd.js'
27+
28+
'@angular/material': 'dist/bundles/material.umd.js',
29+
// NGC always adds the `index` suffix. As a temporary workaround just map it with that.
30+
'@angular/cdk/index': 'dist/bundles/cdk.umd.js'
2831
},
2932
packages: {
3033
// Thirdparty barrels.

src/demo-app/tsconfig-build.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
"sourceMap": true,
1515
"target": "es5",
1616
"stripInternal": false,
17-
"baseUrl": "",
1817
"typeRoots": [
1918
"../../node_modules/@types/!(node)"
2019
],
20+
"baseUrl": ".",
2121
"paths": {
22-
"@angular/material": [
23-
"../../dist/packages/material"
24-
]
22+
"@angular/material": ["../../dist/packages/material"],
23+
"@angular/cdk": ["../../dist/packages/cdk"]
2524
}
2625
},
2726
"files": [

src/e2e-app/system-config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ System.config({
2424
'node:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
2525
'@angular/platform-browser-dynamic':
2626
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
27-
'@angular/material': 'dist/bundles/material.umd.js'
27+
28+
'@angular/material': 'dist/bundles/material.umd.js',
29+
// NGC always adds the `index` suffix. As a temporary workaround just map it with that.
30+
'@angular/cdk/index': 'dist/bundles/cdk.umd.js'
2831
},
2932
packages: {
3033
// Thirdparty barrels.

src/lib/system-config-spec.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/lib/tsconfig-build.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
// ES2015 since the build process will create FESM bundles using rollup.
33
{
44
"compilerOptions": {
5-
"baseUrl": ".",
65
"declaration": true,
76
"stripInternal": false,
87
"experimentalDecorators": true,
98
"module": "es2015",
109
"moduleResolution": "node",
1110
"outDir": "../../dist/packages/material",
12-
"paths": {},
1311
"rootDir": ".",
1412
"sourceMap": true,
1513
"inlineSources": true,
1614
"target": "es2015",
1715
"lib": ["es2015", "dom"],
1816
"skipLibCheck": true,
19-
"types": []
17+
"types": [],
18+
"baseUrl": ".",
19+
"paths": {
20+
"@angular/cdk": ["../../dist/packages/cdk"]
21+
}
2022
},
2123
"files": [
2224
"public_api.ts",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TypeScript config file that extends the default tsconfig file for the library. This config is
2-
// used to compile the specs for Karma. Since the code will run inside of the browser, the target
2+
// used to compile the tests for Karma. Since the code will run inside of the browser, the target
33
// needs to be ES5. The format needs to be CommonJS since Karma only supports that module format.
44
{
55
"extends": "./tsconfig-build",
@@ -10,7 +10,7 @@
1010
"experimentalDecorators": true
1111
},
1212
"include": [
13-
"system-config-spec.ts",
1413
"**/*.spec.ts"
15-
]
14+
],
15+
"files": null
1616
}

0 commit comments

Comments
 (0)