Skip to content

Commit

Permalink
feat(package): upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
zack9433 committed Jan 25, 2018
1 parent 9010757 commit 3129cf8
Show file tree
Hide file tree
Showing 9 changed files with 8,886 additions and 66 deletions.
28 changes: 25 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
{
"presets": ["es2015"],
"plugins": ["lodash"],
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": ["last 2 versions"]
}
}
]
],
"plugins": [
[
"angularjs-annotate",
{
"explicitOnly": true
}
]
],
"env": {
"test": {
"plugins": [
["__coverage__", {"ignore": "*.+(test|spec).*"}]
[
"__coverage__",
{
"ignore": "*.+(test|spec).*"
}
]
]
}
}
Expand Down
46 changes: 23 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@

sudo: required
dist: trusty
sudo: false
language: node_js
node_js:
- "8"
cache:
yarn: true
directories:
- ~/.yarn
- node_modules
notifications:
email: false
node_js:
- '4'
branches:
only:
- master
env:
global:
- YARN_VERSION=1.3.2

before_install:
- 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:
- npm run build
- yarn global add greenkeeper-lockfile@1
- |
if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
fi
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
script: yarn build
after_success:
- npm run semantic-release
- yarn semantic-release
branches:
except:
- /^v\d+\.\d+\.\d+$/

5 changes: 4 additions & 1 deletion app/sanji-window/sanji-window.controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const $inject = ['$rootScope', '$scope', 'sanjiWindowService'];
class SanjiWindowController {
constructor(...injects) {
SanjiWindowController.$inject.forEach((item, index) => this[item] = injects[index]);
SanjiWindowController.$inject.forEach((item, index) => (this[item] = injects[index]));
}

$onInit() {
this.sanjiWindowMgr = this.sanjiWindowService.create(this.windowId, { name: this.windowName });
}

Expand Down
27 changes: 11 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
"check-coverage": "istanbul check-coverage --statements 90 --branches 90 --functions 90 --lines 90",
"report-coverage": "cat ./coverage/lcov.info | codecov",
"start": "cross-env NODE_ENV=development node server/dev-server.js",
"publish-latest": "publish-latest",
"semantic-release": "semantic-release pre && npm publish && npm run publish-latest && semantic-release post"
"postpublish": "publish-latest",
"semantic-release": "semantic-release"
},
"devDependencies": {
"angular-mocks": "~1.5.0",
"autoprefixer": "^6.4.0",
"angular-mocks": "~1.6.8",
"codecov.io": "~0.1.6",
"publish-latest": "~1.1.2",
"sanji-common-devs-ui": "~1.0.2",
"semantic-release": "^4.3.5"
"sanji-common-devs-ui": "^7.0.0",
"semantic-release": "^12.2.4"
},
"repository": {
"type": "git",
Expand All @@ -38,19 +37,15 @@
"bugs": {
"url": "https://github.com/Sanji-IO/angular-sanji-window/issues"
},
"keywords": [
"sanji",
"angular-sanji",
"angular-sanji-window"
],
"keywords": ["sanji", "angular-sanji", "angular-sanji-window"],
"license": "MIT",
"homepage": "https://github.com/Sanji-IO/angular-sanji-window",
"dependencies": {
"angular": "~1.5.0",
"angular-animate": "~1.5.0",
"angular-aria": "~1.5.0",
"angular": "~1.6.8",
"angular-animate": "~1.6.8",
"angular-aria": "~1.6.8",
"angular-busy": "~4.1.4",
"angular-material": "~1.1.3",
"angular-material": "~1.1.6",
"angular-material-icons": "^0.7.1"
}
}
}
3 changes: 3 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [require('autoprefixer')({ browsers: 'last 2 versions' })]
};
21 changes: 10 additions & 11 deletions webpack.build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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');
Expand Down Expand Up @@ -39,27 +38,27 @@ config.externals = {
};

config.module.rules = [
{ test: /\.js$/, loader: 'ng-annotate-loader', exclude: /(node_modules)/, enforce: 'post' },
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!postcss-loader!sass-loader?includePaths[]=' + bourbon
use: [
{ loader: 'css-loader', options: { importLoaders: 1, minimize: true } },
'postcss-loader',
{
loader: 'sass-loader',
options: {
includePaths: bourbon
}
}
]
})
}
].concat(config.module.rules);

config.plugins.push(
new ExtractTextPlugin('angular-sanji-window.css'),
new LodashModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
quiet: true,
options: {
postcss: [autoprefixer({ browsers: ['last 2 versions'] })]
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
Expand Down
2 changes: 0 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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');
Expand Down Expand Up @@ -30,7 +29,6 @@ const config = {
]
},
plugins: [
new ProgressBarPlugin(),
new webpack.DefinePlugin({
__TEST__: 'test' === NODE_ENV,
__DEV__: 'development' === NODE_ENV,
Expand Down
28 changes: 18 additions & 10 deletions webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const bourbon = require('node-bourbon').includePaths;
const config = require('./webpack.config.js');
Expand All @@ -9,22 +8,31 @@ config.entry = {
'angular-module': ['webpack/hot/dev-server', 'webpack-dev-server/client?http://localhost:8080', './app.js']
};
config.module.rules = [
{ test: /\.js$/, loader: 'ng-annotate-loader', exclude: /(node_modules)/, enforce: 'post' },
{ test: /\.scss/, loader: 'style-loader!css-loader!postcss-loader!sass-loader?includePaths[]=' + bourbon },
{ test: /\.css$/, loader: 'style-loader!css-loader!postcss-loader?browsers=last 2 versions' },
{
test: /\.scss/,
use: [
'style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader',
{
loader: 'sass-loader',
options: {
includePaths: bourbon
}
}
]
},
{
test: /\.css$/,
use: ['style-loader', { loader: 'css-loader', options: { importLoaders: 1 } }, 'postcss-loader']
},
{ test: /\.(png|jpg|gif|jpeg)$/, loader: 'url-loader?limit=8192', exclude: /node_modules/ },
{ test: /\.(woff|woff2)$/, loader: 'url-loader?limit=10000&minetype=application/font-woff', exclude: /node_modules/ },
{ test: /\.(ttf|eot|svg)$/, loader: 'file-loader', exclude: /node_modules/ }
].concat(config.module.rules);

config.plugins.push(
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
debug: true,
options: {
postcss: [autoprefixer({ browsers: ['last 2 versions'] })]
}
}),
new HtmlWebpackPlugin({
template: 'index.html',
hash: true
Expand Down
Loading

0 comments on commit 3129cf8

Please sign in to comment.