Skip to content

Commit

Permalink
[PR] Website tweaks
Browse files Browse the repository at this point in the history
Summary:
![330f 1](https://cloud.githubusercontent.com/assets/952783/23810160/4a98f766-0585-11e7-85b0-85db9c371343.gif)
Closes facebook#3498

Differential Revision: D4690749

Pulled By: mroch

fbshipit-source-id: 06f246ae471cb86478c78cc60ef772be8a1273db
  • Loading branch information
jamiebuilds authored and facebook-github-bot committed Mar 20, 2017
1 parent 3ca82ac commit 360d6dc
Show file tree
Hide file tree
Showing 245 changed files with 10,891 additions and 9,405 deletions.
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ env:
- secure: HMGkDgbay0TcQtiCm5K4F1Y8trtMT5X5S8nRGrTrKBuI4RIEkTQ06VdQVf96gnhe/7IjDQfAUbXWspSmlpWbIKij4BRHOijezU37sooNUkQp4R+EfPpbJECnuv+4WqZI2bMj2i3sw3b8f1oNCFztzHrpxZQ9oOeQbenf/8c2fQs=
# AWS_SECRET_ACCESS_KEY
- secure: huLKjE7xlxl7HaCLIIVyDaZN9ZsWrR4RcxW+JNUH1F9lM5mbRjAPayawSKRzHViu7u6uUNkjMOJs3lRlWdj8ezH2vnJNm9oNvCOYuSFmBIBELVlXcfbqpX9ZffbJeFiUZ2dOwrDEhm3+WIg6Wr3QbUtVdlMfNvljOJ3CQQc9Yc4=
# CLOUDFRONT_ID
- secure: Jr+6c6pF5H0lP4Kt6evlf/xYD/Qjoms3HK7lw1kg8lzwoEXPD3MezgkpOktU8ZBllGolc+ou23h+3hgJwvqi7ANmjzfxyVDdpB7Kiw4y2pEm6tAXYzmatSDb401u7+2sb2H/aSe8yikNrVrizvqaJrDOGeptCBjXQF+a2lNeMC0=
# NPM_TOKEN
- secure: hzJKtjqujadYb7QiMhCLCieNtTp77aMRaqxorJq2+CT+dMcIh1S/S9jxXsfl4OzidnIv2QHussHo5gOdS3U4JzRsHEgQ5+4HRkpxif1UijVqb4FXgaaS3PuBylV2xtMAlVjOUW+HqSCVxbokhrqWkeTKEozfk18+E8TnuOqhKjU=

# S3_BUCKET (flowtype.org)
#- secure: Fdgys32ms6aKaNaZ98FvjN/MKZZRQHWw40Fq/FK8MFKhw0eUwRnVzQxJY7q70CVFLJ8f3wSK0ltaBa2VdCWHb7ROigHGZmbk5QpmmgLIrQncm1OrSgmhcMbWqzEr6VvfEVVf9+zU3mkUIo69z6vSZbc4+GnaVWqcSamsX7Wz3TQ=
# CLOUDFRONT_ID (flowtype.org)
#- secure: Jr+6c6pF5H0lP4Kt6evlf/xYD/Qjoms3HK7lw1kg8lzwoEXPD3MezgkpOktU8ZBllGolc+ou23h+3hgJwvqi7ANmjzfxyVDdpB7Kiw4y2pEm6tAXYzmatSDb401u7+2sb2H/aSe8yikNrVrizvqaJrDOGeptCBjXQF+a2lNeMC0=

# S3_BUCKET (beta.flow.org)
- secure: fEJ1vIc7a7xqZPfbUDL1GbMYTcujVU7JY1wrQvDax8rcEOWEO6fKUomIxGCRKhut7fVlvRVaa8nLzVwyRDeT/KD4x2alQLuxJV9wwVGO/PFb6XDjUXayxzG7EmhzsERY9udh0+//SNShetY+1FbBS5zm6/aDAUenYMrqKqEZJyU=
# CLOUDFRONT_ID (beta.flow.org)
- secure: ZJCulN8EEq4sqBth/rOUeqg3Ocyp+C7Dunv0Nit5kDgT6ZuBxqoy4uUJNwO7Ohdt6qO3GXZByJs1P533Te+Zgw2U/mW1fvVLUHVgsR2KvWvbYpTQXMXR1XMbXXMEjBohlHc3YRPPHdw272AFgPEzwMwHgESyYnd3kjFyiwJeVhE=

# NOTE: We set the compiler to a bogus "no-op" bash command (":") to work around
# a Travis caching limitation: the cache slug only depends on the compiler name,
# not any other environment vars, so we fake the compiler name to change the
Expand Down Expand Up @@ -98,7 +106,7 @@ deploy:
script: bash -e resources/travis/deploy.sh
skip_cleanup: true
on:
all_branches: true
branch: master
condition:
- $TRAVIS_TAG != "" || $TRAVIS_BRANCH = "master"
- $TRAVIS_OS_NAME = linux
Expand Down
4 changes: 2 additions & 2 deletions resources/travis/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gem install --no-rdoc --no-ri bundler
printf "travis_fold:end:installing_ruby\n"

printf "travis_fold:start:website_deps\nInstalling website deps\n"
(cd website && make deps)
(cd website && make install)
printf "travis_fold:end:website_deps\n"

printf "travis_fold:start:jekyll_build\nBuilding Jekyll site\n"
Expand All @@ -41,7 +41,7 @@ git ls-remote --tags | awk '{print $2}' | cut -d/ -f3 | \
head -n 5 >> "website/_data/flow_dot_js_versions.csv"
env \
PATH="${TRAVIS_BUILD_DIR}/bin:$PATH" \
bundle exec jekyll build -s website/ -d "$PAGES_CHECKOUT" --verbose
(cd website && make build-production DEST="$PAGES_CHECKOUT")
printf "travis_fold:end:jekyll_build\n"

printf "travis_fold:start:push_s3\nPushing to S3\n"
Expand Down
10 changes: 4 additions & 6 deletions website/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[ignore]
<PROJECT_ROOT>/node_modules/bower

[include]

[libs]

[options]
suppress_comment=^\\( \\|\n\\)*\\$ExpectError\\(([^)]*)\\)?$
suppress_comment=^\\( \\|\n\\)*\\$DocIssue\\(([^)]*)\\)?$
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
max_header_tokens=1
18 changes: 5 additions & 13 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
.DS_STORE
*.swo
*.swp
node_modules

