Skip to content

Commit

Permalink
v2.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
zack9433 committed Sep 11, 2016
2 parents 44df8f8 + fabe80b commit 25ea2ee
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 93 deletions.
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"presets": ["es2015"],
"plugins": ["transform-runtime", "add-module-exports"]
"plugins": ["lodash"],
"env": {
"test": {
"plugins": [
["__coverage__", {"ignore": "*.+(test|spec).*"}]
]
}
}
}
17 changes: 15 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@
"env": {
"es6": true,
"browser": true,
"node": true
"node": true,
"mocha": true,
"protractor": true
},
"globals": {
"angular": true,
"FileSaver": true,
"sinon": true,
"expect": true,
"__DEV__": true,
"__TEST__": true,
"__RELEASE__": true,
"__BASE_PATH__": true
},
"rules": {
"indent": [ 2, 2 ],
"quotes": [ 2, "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"linebreak-style": [ 2, "unix" ],
"semi": [ 2, "always" ]
"semi": [ 2, "always" ],
"no-console": 0
}
}
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
sudo: false

sudo: required
dist: trusty
language: node_js
cache:
directories:
Expand All @@ -7,12 +9,18 @@ notifications:
email: false
node_js:
- '4'
- '0.12'
branches:
only:
- master
before_install:
- npm i -g npm@^2.0.0
- npm i -g npm@^3.0.0
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get update
- sudo apt-get install -y libappindicator1 fonts-liberation
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome*.deb
before_script:
- npm prune
script:
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-sanji-window.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions dist/angular-sanji-window.js

Large diffs are not rendered by default.

90 changes: 71 additions & 19 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,87 @@
// Karma configuration
'use strict';

var webpackConfig = require('./webpack.test');
var test = process.env.NODE_ENV === 'test';

module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '.',
plugins: [
'karma-chrome-launcher',
'karma-mocha',
'karma-chai-plugins',
'karma-sourcemap-loader',
'karma-webpack',
'karma-coverage',
'karma-spec-reporter'
],

autoWatch: test,

webpack: webpackConfig,

webpackMiddleware: {
noInfo: true
},

client: {
captureConsole: true
},

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon-chai'],


// list of files / patterns to load in the browser
files: [
'app/app.test.js'
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
// run the bundle through the webpack and sourcemap plugins
preprocessors: {
'app/app.test.js': [ 'webpack', 'sourcemap' ]
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['spec', 'coverage'],


coverageReporter: {
reporters: [
{type: 'lcov', dir: 'coverage/', subdir: '.'},
{type: 'json', dir: 'coverage/', subdir: '.'},
{type: 'text-summary'}
]
},

// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],

// web server port
port: 8080,
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['PhantomJS'],
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],


// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
// if true, Karma captures browsers, runs the tests and exits
singleRun: !test
});
};
70 changes: 36 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
},
"scripts": {
"test": "NODE_ENV=test karma start",
"test:once": "karma start",
"test": "NODE_ENV=test BABEL_ENV=test karma start",
"test:once": "BABEL_ENV=test karma start",
"prebuild": "rm -rf dist && mkdir dist",
"build": "NODE_ENV=production webpack --config webpack.build.js --display-modules",
"commit": "git-cz",
Expand All @@ -25,47 +25,47 @@
},
"devDependencies": {
"angular-mocks": "~1.5.0",
"autoprefixer-loader": "~3.2.0",
"autoprefixer": "^6.4.0",
"babel-core": "^6.0.0",
"babel-eslint": "^6.0.4",
"babel-loader": "^6.0.0",
"babel-plugin-add-module-exports": "^0.2.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-runtime": "^6.6.1",
"babel-plugin-__coverage__": "^11.0.0",
"babel-plugin-lodash": "^3.2.4",
"babel-preset-es2015": "^6.9.0",
"codecov.io": "~0.1.6",
"commitizen": "~2.8.0",
"css-loader": "~0.23.0",
"cz-conventional-changelog": "~1.1.5",
"eslint": "^2.0.0",
"commitizen": "^2.8.0",
"css-loader": "^0.24.0",
"cz-conventional-changelog": "^1.1.5",
"eslint": "^3.3.0",
"eslint-loader": "^1.3.0",
"extract-text-webpack-plugin": "~1.0.1",
"file-loader": "~0.8.5",
"ghooks": "~1.2.0",
"html-webpack-plugin": "~1.7.0",
"karma": "~0.13.15",
"karma-coverage": "~0.5.3",
"karma-mocha": "~1.0.0",
"karma-mocha-reporter": "~2.0.0",
"karma-phantomjs-launcher": "~1.0.0",
"karma-sinon-chai": "~1.2.0",
"extract-text-webpack-plugin": "^2.0.0-beta.3",
"file-loader": "~0.9.0",
"ghooks": "^1.2.0",
"html-webpack-plugin": "~2.22.0",
"karma": "~1.2.0",
"karma-chai-plugins": "~0.7.0",
"karma-chrome-launcher": "~2.0.0",
"karma-coverage": "~1.1.0",
"karma-mocha": "~1.1.1",
"karma-sourcemap-loader": "~0.3.7",
"karma-webpack": "~1.7.0",
"ng-annotate-loader": "0.1.0",
"ng-cache-loader": "0.0.15",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "~1.8.0",
"lodash-webpack-plugin": "^0.10.0",
"mocha": "^3.0.0",
"ng-annotate-loader": "~0.1.0",
"ng-cache-loader": "~0.0.15",
"node-bourbon": "~4.2.3",
"node-libs-browser": "~1.0.0",
"node-sass": "~3.7.0",
"phantomjs": "~2.1.3",
"node-sass": "^3.8.0",
"postcss-loader": "^0.11.0",
"progress-bar-webpack-plugin": "^1.9.0",
"publish-latest": "~1.1.2",
"raw-loader": "~0.5.1",
"sass-loader": "~3.2.0",
"sass-loader": "~4.0.0",
"semantic-release": "^4.3.5",
"style-loader": "~0.13.0",
"url-loader": "~0.5.7",
"webpack": "~1.13.0",
"webpack-dev-server": "~1.14.0",
"webpack-notifier": "~1.3.0"
"webpack": "^2.1.0-beta.20",
"webpack-dev-server": "^2.1.0-beta.0"
},
"repository": {
"type": "git",
Expand All @@ -83,9 +83,11 @@
"homepage": "https://github.com/Sanji-IO/angular-sanji-window",
"dependencies": {
"angular": "~1.5.0",
"angular-animate": "~1.5.8",
"angular-aria": "~1.5.8",
"angular-busy": "~4.1.3",
"angular-material": "~1.0.5",
"angular-material-icons": "^0.7.0"
"angular-material": "~1.1.0",
"angular-material-icons": "^0.7.1"
},
"version": "2.1.8"
"version": "2.1.9"
}
32 changes: 24 additions & 8 deletions webpack.build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

