Verified Commit 615bee8b authored by Raphael Ochsenbein's avatar Raphael Ochsenbein
Browse files

install, etc

parent b0863624
Pipeline #710 failed with stages
in 3 seconds
......@@ -2,5 +2,42 @@
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {}
"projects": {
"colour-picker-lib": {
"root": "projects/colour-picker-lib",
"sourceRoot": "projects/colour-picker-lib/src",
"projectType": "library",
"prefix": "colour",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/colour-picker-lib/tsconfig.lib.json",
"project": "projects/colour-picker-lib/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/colour-picker-lib/src/test.ts",
"tsConfig": "projects/colour-picker-lib/tsconfig.spec.json",
"karmaConfig": "projects/colour-picker-lib/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/colour-picker-lib/tsconfig.lib.json",
"projects/colour-picker-lib/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "colour-picker-lib"
}
\ No newline at end of file
This diff is collapsed.
# ColourPickerLib
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 colour-picker-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project colour-picker-lib`.
> Note: Don't forget to add `--project colour-picker-lib` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build colour-picker-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build colour-picker-lib`, go to the dist folder `cd dist/colour-picker-lib` and run `npm publish`.
## Running unit tests
Run `ng test colour-picker-lib` 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).
// 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/colour-picker-lib'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/colour-picker-lib",
"lib": {
"entryFile": "src/public_api.ts"
}
}
\ No newline at end of file
{
"name": "colour-picker-lib",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^7.2.0",
"@angular/core": "^7.2.0"
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ColourPickerLibComponent } from './colour-picker-lib.component';
describe('ColourPickerLibComponent', () => {
let component: ColourPickerLibComponent;
let fixture: ComponentFixture<ColourPickerLibComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ColourPickerLibComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ColourPickerLibComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'colour-colour-picker-lib',
template: `
<p>
colour-picker-lib works!
</p>
`,
styles: []
})
export class ColourPickerLibComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { NgModule } from '@angular/core';
import { ColourPickerLibComponent } from './colour-picker-lib.component';
@NgModule({
declarations: [ColourPickerLibComponent],
imports: [
],
exports: [ColourPickerLibComponent]
})
export class ColourPickerLibModule { }
import { TestBed } from '@angular/core/testing';
import { ColourPickerLibService } from './colour-picker-lib.service';
describe('ColourPickerLibService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ColourPickerLibService = TestBed.get(ColourPickerLibService);
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ColourPickerLibService {
constructor() { }
}
/*
* Public API Surface of colour-picker-lib
*/
export * from './lib/colour-picker-lib.service';
export * from './lib/colour-picker-lib.component';
export * from './lib/colour-picker-lib.module';
// 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);
{
"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"
]
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"colour",
"camelCase"
],
"component-selector": [
true,
"element",
"colour",
"kebab-case"
]
}
}
......@@ -17,6 +17,14 @@
"lib": [
"es2018",
"dom"
]
],
"paths": {
"colour-picker-lib": [
"dist/colour-picker-lib"
],
"colour-picker-lib/*": [
"dist/colour-picker-lib/*"
]
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment