6
6
7
7
= head1 Creating and using modules
8
8
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.
11
11
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
15
15
L < S11|https://design.perl6.org/S11.html > .>
16
16
17
17
Modules are typically packages (L < classes|/language/objects#Classes > ,
@@ -24,21 +24,23 @@ mean "module" as a set of source files in a namespace.
24
24
25
25
= head2 Looking for and installing modules.
26
26
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 >
32
31
33
32
= for code :lang<shell>
34
33
zef search WWW
35
34
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,
37
37
38
38
= for code :lang<shell>
39
39
zef install WWW
40
40
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 >
42
44
43
45
44
46
= head2 Basic structure
@@ -677,6 +679,7 @@ Make your X<C<META6.json>|META6.json> file look something like this:
677
679
{
678
680
"perl" : "6.c",
679
681
"name" : "Vortex::TotalPerspective",
682
+ "api" : "1",
680
683
"auth" : "github:SomeAuthor",
681
684
"version" : "0.0.1",
682
685
"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.
714
717
Even if you have created a META6.json file just to express the dependencies
715
718
for a series of scripts, this section must be included.
716
719
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.
721
732
722
733
The C < authors > section includes a list of all the module authors. In
723
734
the case there is only one author, a single element list must be
0 commit comments