-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gulp 3.x CLI does not support both versions of gulp #805
Comments
@ibc We don't need two modules, it functions the exact same way. global = CLI As for the 3 -> 4 global shift, we can do something about that. @phated The CLI should probably do what grunt-cli does and just load the local CLI vs. running a global CLI version and using local code. This will help prevent incompat between major bumps |
Well, I will agree when I can run my global gulp 0.3 CLI within my local gulp 0.4 based project and vice-versa ;) |
@ibc 4 is not finished, it's still being worked on. |
It would be totally awesome to be able to run different local versions of Gulp (3/4) with one globally installed version (3 or 4 - doesn't matter). IMO it would encourage people to try out Gulp4, provide feedback, catch back so it could be out sooner, so the World would be more awesome! |
@pkozlowski-opensource I'm not sure where the incompat lies, I'll check it out |
what about making it a function call @phated? i.e. |
I mean, one could check |
grunt-cli was created to address this exact problem. our codebase was never re-factored to remove the grunt dependency in the cli itself, which makes our usage of this pattern a little strange, though (it needs to be there for the help functionality and a bunch of other things). anyway, assuming you make breaking changes to how gulp is invoked, the idea is that the cli would contain heuristics for detecting which version was required, and then invoke gulp appropriately. you might not need this if the invocation pattern remains the same across major versions, but you will undoubtedly find some in the community confused about what version of gulp they are using if you don't provide a version-agnostic launcher or some very accessible documentation to explain what is happening. i think gulp-cli makes a ton of sense to solve this problem, but given how small the gulp codebase is already, i can see how it would feel strange. if you do decide to do this, one thing i would recommend doing differently is making the cli a dependency of gulp itself, that way local installs have access to |
+1 |
1 similar comment
+1 |
+1 |
@phated What changes were made to the CLI for 4.0? I think we can solve this issue really easily by just making the CLI work with 3 and 4 on both branches. That seems so much easier than doing some craziness of splitting out into new modules to have different CLIs that can co-exist |
@contra I like the idea of the separate CLI. Lots has changed but it can be made backwards compat. I like the idea of a smaller global install. |
All code currently in the 4.0 branch is related to the CLI and not to the core lib. I think that should be tested using spawn/exec (ping @terinjokes) and then just have some smoke tests for the gulp public API |
@phated Saving bytes on a global install is a problem to be solved but isn't really related to why this issue was opened. I think cross-compat is a good first step, and we can split it out later if install size is really an problem (we should probably make a new issue for that). I haven't seen anybody complain about global install size though since you only have to do it one time. |
@contra it's a code maintainability standpoint for me. The cli being bundle causes me more headaches than it solves. It's not a large amount of work to break it out and still support back compat with 3.x |
@phated I understand that from a code maintainability standpoint it makes sense to split it out. You have no argument from me: it should be split out. I 100% agree with everyone in this thread. Splitting it out has nothing to do with this issue though, which is about having a CLI that supports gulp 3 and 4. If we want the gulp 3 branch to support running 4 gulpfiles we are going to need to keep the CLI structure the same so splitting isn't an option. For the 4.0 branch we can split the CLI out and that can support 3 and 4. I think the first thing we need to do is write the cross-compat code. Where it goes will depend on which branch (3 or 4). Conflating the two things (splitting out and cross-compat) is going to cause confusion and prevent this issue from being closed. |
Glad we all agree. If you'll create the repo, I believe I can get it working for 3.x and then add in the functionality to make 4.0 work and keep it backward compat. As @tkellen said, we can just require the gulp-cli module. |
@phated Yep that makes the most sense to me. I'll make a new issue for splitting it out and link the new repo there |
Should be working in gulpjs/gulp-cli#4.0 and #4.0 now. Give it a shot and let me know if it works. |
Can this issue be closed now that the CLI compatibility is fixed? |
@ilanbiala gulpjs/gulp-cli#4.0 branch needs to be merged first and there's a blocker gulpjs/gulp-cli#7 |
Maybe just rename CLI call to: |
As of now, gulp-cli has a published 1.0.0 - https://www.npmjs.com/package/gulp-cli Closing this as completed. |
Woohoo!!
|
same problem, solved this way
but this really works
|
If I use gulp branch 0.4 within my local project but then run
gulp
0.3 (installed globally) then I get an error:May I know why gulp does not provide a separate module
gulp-cli
(similar togrunt-cli
) whose only purpose is to locate the localgulp
executable path (or the global one if not present locally)?The idea of
grunt-cli
is to avoid issues as the described above. I consider it extremely useful.The text was updated successfully, but these errors were encountered: