Comments (19)
That's a question I have since a long time. I am not comfortable with the idea of delivering a broken binary. The compromise I found is to log messages:
Lines 32 to 34 in 1e62154
suggest
in composer.json
. I wonder if this is possible to come with a Composer's plugin that install the hoa
binary if all requirements are satisfied (i.e. if hoa/router
, hoa/dispatcher
and hoa/console
are installed)?
I don't think that's a good idea to install the hoa
binary with hoa/console
because:
hoa/console
does not require neitherhoa/dispatcher
orhoa/router
(https://github.com/hoaproject/Console/blob/e4450ac42d0e807bca7a39bba5b6fede65f54bdd/composer.json),hoa/console
is a library, used in combination withhoa/router
andhoa/dispatcher
to create thehoa
binary,- All libraries come with a
Bin/
directory, containing several commands used by thehoa
binary; consequently all libraries would depend onhoa/console
, and this is not good.
So it's not strictly related.
What do you think about having a Composer's plugin? /cc @hoaproject/hoackers
from core.
/ping @jubianchi (as you asked on IRC)
from core.
I think the 'official' answer would be to create a separate package that distributes the binary and depends on all three packages.
But, if it were me, I wouldn't be fully sure if I would want to do that... it does reduce the visibility of the binary.
from core.
@evert Welcome in my dilema :-].
from core.
Have you put any further thought towards this yet?
from core.
Not yet. I will try to open a discussion about the split of Hoa\Core
very soon. My plans seem correct. This will involve this issue.
from core.
@Hywan Here are my thoughts (based on what I personnally think and on the feedbacks I got from several users of other libraries I contribute to) about this issue :
- The fact that libraries provide some commands accessible through the
hoa
binary makes them kind of dependent tohoa/console
.hoa/core
in particular is where the dependency exists. This is some kind of optional dependency because the library just works withouthoa/console
only users using the CLI will notice the dependency. But, - I once contributed to a library (which I won't link here because the use case is not really related) and we came though a "optional dependency" problem. I used composer
suggest
s and I got the following answer: There's no such thing as an optional dependency. I do not totally agree with those statements but OK, let's consider them. - I totally understand you don't want to make a hard-dependency between
hoa/core
andhoa/console
because, most of the time, thehoa
binary will not be used and the user will get useless dependencies. - I totally understand you don't want to hide the
hoa
binary in a seperate package, but...
Extracting the hoa
binary to its own package seems to be the best solution:
- no more unusable (when dependencies are not here) binary in
hoa/core
- no more "optional dependencies" in
hoa/core
- more user-friendly: user will not have to bother with the binary dependencies and eventual errors, everything will be handled by composer (or any other loader)
- will require an extra package to be installed
- will probably require some work to correctly extract the biary's logic (finding commands among other hoa libraries)
- only a single
suggest
in each hoa library providing CLI commands
I can easily imagine a new package called hoa/cli
with every dependencies hard-linked with composer.json
. This package would be responsible of installing the hoa
binary, its dependencies and publishing the binary in the root-package bin
folder if asked.
My 2 cents ;)
from core.
So, what about putting hoa
CLI tools into Hoa\Devtools
?
from core.
the hoa commands are not all only related to dev ?
from core.
Agree. So, maybe we have to go through hoa/cli
? I don't like the name though. Any better idea? It's like an empty “package”. Do we keep the same naming for these packages?
Please @hoaproject/hoackers, vote!
from core.
hoa/cli is a common name and everybody know what this package do only with the name.
"It's a cli for hoa"
So, 👍 @jubianchi
from core.
Ok. Any volunteer? /cc @hoaproject/hoackers
from core.
@Hywan I'm on it ;)
from core.
@jubianchi Perfect :-). Are you a commiter to create the new repository? Please, come on IRC to discuss about that.
from core.
I'm coming on IRC right now ;)
from core.
Feedbacks welcome: https://github.com/jubianchi/hoaproject-cli/
from core.
Done. Hoa\Cli
.
from core.
👍
from core.
awesome!
from core.
Related Issues (20)
- I'm getting this error *"Hoa main file (Core.php) must be included once."* HOT 7
- mark as deprecated HOT 1
- Support \U, \u, \L, \l, \E and \e in the zFormat HOT 1
- Do we need to cache `extension_loaded` result? HOT 3
- Use a trait for Hoa\Core\Event
- Hoa\Core should NEVER edit php configuration. HOT 12
- Hint IDEs about property. HOT 3
- hoa break when installed globaly HOT 3
- Add a `home` command to open http://hoa-project.net HOT 1
- Setlocal issues in core HOT 4
- PHP7 compatibility
- `Exception::uncaught` can receive a `BaseException` in PHP7.0
- Update `Consistency::isKeyword` for PHP7.0 HOT 1
- Protocol: `stream_stat` is not very verbose when failing
- Does Hoa Core need the "files" load approach in Composer? HOT 14
- Hoa/Core errors when loaded twice HOT 39
- Hoa shouldn't initialize before being used HOT 7
- [meta] Split the core HOT 48
- [meta] Split the core, next HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.