-
Notifications
You must be signed in to change notification settings - Fork 66
Create gulp task to facilitate TDD #49
Comments
Putting this back in the pool. It's needed and I won't get to it for a few days due to other work. So, if someone wants to tackle it between now & then, go for it. The idea here is that you can create a new gulp task... something like
anything else i missed? |
I can do that for a day or two. If that acceptable estimate I'm ready to go) |
thx! |
I'm using this new watcher when working on the
Locally I've made a few changes (local only)... curious on opinions:
This way the first watcher will always build the library on any test / src change & the last one will always vet & test everything on the same condition. Merge these two watchers? Thoughts? Would also be nice to add a browsersync option to watch for changes in the built |
Agreed on both points. |
Works for me... that's another thing I noticed. When you startup |
Hmm.. do you know how to do that? Normally gulp watcher don't start anything on initial watch. |
Just a dependency on the |
Yes! The answer is extremely simple :). Thank you! Never think in that way, that watch can have deps. |
Started implementation. |
Question: do we really need dependency on watch? |
From my POV, when I run a watcher like this, I want it to do everything (vet, run tests, build library) without any blockers… it would do all that, report errors & then go back to watching. Our gulp tasks SHOULD be written today to log the errors, not fail… if not, then IMHO that’s a bug. So with this thinking I don’t think having dependency in place is bad… calling watch would run everything the first time, then just watch to see what it needed to do from there. Thoughts? |
Agreed. This is how it's working right now. The problem is, when running everything first time before watch and there is an error (at least one, vet error, or failing test), it prevents other task to run (watch task itself). Because of this we can't start watchers at all. |
Ah now I see what you're saying... Offhand I don't know. What if instead of within the task instead of the dependency it triggers the first three tasks and when they all finish it then sets of the watchers. Maybe using the module run-sequence? |
Yep, sorry, my first explanation was not so clear. |
Hi, good job @s-KaiNet ! However, I don't like that it stops when my vet test fails. E.g. in development I don't worry too much about vet issues, I fix those at the end. I'm interested to know if my tests fail or pass. And again good stuff, this will make our lifes easier :) |
Thank you @rolandoldengarm !!! good? |
That looks good... one day would be cool if we got to the point where we could also use something like browsersync to have the demo page up and we can see the components working visually with auto refreshes... but that's down the road... |
Good news @andrewconnell |
Also what I'm thinking about. When we run Does that make sense? |
I’d personally love this capability… specifically having a way to filter to a specific spec file. If the watcher can detect and only run that test, that would be ideal. Would be nice if we also added this as an option to the basic test task to… something like |
Thank you guys for your feedback. My first attempt didn't take all cases into account, but now with your help I believe "watch" story looks much better.
|
Cool cool cool, can't wait to check it out. |
Very nice work! Love this! Functionality you’ve nailed it… looking forward to using this! I have a few questions / comments… before merging this in I’d like to see what some others say with this. Mostly I’m thinking about the experience of the developer and help them understand what’s going on without much docs. BTW - I added a few line comments in the PR as well that I think we should address before merging this in so please check those out as well… Regarding browser-sync -First the name (yes, I’m being a little picky here)… I think we could rename this to be more descriptive of what this is doing… for the name to speak the intent. Browser sync as a name doesn’t say what this does. What this is doing is doing live reloading of a new server. Maybe “serve-demo” or “static-serve” or just “serve”? Also, for me, this really should be part of the watcher… not saying we should remove the ability that lets you run it independently… but right now it’s not possible to do live dev (that the new “watch” facilitates) AND see the demo… seems like a gap. The only way around this is two console windows, one kicking off browser-sync, one kicking off watcher. Maybe a switch for “gulp browser-sync —watch” or the other way around (“gulp watch —browser-sync”) <<< these would be pending the name changes I’m proposing… The description in the task needs to explain that you will have to manually type the URL => demo… I admit that I ran it and was looking at the gulp help description as well as the code and couldn’t figure out why my stuff wasn’t loading. I see it’s mentioned in the gulp task doc, but maybe updating the actual task file & description written in the gulp help? Regarding watch -Again, I”m going to be picky, but it’s a naming thing. Maybe “auto-test” or “live-test” or “continuous-dev” (or a shorter version) or “live-dev”? Does the name “watch” work for others? Some project use the word watch, I’ve always preferred task names that speaks more to the intent. Regarding run-all-sequence -Same thing with the name… we don’t need to use the module name in the task name. Current name implies every gulp task is run, but that isn’t what it does… What does this do? It runs all the dev stuff… vet, transpire, build & test. Some ideas: “build-check”, “check-build”, “build-all”, “build-full”, “validate-build”. Personally I favor the last one… thoughts? |
Very good points, @andrewconnell , thank you! Agreed with all of them. I was thinking from my own view and definitely miss the point that all of this should be obvious and intuitive for others (especially for those who wants to quickly jump-in to the project). The only thing which make me sad, is that both
I believe your points look good for the team and it doesn't make big sense to wait response from other guys. This task is rather helpful and wanted, so I'm just trying to speed up all the things. I'm starting this changes, and if any comments\thoughts etc. will address them. Agreed? |
Whew… glad you took my feedback like like that… you did great work and didn’t want to come across wrong :) Everything looks good. As for the combination of serve-demo & watch… maybe it’s just a flag? We do want two separate tasks because maybe someone is just working on demos while someone else wants to work on the directive and look at the demos live. At any rate, the way you have it supports both of these scenarios, the user would just have to open a second console window to run the browser sync while watching happens in one. I think that’s perfectly acceptable for now. If adding the option to the watcher to startup browser sync isn’t a simple thing like you say, then remove that from your checklist. Two console windows is acceptable IMHO. |
Rename `watch` task to `live-dev`. Update `live-dev` task to (1) perform first pass of all things before watching for changes; (2) to only run tests within the test file that was updated; (3) never fail on errors in any checks (vet, test, build)... always run each of these; (4) optionally use browsersync to do live dev of demos with the new `--serve` flag. Due to big changes to build process, when updating forks, recommend following process to clean out all old JavaScript from old tasks: ``` gulp clean tsc -p ./ ``` Closes #49. Closes #145.
Currently developers must manually run builds of the library, manually vet code & manually run tests. Create a gulp task(s) that will watch for code changes and automate the above stuff.
The text was updated successfully, but these errors were encountered: