Giter Club home page Giter Club logo

meta-nodejs-contrib's Introduction

meta-nodejs-contrib

This OpenEmbedded layer is intended to be used as an extension of meta-nodejs layer to provide community contributed package recipes and Bitbake helper classes.

meta-nodejs provides latest Node.js runtime package recipes for current, long-term support, maintenance and legacy release lines.

Community contributions to this layer are welcome!

Installation

Layer installation varies depending on your OpenEmbedded distribution. These instructions are generic.

  1. Fetch meta-nodejs-contrib layer from https://github.com/imyller/meta-nodejs-contrib.git

  2. Add meta-nodejs-contrib layer to EXTRALAYERS in bblayers.conf. For example:

    	EXTRALAYERS +=" \
    		${TOPDIR}/sources/meta-nodejs-contrib \
    	"

Dependencies

meta-nodejs-contrib depends on following layers:

Bitbake classes

meta-nodejs-contrib layer adds few Node.js related helper classes.

grunt class

grunt can build a package that is based on grunt. First it will do an npm install during the do_configure task to make sure all dependencies are available. Then it runs grunt with the default target during the do_compile task.

It defines the following functions:

  • oe_rungrunt: call grunt

Variables

  • NPM_INSTALL_FLAGS: Extra command line arguments for npm calls made in do_configure task
  • GRUNT_TARGET: The grunt target to run. (default: "")

gulp class

gulp can build a package that is based on gulp. First it will do an npm install during the do_configure task to make sure all dependencies are available. Then it runs gulp with the default target during the do_compile task.

The project being built should have a devDependency on gulp in its package.json.

It defines the following functions:

  • oe_rungulp: call gulp

Variables

  • NPM_INSTALL_FLAGS: Extra command line arguments for npm calls made in do_configure task
  • GULP_TASKS: The gulp task(s) to run. (default: "")
  • GULP_OPTIONS: Extra options to pass to gulp (e.g. --production). (default: "")

bower class

bower is a package manager for web applications front-end dependencies: bower.io

bower class defines following functions:

  • oe_runbower: call bower command line utility

Variables

  • BOWER: bower command line utility (default: bower)
  • BOWER_FLAGS: Extra command line arguments for bower calls made by oe_runbower()
  • BOWER_REGISTRY: override Bower registry URL

bower-install class

Suppose a web application has front-end dependencies which are listed in the file bower.json. In this case the web application recipe can auto-install all those dependencies during yocto build by inheriting bower-install class.

bower-install class inherits bower class and adds following build tasks:

  • bower_install: runs bower install in source directory after do_npm_dedupe and before do_install

Note that front-end dependencies are auto-installed into build directory. They have to be explicitely copied into target image in do_install or do_install_append. Here is a simple example of web application recipe with nodejs and bower dependencies:

SUMMARY = "simple web application with JS front-end dependencies listed in bower.json"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"

SRCREV = "${AUTOREV}"

PR = "r0"
PV = "0.0.1+git${SRCPV}"

SRC_URI = "git://webapp.example.org/test.git;branch=master;protocol=ssh"

inherit bower-install

S = "${WORKDIR}/git"

do_install () {
	install -d ${D}/www/test/public
	cp -r ${S}/bower_components ${D}/www/test/public/
}

Variables

  • BOWER_INSTALL: Parameters for bower install command (such as specific package names)
  • BOWER_INSTALL_FLAGS: Extra command line arguments for bower calls made in bower_install task

typings class

typings is a TypeScript definition manager: typings

typings class defines following functions:

  • oe_runtypings: call typings command line utility

Variables

  • TYPINGS: bower command line utility (default: typings)
  • TYPINGS_FLAGS: Extra command line arguments for typings calls made by oe_runtypings()

typings-install class

Suppose a web application has TypeScript dependencies which are listed in the file typings.json. In this case the web application recipe can auto-install all those dependencies during yocto build by inheriting typings-install class.

typings-install class inherits typings class and adds following build tasks:

  • typings_install: runs typings install in source directory after do_configure and before do_compile

Variables

  • TYPINGS_INSTALL: Parameters for typings install command (such as specific package names)
  • TYPINGS_INSTALL_FLAGS: Extra command line arguments for typings calls made in typings_install task

meta-nodejs-contrib's People

Contributors

imyller avatar jeremy-prater avatar nagos avatar raymanfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

meta-nodejs-contrib's Issues

Should node-red recipe depend on both of bash and zsh?

Hi, I've hit an unexpected running update-alternative hook for zsh when installing node-red which is built with meta-nodejs-contrib.

Environment Description

I'm working on bash shell based BSP which is for Renesas RZ/G1 board Yocto 2.0.
This board does not provide zsh compatible PS1:

/etc/profile

# <snip>
if [ "$PS1" ]; then
# works for bash and ash (no other shells known to be in use here)
   PS1='\u@\h:\w\$ '
fi

Expected Behavior

When installing node-red yocto built package, update-alternative hook for zsh does not work and still be able to use bash as /bin/sh.

Actual Behavior

update-alternative hook for zsh works and replace /bin/sh/ with /bin/zsh.

Bower, Typings, Grunt-cli all fail on creating nativesdk

I am trying to get nodejs, bower, typings, and grunt to install as part of the Krogoth SDK. Nodejs was easy enough to edit and get working however bower, typings, and grunt all fail. The do_install appears to work, but there are no files in the image directory.
do_install log shows the following error:

Error: setuid user id does not exist
at /build/core-toolchain_x86_64/tmp-glibc/sysroots/x86_64-linux/usr/lib/node_modules/npm/node_modules/uid-number/uid-number.js:49:16
at ChildProcess.exithandler (child_process.js:193:7)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

Been fighting it for a couple days and haven't gotten any head way into why this is happening. Everything works for target and native builds, but breaks for nativesdk.

peerDependancy error with nodejs4

Hi,

I am hitting an issue building bower, one of the dependencies is failing due to npm not correctly parsing the rc1 version of grunt. Please see attached debug log.

I'm not sure how to hack around this in OE, any ideas?

npm-debug.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.