Commit
This closes #2543, again. Feel free to reopen if there's anything left to address.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -678,7 +678,6 @@ Make your X<C<META6.json>|META6.json> file look something like this: | |
| "perl" : "6.c", | ||
| "name" : "Vortex::TotalPerspective", | ||
| "auth" : "github:SomeAuthor", | ||
| "api" : "1", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jonathanstowe
Contributor
|
||
| "version" : "0.0.1", | ||
| "description" : "Wonderful simulation to get some perspective.", | ||
| "authors" : [ "R<Your Name>" ], | ||
|
|
@@ -697,36 +696,41 @@ Make your X<C<META6.json>|META6.json> file look something like this: | |
| } | ||
| =end code | ||
| For choosing a version numbering scheme, try and use | ||
| "major.minor.patch" | ||
| (see L<the spec on versioning | https://design.perl6.org/S11.html#Versioning> | ||
| for further details). This will go into the C<version> key of C<META6.json>. | ||
| The attributes in this file are analyzed by the | ||
| L<C<META6>|https://github.com/jonathanstowe/META6> class. They are divided into | ||
| optional, mandatory and I<customary>. Mandatory are the ones you need to insert | ||
| into your file, and customary are those used by the current Perl 6 ecosystem and | ||
| possibly displayed on the module page if it's published, but you have no | ||
| obligation to use it. | ||
| For choosing a version numbering scheme, try and use "major.minor.patch" (see | ||
| L<the spec on versioning|https://design.perl6.org/S11.html#Versioning> for | ||
| further details). This will go into the C<version> key of C<META6.json>. This | ||
| field is optional, but used by installation to match against installed version, | ||
| if there's any. The C<description> field is also mandatory, and includes a short | ||
This comment has been minimized.
Sorry, something went wrong.
ugexe
Contributor
|
||
| description of the module. | ||
| The C<name> key is compulsory, and C<zef> will fail if you do not include it. | ||
| Even if you have created a META6.json file just to express the dependencies | ||
| for a series of scripts, this section must be included. | ||
| The C<auth> section identifies the author in GitHub or other repository | ||
| hosting site, such as Bitbucket. | ||
| The C<auth> section identifies the author in GitHub or other repository hosting | ||
| site, such as Bitbucket or GitLab. This field is I<customary>, since it's used | ||
| to identify the author in the ecosystem, and opens the possibility of having | ||
| modules with the same name and different authors. | ||
| The C<authors> section includes a list of all the module authors. In | ||
| the case there is only one author, a single element list must be | ||
| supplied. | ||
| In the C<provides> section, include all the namespaces provided by | ||
| your distribution and that you wish to be installed, only module | ||
| files that are explicitly included here will be installed and | ||
| available with C<use> or C<require> in other programs. | ||
| supplied. This field is optional. | ||
| Set C<perl> version to the minimum perl version your module works with. | ||
| In the C<provides> section, include all the namespaces provided by your | ||
| distribution and that you wish to be installed; only module files that are | ||
| explicitly included here will be installed and available with C<use> or | ||
| C<require> in other programs. This field is also mandatory. | ||
| Optionally, you can set an C<api> field. Incrementing this indicates that | ||
| the interface provided by your module is not backwards compatible with a | ||
| previous version. You can use it if you want to adhere to | ||
| L<Semantic Versioning | https://semver.org>. Simply keep the C<api> field to | ||
| the same value as your major version number. A dependency can then depend on | ||
| your module by including a C<:api> part, which will ensure backwards | ||
| incompatible releases will not be pulled in. | ||
| Set C<perl> version to the minimum perl version your module works with. This | ||
| field is mandatory. Use C<6.c> if your module is valid for Christmas release and | ||
| newer ones, use C<6.d> if it requires, at least, the Diwali version. | ||
| The C<resources> section is optional, but, if present, should contain a list | ||
| of the files in your C<resources> directory that you wish to be installed. | ||
|
|
@@ -736,24 +740,32 @@ indexed on the name provided. C<tags> is also optional, but is used to describe | |
| the module in the Perl 6 ecosystem. | ||
| C<depends>, C<build-depends> and C<test-depends> include different modules that | ||
| are used in those phases of the of installation. The last two are optional, but | ||
| convenient. | ||
| are used in those phases of the of installation. All of them are optional; you | ||
| can split dependencies between the three sections if you do not want to install | ||
| them permanently. Only those in C<depends> will be permanently installed. | ||
This comment has been minimized.
Sorry, something went wrong.
ugexe
Contributor
|
||
| Finally, C<source-url> indicates the URL of the repository where the module is | ||
| developed; this is one of the compulsory modules if you are going to publish it | ||
| in the module ecosystem. It is convenient to also provide the C<source-type> | ||
| field, which indicates the kind of source control system, generally C<git>, | ||
| which can be used to download the module. | ||
| The L<Test::META module | https://github.com/jonathanstowe/Test-META/> | ||
| can help you check the correctness of the META6.json file. | ||
| There are more fields described in the | ||
| L<META design documents |https://design.perl6.org/S22.html#META6.json>, but not | ||
| all of these are implemented by existing package managers. Hence you should | ||
| stick to the fields described in the above example block to ensure compatibility | ||
| with existing package managers. You can also check | ||
| L<Moritz Lenz's repository of all modules for examples|https://github.com/moritz/perl6-all-modules/search?l=JSON&q=META6.json&type=>. | ||
| developed; this is one of the customary modules if you are going to publish it | ||
| in the module ecosystem. The current module ecosystem will link this URL from | ||
| the project description. | ||
| Some old modules also provide a C<source-type> field, | ||
This comment has been minimized.
Sorry, something went wrong.
ugexe
Contributor
|
||
| which was used to indicate the kind of source control system, generally C<git>, | ||
| which can be used to download the module. However, this field is nowadays | ||
| ignored by C<zef> and the rest of the tools. | ||
| The L<Test::META module | https://github.com/jonathanstowe/Test-META/> can help | ||
| you check the correctness of the META6.json file; this module will check for all | ||
| the mandatory fields and that the type used for all of them is correct. | ||
| There are more fields described in the L<META design documents | ||
| |https://design.perl6.org/S22.html#META6.json>, but not all of these are | ||
| implemented by existing package managers. Hence you should stick to the fields | ||
| described in the above example block to ensure compatibility with existing | ||
| package managers such as C<zef>. You can also check | ||
| L<Moritz Lenz's repository of all modules for examples|https://github.com/moritz/perl6-all-modules/search?l=JSON&q=META6.json&type=>, | ||
| but bear in mind that some of them might use fields, such as C<source-type> | ||
| above, which are currently ignored. | ||
| =end item | ||
|
|
||
1 comment
on commit 795cf17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think part of the problem here is that the META6 has several different and distinct consumers as it currently stands which have different optionality for the various attributes, so, instance, description almost certainly isn't required by an installer or by Rakudo to build a Distribution object, but it is most likely required by an aggregator such as CPAN, whereas both the installer and the aggregator will probably require "source" in most circumstances and so on.
So we really need to consider the purpose and audience of the document we are talking about here. which is probably module authors who want to create a META6 that will allow the module to be found, installed and used by other people, so we should be documenting as required those attributes that fill all those requirements (with perhaps some commentary as to which part requires them.)
If we want to make a document that has different audiences with different constraints on the contents of the META6 then we should make it but not let that stop us making a document that is useful for module authors.
Why is this removed? It is completely functional in zef and rakudo.