Commits

Anonymous committed f615efe

Some v2-specific improvements: sass, stand-alone assets, javascript concat

Comments (0)

Files changed (1)

 email-variable-returnpath-regex = noreply\.(\w+)@${config:email-host-regex}
 email-incoming-pop-user =
 email-incoming-pop-password =
-assets-path = ${smartpr:setup}/smartpr/media
+assets-path = ${buildout:directory}/assets
 userfiles-path = ${buildout:directory}/userfiles
 apache2-loglevel = warn
 apache2-log-path =
 apache2-control = /usr/sbin/apache2ctl
 overlay-cp-cmd = cp -a
 link-safely-cmd = ln -sn
+sass-cmd =
 
 [buildout]
 unzip = true
 parts =
-	userfiles
-	userfiles.robots
+	robots.userfiles
+	robots.assets
 	clevercss
 	clevercss.scripts
 	python-cream
 	smartpr.settings
 	smartpr.wsgi.app
 	smartpr.wsgi.marketing
-	js-lib
+	put-smartpr
 	put-date.format
 	put-jquery.metadata
 	put-jquery.fastTrigger
 	put-jquery.smartpr
 	put-jquery.app-layer
 	put-jal
+	concat-js
+	sass-css
+	convert-css
 	parse-sites-fixture
 	syncdb
-	convert-css
-	compile-css
 	cron-process-incoming-mail
 	parse-apache2-config
 	apache2-verify
 py = 0.9.2
 collective.recipe.modwsgi = 1.1
 nose = 0.11.2	# 0.11.3 fails to download
-gdata = 2.0.9
+gdata = 2.0.9	# 2.0.10 has OAuth problems
+
+[robots.userfiles]
+recipe = lovely.recipe:mkfile
+path = ${userfiles:path}/robots.txt
+content = User-agent: *
+	Disallow: /
 
 [userfiles]
 recipe = lovely.recipe:mkdir
 path = ${config:userfiles-path}
 createpath = true
 
-[userfiles.robots]
+[robots.assets]
 recipe = lovely.recipe:mkfile
-path = ${userfiles:path}/robots.txt
+path = ${assets:path}/robots.txt
 content = User-agent: *
 	Disallow: /
 
+[assets]
+recipe = lovely.recipe:mkdir
+path = ${config:assets-path}
+createpath = true
+
 [clevercss]
 recipe = zc.recipe.egg:develop
 setup = ${clevercss.pkg:location}
 	EMAIL_INCOMING_POP_USER = '${config:email-incoming-pop-user}'
 	EMAIL_INCOMING_POP_PASSWORD = '${config:email-incoming-pop-password}'
 	MEDIA_URL = 'http://assets.${config:visit-domain}/'
-	MEDIA_ROOT = '${config:assets-path}'
+	MEDIA_ROOT = '${assets:path}'
 	USERFILES_URL = 'http://files.${config:visit-domain}/'
-	USERFILES_ROOT = '${config:userfiles-path}'
+	USERFILES_ROOT = '${userfiles:path}'
 
 [smartpr.wsgi.app]
 recipe = collective.recipe.modwsgi
 	use = egg:SmartPR#app
 	PYTHON_EGG_CACHE = ${buildout:download-cache}
 
+# TODO: Remove
 [smartpr.wsgi.marketing]
 recipe = collective.recipe.modwsgi
 config-file = ${smartpr.wsgi.marketing.config:path}
 	PasteDeploy
 	SmartPR
 
+# TODO: Remove
 [smartpr.wsgi.marketing.config]
 recipe = lovely.recipe:mkfile
 path = ${buildout:directory}/marketing.ini
 	use = egg:SmartPR#marketing
 	PYTHON_EGG_CACHE = ${buildout:download-cache}
 
-[js-lib]
-recipe = lovely.recipe:mkdir
-path = ${config:assets-path}/js/lib
+[put-smartpr]
+recipe = iw.recipe.cmd
+on_install = true
+on_update = true
+cmds = ${config:link-safely-cmd} ${smartpr:setup}/smartpr/media ${assets:path}/smartpr
 
+# TODO: Remove
 [put-date.format]
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${date.format:location} ${js-lib:path}/date.format
+cmds = ${config:link-safely-cmd} ${date.format:location} ${assets:path}/date.format
 
