scratch-www/Makefile
chrisgarrity 74e315dc71 Add new Tips page (#1357)
New of tips page, uses cards from new resources server (s3)

* added get-localized-urls script to get the generated json from the s3 bucket
* added /tips route
* correct localized-urls for other pages
* remove thingstotry
* redirect /go
* fix up /info/cards view to use resources (s3).
* redirect /go to /tips
* change /hoc redirect from /go to /tips
* Add full set of cards pdf download to tips localization
* removed cards and guides from static PDFs, they are all coming from resources.scratch.mit.edu now.
* removed things to try view

Corrections for reviews:
* decided to pretty print the localized URLs
* replaced console.errors with process.stdout and fail with exit(1)
* formatted localized-urls to make it easier to read
* moved link outside  `<Button…` makes whole button clickable instead of just text
* fixed up css styles, removed unnecessary classes
* corrected “unused” resource links
2017-06-21 16:20:18 -04:00

85 lines
1.8 KiB
Makefile

ESLINT=./node_modules/.bin/eslint
NODE=node
SASSLINT=./node_modules/.bin/sass-lint -v
S3CMD=s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
TAP=./node_modules/.bin/tap
WATCH=./node_modules/.bin/watch
WEBPACK=./node_modules/.bin/webpack
# ------------------------------------
build:
@make clean
@make translations
@make webpack
clean:
rm -rf ./build
rm -rf ./intl
mkdir -p build
mkdir -p intl
deploy:
@make build
@make sync
translations:
./bin/get-localized-urls localized-urls.json
./bin/build-locales node_modules/scratchr2_translations/www/translations intl
webpack:
$(WEBPACK) --bail
sync-s3:
$(S3CMD) --exclude '.DS_Store' --exclude '*.svg' --exclude '*.js' ./build/ s3://$(S3_BUCKET_NAME)/
$(S3CMD) --exclude '*' --include '*.svg' --mime-type 'image/svg+xml' ./build/ s3://$(S3_BUCKET_NAME)/
$(S3CMD) --exclude '*' --include '*.js' --mime-type 'application/javascript' ./build/ s3://$(S3_BUCKET_NAME)/
sync-fastly:
$(NODE) ./bin/configure-fastly.js
sync:
@make sync-s3
@make sync-fastly
# ------------------------------------
start:
$(NODE) ./dev-server/index.js
# ------------------------------------
test:
@make lint
@make build
@make tap
lint:
$(ESLINT) . --ext .js,.jsx,.json
$(SASSLINT) ./src/*.scss
$(SASSLINT) ./src/**/*.scss
unit:
$(TAP) ./test/unit/*.js
functional:
$(TAP) ./test/functional/*.js
integration:
$(TAP) ./test/integration/*.js
smoke:
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600
localization:
$(TAP) ./test/localization/*.js
tap:
$(TAP) ./test/{unit,functional,localization}/*.js
coverage:
$(TAP) ./test/{unit,functional,localization}/*.js --coverage --coverage-report=lcov
# ------------------------------------
.PHONY: build clean deploy translations webpack start test lint unit functional integration localization tap coverage