g information from components.json
use Moose;
with 'Dist::Zilla::Role::FileGatherer';
with 'Dist::Zilla::Role::FileMunger';
use Dist::Zilla::File::Generated;
use JSON -support_by_pp, -no_export;
has 'filename' => (
isa => 'Str',
is => 'rw',
default => 'components.json'
);
has 'lib_dir' => (
isa => 'Str',
is => 'rw',
default => 'lib'
);
$content =~ m/(\{.*\})/s;
$content = $1;
my $json = JSON->new->relaxed->allow_singlequote->allow_barekey;
return $json->decode($content);
}
#===================================
e;
$Dist::Zilla::Plugin::Web::NPM::Package::VERSION = '0.0.10';
# ABSTRACT: Generate the `package.json` file, suitable for `npm` package manager
use Moose;
with 'Dist::Zilla::Role::FileGatherer';
#
Role::BuildRunner';
with 'Dist::Zilla::Role::AfterBuild';
use Dist::Zilla::File::FromCode;
use JSON 2;
use Path::Class;
use File::ShareDir;
use Cwd;
has 'name' => (
is => 'rw',
$self->add_file(Dist::Zilla::File::FromCode->new({
name => file('package.json') . '',
code => sub {
my $package = {};
[ 'filename=s' => 'a file from which to take the bundling information', { default => 'components.json' } ],
[ 'lib_dir=s' => 'a name for lib dir', { default => 'lib' } ],
}
sub execute {
my
o bundles
=head1 VERSION
version 0.0.10
=head1 SYNOPSIS
dzil bundle [ --filename components.json] [ --lib_dir lib ]
=head1 DESCRIPTION
This command is a very thin layer over the Dist::Zilla::P
=head2 --file
A file from which to take the bundling information. Default value is "components.json".
=head2 --lib_dir
A name for "lib" directory. Default is "lib".
=head1 AUTHOR
Nickolay Plato