summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/bitbake-user-manual
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2022-06-22 10:26:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-22 22:41:58 +0100
commite13a057812ec639544c321db0aedf9c7c203953e (patch)
treeec6d8510f80895d9ee1365637a129e9ebace8957 /bitbake/doc/bitbake-user-manual
parent22a31b1ab291d567dd898127690b6f9f82697379 (diff)
downloadpoky-e13a057812ec639544c321db0aedf9c7c203953e.tar.gz
bitbake: doc: bitbake-user-manual: document npm and npmsw fetchers
This addresses bug [YOCTO #10098] (Bitbake rev: cca7999586317435d79bf53df4359cdd8bfadff4) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc/bitbake-user-manual')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst76
1 files changed, 74 insertions, 2 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
index ea8a8aa70f..4dfb7889e8 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst
@@ -706,6 +706,80 @@ Here is an example URL::
706 706
707 SRC_URI = "crate://crates.io/glob/0.2.11" 707 SRC_URI = "crate://crates.io/glob/0.2.11"
708 708
709.. _npm-fetcher:
710
711NPM Fetcher (``npm://``)
712------------------------
713
714This submodule fetches source code from an
715`NPM <https://en.wikipedia.org/wiki/Npm_(software)>`__
716Javascript package registry.
717
718The format for the :term:`SRC_URI` setting must be::
719
720 SRC_URI = "npm://some.registry.url;OptionA=xxx;OptionB=xxx;..."
721
722This fetcher supports the following parameters:
723
724- *"package":* The NPM package name. This is a mandatory parameter.
725
726- *"version":* The NPM package version. This is a mandatory parameter.
727
728- *"downloadfilename":* Specifies the filename used when storing the downloaded file.
729
730- *"destsuffix":* Specifies the directory to use to unpack the package (default: ``npm``).
731
732Note that NPM fetcher only fetches the package source itself. The dependencies
733can be fetched through the `npmsw-fetcher`_.
734
735Here is an example URL with both fetchers::
736
737 SRC_URI = " \
738 npm://registry.npmjs.org/;package=cute-files;version=${PV} \
739 npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \
740 "
741
742See :yocto_docs:`Creating Node Package Manager (NPM) Packages
743</dev-manual/common-tasks.html#creating-node-package-manager-npm-packages>`
744in the Yocto Project manual for details about using
745:yocto_docs:`devtool <https://docs.yoctoproject.org/ref-manual/devtool-reference.html>`
746to automatically create a recipe from an NPM URL.
747
748.. _npmsw-fetcher:
749
750NPM shrinkwrap Fetcher (``npmsw://``)
751-------------------------------------
752
753This submodule fetches source code from an
754`NPM shrinkwrap <https://docs.npmjs.com/cli/v8/commands/npm-shrinkwrap>`__
755description file, which lists the dependencies
756of an NPM package while locking their versions.
757
758The format for the :term:`SRC_URI` setting must be::
759
760 SRC_URI = "npmsw://some.registry.url;OptionA=xxx;OptionB=xxx;..."
761
762This fetcher supports the following parameters:
763
764- *"dev":* Set this parameter to ``1`` to install "devDependencies".
765
766- *"destsuffix":* Specifies the directory to use to unpack the dependencies
767 (``${S}`` by default).
768
769Note that the shrinkwrap file can also be provided by the recipe for
770the package which has such dependencies, for example::
771
772 SRC_URI = " \
773 npm://registry.npmjs.org/;package=cute-files;version=${PV} \
774 npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \
775 "
776
777Such a file can automatically be generated using
778:yocto_docs:`devtool <https://docs.yoctoproject.org/ref-manual/devtool-reference.html>`
779as described in the :yocto_docs:`Creating Node Package Manager (NPM) Packages
780</dev-manual/common-tasks.html#creating-node-package-manager-npm-packages>`
781section of the Yocto Project.
782
709Other Fetchers 783Other Fetchers
710-------------- 784--------------
711 785
@@ -715,8 +789,6 @@ Fetch submodules also exist for the following:
715 789
716- Mercurial (``hg://``) 790- Mercurial (``hg://``)
717 791
718- npm (``npm://``)
719
720- OSC (``osc://``) 792- OSC (``osc://``)
721 793
722- Secure FTP (``sftp://``) 794- Secure FTP (``sftp://``)