arboleya / coffee-toaster

Minimalist build system for CoffeeScript.
114 stars 23 forks source link

Wrong behaviour when source coffee files are not inside subfolders of src #34

Closed adammunoz closed 12 years ago

adammunoz commented 12 years ago

I have the following folder structure:

Inside some_lib.coffee there's a class declaration SomeLib

I noticed that in the compiled some_lib.js that it is outputted when compiling with the debug flag the call to the function __t that declares the name space is not present at all, but rather we have the normal compiled output from coffeescript, as if coffee-toaster had not done anything to that file.

If I wrap the sources in sub-folders inside src everything works fine:

This behavior shows whether I have the package flag set to true or not in the config file.

Adam

arboleya commented 12 years ago

Hi,

CoffeeToaster creates namespaces for the folders you have under your 'src' directory and because your files are not inside any folder there's no "__t" call in the output javascript.

The 'src' folder itself cannot be handled as a namespace, thats that right behavior.

What exactly were your expecting?

Anderson

adammunoz commented 12 years ago

Hi Anderson,

Thanks for the explanation. To be honest I wasn't sure if the behavior was part of the design or a bug, now that you explain it, it is clearer.

I guess I was expecting that anything I put under src folder would be available to import. For me it is easier to understand the file being the namespace rather than the folder.

Anyway, thanks for the explanation

Adam