dev-manual: update section about creating NPM packages

From running the instructions using Poky master

In particular, update command output and the contents
of generated files.

The "cute-files" example application can now directly be run,
without having to run it through "node".

(From yocto-docs rev: a100fb1e25e3f2e144d771d31e952deae2fe3302)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Opdenacker
2022-06-15 17:59:08 +02:00
committed by Richard Purdie
parent 9900bb5d13
commit df1904a85f

View File

@@ -7614,6 +7614,11 @@ The
fetch URI to download each dependency and capture license details where
possible. The result is a generated recipe.
After running for quite a long time, in particular building the
``nodejs-native`` package, the command should end as follows::
INFO: Recipe /home/.../build/workspace/recipes/cute-files/cute-files_1.0.2.bb has been automatically created; further editing may be required to make it fully functional
The recipe file is fairly simple and contains every license that
``recipetool`` finds and includes the licenses in the recipe's
:term:`LIC_FILES_CHKSUM`
@@ -7636,18 +7641,38 @@ runs.
The ``devtool edit-recipe`` command lets you take a look at the recipe::
$ devtool edit-recipe cute-files
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)
SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network."
LICENSE = "MIT & ISC & Unknown"
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
#
# NOTE: multiple licenses have been detected; they have been separated with &
# in the LICENSE value for now since it is a reasonable assumption that all
# of the licenses apply. If instead there is a choice between the multiple
# licenses then you should change the value to separate the licenses with |
# instead of &. If there is any doubt, check the accompanying documentation
# to determine which situation is applicable.
SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network."
LICENSE = "BSD-3-Clause & ISC & MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=71d98c0a1db42956787b1909c74a86ca \
file://node_modules/toidentifier/LICENSE;md5=1a261071a044d02eb6f2bb47f51a3502 \
file://node_modules/debug/LICENSE;md5=ddd815a475e7338b0be7a14d8ee35a99 \
...
file://node_modules/accepts/LICENSE;md5=bf1f9ad1e2e1d507aef4883fff7103de \
file://node_modules/array-flatten/LICENSE;md5=44088ba57cb871a58add36ce51b8de08 \
...
file://node_modules/cookie-signature/Readme.md;md5=57ae8b42de3dd0c1f22d5f4cf191e15a"
SRC_URI = " \
npm://registry.npmjs.org/;package=cute-files;version=${PV} \
npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \
"
S = "${WORKDIR}/npm"
inherit npm
LICENSE:${PN} = "MIT"
LICENSE:${PN}-accepts = "MIT"
LICENSE:${PN}-array-flatten = "MIT"
@@ -7680,17 +7705,10 @@ command to deploy your package::
$ devtool deploy-target -s cute-files root@192.168.7.2
Once the package is installed on the target, you can
test the application:
.. note::
Because of a known issue, you cannot simply run ``cute-files`` as you would
if you had run ``npm install``.
::
test the application to show the contents of any directory::
$ cd /usr/lib/node_modules/cute-files
$ node cute-files.js
$ cute-files
On a browser,
go to ``http://192.168.7.2:3000`` and you see the following:
@@ -7718,12 +7736,11 @@ command::
$ devtool add https://github.com/martinaglv/cute-files.git
The
recipe this command generates is very similar to the recipe created in
The recipe this command generates is very similar to the recipe created in
the previous section. However, the :term:`SRC_URI` looks like the following::
SRC_URI = " \
git://github.com/martinaglv/cute-files.git;protocol=https \
git://github.com/martinaglv/cute-files.git;protocol=https;branch=master \
npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \
"