Skip to content

Commit

Permalink
Changed build process from gulp to angular-cli with ng-packagr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastiaan van den Berg committed Nov 2, 2017
1 parent 0318818 commit 77a0d17
Show file tree
Hide file tree
Showing 72 changed files with 13,101 additions and 831 deletions.
60 changes: 60 additions & 0 deletions .angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "ng-select"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css"
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# http://editorconfig.org

root = true

[*]
Expand All @@ -9,3 +8,7 @@ indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 40 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/node_modules
/docs/*.map
/tmp
/out-tsc

npm-debug.log
yarn-error.log
.vscode
# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
*.orig
*.swp
*.tgz
*.idea

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# e2e
/e2e/*.js
/e2e/*.map

# System Files
.DS_Store
Thumbs.db
32 changes: 0 additions & 32 deletions .npmignore

This file was deleted.

6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- "6"
- "8"
cache: yarn
before_script:
- yarn global add gulp
script: gulp
- yarn global add angular-cli
script: ng build --prod
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ A select component for angular, based on the [select2] JQuery plugin. See the

## Develop

Make sure that `gulp` and `yarn` are installed.
Make sure that `yarn` is installed.

Clone the repository and run:
After clone the repository, run the test app with:
```bash
$ yarn install
$ gulp build
$ ng serve
```

To install and run the ng-select web site on your local machine, run the following in the demo
folder:
To build the ng-select module, run:
```bash
$ yarn install
$ ng serve
$ yarn run build-lib
```

For manual testing, pack and install a modified version of the ng-select component to ng-select web
site with the script:
To install and run the ng-select demo/documentation web site on your local
machine, enter the demo folder and run:
```bash
$ ./copy_to_demo.sh
$ yarn install
$ ng serve
```

[ng-select]: https://basvandenberg.github.io/ng-select
[select2]: https://select2.github.io
[plunker]: https://plnkr.co/edit/vxwV6zxEwZGVUVR5V6tg?p=preview
4 changes: 2 additions & 2 deletions copy_to_demo.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
rm -v ng-select-*.tgz
rm -v src/app/ng-select/dist/ng-select-*.tgz
rm -rv demo/node_modules/ng-select/*

npm pack
npm pack src/app/ng-select/dist
tar -xzvf ng-select-*.tgz
mv -v package/* demo/node_modules/ng-select/

Expand Down
14 changes: 14 additions & 0 deletions e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AppPage } from './app.po';

describe('ng-select App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
});
});
11 changes: 11 additions & 0 deletions e2e/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
}

getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
14 changes: 14 additions & 0 deletions e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
103 changes: 0 additions & 103 deletions gulpfile.js

This file was deleted.

4 changes: 0 additions & 4 deletions index.d.ts

This file was deleted.

Loading

0 comments on commit 77a0d17

Please sign in to comment.