diff --git a/.eslintignore b/.eslintignore index 22d8c7b0..c13cc422 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ node_modules/* -build/* \ No newline at end of file +build/* +playground/ diff --git a/.gitignore b/.gitignore index 1bd6ef09..d82cb26f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ # NPM /node_modules -npm-* \ No newline at end of file +npm-* + +# Build +playground/* +build/* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..cc8a5822 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/package.json b/package.json index 189178fe..5e4bdb75 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "scratch-blobs", "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", "scripts": { "build": "npm run clean && webpack --progress --colors --bail", "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", "start": "webpack-dev-server", "test": "npm run lint && npm run build", @@ -13,10 +14,10 @@ }, "author": "Massachusetts Institute of Technology", "license": "BSD-3-Clause", - "homepage": "https://github.com/fsih/scratch-blobs#readme", + "homepage": "https://github.com/LLK/scratch-paint#readme", "repository": { "type": "git", - "url": "git+ssh://git@github.com/fsih/scratch-blobs.git" + "url": "git+ssh://git@github.com/LLK/scratch-paint.git" }, "peerDependencies": { "react": "^15", diff --git a/src/index.js b/src/index.js index 2549528c..d56db1b9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,3 @@ import PaintEditorComponent from './components/paint-editor.jsx'; -export {PaintEditorComponent as default}; \ No newline at end of file +export default PaintEditorComponent; diff --git a/webpack.config.js b/webpack.config.js index 3c2516b2..9cc59d15 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -76,5 +76,10 @@ module.exports = { template: 'src/playground/index.ejs', title: 'Scratch 3.0 Paint Editor' }) - ] + ].concat(process.env.NODE_ENV === 'production' ? [ + new webpack.optimize.UglifyJsPlugin({ + include: /\.min\.js$/, + minimize: true + }) + ] : []) };