generator-angular icon indicating copy to clipboard operation
generator-angular copied to clipboard

feat(build): add Jade support

Open gonzaloruizdevilla opened this issue 10 years ago • 29 comments

Added new --jade option to generator that will create jade templates (http://jade-lang.com/)

gonzaloruizdevilla avatar Oct 28 '13 23:10 gonzaloruizdevilla

so many changes. @gonzaloruizdevilla can you rebase and merge conflicts please (again i think)(sorry)?

eddiemonge avatar Nov 06 '13 18:11 eddiemonge

Done. It was small conflict in app/index.js. In the PR, Bootstrap js dependencies are stored in a list before appending them to the html or jade index file. In the original file, they are passed directly as parameter to the function appendScripts.

gonzaloruizdevilla avatar Nov 06 '13 18:11 gonzaloruizdevilla

can you fix the failing test?

eddiemonge avatar Nov 06 '13 18:11 eddiemonge

Please note that the build is failing because my fork project is "generator-angularexpress" and is the express suffix that is responsible for the failure. Mocha tests in my local machine and run in a folder named "generator-angular" pass without problem.

From TravisCi log:

[email protected] test /home/travis/build/gonzaloruizdevilla/generator-angularexpress mocha

That folder is responsible of the failing test.

gonzaloruizdevilla avatar Nov 06 '13 18:11 gonzaloruizdevilla

I have added another commit to the PR. I have modified de .travis.yml file to ensure that the working folder has the same name as the generator. This way the generator can be correctly tested, independently of the repo name.

gonzaloruizdevilla avatar Nov 06 '13 21:11 gonzaloruizdevilla

I've added @passy recommendations and also jshinted the files. I've added a new commit 48eaaa2 to the PR that fixes a small issue with the tests of AngularJs services.

gonzaloruizdevilla avatar Nov 07 '13 23:11 gonzaloruizdevilla

can you pull the travis fix out and submit that as a new pr and then merge/rebase please?

eddiemonge avatar Nov 13 '13 18:11 eddiemonge

why were the view files moved?

eddiemonge avatar Nov 13 '13 18:11 eddiemonge

I concluded that files inside templates/common/root are copied as they are, without modifications, and the files that are manipulated like index.html are stored inside templates/common. Maybe this was a wrong assumption?

gonzaloruizdevilla avatar Nov 13 '13 22:11 gonzaloruizdevilla

no i feel like you are right. what i did in my test branch (https://github.com/eddiemonge/generator-angular/tree/jade_support/templates) was create a new folder to hold these so they didnt clutter up other folders

eddiemonge avatar Nov 13 '13 22:11 eddiemonge

Does it put all generated HTML files in yeoman.app directory? Wouldn't .tmp be better?

szimek avatar Nov 15 '13 09:11 szimek

@szimek I agree with your suggestion, I'm going look at it.

gonzaloruizdevilla avatar Nov 15 '13 11:11 gonzaloruizdevilla

@gonzaloruizdevilla If you do change destination path to .tmp, remember to add '.tmp/**/*.html' to livereload.files config as well.

szimek avatar Nov 15 '13 11:11 szimek

@szimek livereload should still look at the app/*/.jade but the tasks would be jade. it shouldnt watch the tmp folder for html files

eddiemonge avatar Nov 20 '13 20:11 eddiemonge

@eddiemonge I'm a bit lost :) Will livereload work correctly with jade files having the following config:

watch: {
  jade: {
    files: ['<%= yeoman.app %>/views/**/*.jade'],
    tasks: ['jade:server']
  },
  livereload: {
    options: {
      livereload: '<%= connect.options.livereload %>'
    },
    files: ['lots of other stuff', '<%= yeoman.app %>/views/**/*.jade']
  }
}

Will jade:server task always be executed before livereload reloads the page?

szimek avatar Nov 22 '13 09:11 szimek

it will if you remove the jade files from livereload. the watch command triggers it automatically. the livereload target is a bit misleading as its really a bucket to catch everything else

eddiemonge avatar Nov 22 '13 16:11 eddiemonge

So if livereload target is set, it automatically turns livereload for all other targets and additionally for any files listed in its files option?

szimek avatar Nov 22 '13 16:11 szimek

Sorry you need to set livereload to true in that target

eddiemonge avatar Nov 22 '13 17:11 eddiemonge

Got it. Thanks!

szimek avatar Nov 22 '13 17:11 szimek

Hey guys, awesome work here. Is there any chance this will make it into a future release?

nullivex avatar Nov 26 '13 08:11 nullivex

Great work guys! I'm excited to use this!

dagumak avatar Nov 29 '13 08:11 dagumak

Im scared of this one but Im still meaning to get to it

eddiemonge avatar Dec 14 '13 16:12 eddiemonge

This may be a far-future goal, but might it be a good idea to simplify the build process a bit so that stuff like this, and other small custom tasks, can be inserted by users? It'd be neat if there was an easy way to customize angular generator with my own initialization questions like "Would you like to use Jade?".

zakdances avatar Dec 28 '13 04:12 zakdances

@zakdances those are currently hidden behind a flag.

I do want to land this PR or one like it but got to get to other things first. This is a bug one keeping me from using this generator in my own work so it is a high personal priority but not as high on the project priority. That seems odd, I should change that.

eddiemonge avatar Mar 27 '14 23:03 eddiemonge

ping @eddiemonge

also needs to fix merge conflict.

sindresorhus avatar May 10 '14 13:05 sindresorhus

Is this still a thing? I'd love to see this in my work.

nils-wisiol avatar Feb 17 '15 19:02 nils-wisiol

this needs all the comments addressed, conflicts resolved, commits squashed. It might be better to do it as a new PR with all these changes.

eddiemonge avatar Jul 24 '15 18:07 eddiemonge

I'll try to find some time to work in a new PR. I'll close this one when the new one is ready.

gonzaloruizdevilla avatar Jul 24 '15 22:07 gonzaloruizdevilla

Is there any update on the status of this PR?

ricick avatar Jan 18 '16 02:01 ricick