# default jekyll build dir
_site/

# jekyll/jekyll-assets caches
.asset-cache
/node_modules
_site
.sass-cache
.jekyll-metadata

# Bower-installed dependencies
_assets/third-party-bower
.DS_Store
.asset-cache

# Flow build artifacts are copied here:
/_assets/gen
Expand Down
1 change: 0 additions & 1 deletion website/CNAME

This file was deleted.

12 changes: 8 additions & 4 deletions website/Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
source 'https://rubygems.org'
ruby RUBY_VERSION

gem 'jekyll', '~>3.1'
gem 'jekyll'
gem 'jekyll-redirect-from'
gem 'jekyll-paginate'
gem 'octokit'
gem 'crowdin-cli'
gem 'kramdown', '~>1.11' # _plugins/jekyll_ext.rb messes with internals
gem 'rouge', '<2' # rouge2 will require changes in _plugins/jekyll_ext.rb
gem 's3_website'
gem 'sprockets-es6'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
gem 'jekyll-assets', '~>2.2'
gem 'sprockets-es6'
gem 's3_website'
gem 'octokit'
47 changes: 39 additions & 8 deletions website/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ GEM
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
colorator (0.1)
colorator (1.1.0)
colored (1.2)
concurrent-ruby (1.0.2)
configure-s3-website (1.7.1)
deep_merge (= 1.0.0)
crowdin-api (0.4.1)
rest-client (~> 1.8)
crowdin-cli (0.5.4)
crowdin-api (~> 0.4.0)
gli (~> 2.9)
i18n (~> 0.7, >= 0.7.0)
rubyzip (~> 1.0)
deep_merge (1.0.0)
domain_name (0.5.20160826)
unf (>= 0.0.5, < 1.0.0)
dotenv (1.0.2)
execjs (2.7.0)
extras (0.1.0)
Expand All @@ -20,15 +29,20 @@ GEM
multipart-post (>= 1.2, < 3)
fastimage (2.0.0)
addressable (~> 2)
ffi (1.9.10)
ffi (1.9.14)
forwardable-extended (2.6.0)
jekyll (3.1.6)
colorator (~> 0.1)
gli (2.14.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.7.0)
jekyll (3.2.1)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-assets (2.2.7)
Expand All @@ -38,17 +52,21 @@ GEM
pathutil (>= 0.8)
sprockets (~> 3.3)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.11.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.4.0)
sass (~> 3.4)
jekyll-watch (1.4.0)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.11.1)
kramdown (1.12.0)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
mime-types (2.99.3)
multipart-post (2.0.0)
netrc (0.11.0)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
pathutil (0.14.0)
Expand All @@ -57,7 +75,12 @@ GEM
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rouge (1.11.1)
rubyzip (1.2.0)
s3_website (2.14.0)
colored (= 1.2)
configure-s3-website (= 1.7.1)
Expand All @@ -76,19 +99,27 @@ GEM
babel-transpiler
sprockets (>= 3.0.0)
thor (0.19.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)

