Skip to content

Commit e1d785e

Browse files
committed
feat(scroll-collapse): adding angular 6 support
BREAKING CHANGE: Updated peer dependencies to rxjs 6.x and @thisissoon/angular-inviewport 3.x
1 parent 42959c4 commit e1d785e

File tree

10 files changed

+6356
-3950
lines changed

10 files changed

+6356
-3950
lines changed

.angular-cli.json

Lines changed: 0 additions & 60 deletions
This file was deleted.

.travis.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
dist: trusty
2-
sudo: false
31
language: node_js
42
node_js:
53
- "8"
6-
os:
7-
- linux
8-
before_install:
9-
# Use a virtual display.
10-
- export DISPLAY=:99.0
11-
- sh -e /etc/init.d/xvfb start
12-
# Install latest chrome.
13-
- export CHROME_BIN=chromium-browser
4+
5+
addons:
6+
apt:
7+
sources:
8+
- google-chrome
9+
packages:
10+
- google-chrome-stable
11+
12+
cache:
13+
directories:
14+
- ./node_modules
15+
1416
install:
15-
- npm install --no-progress
17+
- npm i --no-progress
18+
1619
script:
20+
# Use Chromium instead of Chrome.
21+
- export CHROME_BIN=chromium-browser
1722
- npm run lint
18-
- npm run test -- --no-progress --code-coverage --single-run --browser=ChromeNoSandbox
19-
- npm run e2e -- --no-progress
23+
- xvfb-run -a npm run test -- --watch false --code-coverage
24+
- xvfb-run -a npm run e2e
2025
- npm run coverage

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[![Coverage Status][coveralls-badge]][coveralls-badge-url]
44
[![Commitizen friendly][commitizen-badge]][commitizen]
55

6-
This project was generated with [Angular CLI][angular-cli] version 1.5.4.
7-
86
A simple lightweight library for [Angular][angular] that detects scroll direction and adds a `sn-scrolling-up` or `sn-scrolling-down` class to the element. The library can also detect when the user has scrolled passed the element and apply a `sn-affix` class. Useful for make a element sticky when the user has scrolled beyond it. This library can will also apply `sn-minimise` class after the user has scrolled beyond the height of the element.
97

108
This is a simple library for [Angular][angular], implemented in the [Angular Package Format v5.0][apfv5].

angular.json

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-scroll-collapse": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"architect": {
11+
"build": {
12+
"builder": "@angular-devkit/build-angular:browser",
13+
"options": {
14+
"outputPath": "dist",
15+
"index": "src/index.html",
16+
"main": "src/main.ts",
17+
"tsConfig": "src/tsconfig.app.json",
18+
"polyfills": "src/polyfills.ts",
19+
"progress": false,
20+
"assets": [
21+
"src/assets",
22+
"src/favicon.ico"
23+
],
24+
"styles": [
25+
"src/styles.scss"
26+
],
27+
"scripts": []
28+
},
29+
"configurations": {
30+
"production": {
31+
"optimization": true,
32+
"outputHashing": "all",
33+
"sourceMap": false,
34+
"extractCss": true,
35+
"namedChunks": false,
36+
"aot": true,
37+
"extractLicenses": true,
38+
"vendorChunk": false,
39+
"buildOptimizer": true,
40+
"fileReplacements": [
41+
{
42+
"replace": "src/environments/environment.ts",
43+
"with": "src/environments/environment.prod.ts"
44+
}
45+
]
46+
}
47+
}
48+
},
49+
"serve": {
50+
"builder": "@angular-devkit/build-angular:dev-server",
51+
"options": {
52+
"browserTarget": "angular-scroll-collapse:build"
53+
},
54+
"configurations": {
55+
"production": {
56+
"browserTarget": "angular-scroll-collapse:build:production"
57+
}
58+
}
59+
},
60+
"extract-i18n": {
61+
"builder": "@angular-devkit/build-angular:extract-i18n",
62+
"options": {
63+
"browserTarget": "angular-scroll-collapse:build"
64+
}
65+
},
66+
"test": {
67+
"builder": "@angular-devkit/build-angular:karma",
68+
"options": {
69+
"main": "src/test.ts",
70+
"karmaConfig": "./karma.conf.js",
71+
"polyfills": "src/polyfills.ts",
72+
"tsConfig": "src/tsconfig.spec.json",
73+
"progress": false,
74+
"scripts": [],
75+
"styles": [
76+
"src/styles.scss"
77+
],
78+
"assets": [
79+
"src/assets",
80+
"src/favicon.ico"
81+
]
82+
}
83+
},
84+
"lint": {
85+
"builder": "@angular-devkit/build-angular:tslint",
86+
"options": {
87+
"tsConfig": [
88+
"src/tsconfig.app.json",
89+
"src/tsconfig.spec.json"
90+
],
91+
"exclude": [
92+
"**/node_modules/**"
93+
]
94+
}
95+
}
96+
}
97+
},
98+
"angular-scroll-collapse-e2e": {
99+
"root": "",
100+
"sourceRoot": "",
101+
"projectType": "application",
102+
"architect": {
103+
"e2e": {
104+
"builder": "@angular-devkit/build-angular:protractor",
105+
"options": {
106+
"protractorConfig": "./protractor.conf.js",
107+
"devServerTarget": "angular-scroll-collapse:serve"
108+
}
109+
},
110+
"lint": {
111+
"builder": "@angular-devkit/build-angular:tslint",
112+
"options": {
113+
"tsConfig": [
114+
"e2e/tsconfig.e2e.json"
115+
],
116+
"exclude": [
117+
"**/node_modules/**"
118+
]
119+
}
120+
}
121+
}
122+
}
123+
},
124+
"defaultProject": "angular-scroll-collapse",
125+
"schematics": {
126+
"@schematics/angular:component": {
127+
"prefix": "sn",
128+
"styleext": "scss"
129+
},
130+
"@schematics/angular:directive": {
131+
"prefix": "sn"
132+
}
133+
}
134+
}

karma.conf.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
module.exports = function (config) {
55
config.set({
66
basePath: '',
7-
frameworks: ['jasmine', '@angular/cli'],
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
1212
require('karma-coverage-istanbul-reporter'),
13-
require('@angular/cli/plugins/karma'),
13+
require('@angular-devkit/build-angular/plugins/karma'),
1414
require('karma-spec-reporter')
1515
],
1616
client:{
1717
clearContext: false // leave Jasmine Spec Runner output visible in browser
1818
},
1919
coverageIstanbulReporter: {
20-
reports: [ 'html', 'lcovonly', 'text-summary' ],
20+
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly', 'text-summary' ],
2121
fixWebpackSourcePaths: true
2222
},
2323
angularCli: {
@@ -30,7 +30,7 @@ module.exports = function (config) {
3030
colors: true,
3131
logLevel: config.LOG_INFO,
3232
autoWatch: true,
33-
browsers: ['Chrome'],
33+
browsers: ['ChromeNoSandbox'],
3434
customLaunchers: {
3535
ChromeNoSandbox: {
3636
base: 'Chrome',

0 commit comments

Comments
 (0)