Skip to content

Build playgrounds for gh-pages #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
/appengine/*
/shim/*
/dist/*
/gh-pages/*
/webpack.config.js
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ python_compressed.js
/blocks_compressed_horizontal.js
/blocks_compressed_vertical.js
/blocks_compressed.js
/gh-pages/playgrounds
/gh-pages/Gemfile.lock
/gh-pages/closure-library
/gh-pages/_site
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ after_script:
# Set version to timestamp
npm --no-git-tag-version version $($(npm bin)/json -f package.json version)-prerelease.$(date +%s)
npm publish
# Publish to gh-pages as most recent committer
GIT_AUTHOR_EMAIL=$(git log --pretty=format:"%ae" -n1) GIT_AUTHOR_NAME=$(git log --pretty=format:"%an" -n1) npm run --silent deploy -- -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
fi
15 changes: 15 additions & 0 deletions gh-pages/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
source "https://rubygems.org"
ruby RUBY_VERSION

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve

# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "jekyll-theme-architect"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
2 changes: 2 additions & 0 deletions gh-pages/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
theme: jekyll-theme-architect
show_downloads: false
2 changes: 2 additions & 0 deletions gh-pages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* [Vertical Playground](playgrounds/tests/vertical_playground.html)
* [Horizontal Playground](playgrounds/tests/horizontal_playground.html)
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
},
"main": "./dist/vertical.js",
"scripts": {
"deploy": "gh-pages -t -d gh-pages -m \"Build for $(git log --pretty=format:%H -n1)\"",
"prepublish": "python build.py && webpack",
"test": "eslint .",
"version": "json -f package.json -I -e \"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\""
},
"devDependencies": {
"copy-webpack-plugin": "4.0.1",
"eslint": "2.9.0",
"exports-loader": "0.6.3",
"gh-pages": "0.12.0",
"google-closure-library": "20160911.0.0",
"imports-loader": "0.6.5",
"json": "9.0.4",
Expand Down
42 changes: 40 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var CopyWebpackPlugin = require('copy-webpack-plugin');
var path = require('path');
module.exports = {

module.exports = [{
entry: {
horizontal: './shim/horizontal.js',
vertical: './shim/vertical.js'
Expand All @@ -10,4 +12,40 @@ module.exports = {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
}
};
}, {
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'gh-pages')
},
plugins: [
new CopyWebpackPlugin([{
from: 'node_modules/google-closure-library',
to: 'closure-library'
}, {
from: 'blocks_common',
to: 'playgrounds/blocks_common',
}, {
from: 'blocks_horizontal',
to: 'playgrounds/blocks_horizontal',
}, {
from: 'blocks_vertical',
to: 'playgrounds/blocks_vertical',
}, {
from: 'core',
to: 'playgrounds/core'
}, {
from: 'media',
to: 'playgrounds/media'
}, {
from: 'msg',
to: 'playgrounds/msg'
}, {
from: 'tests',
to: 'playgrounds/tests'
}, {
from: '*.js',
ignore: 'webpack.config.js',
to: 'playgrounds'
}])
]
}];