Skip to content
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

Patch to compile less when minifying files - updated logic #176

Merged
merged 4 commits into from
Feb 19, 2013

Conversation

tobes
Copy link
Contributor

@tobes tobes commented Nov 20, 2012

This is a sample patch to compile less css files when minifying css/js.

It uses node to compile but makes it part of the minification process.

In my mind the two should be done at the same time so one is not forgotten probably the pater command needs to be renamed. Also I'd be inclined to make it more specific so that we do not specify the directory for minification as we want public/base

I'm happy if people want this done differently.

It also creates the 'custom colour styles'

currently error checking is week

@ghost ghost assigned johnmartin Dec 4, 2012
@johnmartin
Copy link
Contributor

@tobes This is good. Just one thing:

Would it be possible to move the less methods into their own paster command? Then have another paster command that was something like front-end-build which builds the less then minifies?

@tobes
Copy link
Contributor Author

tobes commented Dec 14, 2012

yeah I can do that not sure on the name but that will do for now

@johnmartin
Copy link
Contributor

@tobes What's the status on this patch? (I'd like to write the ckan 2.0 front end deploy process for @amercader)

@tobes
Copy link
Contributor Author

tobes commented Jan 18, 2013

yeah I forgot about this it's on my todo list now

@johnmartin
Copy link
Contributor

@tobes Ping.

@ghost ghost assigned tobes Feb 5, 2013
@tobes
Copy link
Contributor Author

tobes commented Feb 15, 2013

@johnmartin

we now have paster less and paster front-end-build which also does the js translation files

ready for re review



class LessCommand(CkanCommand):
'''Create minified versions of the given Javascript and CSS files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be something like:

'''Compile all root less documents into their CSS counterparts

@johnmartin
Copy link
Contributor

OK, does this mean we can get rid of main.debug.css (I don't really understand why we have it)? and ditch ./bin/less?

@tobes
Copy link
Contributor Author

tobes commented Feb 15, 2013

thanks,

I'll fix the cut paste bugs :)

with main.debug.css the point of this is that it is a none git controlled file that is updated via bin/less (which should be renamed IMHO) . the idea is that you especially when playing around with the css via .less files will see the latest css whilst doing development without seeing the noise in you git diffs etc. It is a bit like the minification stuff where we do not want to do it all over the place because it just causes noise and merge conflicts that help no-one. Now there may be a more graceful way of doing this and if so changing would be ok by me. This is stuff that Aran created because it worked well for him. Before this we were using some js lib to compile the less files but this was too slow to be a usable option.

If you need more info we can discuss on irc or skype :)

@tobes
Copy link
Contributor Author

tobes commented Feb 15, 2013

@johnmartin fixed docstring

@ghost ghost assigned johnmartin Feb 15, 2013
@johnmartin
Copy link
Contributor

@tobes This is good. Except on thing:

I was getting an error with running paster front-end-build. Essentially polib wasn't in my environment (see https://github.com/okfn/ckan/blob/master/ckan/lib/cli.py#L1676)... looking at pip-requirements.txt it's not in there either.

Is this a bug in master? Or is it something odd with my environment?

@tobes
Copy link
Contributor Author

tobes commented Feb 19, 2013

this is a separate issue it is needed for development/deployment but not for using
we should maybe get a better fix like pip-dev.txt

@johnmartin
Copy link
Contributor

@tobes Perfect. I'll merge this.

johnmartin added a commit that referenced this pull request Feb 19, 2013
Patch to compile less when minifying files - updated logic
@johnmartin johnmartin merged commit 26c75e5 into master Feb 19, 2013
@amercader amercader deleted the compile-less-via-paster branch March 4, 2015 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants