Skip to content

Commit d784111

Browse files
committed
Restores the information on the api field
As requested by @jonathanstowe and @ugexe
1 parent 2dcce0a commit d784111

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

doc/Language/modules.pod6

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
77
=head1 Creating and using modules
88
9-
A module is usually a source file or set of source files that expose Perl 6
10-
constructs.
9+
A module is usually a source file or set of source files that expose
10+
Perl 6 constructs.
1111
12-
N<Technically a
13-
module is a set of I<compunits> which are usually files but could come from
14-
anywhere as long as there is a I<compunit repository> that can provide it. See
12+
N<Technically a module is a set of I<compunits> which are usually files
13+
but could come from anywhere as long as there is a I<compunit
14+
repository> that can provide it. See
1515
L<S11|https://design.perl6.org/S11.html>.>
1616
1717
Modules are typically packages (L<classes|/language/objects#Classes>,
@@ -24,21 +24,23 @@ mean "module" as a set of source files in a namespace.
2424
2525
=head2 Looking for and installing modules.
2626
27-
L<C<zef>|https://github.com/ugexe/zef> is the application using for installing
28-
modules in Perl 6. Modules are listed in
29-
L<the Perl 6 ecosystem|https://modules.perl6.org>
30-
and can be searched there or from the
31-
command line using C<zef search>
27+
L<C<zef>|https://github.com/ugexe/zef> is the application used for
28+
installing modules in Perl 6. Modules are listed in L<the Perl 6
29+
ecosystem|https://modules.perl6.org> and can be searched there or from
30+
the command line using C<zef search>
3231
3332
=for code :lang<shell>
3433
zef search WWW
3534
36-
will return a list of modules that includes WWW in their name, for instance. Then,
35+
will return a list of modules that includes WWW in their name, for
36+
instance. Then,
3737
3838
=for code :lang<shell>
3939
zef install WWW
4040
41-
will install the module with that particular name, if it is not already installed.
41+
will install the module with that particular name, if it is not already
42+
installed. N<If it's installed it will reinstall only if the version of
43+
the module is newer than the one installed>
4244
4345
4446
=head2 Basic structure
@@ -677,6 +679,7 @@ Make your X<C<META6.json>|META6.json> file look something like this:
677679
{
678680
"perl" : "6.c",
679681
"name" : "Vortex::TotalPerspective",
682+
"api" : "1",
680683
"auth" : "github:SomeAuthor",
681684
"version" : "0.0.1",
682685
"description" : "Wonderful simulation to get some perspective.",
@@ -714,10 +717,18 @@ The C<name> key is compulsory, and C<zef> will fail if you do not include it.
714717
Even if you have created a META6.json file just to express the dependencies
715718
for a series of scripts, this section must be included.
716719
717-
The C<auth> section identifies the author in GitHub or other repository hosting
718-
site, such as Bitbucket or GitLab. This field is I<customary>, since it's used
719-
to identify the author in the ecosystem, and opens the possibility of having
720-
modules with the same name and different authors.
720+
Optionally, you can set an C<api> field. Incrementing this indicates
721+
that the interface provided by your module is not backwards compatible
722+
with a previous version. You can use it if you want to adhere to
723+
L<Semantic Versioning|https://semver.org>. A best practice is to simply
724+
keep the C<api> field to the same value as your major version number. A
725+
dependency can then depend on your module by including a C<:api> part,
726+
which will ensure backwards incompatible releases will not be pulled in.
727+
728+
The C<auth> section identifies the author in GitHub or other repository
729+
hosting site, such as Bitbucket or GitLab. This field is I<customary>,
730+
since it's used to identify the author in the ecosystem, and opens the
731+
possibility of having modules with the same name and different authors.
721732
722733
The C<authors> section includes a list of all the module authors. In
723734
the case there is only one author, a single element list must be

0 commit comments

Comments
 (0)