Skip to content

Commit f053a47

Browse files
committed
feat(build): Move build environment to angular cli and ng-packagr
Simplified the dev and build environment to be based on the angular cli
1 parent bfb8554 commit f053a47

Some content is hidden

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

86 files changed

+8020
-9328
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-image-loader"
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/TS, 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/TS
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 & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +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
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 --browser=ChromeNoSandbox
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: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
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 progressive/responsive/lazy loading image library for [Angular (2/4+)][angular] that detects browser size and loads the appropriate image only when the element is in view. This package requires [angular-inviewport][angular-inviewport]
68

7-
<img src="https://raw.githubusercontent.com/thisissoon/angular-image-loader/master/src/demo/example.gif" alt="example">
9+
<img src="https://raw.githubusercontent.com/thisissoon/angular-image-loader/master/src/assets/example.gif" alt="example">
810

9-
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).
11+
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).
1012

1113

1214
## Install
@@ -16,9 +18,18 @@ This is a simple library for [Angular][angular], implemented in the [Angular Pac
1618
`app.module.ts`
1719
```ts
1820
import { ImageLoaderModule } from '@thisissoon/angular-image-loader';
21+
import { InViewportModule, WindowRef } from '@thisissoon/angular-inviewport';
22+
23+
// Provide window object for browser and a suitable replacement
24+
// on other platforms
25+
export const getWindow = () => window;
26+
export const providers: Provider[] = [
27+
{ provide: WindowRef, useFactory: (getWindow) }
28+
];
1929

2030
@NgModule({
2131
imports: [
32+
InViewportModule.forRoot(providers),
2233
ImageLoaderModule
2334
]
2435
})
@@ -28,7 +39,7 @@ export class AppModule { }
2839

2940
## Example
3041

31-
a working example can be found inside [/src/demo](https://github.com/thisissoon/angular-image-loader/tree/master/src/demo) folder
42+
a working example can be found inside [/src](https://github.com/thisissoon/angular-image-loader/tree/master/src) folder
3243

3344
### `app.component.html`
3445

@@ -82,6 +93,31 @@ export class AppComponent {
8293
```
8394

8495

96+
## Development server
97+
98+
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.
99+
100+
## Code scaffolding
101+
102+
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`.
103+
104+
## Build
105+
106+
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.
107+
108+
## Running unit tests
109+
110+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
111+
112+
## Running end-to-end tests
113+
114+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
115+
116+
## Further help
117+
118+
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).
119+
120+
85121
[travis-badge]: https://travis-ci.org/thisissoon/angular-image-loader.svg?branch=master
86122
[travis-badge-url]: https://travis-ci.org/thisissoon/angular-image-loader
87123
[coveralls-badge]: https://coveralls.io/repos/github/thisissoon/angular-image-loader/badge.svg?branch=master

bs-config.json

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

0 commit comments

Comments
 (0)