Skip to content

Commit 412c9fc

Browse files
devversionjelbourn
authored andcommitted
build: add empty material-moment-adapter package (#6086)
1 parent ec4ea06 commit 412c9fc

File tree

11 files changed

+119
-9
lines changed

11 files changed

+119
-9
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {_momentAdapter} from './public_api';
2+
3+
describe('moment-adapter', () => {
4+
5+
it('should be tested when running the tests', () => {
6+
expect(_momentAdapter).toBe(0);
7+
});
8+
9+
});

src/material-moment-adapter/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export * from './public_api';
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@angular/material-moment-adapter",
3+
"version": "0.0.0-PLACEHOLDER",
4+
"description": "Angular Material Moment Adapter",
5+
"main": "./bundles/material-moment-adapter.umd.js",
6+
"module": "./@angular/material-moment-adapter.es5.js",
7+
"es2015": "./@angular/material-moment-adapter.js",
8+
"typings": "./material-moment-adapter.d.ts",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/angular/material2.git"
12+
},
13+
"license": "MIT",
14+
"bugs": {
15+
"url": "https://github.com/angular/material2/issues"
16+
},
17+
"homepage": "https://github.com/angular/material2#readme",
18+
"peerDependencies": {
19+
"@angular/material": "0.0.0-PLACEHOLDER",
20+
"@angular/core": "^4.0.0"
21+
},
22+
"dependencies": {
23+
"tslib": "^1.7.1"
24+
}
25+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export const _momentAdapter = 0;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// TypeScript config file that is used to compile the moment-adapter package. Target environment
2+
// needs to be 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+
"noUnusedParameters": true,
10+
"strictNullChecks": true,
11+
"importHelpers": true,
12+
"newLine": "lf",
13+
"module": "es2015",
14+
"moduleResolution": "node",
15+
"outDir": "../../dist/packages/material-moment-adapter",
16+
"rootDir": ".",
17+
"sourceMap": true,
18+
"inlineSources": true,
19+
"target": "es2015",
20+
"lib": ["es2015", "dom"],
21+
"skipLibCheck": true,
22+
"types": [],
23+
"paths": {
24+
"@angular/material": ["../../dist/packages/material/public_api"]
25+
}
26+
},
27+
"files": [
28+
"public_api.ts"
29+
],
30+
"angularCompilerOptions": {
31+
"annotateForClosureCompiler": true,
32+
"strictMetadataEmit": true,
33+
"flatModuleOutFile": "index.js",
34+
"flatModuleId": "@angular/material-moment-adapter",
35+
"skipTemplateCodegen": true
36+
}
37+
}
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 moment-adapter.
2+
// This config is used to compile the tests for Karma. Since the code will run inside of the
3+
// browser, the target needs to be ES5. The format needs to be CommonJS for Karma.
4+
{
5+
"extends": "./tsconfig-build",
6+
"compilerOptions": {
7+
"importHelpers": false,
8+
"module": "commonjs",
9+
"target": "es5",
10+
"types": ["jasmine"]
11+
},
12+
"include": [
13+
"**/*.spec.ts",
14+
"index.ts"
15+
]
16+
}

tools/gulp/gulpfile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import {createPackageBuildTasks} from 'material2-build-tools';
2-
import {cdkPackage, examplesPackage, materialPackage} from './packages';
2+
import {cdkPackage, examplesPackage, materialPackage, momentAdapterPackage} from './packages';
33

44
createPackageBuildTasks(cdkPackage);
55
createPackageBuildTasks(materialPackage);
66
createPackageBuildTasks(examplesPackage);
7+
createPackageBuildTasks(momentAdapterPackage);
78

89
import './tasks/ci';
910
import './tasks/clean';

tools/gulp/packages.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {join} from 'path';
44
export const cdkPackage = new BuildPackage('cdk');
55
export const materialPackage = new BuildPackage('material', [cdkPackage]);
66
export const examplesPackage = new BuildPackage('material-examples', [materialPackage, cdkPackage]);
7+
export const momentAdapterPackage = new BuildPackage('material-moment-adapter',
8+
[materialPackage, cdkPackage]);
79

810
// To avoid refactoring of the project the material package will map to the source path `lib/`.
911
materialPackage.packageRoot = join(buildConfig.packagesDir, 'lib');

tools/gulp/tasks/examples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const examplesPath = path.join(packagesDir, 'material-examples');
3434
/** Output path of the module that is being created */
3535
const outputModuleFilename = path.join(examplesPath, 'example-module.ts');
3636

37-
/** Build ecmascript module import statements */
37+
/** Build ES module import statements */
3838
function buildImportsTemplate(metadata: ExampleMetadata): string {
3939
const components = metadata.additionalComponents.concat(metadata.component);
4040

tools/gulp/tasks/publish.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as minimist from 'minimist';
1111
export const releasePackages = [
1212
'cdk',
1313
'material',
14+
'material-moment-adapter'
1415
];
1516

1617
/** Parse command-line arguments for release task. */

0 commit comments

Comments
 (0)