Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Commit ade96cb

Browse files
committed
feat(lib): created ng lib for the datepicker
1 parent f6ab22f commit ade96cb

13 files changed

+227
-2
lines changed

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"tabSize": 2
5+
}

angular.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,46 @@
118118
}
119119
}
120120
}
121+
},
122+
"datepicker": {
123+
"root": "/datepicker",
124+
"sourceRoot": "/datepicker/src",
125+
"projectType": "library",
126+
"prefix": "mat",
127+
"architect": {
128+
"build": {
129+
"builder": "@angular-devkit/build-ng-packagr:build",
130+
"options": {
131+
"tsConfig": "/datepicker/tsconfig.lib.json",
132+
"project": "/datepicker/ng-package.json"
133+
},
134+
"configurations": {
135+
"production": {
136+
"project": "/datepicker/ng-package.prod.json"
137+
}
138+
}
139+
},
140+
"test": {
141+
"builder": "@angular-devkit/build-angular:karma",
142+
"options": {
143+
"main": "/datepicker/src/test.ts",
144+
"tsConfig": "/datepicker/tsconfig.spec.json",
145+
"karmaConfig": "/datepicker/karma.conf.js"
146+
}
147+
},
148+
"lint": {
149+
"builder": "@angular-devkit/build-angular:tslint",
150+
"options": {
151+
"tsConfig": [
152+
"/datepicker/tsconfig.lib.json",
153+
"/datepicker/tsconfig.spec.json"
154+
],
155+
"exclude": [
156+
"**/node_modules/**"
157+
]
158+
}
159+
}
160+
}
121161
}
122162
},
123163
"schematics": {

datepicker/karma.conf.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, '../../coverage'),
20+
reports: ['html', 'lcovonly'],
21+
fixWebpackSourcePaths: true
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_DEBUG,
27+
mime: {
28+
'text/x-typescript': ['ts', 'tsx']
29+
},
30+
customLaunchers: {
31+
ChromeHeadless: {
32+
base: 'Chrome',
33+
flags: ['--no-sandbox'],
34+
debug: true
35+
}
36+
},
37+
autoWatch: true,
38+
browsers: ['ChromeHeadless'],
39+
singleRun: false
40+
});
41+
};

datepicker/ng-package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../dist/datepicker",
4+
"deleteDestPath": false,
5+
"lib": {
6+
"entryFile": "src/public_api.ts"
7+
}
8+
}

datepicker/ng-package.prod.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../dist/datepicker",
4+
"lib": {
5+
"entryFile": "src/public_api.ts"
6+
}
7+
}

datepicker/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "@coachcare/datepicker",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^6.0.0",
6+
"@angular/core": "^6.0.0"
7+
}
8+
}

datepicker/src/lib/public_api.ts

Whitespace-only changes.

datepicker/src/public_api.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* Public API Surface of datepicker
3+
*/
4+
5+
export * from './lib/public_api';

datepicker/src/test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'core-js/es7/reflect';
4+
import 'zone.js/dist/zone';
5+
import 'zone.js/dist/zone-testing';
6+
import { getTestBed } from '@angular/core/testing';
7+
import {
8+
BrowserDynamicTestingModule,
9+
platformBrowserDynamicTesting
10+
} from '@angular/platform-browser-dynamic/testing';
11+
12+
declare const require: any;
13+
14+
// First, initialize the Angular testing environment.
15+
getTestBed().initTestEnvironment(
16+
BrowserDynamicTestingModule,
17+
platformBrowserDynamicTesting()
18+
);
19+
// Then we find all the tests.
20+
const context = require.context('./', true, /\.spec\.ts$/);
21+
// And load the modules.
22+
context.keys().map(context);

datepicker/tsconfig.lib.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/lib",
5+
"target": "es2015",
6+
"module": "es2015",
7+
"moduleResolution": "node",
8+
"declaration": true,
9+
"sourceMap": true,
10+
"inlineSources": true,
11+
"emitDecoratorMetadata": true,
12+
"experimentalDecorators": true,
13+
"importHelpers": true,
14+
"types": [],
15+
"lib": [
16+
"dom",
17+
"es2015"
18+
]
19+
},
20+
"angularCompilerOptions": {
21+
"annotateForClosureCompiler": true,
22+
"skipTemplateCodegen": true,
23+
"strictMetadataEmit": true,
24+
"fullTemplateTypeCheck": true,
25+
"strictInjectionParameters": true,
26+
"flatModuleId": "AUTOGENERATED",
27+
"flatModuleOutFile": "AUTOGENERATED"
28+
},
29+
"exclude": [
30+
"src/test.ts",
31+
"**/*.spec.ts"
32+
]
33+
}

0 commit comments

Comments
 (0)