-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I'd gladly help you get your first module published.

First off, you'll need to have a META6.json describing which files your
module will provide, and which dependencies it needs. You always will
need this json file, even if you have no dependencies.

Additionally, you will probably want to move the module files into a
lib/ subdirectory, as this is the standard for Perl 6 modules to live
in.

Your README.md could use a little extending as well, with information
on what problems it solves, how people can install it, but most
importantly, some examples on how people can use it. Many people also
add their license information in the README file, which I'd recommend
as well.

On the matter of licensing, your module currently is not licensed,
which means in most legal jurisdictions that it is not freely usable. I
am not a lawyer, though, so I may be completely wrong. I'd still
recommend you use a free software license to clear out any doubt, so
people know what they can and cannot do. I'm a personal proponent of
the GNU General Public License, but you should check out
ChooseALicense[1]. This site can help you pick a suitable license for
your code.

For some shameless self promotion, I have a module that can help you in
creating new modules: Assixt[2]. You can install it with zef:

    zef install App::Assixt

Once installed, you can create a new module skeleton directory using

    assixt new

It will ask you a couple questions, which it will use to create a
correct META6.json file for you. If you're planning on making more
modules, you can configure some default values for a number of these
questions with

    assixt bootstrap config

Once you've created the new module skeleton, change to the new
directory and add the files you want to have added:

    assixt touch class Command
    assixt touch class Command::Result
    cp ../old-dir/Command.pm6 lib/Command.pm6
    cp ../old-dir/Command/Result.pm6 lib/Command/Result.pm6

The assixt calls will generate skeleton class files, and update the
META6.json to reflect these new files. But, since you already have the
actual files, you can just cp them into the new directory to take the
place of the generated skeleton files.

Once you've done this, make sure everything still works. I would
recommend adding some tests[3] as well. You can generate empty test
files in the right directory with

    assixt touch test <your test name>

Assixt will have made a default Travis[4] configuration as well, so you
can enable automated testing on each commit that you push to Github. I
personally prefer GitLab, so there's also a GitLab-CI configuration
available by default. The GitLab-CI tests run *much* quicker, as there
is no need to install Perl 6 as a seperate action.

So, to reiterate, you should:

- - Put your files into the right locations
- - Have a META6.json
- - Add a license
- - Add some tests (and actually run them!)

Once all this is done, you're ready to publish your module. You can
either add them to the Perl 6 ecosystem repository[5], or upload them
to PAUSE[6]. Adding to the ecosystem repo is simply adding an entry
through a PR. I personally prefer PAUSE, which is what I'll cover here
for you.

You'll have to request a PAUSE account on their website[7]. This can
take a couple minutes up to a day or two before these requests get
processed. It looks more scary than it actually is, so just pick a
fancy username and mention that you want to contribute your Perl 6
modules to the community.

Once you have gained access to PAUSE, you can upload your module. The
easiest way to do this, is using Assixt again. When you're in the root
folder of your project, run the following:

    assixt bump
    assixt dist

The first command will "bump" up the version number. You can not
replace an existing version on PAUSE (and you shouldn't do it outside
PAUSE either), so you will have to increase the version number before
each release.

The second command will create a module distribution. This is just a
tarball that contains the files that other users will need to use your
module. Some files will be filtered out by Assixt, since they are
unneeded and would just bloat the distribution (such as
the .git, .gitignore and other such files). Assixt will also tell you
where it saved this distribution. You need to know where it was saved
to continue to uploading the distribution:

    assixt upload <path-to-dist>

Assixt will ask your username and password for PAUSE, and attempt to
upload it for you and store it in the right location. If your username
or password is incorrect, uploading will fail. You can just retry it in
that case.

If you're doing this more often, you can shorten the past three steps to

    assixt push

This will basically run bump, dist and upload in one go. I prefer to
explain them all seperately so you know what's going on first. This
also helps you to understand that you can just rerun the upload command
if only that step failed on the push command.

If any issues arise while using Assixt, feel free to hit me up,
preferably through a GitLab issue. If anything is unclear on getting
your module into the ecosystem, do not hesitate to ask on the mailing
list. I can look into your module at various steps to confirm whether
you're going into the right direction as well.

