2
0

added library project

This commit is contained in:
2018-06-27 19:27:49 +02:00
parent 56a8142fbf
commit 86eab2066e
21 changed files with 909 additions and 37 deletions

View File

@@ -0,0 +1,31 @@
// 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'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

View File

@@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/nls-guilloche",
"deleteDestPath": false,
"lib": {
"entryFile": "src/public_api.ts"
}
}

View File

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

View File

@@ -0,0 +1,33 @@
{
"name": "nls-guilloche",
"version": "0.2.0",
"repository": {
"type": "git",
"url": "https://github.com/nextlevelshit/nls-ng6-d3js-guilloche"
},
"licenses": [
{
"type": "GPL-2.0-only",
"url": "https://github.com/nextlevelshit/nls-ng6-d3js-guilloche/LICENSE.md"
}
],
"author": {
"name": "Michael Czechowski",
"email": "mail@dailysh.it",
"url": "https://dailysh.it"
},
"maintainers": [
{
"name": "Erik Kimsey"
},
{
"name": "Michael Czechowski",
"email": "mail@dailysh.it",
"url": "https://dailysh.it"
}
],
"peerDependencies": {
"@angular/common": "^6.0.0-rc.0 || ^6.0.0",
"@angular/core": "^6.0.0-rc.0 || ^6.0.0"
}
}

View File

@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NlsGuillocheComponent } from './nls-guilloche.component';
describe('NlsGuillocheComponent', () => {
let component: NlsGuillocheComponent;
let fixture: ComponentFixture<NlsGuillocheComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NlsGuillocheComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NlsGuillocheComponent);
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-nls-guilloche',
template: `
<p>
nls-guilloche works!
</p>
`,
styles: []
})
export class NlsGuillocheComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { NlsGuillocheComponent } from './nls-guilloche.component';
@NgModule({
imports: [
],
declarations: [NlsGuillocheComponent],
exports: [NlsGuillocheComponent]
})
export class NlsGuillocheModule { }

View File

@@ -0,0 +1,15 @@
import { TestBed, inject } from '@angular/core/testing';
import { NlsGuillocheService } from './nls-guilloche.service';
describe('NlsGuillocheService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [NlsGuillocheService]
});
});
it('should be created', inject([NlsGuillocheService], (service: NlsGuillocheService) => {
expect(service).toBeTruthy();
}));
});

View File

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

View File

@@ -0,0 +1,7 @@
/*
* Public API Surface of nls-guilloche
*/
export * from './lib/nls-guilloche.service';
export * from './lib/nls-guilloche.component';
export * from './lib/nls-guilloche.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,33 @@
{
"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",
"es2015"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"flatModuleId": "AUTOGENERATED",
"flatModuleOutFile": "AUTOGENERATED"
},
"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"
]
}
}