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 12a44dc commit 85a91f4
Show file tree
Hide file tree
Showing 19 changed files with 9,236 additions and 359 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
50 changes: 22 additions & 28 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": [
"kentcdodds/possible-errors",
"kentcdodds/es6/possible-errors",
"kentcdodds/es6/stylistic",
"kentcdodds/best-practices",
"prettier"
],
"plugins": ["prettier"],
"env": {
"es6": true,
"browser": true,
Expand All @@ -16,32 +18,24 @@
"angular": true,
"sinon": true,
"expect": true,
"__BASE_PATH__": true
"Offline": true,
"__BASE_PATH__": true,
"__API_TOKEN__": true,
"__VERSION__": true
},
"rules": {
"indent": [
"prettier/prettier": [
"error",
2,
{
"SwitchCase": 1
}
],
"quotes": [
2,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
"printWidth": 120,
"singleQuote": true,
"trailingComma": "none"
}
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
],
"no-console": 0
"no-console": "off",
"complexity": "off",
"no-return-assign": "off",
"babel/object-curly-spacing": "off",
"babel/semi": "off"
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ npm-debug.log
demo
coverage/
.opt-in
dist/
52 changes: 28 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
sudo: required
dist: trusty
language: node_js
node_js:
- "8"
addons:
chrome: stable
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
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- 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:
- npm run test:once
- npm run check-coverage
- npm run build
after_success:
- npm run report-coverage
- npm run semantic-release
- yarn test:once
- yarn check-coverage
after_success:
- yarn report-coverage
- yarn travis-deploy-once "yarn semantic-release"
branches:
except:
- /^v\d+\.\d+\.\d+$/

31 changes: 6 additions & 25 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const webpackConfig = require('./webpack.test');
const test = process.env.NODE_ENV === 'test';
const IS_TRAVIS = process.env.TRAVIconst

module.exports = function(config) {
config.set({
Expand All @@ -14,13 +13,6 @@ module.exports = function(config) {
'karma-spec-reporter'
],

customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},

autoWatch: test,

webpack: webpackConfig,
Expand All @@ -37,53 +29,42 @@ module.exports = function(config) {
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon-chai'],


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

files: ['src/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: {
'src/app.test.js': [ 'webpack', 'sourcemap' ]
'src/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'}
{ type: 'lcov', dir: 'coverage/', subdir: '.' },
{ type: 'json', dir: 'coverage/', subdir: '.' },
{ type: 'text-summary' }
]
},


// web server port
port: 9876,


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


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


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [(IS_TRAVIS) ? 'Chrome_travis_ci' : 'Chrome'],

browsers: ['ChromeHeadless'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
Expand Down
86 changes: 26 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"path": "node_modules/cz-conventional-changelog"
},
"ghooks": {
"pre-commit": "opt --in pre-commit --exec 'npm run validate'"
"pre-commit": "opt --in pre-commit --exec 'yarn validate'"
}
},
"scripts": {
"validate": "npm run test:once && npm run check-coverage",
"validate": "yarn test:once && yarn check-coverage",
"test": "cross-env NODE_ENV=test BABEL_ENV=test karma start",
"test:once": "cross-env BABEL_ENV=test karma start",
"prebuild": "rimraf dist && mkdir dist",
Expand All @@ -21,59 +21,24 @@
"check-coverage": "istanbul check-coverage --statements 75 --branches 75 --functions 75 --lines 75",
"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"
"prepublishOnly": "yarn build",
"travis-deploy-once": "travis-deploy-once",
"semantic-release": "semantic-release"
},
"devDependencies": {
"angular-animate": "~1.5.0",
"angular-aria": "~1.5.0",
"angular-material": "~1.1.0",
"angular-mocks": "~1.5.0",
"autoprefixer": "^6.4.0",
"babel-core": "^6.0.0",
"babel-eslint": "^6.0.4",
"babel-loader": "^6.0.0",
"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.9.0",
"cross-env": "^3.1.3",
"css-loader": "^0.26.0",
"cz-conventional-changelog": "^1.1.5",
"eslint": "^3.12.0",
"eslint-loader": "^1.6.0",
"file-loader": "~0.9.0",
"ghooks": "^1.2.0",
"html-webpack-plugin": "~2.22.0",
"istanbul": "~0.4.2",
"jquery": "~2.2.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-spec-reporter": "~0.0.26",
"karma-webpack": "~1.8.0",
"lodash-webpack-plugin": "^0.10.0",
"mocha": "^3.2.0",
"ng-annotate-loader": "~0.1.0",
"ng-cache-loader": "~0.0.15",
"node-bourbon": "~4.2.3",
"node-sass": "~4.1.0",
"opt-cli": "~1.5.1",
"postcss-loader": "^0.11.0",
"progress-bar-webpack-plugin": "^1.9.0",
"raw-loader": "~0.5.1",
"rimraf": "^2.5.4",
"sass-loader": "~4.1.0",
"semantic-release": "^6.3.2",
"style-loader": "~0.13.0",
"toastr": "~2.1.2",
"url-loader": "~0.5.7",
"webpack": "^2.1.0-beta.28",
"webpack-dev-server": "^2.1.0-beta.12"
"angular": "1.6.8",
"angular-animate": "~1.6.8",
"angular-aria": "~1.6.8",
"angular-http-auth": "^1.5.0",
"angular-material": "~1.1.6",
"angular-mocks": "~1.6.8",
"angular-storage": "^0.0.15",
"ng-file-upload": "^12.2.13",
"sanji-common-devs-ui": "^7.0.0",
"sanji-rest-ui": "^1.5.0",
"semantic-release": "^12.2.4",
"toastr": "~2.1.4",
"travis-deploy-once": "^4.3.3"
},
"repository": {
"type": "git",
Expand All @@ -87,10 +52,11 @@
],
"license": "MIT",
"homepage": "https://github.com/Sanji-IO/sanji-auth-ui",
"dependencies": {
"angular": "~1.5.0",
"angular-http-auth": "~1.5.0",
"angular-storage": "~0.0.15",
"sanji-rest-ui": "^1.4.1"
}
}
"peerDependencies": {
"angular": ">=1.5.0 <1.7.0",
"angular-http-auth": "^1.5.0",
"angular-storage": "^0.0.15",
"sanji-rest-ui": "^1.5.0"
},
"version": "0.0.0-development"
}
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' })]
};
Loading

0 comments on commit 85a91f4

Please sign in to comment.