[1]: https://choosealicense.com/
[2]: https://gitlab.com/tyil/perl6-app-assixt
[3]: https://docs.perl6.org/language/testing
[4]: https://docs.travis-ci.com/user/getting-started/
[5]: https://github.com/perl6/ecosystem
[6]: https://pause.perl.org/
[7]: https://pause.perl.org/pause/query?ACTION=request_id

On Sat, 28 Jul 2018 20:38:04 +0000
Mark Devine <m...@markdevine.com> wrote:

> Todd,
> 
> I see that you’re frequently running commands in your code like me.
> I was looking for a reliable reusable approach for commands for a
> long time.  I’m still learning & not quite ready to step up to
> contribute to the ecosystem yet
> (https://docs.perl6.org/language/modules.html).  After reading Perl 6
> Fundamentals (Moritz Lenz), I cobbled together a reusable Command.pm6
> for myself based on his examples.  Method ‘run’ for a single async
> command, or methods ‘sow’+‘reap’ for multiple async (possibly all
> different) commands, with all returns collected in Command::Result
> objects.
> 
> https://github.com/markldevine/perl6-Command
> 
> Now whenever I need any general-purpose external command, I ‘use
> Command;’ and it has never failed me (I.e. curl, , ssh, etc.).
> 
> Because it’s not in the ecosystem, git clone it into a directory and
> set PERL6LIB=<dir > or ‘use lib <dir>’ internally.  Docs are internal
> POD. If any of the Perl 6 big brains are reading this and would
> provide some welcome criticism resulting in something that should be
> published, I would upload as per the instructions it or hand it off
> to someone more capable of maintaining it.
> 
> If you give it a try, I think that you might find it helpful.
> 
> Thanks,
> 
> Mark
> 
> From: Brandon Allbery <allber...@gmail.com>
> Sent: Saturday, July 28, 2018 16:22
> To: ToddAndMargo <toddandma...@zoho.com>
> Cc: perl6-users <perl6-users@perl.org>
> Subject: Re: return code?
> 
> Yes, that's what I was addressing: you can tell run() to do that,
> keeping stderr separate with :err(). qxx does that internally.
> 
> On Sat, Jul 28, 2018 at 4:12 PM ToddAndMargo
> <toddandma...@zoho.com<mailto:toddandma...@zoho.com>> wrote: On
> 07/28/2018 12:56 PM, Brandon Allbery wrote:
> > You can control where run() sends things.  
> 
> Hi Brandon,
> 
> I adore the run command.
> 
> In this particular instance (curl's progress meter, which is
> written to STDERR), I want STDERR to write to the shell, but
> want to collect STDIN and the return code.
> 
>     curl xxxx; echo $?
> 
> will send both to STDIN, which I can easily deal with.
> 
> -T
> 
> 
> --
> brandon s allbery kf8nh                               sine nomine
> associates
> allber...@gmail.com<mailto:allber...@gmail.com>
> ballb...@sinenomine.net<mailto:ballb...@sinenomine.net> unix,
> openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE4eL662U9iK2ST2MqN/W6H45XOE8FAltdmfMACgkQN/W6H45X
OE9FVAf+KkM7N7Qc7a96Llj61PS5an6klw3kSFWhlAYHlimhDKtaAXQ72anQj+Q+
L3Q43x/JLlBDkXm469KKkU9kKutqx5i8I6FikpZi3QVcaD4E3k7Vv7a41ZF7HrMe
RUmcV8+woO58GgG49sSQ23FILfxa5oSanJxce8VdfhN7LX4HcdxYqOTXlmmg2Idt
Ytl6JC+0TTKVMQ51oeZbCZpGQOvG5nor+YNn1ZEN739q9njia8SrEhDlj9Q2vdbN
+QrGDdDUD3Z/EBMKCQoT84O+4q/Uk6YH9W0hO1A9ubakodxyJ1thlf/yFaPS2doX
hDUj+MD5kOZKAwFuzAgDszkM0OqLTg==
=lFKd
-----END PGP SIGNATURE-----

Reply via email to