Closed shaunanoordin closed 7 years ago
npm start
works fine if you're just looking at Penguin Watch on localhost.npm run beta
or npm run build
that haw
issue rears its ugly head - image-min
is effed up, y'all. The build dies in mid-compile, and nothing gets deployed.In the local /node_modules/haw/lib/default-config.coffee
, there's the following...
# Optimize files after a build.
# Paths are rooted at the build directory.
limit: 3
optimize:
'/main.js': (file, callback) ->
UglifyJS = require 'uglify-js'
fs = require 'fs'
{code} = UglifyJS.minify file
fs.writeFile file, code, callback
'/main.css': (filename, callback) ->
fs = require 'fs'
CleanCSS = require 'clean-css'
fs.readFile filename, (error, content) ->
if error?
callback error
else
min = new CleanCSS(keepBreaks: true).minify content
fs.writeFile filename, min, callback
'{*,**/*}.jpg': (filename, callback) ->
Imagemin = require 'image-min'
imagemin = new Imagemin()
.src filename
.dest filename
.use Imagemin.jpegtran progressive: true
.optimize callback
'{*,**/*}.png': (filename, callback) ->
Imagemin = require 'image-min'
imagemin = new Imagemin()
.src filename
.dest filename
.use Imagemin.optipng optimizationLevel: 7
.optimize callback
[A]
replace image-min
with an alternative library, or [B]
delete the lines of code corresponding with .png
and .jpg
and accept potentially huge image assets on the website. (For reference, we should expect 1.4MB of media assets, in total, if completely uncompressed.)[B]
) and then ran npm run beta
. This seems to work: https://www.penguinwatch.org/beta/This is obviously sub-optimal, but it's a solution given the constraints that we're facing. I'm keen to hear thoughts on this.
https://github.com/zooniverse/haw/pull/9 might work. I'm not sure how to test it.
Nice work on the banner by the way π
70d543d should fix the haw build errors (fingers crossed.)
Thanks @eatyourgreens ! I have an idea for testing zooniverse/haw#9 and solving the issue for Penguin Watch:
haw
with your latest (PR#9) updates and set it up with npm install./penguinwatch/node_modules
:
haw
(basically the whole updated repo directory)imagemin
imagemin-jpegtran
imagemin-optipng
npm run build
and the build succeeds.npm run beta
and the build+deploy succeeds: https://penguinwatch.org/betaIn short, the updated haw looks great!
EDIT: Just saw your use Use updated haw
commit; I'll test again with a clean npm install
to make sure this works properly.
If that works then I'll merge zooniverse/zooniverse-readymade#40 and publish a new version.
@eatyourgreens aaawww yeah, it works. π
To confirm:
node_modules
and reinstalled via npm install
(package.json is using zooniverse/zooniverse-readymade#upgrade-haw
)npm run build
and npm run beta
; both are functioning correctly.This is looking good! I'm confident enough now to do a production deploy for Penguin Watch. I'll follow up with you shortly about what needs to be done to correctly propagate the haw/zooniverse-readymade update across other affected repos.
@shaunanoordin published as zooniverse-readymade 1.5.0
Thank you so much @shunanoordin and @eatyourgreens!
On 7 March 2017 at 12:39, eatyourgreens notifications@github.com wrote:
@shaunanoordin https://github.com/shaunanoordin published as zooniverse-readymade 1.5.0
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zooniverse/penguinwatch/pull/98#issuecomment-284710612, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEyd5tllh1oexx7B_PuSJ21GQr6CV2Hks5rjVAUgaJpZM4MUfpO .
I've just updated master to add German translations, so this will need rebasing.
Woop! Thank you both!
Dr Tom Hart, Penguinologist. Department of Zoology, South Parks Road, Oxford, OX1 3PS.
+44 1865 600 170
www.penguinwatch.orghttp://www.penguinwatch.org/ www.penguinlifelines.orghttp://www.penguinlifelines.org/
From: Shaun A. Noordin [mailto:notifications@github.com] Sent: 07 March 2017 12:35 To: zooniverse/penguinwatch Cc: Subscribed Subject: Re: [zooniverse/penguinwatch] British Science Week 2017 (temporary addition) (#98)
@eatyourgreenshttps://github.com/eatyourgreens aaawww yeah, it works. π
To confirm:
This is looking good! I'm confident enough now to do a production deploy for Penguin Watch. I'll follow up with you shortly about what needs to be done to correctly propagate the haw/zooniverse-readymade update across other affected repos.
β You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/zooniverse/penguinwatch/pull/98#issuecomment-284709588, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHUobw1wlDvCeXm4pOPrCgS40rCNoK9Yks5rjU7egaJpZM4MUfpO.
GitHub Code Note: In case any fellow dev in the year 3010 is trying to follow what happened in this convo, note that this branch was rebased onto a new master that incorporates PR #99
The root of the problem was that the previous master was using "zooniverse-readymade": "~1.1.3"
, which had issues. The new/updated master, which this branch is rebased on, correctly uses "zooniverse-readymade": "~1.6"
in package.json
Also, fellow dev of the year 3010: say hi to our robot overlords for me! Please tell them 01010100 01101000 01101001 01110011 00100000 01110011 01110100 01100001 01110100 01100101 01101101 01100101 01101110 01110100 00100000 01101001 01110011 00100000 01100110 01100001 01101100 01110011 01100101 00100001
This has been rebased again to accommodate some text changes in #100
@mrniaboc https://www.penguinwatch.org/ has been updated with the new link! Your code update was good, by the way; it's just that instead of merging to master, we'd just npm run deploy
in this case. π
Thanks @shaunanoordin!
On 10 March 2017 at 12:27, Shaun A. Noordin notifications@github.com wrote:
@mrniaboc https://github.com/mrniaboc https://www.penguinwatch.org/ has been updated with the new link! Your code update was good, by the way; it's just that instead of merging to master, we'd just npm run deploy in this case. π
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zooniverse/penguinwatch/pull/98#issuecomment-285656938, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEyd6orSXMtSyCnZltBYcwUqg_D2CPZks5rkUGvgaJpZM4MUfpO .
Rebased again to reflect new information for schools, as added in #101
Wait, that PR was one hundred and one? Damn, should have named it Education 101
Fiona just gave the clear to remove these temporary additions to Penguin Watch. As of right now, https://www.penguinwatch.org/ has been reverted back to its original non-BSW incarnation.
This PR will be closed, but hopefully preserved in case similar temporary modifications are required in the future.
PR Overview
master
branch will be manually re-deployed.Notes
penguinwatch
->zooniverse-readymade
->haw
->image-min
)npm install
, thoughhaw
issue.