Skip to content

Commit d53c79f

Browse files
committed
Init project
0 parents  commit d53c79f

26 files changed

+7263
-0
lines changed

.angular-cli.json

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

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
12+
[package.json]
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.md]
17+
max_line_length = off
18+
trim_trailing_whitespace = false

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/*
2+
npm-debug.log
3+
*.map
4+
*.d.ts
5+
**/*.ngfactory.ts
6+
tmp
7+
*.iml
8+
dist

.npmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Node
2+
node_modules/*
3+
npm-debug.log
4+
src
5+
tmp
6+
dist
7+
.angular-cli.json
8+
.editorconfig
9+
.gitignore
10+
.npmignore
11+
.travis.yml
12+
gulpfile.js
13+
karma.conf.js
14+
karmaMain.ts
15+
polyfills.ts
16+
protractor.conf.js
17+
test.ts
18+
tsconfig.json
19+
tsconfig.ngc.json
20+
tsconfig.spec.json
21+
tslint.json
22+
yarn.lock
23+
*.iml

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- 6.10.1

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 mpalourdio
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.MD

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[![Build Status](https://travis-ci.org/mpalourdio/ng-http-interceptor.svg?branch=master)](https://travis-ci.org/mpalourdio/ng-http-interceptor)
2+
# ng-http-interceptor
3+
4+
## Installation
5+
6+
To install this library, run:
7+
8+
```bash
9+
$ npm install ng-http-interceptor --save
10+
```
11+
12+
This package provides an HTTP Interceptor, and a spinner component. The HTTP interceptor listens to all HTTP requests
13+
and shows a spinner during pending requests.
14+
15+
It's compatible with Angular 4+.
16+
17+
The spinner has been taken from [SpinKit](https://github.com/tobiasahlin/SpinKit).

gulpfile.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const inlineNg2Template = require('gulp-inline-ng2-template');
2+
const gulp = require('gulp');
3+
const clean = require('gulp-clean');
4+
5+
const tmpDir = './tmp';
6+
const distDir = './dist';
7+
8+
gulp.task('inline-templates', ['clean-tmp'], function () {
9+
return gulp.src(['!./src/app/**/*.spec.ts', './src/app/**/*.ts'])
10+
.pipe(inlineNg2Template({
11+
base: '/src',
12+
target: 'es6',
13+
useRelativePaths: true
14+
}))
15+
.pipe(gulp.dest(tmpDir));
16+
});
17+
18+
gulp.task('clean-tmp', function () {
19+
return gulp.src(tmpDir, {read: false})
20+
.pipe(clean());
21+
});
22+
23+
gulp.task('clean-dist', function () {
24+
return gulp.src(distDir, {read: false})
25+
.pipe(clean());
26+
});
27+
28+
gulp.task('copy-package-json', function () {
29+
return gulp.src('package.json')
30+
.pipe(gulp.dest(distDir));
31+
});
32+
33+
gulp.task('copy-all', ['copy-package-json']);

karma.conf.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/0.13/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular/cli'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-phantomjs-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
14+
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
files: [
19+
{ pattern: './test.ts', watched: false }
20+
],
21+
preprocessors: {
22+
'./test.ts': ['@angular/cli']
23+
},
24+
mime: {
25+
'text/x-typescript': ['ts','tsx']
26+
},
27+
coverageIstanbulReporter: {
28+
reports: [ 'html', 'lcovonly' ],
29+
fixWebpackSourcePaths: true
30+
},
31+
angularCli: {
32+
environment: 'dev'
33+
},
34+
reporters: config.angularCli && config.angularCli.codeCoverage
35+
? ['progress', 'coverage-istanbul']
36+
: ['progress', 'kjhtml'],
37+
port: 9876,
38+
colors: true,
39+
logLevel: config.LOG_INFO,
40+
autoWatch: true,
41+
browsers: ['PhantomJS'],
42+
singleRun: false
43+
});
44+
};

karmaMain.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
import { NgHttpInterceptorModule } from './src/app/ng-http-interceptor.module';
3+
4+
platformBrowserDynamic().bootstrapModule(NgHttpInterceptorModule);

0 commit comments

Comments
 (0)