Skip to content

Commit

Permalink
build: use ng-packagr to create build package
Browse files Browse the repository at this point in the history
Summary:
 - use ng-packagr to create build
  - added
   - src/ng-package.json -> contains the ng-packagr settings
   - src/public_api.ts -> same as the old src/index.js, but it is ng-packagr convention

- moved the demo app out from the src folder to the root

 - deleted the old build settings
  - npm scripts
  - scripts/release.js
  - rollup.config.js
  - tsconfig.release.js
  • Loading branch information
ert78gb committed Mar 16, 2018
1 parent 37a68dd commit 21aa385
Show file tree
Hide file tree
Showing 42 changed files with 1,682 additions and 1,783 deletions.
4 changes: 2 additions & 2 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
},
"apps": [
{
"root": "src/demo/src",
"outDir": "dist/demo",
"root": "demo/src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';

import { MultiselectDropdownModule } from '../../..';
import { MultiselectDropdownModule } from '../../../src';
import { AppComponent } from './app.component';
import { DataService } from './data.service';
import { DummyComponent } from './dummy.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IMultiSelectOption } from '../../../';
import { IMultiSelectOption } from '../../../src';

export interface DataModel {
options: IMultiSelectOption[];
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';

import { IMultiSelectSettings } from '../../../..';
import { IMultiSelectSettings } from '../../../src';
import { DataModel } from './data-model';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion src/demo/src/app/util.ts → demo/src/app/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IMultiSelectOption } from '../../../';
import { IMultiSelectOption } from '../../../src';

export const generateItem = (id: number): IMultiSelectOption => {
return {id, name: `Item #${id}`};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 6 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{
"name": "angular-2-dropdown-multiselect",
"version": "1.7.1",
"version": "0.0.0-development",
"description": "Customizable dropdown multiselect in Angular 2 with bootstrap css.",
"main": "dist/bundles/dropdown.umd.js",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"start": "ng serve",
"prebuild": "rimraf dist",
"build": "npm-run-all -s build:*",
"postbuild": "npm run prepare-package",
"build:main": "npm run ng-copy && npm run ng-inline && npm run ngc",
"postbuild:main": "rimraf dist/tmp",
"build:umd": "rollup -c rollup.config.js",
"postbuild:umd": "uglifyjs -c --screw-ie8 --comments -o dist/bundles/dropdown.umd.min.js dist/bundles/dropdown.umd.js",
"ng-copy": "copyup src/index.ts dist/tmp && ncp src dist/tmp",
"ng-inline": "ng2-inline -u 1 -o dist/tmp -r src/**/*.component.ts",
"prepare-package": "node scripts/release.js",
"ngc": "ngc -p tsconfig.release.json"
"build": "ng-packagr -p src/ng-package.json"
},
"repository": {
"type": "git",
Expand All @@ -37,13 +28,6 @@
"url": "https://github.com/softsimon/angular-2-dropdown-multiselect/issues"
},
"homepage": "http://softsimon.github.io/angular-2-dropdown-multiselect",
"dependencies": {},
"peerDependencies": {
"@angular/common": "^5.2.9",
"@angular/core": "^5.2.9",
"@angular/forms": "^5.2.9",
"tslib": "^1.6.1"
},
"devDependencies": {
"@angular/cli": "^1.7.3",
"@angular/common": "^5.2.9",
Expand All @@ -59,21 +43,12 @@
"@angular/router": "^5.2.9",
"@types/core-js": "^0.9.41",
"@types/jasmine": "^2.5.47",
"@types/node": "^7.0.15",
"angular2-inline-template-style": "^1.1.0",
"chokidar": "^1.6.1",
"codelyzer": "^2.0.0",
"copyfiles": "^1.2.0",
"ncp": "^2.0.0",
"npm-run-all": "^4.0.2",
"ng-packagr": "^2.2.0",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-globals-regex": "^0.0.3",
"rollup-plugin-node-resolve": "^3.0.0",
"rxjs": "^5.1.0",
"tslib": "^1.6.1",
"typescript": "^2.2.2",
"uglifyjs": "^2.4.10",
"zone.js": "^0.7.6"
"tsickle": "^0.27.2",
"typescript": "2.6.2",
"zone.js": "^0.8.4"
}
}
26 changes: 0 additions & 26 deletions rollup.config.js

This file was deleted.

33 changes: 0 additions & 33 deletions scripts/release.js

This file was deleted.

5 changes: 1 addition & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export * from './dropdown/types';
export * from './dropdown/search-filter.pipe';
export * from './dropdown/dropdown.module';
export * from './dropdown/dropdown.component';
export * from './public_api'
8 changes: 8 additions & 0 deletions src/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "public_api.ts",
"languageLevel": ["dom", "es2017"]
},
"dest": "../dist"
}
29 changes: 29 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "angular-2-dropdown-multiselect",
"version": "1.7.1",
"description": "Customizable dropdown multiselect in Angular 2 with bootstrap css.",
"repository": {
"type": "git",
"url": "git+https://github.com/softsimon/angular-2-dropdown-multiselect.git"
},
"keywords": [
"angular 2",
"dropdown",
"multi select"
],
"author": "Simon Lindh",
"contributors": [
"Alex Malkevich <[email protected]>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/softsimon/angular-2-dropdown-multiselect/issues"
},
"homepage": "http://softsimon.github.io/angular-2-dropdown-multiselect",
"peerDependencies": {
"@angular/common": "^5.2.9",
"@angular/core": "^5.2.9",
"@angular/forms": "^5.2.9",
"tslib": "^1.6.1"
}
}
4 changes: 4 additions & 0 deletions src/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './dropdown/types';
export * from './dropdown/search-filter.pipe';
export * from './dropdown/dropdown.module';
export * from './dropdown/dropdown.component';
37 changes: 0 additions & 37 deletions tsconfig.release.json

This file was deleted.

Loading

0 comments on commit 21aa385

Please sign in to comment.