Closed ravage84 closed 7 years ago
It is indeed a good blog post comment; I need to answer it there as well.
My first thought is that "provides" says that a package "makes X available", not that a package "uses X". (I may be wrong about that, and need to read the schema more closely.)
My second thought is something that I've only spoken publicly about on https://voicesoftheelephpant.com/2016/12/20/interview-paul-m-jones/ . It is that by require-dev
-ing the standard in your package, the standard can do two things:
Deliver the standards document into the package, for reference by developers as they work on the package.
Possibly also deliver some code related to the standard. In the case of pds/skeleton, that might mean a validation script, or a skeleton-generator script. But I would want to think more carefully about this one.
Hope that makes sense.
Why not using Composer's create-project
?
https://getcomposer.org/doc/03-cli.md#create-project
It's exactly made for that purpose. Once a directory structure is created for a package, one will never use such a script again.
So, requiring it, even just as development dependency, does not make much sense for a package developer. Thus, provide
does the job.
Why not using Composer's create-project?
Off the cuff, one reason is that it would apply only to new projects, whereas there are many existing packages now that are at least tentatively compliant with the standard. These existing projects can add a package-manifest entry pretty easily to advertise acceptance; e.g., with Composer, it's a require-dev
entry.
Further, I expect there to be other PDS publications. One will not "create-project" with them all individually.
I wanted to bring up a really good blog post comment on your blog post about this standard:
Totally agree, as it would be "semantically incorrect" to
require(-dev)
the standard, but "semantically correct" to use theprovide
key.https://getcomposer.org/doc/04-schema.md#provide
Not sure how one could query the Packagist API on that, though...