Skip to content

Multifile compilation support and tinier output with --js option#100

Open
mnichols wants to merge 20 commits intomauricemach:masterfrom
Zertis:multifile
Open

Multifile compilation support and tinier output with --js option#100
mnichols wants to merge 20 commits intomauricemach:masterfrom
Zertis:multifile

Conversation

@mnichols
Copy link

Hi this patch does the following:

UPDATE : I just added namespacing for templates, based on the directory structure.
So you can have this structure:

  • templates
    myTempl.coffee => this.templates["myTempl"] = ...
    • myModule
      mySpecificTempl.coffee => this.templates["myModule"]["mySpecificTempl"] = ...
  • Allows compilation of all files in a directory producing a single file with only one instance of the skeleton boilerplate code. So you can do this coffeekup --js ./templates which yields a single 'templates.js' . The output file name is coming from the namespace option.
  1. Watching is supported on all the contributing files.
  2. Extract method refactoring on compiler ops inside coffeekup.coffee to eliminate duplication (and size)
  3. Split internal method calls in cli.coffee to simplify

4a. Updated README to give examples of using the extended CLI and also added ./browser/examples/sugar to give you an idea the improvements

  1. Had to fix the optsparser path from coffee-script to get it going...it's on the other pull requests too.

@mnichols
Copy link
Author

I just appended this request with support for hardcoded helpers from the CLI.
You can pass an -i path/to/helpers/directory and it will read in the file contents to include as 'hardcode' inside each template.
Check out the 'sugar' example. I updated docs to demonstrate this as well.

@lorensr
Copy link

lorensr commented Dec 13, 2011

I was just about to open an issue for adding this. Beautiful, thank you so much.

@ghost
Copy link

ghost commented Dec 13, 2011

Glad I could help! Let me know if you need help

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.

2 participants