var webpack = require('webpack');
var WebpackNotifierPlugin = require('webpack-notifier');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var bourbon = require('node-bourbon').includePaths;
var config = require('./webpack.config.js');
const webpack = require('webpack');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const bourbon = require('node-bourbon').includePaths;
const config = require('./webpack.config.js');

config.devtool = 'source-map';
config.entry = {
Expand Down Expand Up @@ -42,17 +43,32 @@ config.externals = {
config.module.loaders = [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style-loader', 'css!autoprefixer?browsers=last 2 versions!sass?includePaths[]=' + bourbon)
loader: ExtractTextPlugin.extract({
notExtractLoader: 'style-loader',
loader: 'css!postcss!sass?includePaths[]=' + bourbon
})
}
].concat(config.module.loaders);

config.module.postLoaders = [
{test: /\.js$/, loader: 'ng-annotate', exclude: /(node_modules)/}
];
config.postcss = [ autoprefixer({ browsers: ['last 2 versions'] }) ];

config.plugins.push(
new ExtractTextPlugin('angular-sanji-window.css'),
new LodashModuleReplacementPlugin,
new webpack.optimize.DedupePlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
quiet: true
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
screw_ie8: true,
warnings: false,
dead_code: true
}
})
);
Expand Down
20 changes: 10 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use strict';

var path = require('path');
var webpack = require('webpack');
var bourbon = require('node-bourbon').includePaths;
var NODE_ENV = process.env.NODE_ENV;
var nodeRoot = path.join(__dirname, 'node_modules');
var appRoot = path.join(__dirname, 'app');
var config = {
const path = require('path');
const webpack = require('webpack');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const NODE_ENV = process.env.NODE_ENV;
const nodeRoot = path.join(__dirname, 'node_modules');
const appRoot = path.join(__dirname, 'app');
const config = {
context: appRoot,
output: {
path: path.resolve(__dirname, 'dist'),
Expand All @@ -28,13 +28,13 @@ var config = {
{test: /\.js$/, loader: "eslint", exclude: /(node_modules)/}
],
loaders: [
{test: /\.js$/, loader: 'ng-annotate!babel?cacheDirectory', exclude: /(node_modules)/},
{test: /\.html$/, loader: 'ng-cache?prefix=[dir]/[dir]', exclude: /(node_modules)/}
{ test: /\.js$/, loader: 'babel?cacheDirectory', exclude: /node_modules/ },
{ test: /\.html$/, loader: 'ng-cache?prefix=[dir]/[dir]', exclude: [/node_modules/, path.join(__dirname, '/app/index.html')] }
],
noParse: []
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new ProgressBarPlugin(),
new webpack.DefinePlugin({
__TEST__: 'test' === NODE_ENV,
__DEV__: 'development' === NODE_ENV,
Expand Down
Loading

0 comments on commit 25ea2ee

Please sign in to comment.