Socket
Book a DemoInstallSign in
Socket

@kpdecker/linoleum

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kpdecker/linoleum

Shared javascript build and testing infrastructure

latest
Source
npmnpm
Version
2.2.0
Version published
Maintainers
1
Created
Source

Linoleum

Shared javascript build and testing infrastructure

Base project to avoid duplicating infrastructure boilerplate across javascript projects. Provides linting, es6, code coverage, with source maps all running in node, browser, or electron environments.

  • For Node, see linoleum-node.
  • For Webpack browser builds, see linoleum-webpack.
  • For Electron, see linoleum-electron.

That's right I've got a floor.

Usage

Within Gulpfile.js:

// Init global state
var Linoleum = require('@kpdecker/linoleum');

// Include optional linoleum tasks
require('@kpdecker/linoleum-node');
require('@kpdecker/linoleum-webpack');
require('@kpdecker/linoleum-electron');

Global APIs:

  • WATCHING: Set to true if the build is in watch mode.

  • SOURCE_FILES: Glob representing source files. May be overridden.

  • TEST_FILES: Glob representing test files. May be overridden.

  • BUILD_TARGET: Path that build artifacts will be output to. May be overridden.

  • COVERAGE_TARGET: Path that coverage reports will be output to. May be overridden.

  • jsFiles: Helper used to generate the final list js files glob

  • testFiles: Helper used to generate the final list test files glob

  • watch: Helper utility to watch and immediately run a particular command on a set of files:

    Linoleum.watch(Linoleum.SOURCE_FILES, 'cover');
    

    Will create watch:cover task.

    Accepts an option 3rd argument options, which may define:

    • setup: Task that is called once prior to the first exec of the watched task.
    • onChange: Called prior to exec with an array of the changes that occurred to trigger this cycle.

linoleum/tasks/clean

Defines the clean and clean:always task which will remove all build and coverage output from the project. The clean task will only run once in watch mode, while the clean:always task will run on each invocation.

linoleum/tasks/lint

Defines the lint task which will lint all source and test files.

linoleum/tasks/cover

Defines:

  • cover:untested task which runs empty coverage report to ensure that untested files are included in cover:report.
  • cover:report task which combines raw data from the other coverage tasks and asserts coverage.

Common issues

Node Compile Issues

Newer versions of Node (5+, potentially earlier) may run into native compiler errors under Travis due to older versions of the C++ compiler. This can be resolved via this config:

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-4.8
env:
  - CXX=g++-4.8

FAQs

Package last updated on 15 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts