From 80e7f1c0b3ce22cb4292a5966f13bd6d4c2b2560 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Thu, 13 Jul 2017 15:06:10 -0400 Subject: [PATCH 1/5] Add deploy things --- .travis.yaml | 29 +++++++++++++++++++++++++++++ package.json | 7 ++++--- webpack.config.js | 7 ++++++- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 .travis.yaml diff --git a/.travis.yaml b/.travis.yaml new file mode 100644 index 00000000..cc8a5822 --- /dev/null +++ b/.travis.yaml @@ -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..9db598e3 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 build/.nojekyll && gh-pages -t -d build -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/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 + }) + ] : []) }; From 0daa70fc7c95d6e5aded8dbd16287775ad4add20 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Thu, 13 Jul 2017 15:30:06 -0400 Subject: [PATCH 2/5] Fix travis --- .eslintignore | 3 ++- .travis.yaml => .travis.yml | 0 package.json | 2 +- src/index.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename .travis.yaml => .travis.yml (100%) diff --git a/.eslintignore b/.eslintignore index 22d8c7b0..03380294 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ node_modules/* -build/* \ No newline at end of file +build/* +playground/ \ No newline at end of file diff --git a/.travis.yaml b/.travis.yml similarity index 100% rename from .travis.yaml rename to .travis.yml diff --git a/package.json b/package.json index 9db598e3..5e4bdb75 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "npm run clean && webpack --progress --colors --bail", "clean": "rimraf ./build && mkdirp build", - "deploy": "touch build/.nojekyll && gh-pages -t -d build -m \"Build for $(git log --pretty=format:%H -n1)\"", + "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", diff --git a/src/index.js b/src/index.js index 2549528c..5df3df46 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 {PaintEditorComponent as default}; From dbb23cf113d961fe308824a3d355942bbaf1337e Mon Sep 17 00:00:00 2001 From: DD Liu Date: Fri, 14 Jul 2017 11:31:55 -0400 Subject: [PATCH 3/5] update git ignore --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1bd6ef09..8c617a05 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ # NPM /node_modules -npm-* \ No newline at end of file +npm-* + +# Build +playground/* +build/* \ No newline at end of file From 4bd8343338a54dd4b1a205f959603ac2b5f5fa02 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Tue, 18 Jul 2017 14:41:40 -0400 Subject: [PATCH 4/5] change export syntax --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 5df3df46..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}; +export default PaintEditorComponent; From 6ed35b314b13a872d6cb7b3d40847206dc512b39 Mon Sep 17 00:00:00 2001 From: DD Liu Date: Tue, 18 Jul 2017 14:42:26 -0400 Subject: [PATCH 5/5] newlines at ends --- .eslintignore | 2 +- .gitignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 03380294..c13cc422 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,3 @@ node_modules/* build/* -playground/ \ No newline at end of file +playground/ diff --git a/.gitignore b/.gitignore index 8c617a05..d82cb26f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ npm-* # Build playground/* -build/* \ No newline at end of file +build/*