PLATFORMS
ruby

DEPENDENCIES
jekyll (~> 3.1)
crowdin-cli
jekyll
jekyll-assets (~> 2.2)
jekyll-paginate
jekyll-redirect-from
kramdown (~> 1.11)
octokit
rouge (< 2)
s3_website
sprockets-es6

RUBY VERSION
ruby 2.3.0p0

BUNDLED WITH
1.12.4
1.13.1
85 changes: 62 additions & 23 deletions website/Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,80 @@
# Copyright (c) 2013-present, Facebook, Inc.
# All rights reserved.

all:
.PHONY: start install serve build i18n-upload i18n-download

clean:
@rm -rf _assets/gen static/master _build _site node_modules .asset-cache
ifeq ($(origin DEST), undefined)
BUILD_FLAGS=
else
BUILD_FLAGS=-d $(DEST)
endif

_build/ruby_deps_installed: Gemfile Gemfile.lock
bundle install
@mkdir -p _build
@touch $@
.DEFAULT_GOAL := start
start:
@make install
@make serve

_build/js_deps_installed: package.json yarn.lock
yarn install --pure-lockfile
@mkdir -p _build
@touch $@
install: test-bundler test-yarn
@yarn install
@bundle install

flow_js:
(cd ..; make js)

_assets/gen/master/flow.js:
mkdir -p $(dir $@)
ln -sf "../../../../bin/flow.js" $@
(cd $(dir $@); ln -sf "../../../../bin/flow.js" "flow.js")

static/master/flowlib:
mkdir -p $(dir $@)
ln -sf "../../../lib" $@

deps: _build/ruby_deps_installed _build/js_deps_installed
(cd $(dir $@); ln -sf "../../../lib" "flowlib")

symlinks: _assets/gen/master/flow.js static/master/flowlib

js:
(cd ..; make js)
serve: test-jekyll symlinks
@bundle exec jekyll serve --host="::" --port=8080

build: test-jekyll symlinks
bundle exec jekyll build $(BUILD_FLAGS)

serve-production: test-jekyll flow_js symlinks
@JEKYLL_ENV=production bundle exec jekyll serve --host="::" --port=8080

build-production: test-jekyll flow_js symlinks
@JEKYLL_ENV=production bundle exec jekyll build $(BUILD_FLAGS)

# crowdin-sync: test-crowdin
# @crowdin-cli upload sources --auto-update -b master
# @crowdin-cli download -b master

###
# Misc stuff:
###

BUNDLE_EXISTS := $(shell command -v bundle 2> /dev/null)
YARN_EXISTS := $(shell command -v yarn 2> /dev/null)
JEKYLL_EXISTS := $(shell command -v jekyll 2> /dev/null)
# CROWDIN_EXISTS := $(shell command -v crowdin-cli 2> /dev/null)

test-bundler:
ifndef BUNDLE_EXISTS
$(error bundler is not installed. Run `gem install bundler`)
endif

serve: deps symlinks js
bundle exec jekyll serve
test-yarn:
ifndef YARN_EXISTS
$(error yarn is not installed. Run `npm install yarn`)
endif

watch: deps symlinks js
bundle exec jekyll serve -w
test-jekyll:
ifndef JEKYLL_EXISTS
$(error Jekyll is not installed. Run `make install`)
endif

.SUFFIXES:
.PHONY: all clean deps js symlinks serve watch
# test-crowdin:
# ifndef CROWDIN_EXISTS
# $(error Crowdin is not installed. Run `make install`)
# endif
# ifndef CROWDIN_API_KEY
# $(error CROWDIN_API_KEY is undefined)
# endif
Loading

0 comments on commit 360d6dc

Please sign in to comment.