Skip to content

Commit a8746dd

Browse files
authored
Merge pull request #14 from thisissoon/feature/cli-ng-packagr
build(CLI): Move build environment to angular/cli and ng-packagr
2 parents 5e0c4a2 + f86f1c6 commit a8746dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+8424
-9160
lines changed

.angular-cli.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "angular-inviewport"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "sn",
21+
"styles": [
22+
"styles.scss"
23+
],
24+
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
26+
"environments": {
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
}
31+
],
32+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json",
40+
"exclude": "**/node_modules/**"
41+
},
42+
{
43+
"project": "src/tsconfig.spec.json",
44+
"exclude": "**/node_modules/**"
45+
},
46+
{
47+
"project": "e2e/tsconfig.e2e.json",
48+
"exclude": "**/node_modules/**"
49+
}
50+
],
51+
"test": {
52+
"karma": {
53+
"config": "./karma.conf.js"
54+
}
55+
},
56+
"defaults": {
57+
"styleExt": "scss",
58+
"component": {}
59+
}
60+
}

.editorconfig

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,54 @@
1-
# http://editorconfig.org
1+
# ____ __ __ __ _
2+
# / ___) / \ / \ ( ( \
3+
# \___ \( O )( O )/ / ____
4+
# (____/ \__/ \__/ \_)__)(____)
5+
#
6+
# SOON_ Cross team root editorconfig configuration
7+
# Projects can also have a local .editorconfig to customise syntax
8+
#
9+
10+
# top-most EditorConfig file
211
root = true
312

13+
# Unix-style newlines with a newline ending every file
414
[*]
5-
charset = utf-8
15+
end_of_line = lf
16+
insert_final_newline = true
17+
18+
# Backend Languages (Python, Go, Ruby etc)
19+
20+
# Python
21+
[*.py]
22+
indent_style = space
23+
indent_size = 4
24+
line_length=80
25+
multi_line_output=3
26+
default_section=THIRDPARTY
27+
import_heading_stdlib=Standard Libs
28+
import_heading_thirdparty=Third Party Libs
29+
import_heading_firstparty=First Party Libs
30+
lines_after_imports=2
31+
32+
# Ruby
33+
[{*.rb,Vagrantfile}]
634
indent_style = space
735
indent_size = 2
8-
insert_final_newline = true
36+
37+
# Front End Languages (HTML, JS, CSS etc)
38+
39+
[*.{js, ts, css, html}]
40+
indent_style = space
41+
indent_size = 2
42+
charset = utf-8
943
trim_trailing_whitespace = true
1044

45+
## JS
46+
[*.{js, ts}]
47+
quote_type = single
48+
49+
# Misc
1150

12-
[*.md]
13-
max_line_length = 0
14-
trim_trailing_whitespace = false
51+
# YAML Based files - 2 space indent
52+
[*.{yml, yaml, sls}]
53+
indent_style = space
54+
indent_size = 2

.gitignore

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
1-
.DS_STORE
2-
dist/
3-
node_modules/
4-
out-tsc/
5-
debug.log
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
632
npm-debug.log
7-
src/**/*.js
8-
!src/demo/systemjs.config.js
9-
!src/demo/systemjs.config.lib.js
10-
!**/*systemjs-angular-loader.js
11-
*.js.map
12-
e2e/**/*.js
13-
e2e/**/*.js.map
14-
coverage
15-
.idea/
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/e2e/*.js
38+
/e2e/*.map
39+
40+
# System Files
41+
.DS_Store
42+
Thumbs.db

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dist: trusty
22
sudo: false
33
language: node_js
44
node_js:
5-
- "6"
5+
- "8"
66
os:
77
- linux
88
before_install:
@@ -12,9 +12,9 @@ before_install:
1212
# Install latest chrome.
1313
- export CHROME_BIN=chromium-browser
1414
install:
15-
- npm install
15+
- npm install --no-progress
1616
script:
1717
- npm run lint
18-
- npm run test:once
19-
- npm run integration
18+
- npm run test -- --no-progress --code-coverage --single-run
19+
- npm run e2e -- --no-progress
2020
- npm run coverage

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2014-2016 Google, Inc.
3+
Copyright (c) 2017 SOON London Ltd.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
[![Build Status][travis-badge]][travis-badge-url]
33
[![Coverage Status][coveralls-badge]][coveralls-badge-url]
44

5+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4.
6+
57
A simple lightweight library for [Angular (2+)][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.
68

79
This is a simple library for [Angular][angular], implemented in the [Angular Package Format v4.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).
@@ -61,7 +63,7 @@ export class AppModule { }
6163
#### `app.component.html`
6264

6365
```html
64-
<p class="foo" snInViewport (onInViewportChange)="onInViewportChange($event)">
66+
<p class="foo" snInViewport (inViewportChange)="onInViewportChange($event)">
6567
Amet tempor excepteur occaecat nulla.
6668
</p>
6769
```
@@ -104,12 +106,37 @@ Useful if element is within another scrollable element
104106

105107
```html
106108
<div #container>
107-
<p class="foo" snInViewport [debounce]="500" [snInViewportParent]="container">
109+
<p class="foo" snInViewport [debounce]="500" [parent]="container">
108110
Amet tempor excepteur occaecat nulla.
109111
</p>
110112
</div>
111113
```
112114

115+
## Development server
116+
117+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
118+
119+
## Code scaffolding
120+
121+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
122+
123+
## Build
124+
125+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
126+
127+
## Running unit tests
128+
129+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
130+
131+
## Running end-to-end tests
132+
133+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
134+
135+
## Further help
136+
137+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
138+
139+
113140
[travis-badge]: https://travis-ci.org/thisissoon/angular-inviewport.svg?branch=master
114141
[travis-badge-url]: https://travis-ci.org/thisissoon/angular-inviewport
115142
[coveralls-badge]: https://coveralls.io/repos/github/thisissoon/angular-inviewport/badge.svg?branch=master

bs-config.json

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

0 commit comments

Comments
 (0)