Export more types, add stub for common-map library
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2019-07-17 11:51:14 +02:00
parent 4ab7e39b8e
commit 6f28561303
18 changed files with 313 additions and 7 deletions

View File

@ -166,6 +166,41 @@
}
}
}
},
"common-map": {
"root": "projects/common-map",
"sourceRoot": "projects/common-map/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/common-map/tsconfig.lib.json",
"project": "projects/common-map/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/common-map/src/test.ts",
"tsConfig": "projects/common-map/tsconfig.spec.json",
"karmaConfig": "projects/common-map/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/common-map/tsconfig.lib.json",
"projects/common-map/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "farmmaps-lib-app"

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "farmmaps-lib-app",
"version": "0.0.0",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -0,0 +1,24 @@
# CommonMap
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0.
## Code scaffolding
Run `ng generate component component-name --project common-map` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project common-map`.
> Note: Don't forget to add `--project common-map` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build common-map` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build common-map`, go to the dist folder `cd dist/common-map` and run `npm publish`.
## Running unit tests
Run `ng test common-map` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

View File

@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/common-map'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

View File

@ -0,0 +1,7 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/common-map",
"lib": {
"entryFile": "src/public-api.ts"
}
}

View File

@ -0,0 +1,8 @@
{
"name": "@farmmaps/common/map",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^7.2.0",
"@angular/core": "^7.2.0"
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CommonMapComponent } from './common-map.component';
describe('CommonMapComponent', () => {
let component: CommonMapComponent;
let fixture: ComponentFixture<CommonMapComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CommonMapComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CommonMapComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,19 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'lib-common-map',
template: `
<p>
common-map works!
</p>
`,
styles: []
})
export class CommonMapComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonMapComponent } from './common-map.component';
@NgModule({
declarations: [CommonMapComponent],
imports: [
],
exports: [CommonMapComponent]
})
export class CommonMapModule { }

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { CommonMapService } from './common-map.service';
describe('CommonMapService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: CommonMapService = TestBed.get(CommonMapService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class CommonMapService {
constructor() { }
}

View File

@ -0,0 +1,7 @@
/*
* Public API Surface of common-map
*/
export * from './lib/common-map.service';
export * from './lib/common-map.component';
export * from './lib/common-map.module';

View File

@ -0,0 +1,22 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@ -0,0 +1,32 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2018"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}

View File

@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View File

@ -0,0 +1,17 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"lib",
"camelCase"
],
"component-selector": [
true,
"element",
"lib",
"kebab-case"
]
}
}

View File

@ -15,8 +15,6 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { AppCommonRoutingModule } from './common-routing.module';
import { MODULE_NAME } from './module-name';
import * as appCommonReducers from './reducers/app-common.reducer';
import * as appCommonEffects from './effects/app-common.effects';
//components
import { FolderService } from './services/folder.service';
@ -41,6 +39,18 @@ import { NotFoundComponent } from './components/not-found/not-found.component';
import { SidePanelComponent } from './components/side-panel/side-panel.component';
import { TimespanComponent } from './components/timespan/timespan.component';
import { TagInputComponent } from './components/tag-input/tag-input.component';
import {IEventMessage } from './models/event.message';
import { IItem, Item } from './models/item';
import {IItemType} from './models/item.type';
import {IItemTypes} from './models/item.types';
import {IItemTask,ItemTask} from './models/itemTask';
import {IListItem} from './models/list.item';
import {ITypeaheadItem} from './models/typeahead.item';
import {IUser} from './models/user';
import * as commonActions from './actions/app-common.actions';
import * as commonReducers from './reducers/app-common.reducer';
import * as commonEffects from './effects/app-common.effects';
import { from } from 'rxjs';
export {FolderService,
TimespanService,
@ -62,7 +72,19 @@ export {FolderService,
NotFoundComponent,
SidePanelComponent,
TimespanComponent,
TagInputComponent
TagInputComponent,
IEventMessage,
IItem,
Item,
IItemType,
IItemTypes,
IItemTask,
ItemTask,
IListItem,
ITypeaheadItem,
IUser,
commonActions,
commonReducers,
};
@NgModule({
@ -70,8 +92,8 @@ export {FolderService,
CommonModule,
HttpClientModule,
AppCommonRoutingModule,
StoreModule.forFeature(MODULE_NAME, appCommonReducers.reducer ),
EffectsModule.forFeature([appCommonEffects.AppCommonEffects]),
StoreModule.forFeature(MODULE_NAME, commonReducers.reducer ),
EffectsModule.forFeature([commonEffects.AppCommonEffects]),
OAuthModule.forRoot(),
NgbModule,
FormsModule

View File

@ -17,6 +17,14 @@
"lib": [
"es2018",
"dom"
],
"paths": {
"common-map": [
"dist/common-map"
],
"common-map/*": [
"dist/common-map/*"
]
}
}
}