Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

feat(build): add Jade support #420

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gonzaloruizdevilla
Copy link
Contributor

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

@eddiemonge
Copy link
Member

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

@gonzaloruizdevilla
Copy link
Contributor Author

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.

@eddiemonge
Copy link
Member

can you fix the failing test?

@gonzaloruizdevilla
Copy link
Contributor Author

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:

generator-angular@0.5.1 test /home/travis/build/gonzaloruizdevilla/generator-angularexpress
mocha

That folder is responsible of the failing test.

@gonzaloruizdevilla
Copy link
Contributor Author

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.

};

Generator.prototype.createIndexHtml = function createIndexHtml() {
this.write(path.join(this.appPath, 'index.html'), this.indexFile);
if(this.env.options.jade) {
this.write(path.join(this.appPath, 'index.jade'), this.indexFile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just alter the file name? Something like var indexFile = 'index.' + this.env.options.jade ? 'jade' : 'html';

@gonzaloruizdevilla
Copy link
Contributor Author

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.

@eddiemonge
Copy link
Member

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

};

function spacePrefix(jade, block){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like all these functions should go in the utils file

@eddiemonge
Copy link
Member

why were the view files moved?

@gonzaloruizdevilla
Copy link
Contributor Author

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?

@eddiemonge
Copy link
Member

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

@szimek
Copy link

szimek commented Nov 15, 2013

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

@gonzaloruizdevilla
Copy link
Contributor Author

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

@szimek
Copy link

szimek commented Nov 15, 2013

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

@eddiemonge
Copy link
Member

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

@szimek
Copy link

szimek commented Nov 22, 2013

@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?

@eddiemonge
Copy link
Member

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

@szimek
Copy link

szimek commented Nov 22, 2013

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

@eddiemonge
Copy link
Member

Sorry you need to set livereload to true in that target

@szimek
Copy link

szimek commented Nov 22, 2013

Got it. Thanks!

@nullivex
Copy link

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

@dagumak
Copy link

dagumak commented Nov 29, 2013

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

@eddiemonge
Copy link
Member

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

@zakdances
Copy link

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?".

@eddiemonge eddiemonge mentioned this pull request Jan 20, 2014
19 tasks
@eddiemonge
Copy link
Member

@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.

@sindresorhus
Copy link
Member

ping @eddiemonge

also needs to fix merge conflict.

@eddiemonge eddiemonge added this to the 0.10.0: The Future milestone Jun 5, 2014
@nils-wisiol
Copy link

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

@eddiemonge
Copy link
Member

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 eddiemonge modified the milestone: 0.10.0: The Future Jul 24, 2015
@gonzaloruizdevilla
Copy link
Contributor Author

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

@ricick
Copy link

ricick commented Jan 18, 2016

Is there any update on the status of this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet