Skip to content

Use Puli discovery #34

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

Merged
merged 1 commit into from
Dec 30, 2015
Merged

Use Puli discovery #34

merged 1 commit into from
Dec 30, 2015

Conversation

sagikazarmark
Copy link
Member

As discussed #28, this PR aims to replace any custom discovery logic with Puli.

The convenient static wrappers are preserved, there is no major API change.

I am pretty in favour of this PR, really like how Puli works.

One arguable thing: this PR requires Puli to be installed on the user's machine or to be installed through composer (as in the require-dev of this package). I am fine with that requirement, even if it is beta, but I would like to hear other opinions about this.

Many thanks to @webmozart for helping me with Puli.

@jeromegamez
Copy link

Big Puli 👍!

build/
vendor/
composer.lock
phpspec.yml
phpunit.xml
puli.json

Choose a reason for hiding this comment

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

Did you not commit the puli.json file by intention? Just like composer.json, this file should usually be committed and distributed with the package.

Copy link
Member Author

Choose a reason for hiding this comment

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

I generally agree, but this package is supposed to be installed in other packages or an application. There are no bindings or binding types in this package, so only the "lock" functionality would be generated into the json file, which IMO doesn't make sense here, but would make sense in the application.

Why is the package list generated in the json file in the first place? I though the json file is some kind of configuration and I expect it doesn't contain anything else. The generated package list could be part of some kind of lock file, couldn't it?

Choose a reason for hiding this comment

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

Ok, makes sense then.

The package list is in there since, at least in principle, Puli is independent of Composer. You could install additional packages manually or generally use Puli without Composer, if that makes sense for your project. So puli.json duplicates some parts of composer.json, however those parts are synchronized by the Composer plugin.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I was thinking about a puli.lock file. In cases like this, a puli.json might not even be necessary in a project/application, only a puli.lock where non-configuration stuff can go. Even if you add stuff manually there, it is rather an "environmental" (aka. project dependent) thing, which depends on external resources, while you might change a configuration based on internal project changes.

Choose a reason for hiding this comment

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

Puli works differently than Composer. There's no need for a lock file in Puli.

You are right that in this case, a puli.json is not needed (but neither is a lock file).

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, calling it lock is probably not straightforward and multiple configuration can be confusing. Also, packages for composer are only generated when the composer plugin is installed and it should only be done in an application, am right? With other words: package configuration, like composer packages should only be in an application, but not in reusable packages. Am I correct?

Choose a reason for hiding this comment

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

Not necessarily. If your packages contain integration tests that require f.i. Puli's Discovery service and certain binding types/bindings to be loaded from other packages, then those packages must be loaded into Puli as well, otherwise the binding types/bindings are not found.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see. Are those packages loaded into the application where the package is installed afterwards? Because I probably don't want integration testing binding in the application where I use the package.

Choose a reason for hiding this comment

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

No. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool. Thanks for clarification.

@ddeboer
Copy link
Contributor

ddeboer commented Dec 30, 2015

This is a great improvement! Good to use something for discovery that’s already good at discovery, like Puli. 😉

@sagikazarmark Let’s squash and merge?

Add Puli CLI as dev dependency

Replace actual implementations with mocks

Update Change Log
sagikazarmark added a commit that referenced this pull request Dec 30, 2015
@sagikazarmark sagikazarmark merged commit 9db2184 into master Dec 30, 2015
@sagikazarmark sagikazarmark deleted the puli_discovery branch December 30, 2015 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants