Skip to content

"How it works" Chapter 4 README.md #20

@Student007

Description

@Student007

How it works

Vagrunt up

The vagrant up command installs the download manager axel and the version control client git on top of a prepared vagrant box (ubuntu/trusty64). Further it downloads and extracts the mipsel-toolchain (276 MB) (Toolchain for cross-compiling which uses uClibc for RISC processors)

Bash Script compile.sh

This script first logs into the VM and causes installing NVM and NodeJS 4.2.1 if missing. Further node-gyp installs node development header files for the corresponding NodeJS version.
Now pre-gypify compiles pre-gyp into non-gyp modules. The package to compile now is installed without pre-install and pre-publish scripts (npm install --ignore-scripts). Afterwards node-pre-gyp build package creates the compiled binary module for the Tessel 2 which is using a RISC Processor Mediatek MT7620n.
Finally it syncs the compiler output via ssh to your current ./out

Binary Server

  • The /lib/server.jsis starting the /lib/package-listener.js and a /lib/web-server (http://0.0.0.0:3000) which shows package names from the local ../knexfile database.
  • The /lib/package-listener.js is is watching (listenForChanges()) https://skimdb.npmjs.com/registry/ for changes by calling check-for-gyp. It uses concurrent-couch-follower to ensure every packages.json with a binding.gyp is completely checked (in parallel for up to 20 docs at the moment)
  • /lib/check-for-gyp.js returns a promise which checks whether a binding.gyp exists in the doc (package.json)
  • /lib/package-url.js is fetching and parsing the packages.json from npmjs.com
  • db.js sets up the local kexfile.js

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions