Merge pull request #1 from fsih/addTravis

Add travis testing and deploy
This commit is contained in:
DD Liu 2017-07-18 15:10:08 -04:00 committed by GitHub
commit ef19e6f37e
6 changed files with 47 additions and 7 deletions

View file

@ -1,2 +1,3 @@
node_modules/* node_modules/*
build/* build/*
playground/

6
.gitignore vendored
View file

@ -3,4 +3,8 @@
# NPM # NPM
/node_modules /node_modules
npm-* npm-*
# Build
playground/*
build/*

29
.travis.yml Normal file
View file

@ -0,0 +1,29 @@
language: node_js
sudo: false
dist: trusty
node_js:
- 6
cache:
directories:
- node_modules
env:
global:
- NODE_ENV=production
install:
- npm --production=false install
- npm --production=false update
before_deploy:
- git config --global user.email $(git log --pretty=format:"%ae" -n1)
- git config --global user.name $(git log --pretty=format:"%an" -n1)
deploy:
- provider: script
on:
all_branches: true
condition: $TRAVIS_BRANCH != master
skip_cleanup: true
script: npm run deploy -- -x -e $TRAVIS_BRANCH -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- provider: script
on:
branch: master
skip_cleanup: true
script: npm run --silent deploy -- -x -a -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git

View file

@ -1,11 +1,12 @@
{ {
"name": "scratch-blobs", "name": "scratch-blobs",
"version": "0.1.0", "version": "0.1.0",
"description": "GraphicaL User Interface for the Scratch 3.0 paint editor, which is used to make and edit sprites for use in projects.", "description": "Graphical User Interface for the Scratch 3.0 paint editor, which is used to make and edit sprites for use in projects.",
"main": "./src/index.js", "main": "./src/index.js",
"scripts": { "scripts": {
"build": "npm run clean && webpack --progress --colors --bail", "build": "npm run clean && webpack --progress --colors --bail",
"clean": "rimraf ./build && mkdirp build", "clean": "rimraf ./build && mkdirp build",
"deploy": "touch playground/.nojekyll && gh-pages -t -d playground -m \"Build for $(git log --pretty=format:%H -n1)\"",
"lint": "eslint . --ext .js,.jsx", "lint": "eslint . --ext .js,.jsx",
"start": "webpack-dev-server", "start": "webpack-dev-server",
"test": "npm run lint && npm run build", "test": "npm run lint && npm run build",
@ -13,10 +14,10 @@
}, },
"author": "Massachusetts Institute of Technology", "author": "Massachusetts Institute of Technology",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"homepage": "https://github.com/fsih/scratch-blobs#readme", "homepage": "https://github.com/LLK/scratch-paint#readme",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+ssh://git@github.com/fsih/scratch-blobs.git" "url": "git+ssh://git@github.com/LLK/scratch-paint.git"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^15", "react": "^15",

View file

@ -1,3 +1,3 @@
import PaintEditorComponent from './components/paint-editor.jsx'; import PaintEditorComponent from './components/paint-editor.jsx';
export {PaintEditorComponent as default}; export default PaintEditorComponent;

View file

@ -76,5 +76,10 @@ module.exports = {
template: 'src/playground/index.ejs', template: 'src/playground/index.ejs',
title: 'Scratch 3.0 Paint Editor' title: 'Scratch 3.0 Paint Editor'
}) })
] ].concat(process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
})
] : [])
}; };