Skip to content

Commit

Permalink
Merge branch 'development' into doc-new-design
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin authored Sep 28, 2017
2 parents c96dc2c + ae2ace3 commit 083c202
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 34 deletions.
105 changes: 79 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,91 @@
sudo: false
language: node_js
node_js: "8"
dist: precise

env:
global:
- SAUCE_USERNAME=valorkin
- SAUCE_ACCESS_KEY=aeaf806e-ad5c-484b-a8fe-4b4b9f54e99a
notifications:
email: false

git:
depth: 3
submodules: false

stages:
- name: precache
if: ( branch = development AND type = push ) OR type = pull_request
- name: lint
if: ( branch = development AND type = push ) OR type = pull_request
- name: test
if: ( branch = development AND type = push ) OR type = pull_request
- name: build
if: ( branch = development AND type = push ) OR type = pull_request
- name: deploy-surge
if: branch = development AND type = push

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

script:
- npm run lint
- npm run build
- rm -rf node_modules/ngx-bootstrap
- npm i ./dist
- npm run demo.ng-build
# istanbul is broken, should be fixed
- npm run test-coverage

after_success:
- ./node_modules/.bin/codecov
#- npm run test-cross
install:
- npm install > /dev/null
- npm run build > /dev/null
- if [[ "$NGV" == "latest" ]]; then ./scripts/ci/npm-ng-latest.sh; fi
- if [[ "$NGV" == "next" ]]; then ./scripts/ci/npm-ng-next.sh; fi
- npm i ./dist > /dev/null

jobs:
fast_finish: true
allow_failures:
- env: NGV=next
include:
# precache npm and apt dependencies
- stage: precache
install: npm install > /dev/null
script: true
addons:
# sauce labs tunel connector (read more https://docs.travis-ci.com/user/sauce-connect/ )
# sauce_connect: true
chrome: stable
apt:
sources:
- ubuntu-toolchain-r-test
# required by node-gyp to build some packages
packages:
- g++-4.8
# lint code
- stage: lint
install: true
script: npm run lint
# test
- &test
stage: test
script: npm run test-coverage
after_success:
- ./node_modules/.bin/codecov
- <<: *test
env: NGV=latest
- <<: *test
env: NGV=next
# check prod build
- &build
stage: build
script: npm run demo.ng-build
- <<: *build
env: NGV=latest
- <<: *build
env: NGV=next
# deploy to ngx-bootstrap.surge.sh
- stage: deploy-surge
script: npm run demo.build
deploy:
provider: surge
project: ./gh-pages/
domain: ngx-bootstrap.surge.sh
on: development

addons:
# sauce labs tunel connector (read more https://docs.travis-ci.com/user/sauce-connect/ )
sauce_connect: true
firefox: "latest"
apt:
sources:
- ubuntu-toolchain-r-test
# required by node-gyp to build some packages
packages:
- g++-4.8
cache:
apt: true
npm: true
directories:
- node_modules
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ module.exports = function (config) {
singleRun: false,
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
base: 'ChromeHeadless',
flags: ['--disable-translate', '--disable-extensions']
}
},
mime: { 'text/x-typescript': ['ts','tsx'] },
client: { captureConsole: true, clearContext: false }
};

if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
configuration.browsers = ['ChromeHeadless'];
}

