[RFC,00/15] Rework npm support

Message ID 20211124144739.2250-1-stefan.herbrechtsmeier-oss@weidmueller.com
Headers show
Series Rework npm support | expand

Message

Stefan Herbrechtsmeier Nov. 24, 2021, 2:47 p.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>


This patch series rework the npm support. It contains bitbake patches
and sample recipes to simplify the discussion. The series is a work in
progress.

Changes:
* Remove the npm-shrinkwrap.json from the npm recipes and replace it
  with direct download urls to simplify the manipulation and update of
  dependencies.
* Remove the npm cache and instead rebuild the fetched npm packages
* Replace python do_* functions with shell functions
* Add support to build packages from source
* Add support to build web applications
* Add support to test packages on the host
* Add support to build angular application
* Add support to test web application via karma and a preinstalled
  chrome browser

ToDos:
* Replace the npm URLs with a python function (ex. pypi.bbclass) or a
  new npm fetcher (ex. crate.py).
* Add support for existing npm-shrinkwrap.json to recipetool
* Add support to reuse existing npm recipes of dependencies to
  recipetool


Stefan Herbrechtsmeier (15):
  openssh: Extend to provide native recipe
  recipetool: Skip hbs extension in guess license
  externalsrc: Remove subsequent slash from B
  bitbake: fetch2: Add striplevel support to unpack
  bitbake: fetch2: Support archives with missing search directory mode
  npm: Rework to use plain npm commands and avoid npm cache
  npm_build: add class to build and install an npm package and its
    dependencies
  npm_build_dist: add class to build npm package and install its dist
    folder
  npm_test: add class to test an npm package
  karma: add class to execute JavaScript code in real browsers
  angular: Add support for angular projects
  recipetool: npm: Add dependencies to SRC_URI and auto select classes
  npm_build: Enable OpenSSL 3.0 legacy provider
  node-red: Add version 2.1.3
  node-red: Add git version

 bitbake/lib/bb/fetch2/__init__.py             |    4 +
 meta/classes/angular.bbclass                  |   30 +
 meta/classes/externalsrc.bbclass              |    2 +-
 meta/classes/karma.bbclass                    |   18 +
 meta/classes/npm.bbclass                      |  340 +-
 meta/classes/npm_build.bbclass                |   81 +
 meta/classes/npm_build_dist.bbclass           |   31 +
 meta/classes/npm_test.bbclass                 |   29 +
 .../openssh/openssh_8.8p1.bb                  |    2 +-
 .../node-red/node-red-src_git.bb              | 2855 +++++++++++++++++
 .../node-red/node-red_2.1.3.bb                |  908 ++++++
 scripts/lib/devtool/standard.py               |    6 +-
 scripts/lib/recipetool/create.py              |    2 +-
 scripts/lib/recipetool/create_npm.py          |  243 +-
 14 files changed, 4300 insertions(+), 251 deletions(-)
 create mode 100644 meta/classes/angular.bbclass
 create mode 100644 meta/classes/karma.bbclass
 create mode 100644 meta/classes/npm_build.bbclass
 create mode 100644 meta/classes/npm_build_dist.bbclass
 create mode 100644 meta/classes/npm_test.bbclass
 create mode 100644 meta/recipes-devtools/node-red/node-red-src_git.bb
 create mode 100644 meta/recipes-devtools/node-red/node-red_2.1.3.bb