Skip to content

Commit 7184eb4

Browse files
committed
v0.9.0. Better support for AoT compilation. Breaking changes, no more static functions, methods must be called from the injected KC object.
1 parent 3a33ab8 commit 7184eb4

39 files changed

Lines changed: 2123 additions & 1804 deletions

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
1-
#################
2-
## Misc
3-
#################
4-
**/.DS_Store
5-
nbproject
6-
manifest.mf
7-
build.xml
8-
node_modules/*
1+
.idea/
2+
.DS_Store
3+
node_modules/
4+
coverage/
95
npm-debug.log
10-
!tools/*
11-
*.js
12-
!config/*
13-
!karma.conf.js
14-
!webpack.config.js
15-
!gulpfile.js
16-
!inline-resources.js
17-
*.map
18-
*.d.ts
19-
!make.js
20-
coverage
21-
*.metadata.json
22-
bundles
23-
.vscode
24-
25-
#################
26-
## JetBrains
27-
#################
28-
.idea
29-
.project
30-
.settings
31-
32-
############
33-
## Windows
34-
############
35-
36-
# Windows image file caches
37-
Thumbs.db
38-
39-
# Folder config file
40-
Desktop.ini
41-
42-
############
43-
## Mac
44-
############
45-
46-
# Mac crap
47-
.DS_Store
6+
dist/

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ Desktop.ini
2222
# Mac
2323
.DS_Store
2424
**/.DS_Store
25+
26+
/compiled
27+
28+
# or
29+
30+
*.ngFactory.ts

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-prefix=^

.travis.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
language: node_js
2-
sudo: false
2+
33
node_js:
4-
- '4.2.1'
4+
- '8'
5+
6+
script: npm test
7+
8+
notifications:
9+
email: false
10+
11+
cache:
12+
directories:
13+
- node_modules
14+
15+
after_success:
16+
- npm run codecov
17+
18+
addons:
19+
chrome: stable
20+
21+
dist: trusty

.yo-rc.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
2-
"generator-angular2-library": {
3-
"promptValues": {
4-
"gitRepositoryUrl": "https://github.com/ebondu/angular2-keycloak"
5-
}
2+
"generator-angular-library": {
3+
"githubUsername": "ebondu@gmail.com",
4+
"githubRepoName": "ngx-keycloak",
5+
"npmModuleName": "ngx-keycloak",
6+
"moduleGlobal": "ngxKeycloak",
7+
"ngModuleName": "NgxKeycloakModule",
8+
"selectorPrefix": "component",
9+
"projectTitle": "ngx keycloak",
10+
"projectDescription": "An angular keycloak wrapper",
11+
"authorName": "ebondu",
12+
"packageManager": "npm"
613
}
714
}

custom-typings.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare module 'fork-ts-checker-webpack-plugin';
2+
declare module 'webpack-angular-externals';
3+
declare module 'webpack-rxjs-externals';
4+
declare module 'webpack-config-utils';
5+
declare module 'offline-plugin';
6+
declare module '@mattlewis92/webpack-karma-die-hard';

gulpfile.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ gulp.task('rollup:fesm', function () {
8484
// See https://github.com/rollup/rollup/wiki/JavaScript-API#external
8585
external: [
8686
'@angular/core',
87-
'@angular/common'
87+
'@angular/common',
88+
'@angular/http',
89+
'rxjs/Rx',
90+
'rxjs/operator/map',
91+
'rxjs/operator/filter',
92+
'rxjs/operator/catch'
8893
],
8994

9095
// Format of generated bundle
@@ -117,7 +122,12 @@ gulp.task('rollup:umd', function () {
117122
// See https://github.com/rollup/rollup/wiki/JavaScript-API#external
118123
external: [
119124
'@angular/core',
120-
'@angular/common'
125+
'@angular/common',
126+
'@angular/http',
127+
'rxjs/Rx',
128+
'rxjs/operator/map',
129+
'rxjs/operator/filter',
130+
'rxjs/operator/catch'
121131
],
122132

123133
// Format of generated bundle

karma.conf.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import * as webpack from 'webpack';
2+
import * as path from 'path';
3+
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
4+
import * as WebpackKarmaDieHardPlugin from '@mattlewis92/webpack-karma-die-hard';
5+
6+
export default (config: any) => {
7+
8+
config.set({
9+
10+
// base path that will be used to resolve all patterns (eg. files, exclude)
11+
basePath: './',
12+
13+
// frameworks to use
14+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
15+
frameworks: ['mocha'],
16+
17+
// list of files / patterns to load in the browser
18+
files: [
19+
'test/entry.ts'
20+
],
21+
22+
// preprocess matching files before serving them to the browser
23+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
24+
preprocessors: {
25+
'test/entry.ts': ['webpack', 'sourcemap']
26+
},
27+
28+
webpack: {
29+
resolve: {
30+
extensions: ['.ts', '.js']
31+
},
32+
module: {
33+
rules: [{
34+
test: /\.ts$/,
35+
loader: 'tslint-loader',
36+
exclude: /node_modules/,
37+
enforce: 'pre',
38+
options: {
39+
emitErrors: config.singleRun,
40+
failOnHint: config.singleRun
41+
}
42+
}, {
43+
test: /\.ts$/,
44+
loader: 'ts-loader',
45+
exclude: /node_modules/,
46+
options: {
47+
transpileOnly: !config.singleRun
48+
}
49+
}, {
50+
test: /src(\\|\/).+\.ts$/,
51+
exclude: /(node_modules|\.spec\.ts$)/,
52+
loader: 'istanbul-instrumenter-loader',
53+
enforce: 'post'
54+
}]
55+
},
56+
plugins: [
57+
new webpack.SourceMapDevToolPlugin({
58+
filename: null,
59+
columns: false,
60+
test: /\.(ts|js)($|\?)/i
61+
}),
62+
new webpack.ContextReplacementPlugin(
63+
/angular(\\|\/)core(\\|\/)@angular/,
64+
path.join(__dirname, 'src')
65+
),
66+
...(config.singleRun ? [
67+
new WebpackKarmaDieHardPlugin(),
68+
new webpack.NoEmitOnErrorsPlugin()
69+
] : [
70+
new ForkTsCheckerWebpackPlugin({
71+
watch: ['./src', './test'],
72+
formatter: 'codeframe'
73+
})
74+
])
75+
]
76+
},
77+
78+
mochaReporter: {
79+
showDiff: true,
80+
output: 'autowatch'
81+
},
82+
83+
coverageIstanbulReporter: {
84+
reports: ['text-summary', 'html', 'lcovonly'],
85+
fixWebpackSourcePaths: true
86+
},
87+
88+
mime: {
89+
'text/x-typescript': ['ts']
90+
},
91+
92+
// test results reporter to use
93+
// possible values: 'dots', 'progress'
94+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
95+
reporters: ['mocha', 'coverage-istanbul'],
96+
97+
// level of logging
98+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
99+
logLevel: config.LOG_INFO,
100+
101+
// start these browsers
102+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
103+
browsers: ['ChromeHeadless']
104+
105+
});
106+
107+
};

0 commit comments

Comments
 (0)