[OE-core] [PATCH 1/7] create_npm.py: add devDependencies to depends
Anders Darander
anders at chargestorm.se
Mon Mar 6 07:11:24 UTC 2017
Hi,
* Paul Eggleton <paul.eggleton at linux.intel.com> [170302 02:44]:
> On Thursday, 2 March 2017 6:19:55 AM NZDT Anders Darander wrote:
> > NpmRecipeHandler(RecipeHandler):
> > def get_npm_package_dependencies(self, pdata):
> > dependencies = pdata.get('dependencies', {})
> > optionalDependencies = pdata.get('optionalDependencies', {})
> > + devDependencies = pdata.get('devDependencies', {})
> > dependencies.update(optionalDependencies)
> > + dependencies.update(devDependencies)
> > depsfound = {}
> > optdepsfound = {}
> > + devdepsfound = {}
> > for dep in dependencies:
> > if dep in optionalDependencies:
> > optdepsfound[dep] = dependencies[dep]
> > + elif dep in devDependencies:
> > + devdepsfound[dep] = dependencies[dep]
> > else:
> > depsfound[dep] = dependencies[dep]
> > - return depsfound, optdepsfound
> > + return depsfound, optdepsfound, devdepsfound
> > # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
> > # (split out from _getdependencies())
> This worries me slightly - I've no familiarity with angular2 but AIUI in
> general the dev dependencies most often aren't needed, and may be onerous to
> pull in and build - should we really be pulling those in unconditionally?
I fully understand. However, I found no obvious way of doing this
conditionally. At least, the devDependencies won't be used during npm
install, unless you add NPM_INSTALL_DEV = "1" to the recipe in question.
Well, I guess, it could be possible to add a command line switch to
recipetool; though, in that question, I've got a few questions. Is it
possible to add this only for create_npm? (Ie not for generation of
other recipes?) How to add this to devtool (and have it propagate for
npm-packages only?
Cheers,
Anders
--
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB
More information about the Openembedded-core
mailing list