Skip to content

Commit

Permalink
feat(inviewport): adding support for angular 6
Browse files Browse the repository at this point in the history
BREAKING CHANGE: rxjs > 6 is now a peer dependency
  • Loading branch information
edoparearyee committed May 23, 2018
1 parent 5836336 commit aeecd91
Show file tree
Hide file tree
Showing 10 changed files with 5,912 additions and 3,756 deletions.
66 changes: 0 additions & 66 deletions .angular-cli.json

This file was deleted.

30 changes: 19 additions & 11 deletions .travis.yml
@@ -1,20 +1,28 @@
dist: trusty
sudo: false

language: node_js
node_js:
- "8"
os:
- linux
before_install:
# Use a virtual display.
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# Install latest chrome.
- export CHROME_BIN=chromium-browser

addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

cache:
directories:
- ./node_modules

install:
- npm install --no-progress
- npm i --no-progress

script:
# Use Chromium instead of Chrome.
- export CHROME_BIN=chromium-browser
- npm run lint
- npm run test -- --no-progress --code-coverage --single-run
- npm run e2e -- --no-progress
- xvfb-run -a npm run test -- --watch false --code-coverage --browsers ChromeNoSandbox
- xvfb-run -a npm run e2e
- npm run coverage
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4.

A simple lightweight library for [Angular][angular] with no other dependencies that detects when an element is within the browser viewport and adds a `sn-viewport-in` or `sn-viewport-out` class to the element.
A simple lightweight library for [Angular][angular] that detects when an element is within the browser viewport and adds a `sn-viewport-in` or `sn-viewport-out` class to the element.

This is a simple library for [Angular][angular], implemented in the [Angular Package Format v5.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).

Expand Down
134 changes: 134 additions & 0 deletions angular.json
@@ -0,0 +1,134 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-inviewport": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"progress": false
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular-inviewport:build"
},
"configurations": {
"production": {
"browserTarget": "angular-inviewport:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular-inviewport:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"progress": false,
"styles": [
"src/styles.scss"
],
"assets": [
"src/assets",
"src/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"angular-inviewport-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "angular-inviewport:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "angular-inviewport",
"schematics": {
"@schematics/angular:component": {
"prefix": "sn",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "sn"
}
}
}
5 changes: 3 additions & 2 deletions karma.conf.js
Expand Up @@ -4,19 +4,20 @@
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma'),
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-spec-reporter')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'),
reports: [ 'html', 'lcovonly', 'text-summary' ],
fixWebpackSourcePaths: true
},
Expand Down

0 comments on commit aeecd91

Please sign in to comment.