Skip to content

Commit 38782d0

Browse files
author
Leo Vo
committed
Apply rollup.
1 parent ebb112f commit 38782d0

16 files changed

+177
-65
lines changed

.angular-cli.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@
55
},
66
"apps": [
77
{
8+
"name": "lib",
9+
"root": "src",
10+
"outDir": "dist/demo",
11+
"assets": [
12+
"assets",
13+
"favicon.ico"
14+
],
15+
"index": "index.html",
16+
"main": "main.ts",
17+
"polyfills": "polyfills.ts",
18+
"test": "test.ts",
19+
"tsconfig": "tsconfig.lib.json",
20+
"testTsconfig": "tsconfig.spec.json",
21+
"prefix": "ngx",
22+
"styles": [
23+
"../node_modules/font-awesome/scss/font-awesome.scss",
24+
"../node_modules/bootstrap/scss/bootstrap.scss",
25+
"styles.scss"
26+
],
27+
"scripts": [],
28+
"environmentSource": "environments/environment.ts",
29+
"environments": {
30+
"dev": "environments/environment.ts",
31+
"prod": "environments/environment.prod.ts"
32+
}
33+
},
34+
{
35+
"name": "demo",
836
"root": "src",
937
"outDir": "dist/demo",
1038
"assets": [

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ branches:
2828
#
2929

3030
install:
31+
- npm config set loglevel warn
3132
- npm install
3233

3334
before_script:
3435
- export DISPLAY=:99.0
3536
- sh -e /etc/init.d/xvfb start
3637

3738
script:
38-
- npm run lint
39-
- npm run test-ci
40-
- npm run e2e
39+
- npm run ci
4140

4241
after_success:
4342
# Send coverage info off to cloud ppl

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@
66
# [0.0.5](https://www.npmjs.com/package/ngx-treeview) (2017-05-25)
77

88
### Enhancement:
9-
* Item always expands when matching search filter.
9+
* Item always expands when matching search filter.
10+
11+
# [0.0.6](https://www.npmjs.com/package/ngx-treeview) (2017-05-25)
12+
13+
### Enhancement:
14+
* Build bundles.
15+
* 100% code coverage.

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# ngx-treeview [![Build Status](https://travis-ci.org/leovo2708/ngx-treeview.svg?branch=master)](https://travis-ci.org/leovo2708/ngx-treeview) [![npm version](https://img.shields.io/npm/v/ngx-treeview.svg)](https://www.npmjs.com/package/ngx-treeview)
1+
[![Build Status](https://travis-ci.org/leovo2708/ngx-treeview.svg)](https://travis-ci.org/leovo2708/ngx-treeview)
2+
[![codecov](https://codecov.io/gh/leovo2708/ngx-treeview/badge.svg)](https://codecov.io/gh/leovo2708/ngx-treeview)
3+
[![npm version](https://img.shields.io/npm/v/ngx-treeview.svg)](https://www.npmjs.com/package/ngx-treeview)
4+
[![npm](https://img.shields.io/npm/l/ngx-treeview.svg)]()
5+
6+
# ngx-treeview
27

38
An Angular treeview component with checkbox
49

bs-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"server": {
3+
"baseDir": "dist/demo",
4+
"routes": {
5+
"/node_modules": "node_modules"
6+
}
7+
}
8+
}

package-lock.json

Lines changed: 6 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
{
22
"name": "ngx-treeview",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"license": "MIT",
55
"description": "An Angular treeview component with checkbox",
66
"scripts": {
7-
"start": "ng serve",
7+
"start": "ng serve --app lib",
8+
"start:demo": "npm run build:demo && lite-server -c bs-config.json",
89
"lint": "ng lint",
910
"test": "ng test",
1011
"test-coverage": "ng test --code-coverage",
1112
"test-ci": "ng test --watch=false --code-coverage --single-run=true",
1213
"e2e": "ng e2e",
13-
"build:lib": "rimraf dist && ngc && gulp && copyfiles package.json README.md LICENSE dist/",
14-
"build:demo": "rimraf dist && ng build --prod",
15-
"build": "npm run build:lib && npm run build:demo",
16-
"serve:demo": "npm run build:demo && lite-server --baseDir=\"dist/demo\"",
14+
"build:lib": "rimraf dist/lib && ngc -p tsconfig-lib.json && gulp && rollup -c rollup.config.js && copyfiles package.json README.md LICENSE dist/lib",
15+
"build:demo": "npm run build:lib && rimraf dist/demo && ng build --app demo --prod",
16+
"build": "rimraf dist && npm run build:demo",
1717
"pub:demo": "npm run build:demo -- --base-href /ngx-treeview/ && gh-pages -d dist/demo",
1818
"pub:lib": "npm run build:lib && npm publish dist/lib",
19-
"pub": "npm run pub:lib && npm run pub:demo"
19+
"pub": "rimraf dist && npm run pub:lib && npm run pub:demo",
20+
"ci": "npm run lint && npm run test-ci && npm run e2e"
2021
},
2122
"keywords": [
2223
"ng",
@@ -39,10 +40,10 @@
3940
"bugs": {
4041
"url": "https://github.com/leovo2708/ngx-treeview/issues"
4142
},
42-
"main": "lib/index.js",
43-
"module": "lib/index.js",
44-
"jsnext:main": "lib/index.js",
45-
"types": "lib/index.d.ts",
43+
"main": "./bundles/ngx-treeview.umd.js",
44+
"module": "./src/index.js",
45+
"jsnext:main": "src/index.js",
46+
"typings": "./src/index.d.ts",
4647
"private": false,
4748
"peerDependencies": {
4849
"@angular/common": "^4.0.0",
@@ -59,7 +60,6 @@
5960
"@angular/forms": "^4.2.2",
6061
"@angular/platform-browser": "^4.2.2",
6162
"@angular/platform-browser-dynamic": "^4.2.2",
62-
"@angular/platform-server": "^4.2.2",
6363
"@angular/router": "^4.2.2",
6464
"@types/jasmine": "2.5.38",
6565
"@types/lodash": "^4.14.66",
@@ -85,10 +85,10 @@
8585
"node-sass": "^4.5.3",
8686
"protractor": "^5.1.2",
8787
"rimraf": "^2.6.1",
88-
"rxjs": "^5.1.0",
88+
"rollup": "^0.43.0",
8989
"ts-node": "^3.0.6",
9090
"tslint": "^5.4.3",
9191
"typescript": "^2.4.0",
9292
"zone.js": "^0.8.12"
9393
}
94-
}
94+
}

rollup.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export default {
2+
entry: 'dist/lib/src/index.js',
3+
dest: 'dist/lib/bundles/ngx-treeview.umd.js',
4+
sourceMap: true,
5+
format: 'umd',
6+
onwarn: function (warning) {
7+
// Skip certain warnings
8+
9+
// should intercept ... but doesn't in some rollup versions
10+
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
11+
12+
// console.warn everything else
13+
console.warn(warning.message);
14+
},
15+
moduleName: 'ngx-treeview',
16+
external: [
17+
'@angular/common',
18+
'@angular/core',
19+
'@angular/forms',
20+
'lodash'
21+
],
22+
globals: {
23+
'@angular/common': 'ng.common',
24+
'@angular/core': 'ng.core',
25+
'@angular/forms': 'ng.forms',
26+
'lodash': 'lodash'
27+
}
28+
}

src/demo/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component } from '@angular/core';
2-
import { TreeviewI18n } from '../lib';
2+
import { TreeviewI18n } from 'ngx-treeview';
33
import { I18n } from './i18n';
44
import { DefaultTreeviewI18n } from './default-treeview-i18n';
55

src/lib/dropdown-treeview.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Component, DebugElement } from '@angular/core';
22
import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testing';
33
import { BrowserModule, By } from '@angular/platform-browser';
44
import { FormsModule } from '@angular/forms';
5-
import * as _ from 'lodash';
65
import { TreeviewComponent } from './treeview.component';
76
import { DropdownTreeviewComponent } from './dropdown-treeview.component';
87
import { TreeviewItemComponent } from './treeview-item.component';

src/lib/dropdown-treeview.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component, EventEmitter, Input, Output, HostListener, ViewChild, TemplateRef } from '@angular/core';
2-
import * as _ from 'lodash';
32
import { TreeviewI18n } from './treeview-i18n';
43
import { TreeviewItem } from './treeview-item';
54
import { TreeviewConfig } from './treeview-config';

src/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ getTestBed().initTestEnvironment(
2525
platformBrowserDynamicTesting()
2626
);
2727
// Then we find all the tests.
28-
const context = require.context('./', true, /\.spec\.ts$/);
28+
const context = require.context('./lib', true, /\.spec\.ts$/);
2929
// const context = require.context('./', true, /dropdown-toggle.directive.spec.ts$/);
3030
// And load the modules.
3131
context.keys().map(context);

src/tsconfig.app.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compileOnSave": false,
33
"compilerOptions": {
44
"outDir": "../out-tsc/demo",
5-
"baseUrl": ".",
5+
"baseUrl": "..",
66
"sourceMap": true,
77
"declaration": false,
88
"moduleResolution": "node",
@@ -12,7 +12,12 @@
1212
"lib": [
1313
"es2016",
1414
"dom"
15-
]
15+
],
16+
"paths": {
17+
"ngx-treeview": [
18+
"dist/lib"
19+
]
20+
}
1621
},
1722
"exclude": [
1823
"test.ts",

src/tsconfig.lib.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/demo",
5+
"baseUrl": "..",
6+
"sourceMap": true,
7+
"declaration": false,
8+
"moduleResolution": "node",
9+
"emitDecoratorMetadata": true,
10+
"experimentalDecorators": true,
11+
"target": "es5",
12+
"lib": [
13+
"es2016",
14+
"dom"
15+
],
16+
"paths": {
17+
"ngx-treeview": [
18+
"src/lib"
19+
]
20+
}
21+
},
22+
"exclude": [
23+
"test.ts",
24+
"**/*.spec.ts"
25+
]
26+
}

tsconfig-lib.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"outDir": "./dist/lib/src",
6+
"target": "es5",
7+
"module": "es2015",
8+
"moduleResolution": "node",
9+
"sourceMap": true,
10+
"emitDecoratorMetadata": true,
11+
"experimentalDecorators": true,
12+
"declaration": true,
13+
"lib": [
14+
"es2016",
15+
"dom"
16+
]
17+
},
18+
"files": [
19+
"src/lib/index.ts"
20+
],
21+
"exclude": [
22+
"node_modules"
23+
],
24+
"angularCompilerOptions": {
25+
"skipTemplateCodegen": true,
26+
"skipMetadataEmit": true
27+
}
28+
}

0 commit comments

Comments
 (0)