Skip to content

Commit fc1f66d

Browse files
committed
feat(package): AOT support added
1 parent 9da9964 commit fc1f66d

14 files changed

+2012
-647
lines changed

.travis.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
sudo: required
2+
dist: trusty
3+
addons:
4+
apt:
5+
sources:
6+
- google-chrome
7+
packages:
8+
- google-chrome-stable
9+
before_script:
10+
- export DISPLAY=:99.0
11+
- sh -e /etc/init.d/xvfb start
12+
- sleep 3
13+
language: node_js
14+
node_js:
15+
- "6"
16+
script:
17+
- npm run ci
18+
after_success:
19+
- npm run coveralls

CHANGELOG.md

Whitespace-only changes.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[![npm version](https://badge.fury.io/js/angular-i18next.svg)](https://badge.fury.io/js/angular-i18next)
2+
[![Build Status](https://travis-ci.org/Romanchuk/angular-i18next.svg?branch=master)](https://travis-ci.org/Romanchuk/angular-i18next)
3+
[![Coverage Status](https://coveralls.io/repos/github/Romanchuk/angular-i18next/badge.svg?branch=master)](https://coveralls.io/github/Romanchuk/angular-i18next?branch=master)
4+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
5+
[![Dependency Status](https://david-dm.org/Romanchuk/angular-i18next.svg)](https://david-dm.org/Romanchuk/angular-i18next)
6+
[![devDependency Status](https://david-dm.org/Romanchuk/angular-i18next/dev-status.svg)](https://david-dm.org/Romanchuk/angular-i18next?type=dev)
7+
18
# angular-i18next
29
[i18next](http://i18next.com/) integration with angular 2.0+
310

karma.conf.debug.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
var webpack = require('webpack');
2+
var path = require('path');
3+
module.exports = function (config) {
4+
config.set({
5+
browsers: ['Chrome'],
6+
colors: true,
7+
files: [
8+
'karma.entry.js'
9+
],
10+
frameworks: ['jasmine'],
11+
preprocessors: {
12+
'karma.entry.js': ['webpack', 'sourcemap']
13+
},
14+
singleRun: false,
15+
webpack: {
16+
devtool: 'inline-source-map',
17+
module: {
18+
rules: [
19+
{
20+
exclude: [path.resolve(__dirname, 'node_modules')],
21+
include: [
22+
path.resolve(__dirname, 'src'),
23+
path.resolve(__dirname, 'tests')
24+
],
25+
loader: 'ts-loader',
26+
test: /\.ts$/,
27+
options: {
28+
compilerOptions: {
29+
noEmitHelpers: true
30+
}
31+
}
32+
}
33+
]
34+
},
35+
resolve: {
36+
extensions: ['.ts', '.tsx', '.json', '.js'],
37+
modules: [
38+
'node_modules'
39+
]
40+
}
41+
},
42+
webpackServer: {
43+
noInfo: true,
44+
noLog: true
45+
}
46+
});
47+
};

karma.conf.js

+70-69
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,76 @@
1-
// Karma configuration
2-
// Generated on Mon Apr 17 2017 20:18:26 GMT+0700 (Новосибирское стандартное время)
3-
4-
module.exports = function(config) {
1+
var webpack = require('webpack');
2+
var path = require('path');
3+
module.exports = function (config) {
54
config.set({
6-
7-
// base path that will be used to resolve all patterns (eg. files, exclude)
8-
basePath: '',
9-
10-
11-
// frameworks to use
12-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
13-
frameworks: ['jasmine', "karma-typescript"],
14-
15-
16-
// list of files / patterns to load in the browser
5+
browsers: ['Chrome'],
6+
colors: true,
7+
coverageReporter: {
8+
dir: './',
9+
reporters: [
10+
{ type: 'lcov', subdir: 'coverage' }
11+
]
12+
},
13+
customLaunchers: {
14+
Chrome_travis_ci: {
15+
base: 'Chrome',
16+
flags: ['--no-sandbox']
17+
}
18+
},
1719
files: [
18-
'node_modules/es6-shim/es6-shim.min.js',
19-
'karma.entry.js',
20-
{ pattern: "src/**/*.ts" },
21-
{ pattern: "tests/**/*.ts" }
20+
'karma.entry.js'
2221
],
23-
24-
// list of files to exclude
25-
exclude: [
26-
27-
],
28-
29-
30-
// preprocess matching files before serving them to the browser
31-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
22+
frameworks: ['jasmine'],
3223
preprocessors: {
3324
'karma.entry.js': ['webpack', 'sourcemap'],
34-
"src/**/*.ts": ["karma-typescript", "coverage"],
35-
"tests/**/*.ts": ["karma-typescript"]
25+
'src/**/*.js': ['coverage']
3626
},
37-
38-
39-
// test results reporter to use
40-
// possible values: 'dots', 'progress'
41-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
42-
reporters: ["progress", "karma-typescript"],
43-
44-
45-
// web server port
46-
port: 9876,
47-
48-
49-
// enable / disable colors in the output (reporters and logs)
50-
colors: true,
51-
52-
53-
// level of logging
54-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
55-
logLevel: config.LOG_INFO,
56-
57-
58-
// enable / disable watching file and executing tests whenever any file changes
59-
autoWatch: true,
60-
61-
62-
// start these browsers
63-
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
64-
browsers: ['Chrome'], // 'Firefox', 'Opera', 'IE'],
65-
66-
67-
// Continuous Integration mode
68-
// if true, Karma captures browsers, runs the tests and exits
69-
singleRun: false,
70-
71-
// Concurrency level
72-
// how many browser should be started simultaneous
73-
concurrency: Infinity
74-
})
75-
}
27+
reporters: ['spec', 'coverage'],
28+
singleRun: true,
29+
webpack: {
30+
devtool: 'inline-source-map',
31+
module: {
32+
rules: [
33+
{
34+
exclude: [path.resolve(__dirname, 'node_modules')],
35+
include: [
36+
path.resolve(__dirname, 'src'),
37+
path.resolve(__dirname, 'tests')
38+
],
39+
loader: 'ts-loader',
40+
test: /.*(?!\.d\.ts)|(\.ts)$/,
41+
options: {
42+
compilerOptions: {
43+
noEmitHelpers: true
44+
}
45+
}
46+
},
47+
{
48+
exclude: [
49+
path.resolve(__dirname, 'node_modules/@angular'),
50+
path.resolve(__dirname, 'node_modules/rxjs')
51+
],
52+
include: [
53+
path.resolve(__dirname, 'src')
54+
],
55+
loader: 'istanbul-instrumenter-loader',
56+
test: /\.ts$/,
57+
enforce: 'post'
58+
}
59+
]
60+
},
61+
resolve: {
62+
extensions: ['.ts', '.tsx', '.json', '.js'],
63+
modules: [
64+
'node_modules'
65+
]
66+
}
67+
},
68+
webpackServer: {
69+
noInfo: true,
70+
noLog: true
71+
}
72+
});
73+
if (process.env.TRAVIS) {
74+
config.browsers = ['Chrome_travis_ci'];
75+
}
76+
};

karma.entry.js

+22-18
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@ require('es6-shim');
22
require('reflect-metadata');
33
require('zone.js/dist/zone');
44
require('zone.js/dist/long-stack-trace-zone');
5-
require('zone.js/dist/async-test');
6-
require('zone.js/dist/fake-async-test');
7-
require('zone.js/dist/sync-test');
85
require('zone.js/dist/proxy');
6+
require('zone.js/dist/sync-test');
97
require('zone.js/dist/jasmine-patch');
10-
11-
const browserTesting = require('@angular/platform-browser-dynamic/testing');
12-
const coreTesting = require('@angular/core/testing');
13-
const context = require.context('./tests/', true, /\.spec\.ts$/);
14-
15-
Error.stackTraceLimit = Infinity;
16-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000;
17-
18-
coreTesting.TestBed.resetTestEnvironment();
19-
coreTesting.TestBed.initTestEnvironment(
20-
browserTesting.BrowserDynamicTestingModule,
21-
browserTesting.platformBrowserDynamicTesting()
22-
);
23-
24-
context.keys().forEach(context);
8+
require('zone.js/dist/async-test');
9+
require('zone.js/dist/fake-async-test');
10+
require('ts-helpers');
11+
// Prevent Karma from running prematurely.
12+
__karma__.loaded = function () { return; };
13+
Promise.all([
14+
require('@angular/core/testing'),
15+
require('@angular/platform-browser-dynamic/testing')
16+
])
17+
.then(function (a) {
18+
var testing = a[0];
19+
var testingBrowser = a[1];
20+
testing
21+
.getTestBed()
22+
.initTestEnvironment(
23+
testingBrowser.BrowserDynamicTestingModule,
24+
testingBrowser.platformBrowserDynamicTesting());
25+
})
26+
.then(function () { return require.context('./tests/', true, /\.ts/); })
27+
.then(function (context) { return context.keys().map(context); })
28+
.then(__karma__.start, __karma__.error);

0 commit comments

Comments
 (0)