jakubpawlowicz / assets-packager

Assets pipeline for ultra fast CSS and JavaScript packaging.
MIT License
44 stars 9 forks source link

Can't run the example #5

Closed PanzerKunst closed 12 years ago

PanzerKunst commented 12 years ago

Hi,

When I run the example, I get the following error:

e:\Pro\assets-packager\examples>assetspkg -c assets.yml -g
The "sys" module is now called "util". It should have a similar interface.

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
\n  application: 'reset,g"or: near "
    at Object.<anonymous> (C:\Users\Blackbird\AppData\Roaming\npm\node_modules\assets-packager\node_modules\assets-expander\lib\assets.js:12:11)
    at Object.<anonymous> (C:\Users\Blackbird\AppData\Roaming\npm\node_modules\assets-packager\bin\assetspkg:94:16)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:40)

(I'm using Windows 7)

GoalSmashers commented 12 years ago

Hi @PanzerKunst,

Could you please post your assets.yml file and version of node you use (node -v)? It looks like a YAML parsing issue.

Thanks, Jakub

PanzerKunst commented 12 years ago

Hi Jakub,

I didn't modify assets.yml. Just executing the example as is.

node -v
v0.6.15

Thx!

Edit: updated to Node 0.8.1, got the following error now:

e:\Pro\assets-packager\examples>assetspkg -c assets.yml -g
path.existsSync is now called `fs.existsSync`.

C:\Users\Blackbird\AppData\Roaming\npm\node_modules\assets-packager\node_modules\assets-expander\lib\assets.js:12
    throw new AssetsExpander.YamlSyntaxError(e.toString());
          ^
\n  application: 'reset,g"or: near "
    at Object.AssetsExpander (C:\Users\Blackbird\AppData\Roaming\npm\node_modules\assets-packager\node_modules\assets-expander\lib\assets.js:12:11)
    at Object.<anonymous> (C:\Users\Blackbird\AppData\Roaming\npm\node_modules\assets-packager\bin\assetspkg:94:16)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:487:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
GoalSmashers commented 12 years ago

I've just tested on Win XP and got a different error due to a bug in 'seq' but appearing later in processing flow. Will check tomorrow on Win 7.

Do you use MingGW by any chance? Jakub

PanzerKunst commented 12 years ago

I don't use MingGW.

GoalSmashers commented 12 years ago

Ok, thanks for info. Will get back to you tomorrow (Tuesday).

GoalSmashers commented 12 years ago

@PanzerKunst is there any chance that examples/assets.yml is corrupted? Could you paste its content? Unfortunately I haven't been able to reproduce this issue even under Win 7.

PanzerKunst commented 12 years ago

I don't think it's corrupted. My Git says that it's identical to the remote repo. Maybe it's because it's checked-out as a Windows file? (carriage returns?)

Its contents:

stylesheets:
  application: 'reset,grid,base,application'
javascripts:
  application:
    - 'vendor/jquery'
    - 'application,helpers'
PanzerKunst commented 12 years ago

Hi again. I converted assets.yml to UNIX, and got one step further:

e:\Pro\assets-packager\examples>assetspkg -c assets.yml -g
path.existsSync is now called `fs.existsSync`.
Compiling 0 Less file(s) to CSS...
Processing type 'stylesheets'...
  Processed stylesheets group 'application' - squeezing 2 file(s)
Processing type 'javascripts'...
Error: Command failed: A subdirectory or file -p already exists.
Error occurred while processing: -p.

    at ChildProcess.exithandler (child_process.js:536:15)
    at ChildProcess.EventEmitter.emit (events.js:91:17)
    at maybeClose (child_process.js:634:16)
    at Process._handle.onexit (child_process.js:676:5)

A "-p" directory is indeed created. But even after deleting it and relaunching the script, I still have the same error. Please help!

GoalSmashers commented 12 years ago

Hi @PanzerKunst,

I did some testing and I'm afraid we need to give the tool a refactoring to be able to run on Windows. As a matter of fact assets-packager was started in times of Node 0.2.x where nobody dreamt of Windows support so it's based on a couple UNIX tools which do not have Windows equivalents or are incompatible with UNIX tools.

We've already started some work on 'win' branch but it's far from being finished. Could you give us a couple days to iron things out?

Best Regards, Jakub Pawlowicz

PanzerKunst commented 12 years ago

Hi Jakub,

Thanks for your support. No worries, I'm not in a hurry. I'm really looking forward to your tool, especially the automatic image embedding to Base64 (no more images sprites!)

GoalSmashers commented 12 years ago

Cool, thanks. I'll update you later this week about out proceedings in making this tool compatible with Windows.

I understand your need as image embedding was one of the reasons we built this tool for GoalSmashers.com.

GoalSmashers commented 12 years ago

Hi @PanzerKunst,

The version which is actually compatible with Windows is live under 'win' branch. We tested it under Win 7 / node 0.6.19 and it yields good results. However we haven't been able to run our tests under Windows properly thus it's not released yet.

If you wish to give it a try, you can clone 'win' branch and run examples with the following command: node ../bin/assetspkg -c assets.yml -r public

We should release it as soon as we can verify tests under Windows.

Jakub Pawlowicz

PanzerKunst commented 12 years ago

Great news, thanks!

PanzerKunst commented 12 years ago

I ran the example, it worked with 1 condition: converting assets.yml to UNIX. This is a bug to me, as the standard setting for Git on Windows is "check-out as Windows format, check-in as UNIX".

Without converting to UNIX beforehand, I get this error:

e:\Pro\assets-packager\examples>node ../bin/assetspkg -c assets.yml -r public
path.existsSync is now called `fs.existsSync`.

e:\Pro\assets-packager\node_modules\assets-expander\lib\assets.js:12
    throw new AssetsExpander.YamlSyntaxError(e.toString());
          ^
\n  application: 'reset,g"or: near "
    at Object.AssetsExpander (e:\Pro\assets-packager\node_modules\assets-expander\lib\assets.js:12:11)
    at Object.<anonymous> (e:\Pro\assets-packager\bin\assetspkg:98:16)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:487:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
PanzerKunst commented 12 years ago

Hi again,

I tried the killer feature of this script: embedding images in the CSS files by their base64 encoding, and didn't manage to make it work.

This is what I did, in the example:

Unfortunately, bundled/application.css contained the original url declaration.

What did I miss?

Thanks for your help!

GoalSmashers commented 12 years ago

Hi PanzerKunst,

Thanks for giving it a try. Since specs do not pass yet I wasn't able to catch that problem with embedding images but we will fix that.

Actually this feature is a part of 'enhance-css' project as we designed the whole stack in a very modular way.

Will keep you updated as we move forward with Windows support.

Thanks again, Jakub

On 14 lip 2012, at 01:18, PanzerKunstreply@reply.github.com wrote:

Hi again,

I tried the killer feature of this script: embedding images in the CSS files by their base64 encoding, and didn't manage to make it work.

This is what I did, in the example:

  • Edited application.less, adding #foo { background-image: url("../img/foo.png");}
  • Ran the script
  • Opened bundled/application.css, expecting the declaration to look something like: #foo { background-image: url(data:image/png;base64,BASE64STRINGHERE);}

Unfortunately, bundled/application.css contained the original url declaration.

What did I miss?

Thanks for your help!


Reply to this email directly or view it on GitHub: https://github.com/GoalSmashers/assets-packager/issues/5#issuecomment-6977825

PanzerKunst commented 12 years ago

Hi,

Any progress?

Cheers, Christophe

GoalSmashers commented 12 years ago

Hi Christophe,

As you may have noticed we updated all our tools in the last couple of day by bringing node 0.6+ support to all of them but also to ease future updates of dependent packages. Assets-packager got updated to version 0.6 which brings basic Windows compatibility but it still suffers from lack of proper images inlining (on Windows).

To bring Windows support to all out tools we decided to start from the beginning and start with two base tools first: clean-css and enhance-css (which is responsible for image inlining). As we progress with it in the coming days I should have more info for you.

Hope you can wait for a couple days longer.

Best, Jakub

PanzerKunst commented 12 years ago

Hi Jakub,

I'll wait, but needed an update. Not everyone has money to put in a Mac, Windows support is important!

Cheers, Christophe

GoalSmashers commented 12 years ago

Great to hear that. We are aware Windows support important but it was left out mostly due to a facts that the platform is different from *nix ones and node.js not supporting Windows until 0.6.x branch.

But support is definitely coming. We landed clean-css 0.6 and enhance-css 0.5 during the weekend with full Windows support, so we are one step closer to assets-packager running smoothly on Windows.

I will keep you updated! Jakub

GoalSmashers commented 12 years ago

Hi Christophe,

We've just released assets-packager 0.7 which is fully compatible with Windows (tested under Win 7) and node 0.8+. We tested it by building all assets for GoalSmashers.com and it yields exactly the same files as under *nix so we assume it's fine. Give it a try and let us know how it works for you.

Later, Jakub

PanzerKunst commented 12 years ago

Ran the example, worked as expected :) I'll now adapt my website to use assets-packager.

