Module::Build::JSAN::Installable - Build JavaScript distributions for JSAN, which can be installed locally
In Build.PL:
use Module::Build::JSAN::Installable; my $build = Module::Build::JSAN::Installable->new( module_name => 'Foo.Bar', license => 'perl', keywords => [qw(Foo Bar pithyness)], requires => { 'JSAN' => 0.10, 'Baz.Quux' => 0.02, }, build_requires => { 'Test.Simple' => 0.20, }, static_dir => 'assets', docs_markup => 'mmd' ); $build->create_build_script;
To build, test and install a distribution:
% perl Build.PL % ./Build % ./Build test % ./Build install
In Components.js:
COMPONENTS = { "Kernel" : [ "JooseX.Namespace.Depended.Manager", "JooseX.Namespace.Depended.Resource", "JooseX.Namespace.Depended.Materialize.Eval", "JooseX.Namespace.Depended.Materialize.ScriptTag" ], "Web" : [ "+Kernel", "JooseX.Namespace.Depended.Transport.AjaxAsync", "JooseX.Namespace.Depended.Transport.AjaxSync", "JooseX.Namespace.Depended.Transport.ScriptTag", "JooseX.Namespace.Depended.Resource.URL", "JooseX.Namespace.Depended.Resource.URL.JS", "JooseX.Namespace.Depended.Resource.JS", "JooseX.Namespace.Depended.Resource.JS.External", //should be the last "JooseX.Namespace.Depended" ], "ServerJS" : [ "+Kernel", "JooseX.Namespace.Depended.Transport.Require", "JooseX.Namespace.Depended.Resource.Require", //should be the last "JooseX.Namespace.Depended" ] }
This is a developer aid for creating JSAN distributions, which can be also installed in the local system. JSAN is the "JavaScript Archive Network," a JavaScript library akin to CPAN. Visit http://www.openjsan.org/ for details.
This module works nearly identically to Module::Build::JSAN, so please refer to its documentation for additional details.
This action will install current distribution in your local JSAN library. See below for details.
This action will build a documentation files for this distribution. Default markup for documentation is POD. Alternative markup can be specified with docs_markup configuration parameter (see Synopsis). Currently supported markups: 'pod', 'md' (Markdown via Text::Markdown), 'mmd' (MultiMarkdown via Text::MultiMarkdown).
docs_markup
Resulting documentation files will be placed under /docs directory, categorized by the formats. For 'pod' markup there will be /doc/html, /doc/pod and /doc/text directories. For 'md' and 'mmd' markups there will be /doc/html and /doc/[m]md directories.
For 'md' and 'mmd' markups, its possible to keep the module's documentation in separate file. The file should have the same name as module, with extensions, changed to markup abbreviature. An example:
/lib/Module/Name.js /lib/Module/Name.mmd
This action will build a specific concatenated version (task) of current distribution. Default task name is 'Core', task name can be specified with --task_name command line option.
--task_name
Information about tasks is stored in the Components.JS file in the root of distribution. See the Synposys for example of Components.JS.
After concatenation, resulting file is placed on the following path: /lib/Task/Distribution/Name/SampleTask.js, assuming the name of your distribution was Distribution.Name and the task name was SampleTask
This action relies on not yet released JSAN::Prove module, stay tuned for further updates.
This module uses concept of local JSAN library, which is organized in the same way as perl library.
The path to the library is resolved in the following order:
1. --install_base command-line argument
2. environment variable JSANLIB
3. Either the first directory in $Config{libspath}, followed with /jsan (probably /usr/local/lib on linux systems) or C:\JSAN (on Windows)
$Config{libspath}
/jsan
/usr/local/lib
C:\JSAN
As a convention, it is recommended, that you configure your local web-server that way, that /jsan will point at the /lib subdirectory of your local JSAN library. This way you can access any module from it, with URLs like: '/jsan/Test/Run.js'
Under static files we'll assume any files other than javascript (*.js). Typically those are *.css files and images (*.jpg, *.gif, *.png etc).
All such files should be placed in the "static" directory. Default name for share directory is '/static'. Alternative name can be specified with static_dir configuration parameter (see Synopsis). Static directory can be organized in any way you prefere.
static_dir
Lets assume you have the following distribution structure:
/lib/Distribution/Name.js /static/css/style1.css /static/img/image1.png
After building (./Build) it will be processed as:
/blib/lib/Distribution/Name.js /blib/lib/Distribution/Name/static/css/style1.css /blib/lib/Distribution/Name/static/img/image1.png
During installation (./Build install) the whole 'blib' tree along with static files will be installed in your local library.
Nickolay Platonov, <nplatonov at cpan.org>
<nplatonov at cpan.org>
Please report any bugs or feature requests to bug-module-build-jsan-installable at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Build-JSAN-Installable. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-module-build-jsan-installable at rt.cpan.org
http://github.com/SamuraiJack/JooseX-Namespace-Depended/tree
http://github.com/SamuraiJack/joosex-bridge-ext/tree
Home of the JavaScript Archive Network.
Joose - Moose for JavaScript
Yet another testing platform for JavaScript
This module is stored in an open repository at the following address:
http://github.com/SamuraiJack/Module-Build-JSAN-Installable/tree/
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Build-JSAN-Installable
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Module-Build-JSAN-Installable
CPAN Ratings
http://cpanratings.perl.org/d/Module-Build-JSAN-Installable
Search CPAN
http://search.cpan.org/dist/Module-Build-JSAN-Installable/
Thanks to David Wheeler for his excelent Module::Build::JSAN, on top of which this module is built.
Copyright 2009 Nickolay Platonov, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Module::Build::JSAN::Installable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Build::JSAN::Installable
CPAN shell
perl -MCPAN -e shell install Module::Build::JSAN::Installable
For more information on module installation, please visit the detailed CPAN module installation guide.