angular-ui / ui-date

jQuery UI Datepicker for AngularJS
http://angular-ui.github.io/ui-date/
MIT License
266 stars 207 forks source link

Fix remaining tests #2

Closed ProLoser closed 11 years ago

ProLoser commented 11 years ago

Hopefully @petebacondarwin you can help me out with the last tests having to do with uiDateFormatConfig.

To run tests, do the following:

Of course, feel free to whatever browsers you want. And yes, angular-module (for now) is that global module building toolkit you suggested we make. For now I'm trying to stick to using bower components for everything. I may drop the package if it ends up being superfluous.

petebacondarwin commented 11 years ago

@ProLoser - I had a look at this. I think that angular-module doesn't really help as a dependency. For instance, the jquery-ui component doesn't have the same structure as other components and so it is not so easy to include generically. I think, instead, each component should have its own build and test config - just a simple testacular config for most cases, possibly a grunt file if it is very complex - then the "super" module/component should simply "bower depend" upon the output of these modules.

I will push some changes to get this module's tests working.

Aside: You could also have a "documentation" module that includes each of the individual components and generates the demo pages.

petebacondarwin commented 11 years ago

Latest commit builds fine on Travis.

ProLoser commented 11 years ago

Just saw this after my comment on ui-calendar.

You may be right, I'm still toying with the angular-module idea. Perhaps the best thing would be to simply create a yeoman template that contains most of the code for you.

I very very much want to avoid building whenever possible. I realize this sounds a bit crazy but I feel like it's been a huge source of pain for just about every project, and for gods' sake this is javascript, not java. You don't NEED to compile the code to run it, and just about EVERYONE uses their own build solution. The jQuery component does not contain minified code, and jQueryUI does not contained merged files. There seems to be a big disparity across components but for now I would prefer to take the easy route and just work with src files. Especially since modules will now be a lot more standalone (at least until I do ui-utils).

As for the docs, I was trying to come up with a way that 1 webserver can serve up the docs for any module. Like by hitting some sort of json manifest or simply using the same filenames. Each doc on the current website is just a <section> so I started to develop a website that iterates through modules and loads up the docs as partials.

petebacondarwin commented 11 years ago

@ProLoser - have you looked at how docs are generated in the bootstrap project? This is the sort of thing that a build should do. We could make an npm grunt module (angular-ui-doc-build-task) that we can add to package.json for each project.

My basic idea is that "dependencies" should all be done with bower (component.json). Build tasks should be done with testacular and grunt (package.json). By the way, did you see that component.json can contain devDependencies (for things like angular-mocks)?

petebacondarwin commented 11 years ago

I have made further mods to the ui-date project structure. Please treat this as a proving ground for discussing how to move forwards on the other projects. I am very keen that each project can be used in its own right so a developer can simply come along and do

bower install angular-ui-date

and start working. There should be no need to run anything or include other dependencies manually. We can have a super module that contains all the angular-ui modules, but all this will do is depend upon each of the individual modules through component.json. It is this super module that would contain a build step to generate global documentation from each of the dependent modules. And it could also run each of their test scripts too, individually.

Further to this, I would like there to be an easy way for users of a single component to be able to see a running demo of the module without having to install the super module, while at the same time being able to generate an global demo from assets within each individual component. Ideas?