diff --git a/.travis.yml b/.travis.yml index b84f1d29b..cc8a5822a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,33 +1,29 @@ language: node_js +sudo: false +dist: trusty node_js: - 6 -- 'node' cache: directories: - node_modules env: global: - - BASE_PATH=/scratch-gui/ - NODE_ENV=production install: - npm --production=false install - npm --production=false update -after_script: -- | - # RELEASE_BRANCHES and NPM_TOKEN defined in Travis settings panel - declare exitCode - $(npm bin)/travis-after-all - exitCode=$? - if [[ - # Execute after all jobs finish successfully - $exitCode = 0 && - # Only release on release branches - $RELEASE_BRANCHES =~ $TRAVIS_BRANCH && - # Don't release on PR builds - $TRAVIS_PULL_REQUEST = "false" - ]]; then - # Publish to gh-pages as most recent committer - git config --global user.email $(git log --pretty=format:"%ae" -n1) - git config --global user.name $(git log --pretty=format:"%an" -n1) - npm run --silent deploy -- -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git - fi +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/README.md b/README.md index a48de2ef4..47ab4a65d 100644 --- a/README.md +++ b/README.md @@ -33,5 +33,10 @@ Then go to [http://localhost:8601/](http://localhost:8601/) - the playground out npm test ``` +## Publishing to GitHub Pages + +You can publish the GUI to github.io so that others on the Internet can view it. +[Read the wiki for a step-by-step guide.](https://github.com/LLK/scratch-gui/wiki/Publishing-to-GitHub-Pages) + ## Donate We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you! diff --git a/package.json b/package.json index 601b93663..75bd48ebc 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "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" + "test": "npm run lint && npm run build", + "watch": "webpack --progress --colors --watch" }, "author": "Massachusetts Institute of Technology", "license": "BSD-3-Clause", @@ -36,7 +37,7 @@ "eslint": "^3.16.1", "eslint-config-scratch": "^3.0.0", "eslint-plugin-react": "^7.0.1", - "gh-pages": "^1.0.0", + "gh-pages": "github:rschamp/gh-pages#publish-branch-to-subfolder", "html-webpack-plugin": "2.28.0", "immutable": "3.8.1", "lodash.bindall": "4.4.0", @@ -64,12 +65,11 @@ "scratch-audio": "latest", "scratch-blocks": "latest", "scratch-render": "latest", - "scratch-storage": "^0.1.0", + "scratch-storage": "^0.2.0", "scratch-vm": "latest", "style-loader": "^0.18.0", "svg-to-image": "1.1.3", "svg-url-loader": "2.0.2", - "travis-after-all": "^1.4.4", "webpack": "^2.4.1", "webpack-dev-server": "^2.4.1", "xhr": "2.4.0" diff --git a/src/components/gui/gui.css b/src/components/gui/gui.css index 989601a57..821f55014 100644 --- a/src/components/gui/gui.css +++ b/src/components/gui/gui.css @@ -19,6 +19,12 @@ */ flex-direction: row; height: 100%; + + /* + Stop scrollbar popping in and out from scratch-blocks border issue + https://github.com/LLK/scratch-gui/issues/318 + */ + overflow-y: hidden; } .editor-wrapper { diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index 47fb1b327..6d0bb59dc 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -119,6 +119,6 @@ GUIComponent.propTypes = { vm: PropTypes.instanceOf(VM).isRequired }; GUIComponent.defaultProps = { - basePath: '/' + basePath: './' }; module.exports = GUIComponent; diff --git a/src/components/modal/modal.jsx b/src/components/modal/modal.jsx index 2a743bd74..2ccd4b593 100644 --- a/src/components/modal/modal.jsx +++ b/src/components/modal/modal.jsx @@ -18,6 +18,7 @@ class ModalComponent extends React.Component { isOpen={this.props.visible} overlayClassName={styles.modalOverlay} ref={m => (this.modal = m)} + onRequestClose={this.props.onRequestClose} >