Thanks!

GoalSmashers commented 12 years ago

Great to hear that. I guess we can close this issue now.

Out of curiosity which programming language do you use for your site? We have a helper project called assets-include for including assets from assets.yml into HTML views. It's still in its infancy but it serves as well @ GoalSmashers (where we use Ruby).

On Aug 7, 2012, at 23:36, PanzerKunst notifications@github.com wrote:

Ran the example, worked as expected :) I'll now adapt my website to use assets-packager.

Thanks!

— Reply to this email directly or view it on GitHub.

PanzerKunst commented 12 years ago

I come from a Java background, so backend is in Scala (using Play! Framework v2.0)

HTML markup is mainly generated by Javascript, using Mustache templates. But some of it is also generated on the server side, using Scala templates (http://www.playframework.org/documentation/2.0/ScalaTemplates)

GoalSmashers commented 12 years ago

We have a (still private) wrapper in Ruby around assets-include which makes integration easy. Let us know I you need any inspiration for doing sth similar in Scala.

On Aug 8, 2012, at 0:17, PanzerKunst notifications@github.com wrote:

I come from a Java background, so backend is in Scala (using Play! Framework v2.0)

— Reply to this email directly or view it on GitHub.

PanzerKunst commented 12 years ago

Thanks for the suggestion, I'm fine for now with the functionalities provided by assets-packager, it's very powerful already!

GoalSmashers commented 12 years ago

Cool, have fun using it!