wet-boew / generator-wet-boew-theme

Yo generator for WET theme development
Other
4 stars 10 forks source link

Files exclusion from build process. #12

Open delisma opened 9 years ago

delisma commented 9 years ago

Maybe this is a grunt related question rather than a Generator WET-BOEW Theme related issue, but when building the theme is there a way to exclude files that are not necessary like the i18n files for language that are not used?

LaurentGoderre commented 9 years ago

Use the .gitignore file to add exclusion patterns. Pretty much all of our repositories use one

LaurentGoderre commented 9 years ago

Nevermind, that's for git, not grunt. To exclude files from the grunt, you need to modify the grunt file and add a pattern that starts with ! to exclude.

However, the generator does not include multiple languages so you are free to only use the one you need. That being said, the WET core build should not be modified.

delisma commented 9 years ago

I did a couple of test last week-end, and I had in the site > data > i18n only two files (en.js and fr.js) and after I ran the build, in the dist folder, the i18n folder had all the js files for all the languages and the dist > ajax folder had all the menu files for all languages as well.

LaurentGoderre commented 9 years ago

Ok, I see what you are saying. These come from core. @nschonni maybe we will need to add some logic to only copy languages based on the theme languages

LaurentGoderre commented 9 years ago

@ElismaD is it only the i18n files you are concerned about?

delisma commented 9 years ago

From my point of view, if I'm building a theme for private use, the build should be as lean as possible, so no docs folder or demos folder either. Unless you've had a different thinking behind the generator role that I've missed.

LaurentGoderre commented 9 years ago

There is some different opinion on that but I get you. We probably can optimize it further

delisma commented 9 years ago

I don't know if it is because of best practices in the web development community, or because of the targeted audiences or TBS internal policies, but it could be cool to see what are those different opinions. At least it could give us a better insight on how you're trying to solve these issues too. I think we should ask ourselves if we're building a theme or a website.

nschonni commented 9 years ago

The simplest way right now would be to add custom clean task to your Gruntfile https://github.com/wet-boew/generator-wet-boew-theme/blob/master/app/templates/_Gruntfile.coffee#L102 and then add any dist files you no longer want. I agree that there should be a better way to say what languages you actually want.

delisma commented 9 years ago

@nschonni I'm trying to wrap my head around grunt/gulp tasks, to write a build process that should ignore the demo and docs folders too, to speed up the build process. Cause I realized that, when building a new site, the "debugging" takes a while because it's building the whole WET website on top of the customized one we're trying to do. I was wondering if the folder structure had some sort of reasoning behind it? I find it hard to navigate and it's a good thing that I attend the presentation at Codefest otherwise I would have been completely lost. What I'm used to is:

Right now I have to navigate between "src", "lib" and "site" to override the proper files. Is there a way to optimize my workflow if the folder structure has to stay the way it is?

LaurentGoderre commented 9 years ago

Our workflow is somewhat consistent of other web projects using bower. The only thing you need the lib folder is when you need to override some handlebars template.

delisma commented 9 years ago

Took me a while but I was able to understand the Gruntfile for the build process and was wondering one things, Is it by design that the "dist" task calls the "build" task, that then calls the "hub" task, that then calls "dist" task again? As a result the "hub" task takes up more than five minutes to complete, it is some kind of "recursivety" for grunt tasks?

LaurentGoderre commented 9 years ago

No, it calls the dist task from the WET project. However this is being fixed by only running hub when WET is updated