aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/npm.bbclass
AgeCommit message (Collapse)Author
2017-03-21classes/npm: allow installation of devDependenciesAnders Darander
Often, eg when using angular2, there's a need to install also the devDependencies. The default is to keep the old behaviour, to not install devDependencies. Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-07classes/npm: set HOME during do_installPaul Eggleton
In do_compile we set HOME so that ~/.npm* only get created in the work directory; we need to do the same in do_install as well or they'll go into the user's home directory which we do not want. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-06classes/npm: use npm install to do installationPaul Eggleton
Using "npm install" instead of "cp -a" is the more correct thing to be doing here, and ensures that symlinks for executable scripts are put into ${prefix}/bin. (I'd prefer ${bindir}, but npm does not allow specifying paths at that level - only a prefix.) Fixes [YOCTO #10460]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-08recipetool: create: support node.js code outside of npmPaul Eggleton
If you have your own node.js application you may not publish it (or at least not immediately) in an npm registry - it might just be in a repository on github or on your local machine. Add support to recipetool create for creating recipes to build such applications - extract their dependencies, fetch them, and add corresponding npm:// URLs to SRC_URI, and ensure that LICENSE / LIC_FILES_CHKSUM are updated to match. For example, you can now run: recipetool create https://github.com/diversario/node-ssdp (I had to borrow some code from bitbake/lib/bb/fetch2/npm.py to implement this functionality; this should be refactored out but now isn't the time to do that refactoring.) Part of the fix for [YOCTO #9537]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-08-17npm: npm.bbclass now adds nodejs to RDEPENDSHenry Bruce
We expect that any package that uses the npm bbclass will have a runtime dependency on node.js Signed-off-by: Henry Bruce <henry.bruce@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-12npm.bbclass: avoid str/byte conversion problems for PKGV and SUMMARYPatrick Ohly
In Python3, str.encode() returns byte strings, which later are not converted back to strings automatically, leading to "TypeError: Can't convert 'bytes' object to str implicitly" in code which reads PKGV and SUMMARY and expects to find strings there. The npm.bbclass must use values for d.setVar() that meet that expectation, and thus the redundant (and in Python3, harmful) .encode() gets removed. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-30npm: add target_arch flag to npmBrendan Le Foll
npm takes a target_arch flag which needs to be set to do some gyp compilations correctly. It also doesn't use the same mapping as OE for target arch so a small function is required to make the mapping work. Function is taken from meta-nodejs Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-04-14npm.bbclass: Stop packagenames containing underscores from being generatedBrendan Le Foll
Package names cannot contain underscores yet some npm modules use them as part of the name, replace them with hyphens in the package name. Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-03-23devtool: add: delete externalsrc files on npm recipe do_installPaul Eggleton
The npm class just installs whatever is in ${S}; if you're using externalsrc in conjunction with it the symlinks (oe-workdir and oe-logs by default) plus singletask.lock will end up in the final package, which isn't really right. Introduce a variable so we know the path the files will be installed into within npm.bbclass, and append to do_install within the workspace bbappend to delete the files. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-09recipetool: create: split npm module dependencies into packagesPaul Eggleton
Rather than rolling all of an npm module's dependencies into the same package, split them into one module per package, setting the SUMMARY and PKGV values from the package.json file for each package. Additionally, mark each package with the appropriate license using the license scanning we already do, falling back to the license stated in the package.json file for the module if unknown. All of this is mostly in aid of ensuring all modules and their licenses now show up in the manifests for the image. Additionally we set the main LICENSE value more concretely once we've calculated the per-package licenses, since we have more information at that point. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28npm.bbclass: Add npm class to match fetcherBrendan Le Foll
npm class supports the npm fetcher, helping doing the basic compile/install stages of an npm package Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>