+# TODO: Remove
 [date.format]
 recipe = hexagonit.recipe.download
 url = http://stevenlevithan.com/assets/misc/date.format.js
 download-only = true
 
+# TODO: Remove
 [put-jquery.metadata]
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${jquery.metadata:location} ${js-lib:path}/jquery.metadata
+cmds = ${config:link-safely-cmd} ${jquery.metadata:location} ${assets:path}/jquery.metadata
 
+# TODO: Remove
 [jquery.metadata]
 recipe = hexagonit.recipe.download
 url = http://plugins.jquery.com/files/jquery.metadata.2.0.zip
 md5sum = bd6dddd934896a3adfa5c06430782ff9
 strip-top-level-dir = true
 
+# TODO: Remove
 [put-jquery.fastTrigger]
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${jquery.fastTrigger:location} ${js-lib:path}/jquery.fastTrigger
+cmds = ${config:link-safely-cmd} ${jquery.fastTrigger:location} ${assets:path}/jquery.fastTrigger
 
+# TODO: Remove
 [jquery.fastTrigger]
 recipe = hexagonit.recipe.download
 url = http://plugins.jquery.com/files/jquery.fastTrigger-1.0.0.zip
 md5sum = 5f90fd4f8b3dcfb199318470ed8ef6b2
 
+# TODO: Remove
 [put-jquery.json]
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${jquery.json:location} ${js-lib:path}/jquery.json
+cmds = ${config:link-safely-cmd} ${jquery.json:location} ${assets:path}/jquery.json
 
+# TODO: Remove
 [jquery.json]
 recipe = infrae.subversion
 urls = http://jquery-json.googlecode.com/svn/trunk/ .
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${jquery.smartpr:location} ${js-lib:path}/jquery.smartpr
+cmds = ${config:link-safely-cmd} ${jquery.smartpr:location} ${assets:path}/jquery.smartpr
 
 [jquery.smartpr]
 recipe = MercurialRecipe
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${jquery.app-layer:location} ${js-lib:path}/jquery.app-layer
+cmds = ${config:link-safely-cmd} ${jquery.app-layer:location} ${assets:path}/jquery.app-layer
 
 [jquery.app-layer]
 recipe = MercurialRecipe
 repository = http://bitbucket.org/tawm/app-layer/
 
+# TODO: Remove
 [put-jal]
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
-cmds = ${config:link-safely-cmd} ${jal:location} ${js-lib:path}/jal
+cmds = ${config:link-safely-cmd} ${jal:location} ${assets:path}/jal
 
+# TODO: Remove
 [jal]
 recipe = MercurialRecipe
 repository = http://bitbucket.org/tawm/jquery-app-layer/
 times = */5 * * * *
 command = ${buildout:bin-directory}/smartpr.process_incoming_mail | mail -Es "[Django] smartpr.process_incoming_mail" ${config:admin-email}
 
+# TODO: Include all JS
+[concat-js]
+recipe = iw.recipe.cmd
+on_install = true
+on_update = true
+cmds = cat ${assets:path}/smartpr/js/* ${assets:path}/all.js
+
+[sass-css]
+recipe = iw.recipe.cmd
+on_install = true
+on_update = true
+cmds = ${config:sass-cmd} --update -t compressed ${assets:path}/smartpr/css:${assets:path}
+
+# TODO: Remove
 [convert-css]
 recipe = iw.recipe.cmd
 on_install = true
 on_update = true
 cmds =
-	${buildout:bin-directory}/clevercss ${config:assets-path}/css/*.clevercss
-	${buildout:bin-directory}/clevercss ${config:assets-path}/css/src/*.clevercss
-
-[compile-css]
-recipe = falkolab.recipe.csstools:builder
-resource-dir = ${config:assets-path}/css
-output-dir = ${compile-css:resource-dir}
-config = ${compile-css.config:path}
-compress = true
-
-[compile-css.config]
-recipe = lovely.recipe:mkfile
-path = ${compile-css:resource-dir}/app.cfg
-content =
-	[all.css]
-	root = ${compile-css:resource-dir}/src
+	${buildout:bin-directory}/clevercss ${assets:path}/smartpr/css/*.clevercss
 
 [parse-apache2-config]
 recipe = collective.recipe.template