Skip to content

Commit

Permalink
feat(package): update to angular 2.0.0 (#412)
Browse files Browse the repository at this point in the history
* update angular to rc7, update rest of dependencies, use ng2-webpack-config, create modules and update app to rc7

* add custom typings

* update to 2.0.0, remove typings

* return typescript v

* fix select styles

* sanitize html (colorbox) add ngc compiler
  • Loading branch information
otelnov authored and valorkin committed Sep 21, 2016
1 parent d39def2 commit 10aeaba
Show file tree
Hide file tree
Showing 34 changed files with 672 additions and 686 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ npm-debug.log

# WebStorm
.idea
.vscode

# ignore build and dist for now
/bundles
Expand All @@ -20,6 +21,7 @@ npm-debug.log
/demo/**/*.js
/demo/**/*.js.map
/demo/**/*.d.ts
!/demo/custom-typings.d.ts
/components/**/*.js
/components/**/*.js.map
/components/**/*.d.ts
Expand All @@ -28,3 +30,7 @@ ng2-select.js.map
ng2-select.d.ts

/logs

factories

/**/*.metadata.json
29 changes: 29 additions & 0 deletions .ng2-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict';
var pkg = require('./package.json');

module.exports = {
// metadata
title: pkg.description,
baseUrl: '/',
// root folder name
src: 'demo',
dist: 'demo-build',
htmlIndexes: ['index.html'],
// karma bundle src
spec: './spec-bundle.js',
// webpack entry
entry: {
polyfills: './demo/polyfills.ts',
vendor: './demo/vendor.ts',
main: './demo/index.ts'
},
commonChunks: {
name: ['polyfills', 'vendor'].reverse()
},
// webpack alias
alias: {},
copy: [
{from: 'demo/favicon.ico', to: 'favicon.ico'},
{from: 'demo/assets', to: 'assets'}
]
};
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ webpack.config.js
/components/**/*.ts
!/components/**/*.d.ts

factories
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ language: node_js
node_js:
- "6"

#before_install: npm i -g npm@latest

script:
- npm run flow.install:typings
- npm test

after_success:
- ./node_modules/.bin/codecov
- ./node_modules/.bin/codecov -f coverage/coverage-final.json

addons:
# sauce labs tunel connector (read more https://docs.travis-ci.com/user/sauce-connect/ )
Expand Down
14 changes: 14 additions & 0 deletions components/select.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { SelectComponent } from './select/select';
import { HighlightPipe } from './select/select-pipes';
import { OffClickDirective } from './select/off-click';

@NgModule({
imports: [CommonModule],
declarations: [SelectComponent, HighlightPipe, OffClickDirective],
exports: [SelectComponent, HighlightPipe, OffClickDirective]
})
export class SelectModule {
}
2 changes: 0 additions & 2 deletions components/select.ts

This file was deleted.

1 change: 0 additions & 1 deletion components/select/off-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ export class OffClickDirective implements OnInit, OnDestroy {
public ngOnDestroy(): any {
document.removeEventListener('click', this.offClickHandler);
}

}
42 changes: 32 additions & 10 deletions components/select/select-pipes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
import { it, expect, describe, inject, beforeEachProviders } from '@angular/core/testing';
import { ComponentFixture } from '@angular/compiler/testing';
import { HighlightPipe } from './select-pipes';

describe('Component: HighlightPipe', () => {
beforeEachProviders(() => [
HighlightPipe
]);
it('should be fine', inject([HighlightPipe], (fixture:ComponentFixture<HighlightPipe>) => {
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { SelectModule } from '../../ng2-select';

const html = ``;

describe('Component: ng2-select', () => {
let fixture:ComponentFixture<any>;
let context:TestSelectComponent;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TestSelectComponent],
imports: [SelectModule]
});
TestBed.overrideComponent(TestSelectComponent, {set: {template: html}});
fixture = TestBed.createComponent(TestSelectComponent);
context = fixture.componentInstance;
fixture.detectChanges();
});

it('fixture should not be null', () => {
expect(fixture).not.toBeNull();
}));
});
});

@Component({
selector: 'select-test',
template: '<ng-select></ng-select>'
})

class TestSelectComponent {
}
Loading

0 comments on commit 10aeaba

Please sign in to comment.