diff options
author | Michael Opdenacker <michael.opdenacker@bootlin.com> | 2022-06-15 17:59:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-30 17:09:51 +0100 |
commit | df1904a85f789fddd84a336f6aa01fff800705de (patch) | |
tree | 254c65c93750bea5696a3306cecc145c8e91b3a2 /documentation | |
parent | 9900bb5d13ff309fdf6ac28d211a50366a7288eb (diff) | |
download | poky-df1904a85f789fddd84a336f6aa01fff800705de.tar.gz |
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>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dev-manual/common-tasks.rst | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst index 01dac39c6f..8be3c7c0e8 100644 --- a/documentation/dev-manual/common-tasks.rst +++ b/documentation/dev-manual/common-tasks.rst | |||
@@ -7614,6 +7614,11 @@ The | |||
7614 | fetch URI to download each dependency and capture license details where | 7614 | fetch URI to download each dependency and capture license details where |
7615 | possible. The result is a generated recipe. | 7615 | possible. The result is a generated recipe. |
7616 | 7616 | ||
7617 | After running for quite a long time, in particular building the | ||
7618 | ``nodejs-native`` package, the command should end as follows:: | ||
7619 | |||
7620 | 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 | ||
7621 | |||
7617 | The recipe file is fairly simple and contains every license that | 7622 | The recipe file is fairly simple and contains every license that |
7618 | ``recipetool`` finds and includes the licenses in the recipe's | 7623 | ``recipetool`` finds and includes the licenses in the recipe's |
7619 | :term:`LIC_FILES_CHKSUM` | 7624 | :term:`LIC_FILES_CHKSUM` |
@@ -7636,18 +7641,38 @@ runs. | |||
7636 | The ``devtool edit-recipe`` command lets you take a look at the recipe:: | 7641 | The ``devtool edit-recipe`` command lets you take a look at the recipe:: |
7637 | 7642 | ||
7638 | $ devtool edit-recipe cute-files | 7643 | $ devtool edit-recipe cute-files |
7644 | # Recipe created by recipetool | ||
7645 | # This is the basis of a recipe and may need further editing in order to be fully functional. | ||
7646 | # (Feel free to remove these comments when editing.) | ||
7647 | |||
7648 | SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network." | ||
7649 | # WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is | ||
7650 | # your responsibility to verify that the values are complete and correct. | ||
7651 | # | ||
7652 | # NOTE: multiple licenses have been detected; they have been separated with & | ||
7653 | # in the LICENSE value for now since it is a reasonable assumption that all | ||
7654 | # of the licenses apply. If instead there is a choice between the multiple | ||
7655 | # licenses then you should change the value to separate the licenses with | | ||
7656 | # instead of &. If there is any doubt, check the accompanying documentation | ||
7657 | # to determine which situation is applicable. | ||
7658 | |||
7639 | SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network." | 7659 | SUMMARY = "Turn any folder on your computer into a cute file browser, available on the local network." |
7640 | LICENSE = "MIT & ISC & Unknown" | 7660 | LICENSE = "BSD-3-Clause & ISC & MIT" |
7641 | LIC_FILES_CHKSUM = "file://LICENSE;md5=71d98c0a1db42956787b1909c74a86ca \ | 7661 | LIC_FILES_CHKSUM = "file://LICENSE;md5=71d98c0a1db42956787b1909c74a86ca \ |
7642 | file://node_modules/toidentifier/LICENSE;md5=1a261071a044d02eb6f2bb47f51a3502 \ | 7662 | file://node_modules/accepts/LICENSE;md5=bf1f9ad1e2e1d507aef4883fff7103de \ |
7643 | file://node_modules/debug/LICENSE;md5=ddd815a475e7338b0be7a14d8ee35a99 \ | 7663 | file://node_modules/array-flatten/LICENSE;md5=44088ba57cb871a58add36ce51b8de08 \ |
7644 | ... | 7664 | ... |
7665 | file://node_modules/cookie-signature/Readme.md;md5=57ae8b42de3dd0c1f22d5f4cf191e15a" | ||
7666 | |||
7645 | SRC_URI = " \ | 7667 | SRC_URI = " \ |
7646 | npm://registry.npmjs.org/;package=cute-files;version=${PV} \ | 7668 | npm://registry.npmjs.org/;package=cute-files;version=${PV} \ |
7647 | npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \ | 7669 | npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \ |
7648 | " | 7670 | " |
7671 | |||
7649 | S = "${WORKDIR}/npm" | 7672 | S = "${WORKDIR}/npm" |
7673 | |||
7650 | inherit npm | 7674 | inherit npm |
7675 | |||
7651 | LICENSE:${PN} = "MIT" | 7676 | LICENSE:${PN} = "MIT" |
7652 | LICENSE:${PN}-accepts = "MIT" | 7677 | LICENSE:${PN}-accepts = "MIT" |
7653 | LICENSE:${PN}-array-flatten = "MIT" | 7678 | LICENSE:${PN}-array-flatten = "MIT" |
@@ -7680,17 +7705,10 @@ command to deploy your package:: | |||
7680 | $ devtool deploy-target -s cute-files root@192.168.7.2 | 7705 | $ devtool deploy-target -s cute-files root@192.168.7.2 |
7681 | 7706 | ||
7682 | Once the package is installed on the target, you can | 7707 | Once the package is installed on the target, you can |
7683 | test the application: | 7708 | test the application to show the contents of any directory:: |
7684 | |||
7685 | .. note:: | ||
7686 | |||
7687 | Because of a known issue, you cannot simply run ``cute-files`` as you would | ||
7688 | if you had run ``npm install``. | ||
7689 | |||
7690 | :: | ||
7691 | 7709 | ||
7692 | $ cd /usr/lib/node_modules/cute-files | 7710 | $ cd /usr/lib/node_modules/cute-files |
7693 | $ node cute-files.js | 7711 | $ cute-files |
7694 | 7712 | ||
7695 | On a browser, | 7713 | On a browser, |
7696 | go to ``http://192.168.7.2:3000`` and you see the following: | 7714 | go to ``http://192.168.7.2:3000`` and you see the following: |
@@ -7718,12 +7736,11 @@ command:: | |||
7718 | 7736 | ||
7719 | $ devtool add https://github.com/martinaglv/cute-files.git | 7737 | $ devtool add https://github.com/martinaglv/cute-files.git |
7720 | 7738 | ||
7721 | The | 7739 | The recipe this command generates is very similar to the recipe created in |
7722 | recipe this command generates is very similar to the recipe created in | ||
7723 | the previous section. However, the :term:`SRC_URI` looks like the following:: | 7740 | the previous section. However, the :term:`SRC_URI` looks like the following:: |
7724 | 7741 | ||
7725 | SRC_URI = " \ | 7742 | SRC_URI = " \ |
7726 | git://github.com/martinaglv/cute-files.git;protocol=https \ | 7743 | git://github.com/martinaglv/cute-files.git;protocol=https;branch=master \ |
7727 | npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \ | 7744 | npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json \ |
7728 | " | 7745 | " |
7729 | 7746 | ||