if (process.env.SAUCE) {
Expand Down
15 changes: 15 additions & 0 deletions scripts/ci/npm-ng-latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

npm i @angular/cli@latest \
@angular/common@latest \
@angular/compiler@latest \
@angular/compiler-cli@latest \
@angular/core@latest \
@angular/forms@latest \
@angular/http@latest \
@angular/language-service@latest \
@angular/platform-browser@latest \
@angular/platform-browser-dynamic@latest \
@angular/router@latest \
@angular/service-worker@latest \
@angular/tsc-wrapped@latest \
15 changes: 15 additions & 0 deletions scripts/ci/npm-ng-min.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

npm i @angular/cli@4.3.3 \
@angular/common@4.3.3 \
@angular/compiler@4.3.3 \
@angular/compiler-cli@4.3.3 \
@angular/core@4.3.3 \
@angular/forms@4.3.3 \
@angular/http@4.3.3 \
@angular/language-service@4.3.3 \
@angular/platform-browser@4.3.3 \
@angular/platform-browser-dynamic@4.3.3 \
@angular/router@4.3.3 \
@angular/service-worker@4.3.3 \
@angular/tsc-wrapped@4.3.3 \
13 changes: 13 additions & 0 deletions scripts/ci/npm-ng-next.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

npm i @angular/common@next \
@angular/compiler@next \
@angular/compiler-cli@next \
@angular/core@next \
@angular/forms@next \
@angular/http@next \
@angular/language-service@next \
@angular/platform-browser@next \
@angular/platform-browser-dynamic@next \
@angular/router@next \
@angular/tsc-wrapped@next \
6 changes: 5 additions & 1 deletion scripts/fetch-docs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
const fs = require('fs-extra');
const exec = require('child_process').exec;

const repoUrl = process.env.TRAVIS
? 'https://github.com/valor-software/ngx-bootstrap.git'
: 'git@github.com:valor-software/ngx-bootstrap.git';

if (!fs.existsSync('gh-pages')) {
console.log('Cloning the latest version of gh-pages');
runCmd("git clone -b gh-pages --single-branch --depth 1 git@github.com:valor-software/ngx-bootstrap.git gh-pages");
runCmd(`git clone -b gh-pages --single-branch --depth 1 ${repoUrl} gh-pages`);
return;
}
console.log('Pulling the latest version of gh-pages');
Expand Down
2 changes: 1 addition & 1 deletion src/sortable/sortable.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { DraggableItemService } from './draggable-item.service';
(dragover)="onItemDragover($event, i)"
(dragenter)="cancelEvent($event)"
><ng-template [ngTemplateOutlet]="itemTemplate || defItemTemplate"
[ngOutletContext]="{item:item, index: i}"></ng-template></div>
[ngTemplateOutletContext]="{item:item, index: i}"></ng-template></div>
</div>
<ng-template #defItemTemplate let-item="item">{{item.value}}</ng-template>
Expand Down
6 changes: 3 additions & 3 deletions src/typeahead/typeahead-container.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- inject options list template -->
<ng-template [ngTemplateOutlet]="optionsListTemplate || (isBs4 ? bs4Template : bs3Template)"
[ngOutletContext]="{matches:matches, itemTemplate:itemTemplate, query:query}"></ng-template>
[ngTemplateOutletContext]="{matches:matches, itemTemplate:itemTemplate, query:query}"></ng-template>

<!-- default options item template -->
<ng-template #bsItemTemplate let-match="match" let-query="query"><span [innerHtml]="hightlight(match, query)"></span>
Expand All @@ -14,7 +14,7 @@
<li *ngIf="!match.isHeader()" [class.active]="isActive(match)" (mouseenter)="selectActive(match)">
<a href="#" (click)="selectMatch(match, $event)" tabindex="-1">
<ng-template [ngTemplateOutlet]="itemTemplate || bsItemTemplate"
[ngOutletContext]="{item:match.item, index:i, match:match, query:query}"></ng-template>
[ngTemplateOutletContext]="{item:match.item, index:i, match:match, query:query}"></ng-template>
</a>
</li>
</ng-template>
Expand All @@ -32,7 +32,7 @@ <h6 *ngIf="match.isHeader()" class="dropdown-header">{{ match }}</h6>
(mouseenter)="selectActive(match)"
[class.active]="isActive(match)">
<ng-template [ngTemplateOutlet]="itemTemplate || bsItemTemplate"
[ngOutletContext]="{item:match.item, index:i, match:match, query:query}"></ng-template>
[ngTemplateOutletContext]="{item:match.item, index:i, match:match, query:query}"></ng-template>
</button>
</ng-template>
</ng-template>
Expand Down

0 comments on commit 083c202

Please sign in to comment.