npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@conduitvc/build

v1.0.1

Published

Develop, build, and lint React and Node.js applications with Neutrino-based presets for external tooling

Downloads

5

Readme

Conduit presets for React and Node.js

@conduitvc/build lets you develop, build, and lint React and Node.js applications with Neutrino-based presets for external tooling.

Setup

In your project, install the necessary development dependencies:

# If you are building a React application, also add webpack-dev-server
yarn add --dev webpack webpack-cli neutrino@next eslint @conduitvc/build

Next, add a .neutrinorc.js file to the root of the project with the following minimal boilerplate, adding or removing middleware pieces as needed for the particular project. The setup for each available middleware is outlined below.

module.exports = {
  options: {
    root: __dirname,
  },
  use: [
    // Use available presets here
  ],
};

webpack + React

At a minimum, you need to be able to build and start the React application. Add the react middleware to the .neutrinorc.js use array:

module.exports = {
  options: {
    root: __dirname,
  },
  use: [
    ['@conduitvc/build/react', {
      flow: true, // Optionally enable flow syntax
      typescript: true, // Optionally enable typescript syntax
      html: {
        title: 'Project Title',
      },
    }],
  ],
};

Most middleware allow you to specify an array pair of middleware package and its options. Above we set the default page title, and any more options that can be passed relate to the options accepted by @neutrinojs/react.

Next, create a webpack.config.js file in the root of the project with the following code to ensure that Neutrino loads the necessary middleware and sends it off to webpack:

const neutrino = require('neutrino');

module.exports = neutrino().webpack();

You can now start webpack and webpack-dev-server using normal mechanisms, writing the React application in a src directory.

webpack + Node.js

At a minimum, you need to be able to build and start the Node.js application. Add the node middleware to the .neutrinorc.js use array:

module.exports = {
  options: {
    root: __dirname,
  },
  use: [
    ['@conduitvc/build/node', {
      flow: true, // Optionally enable flow syntax
      typescript: true, // Optionally enable typescript syntax
    }],
  ],
};

Most middleware allow you to specify an array pair of middleware package and its options. More options that can be passed relate to the options accepted by @neutrinojs/node.

Next, create a webpack.config.js file in the root of the project with the following code to ensure that Neutrino loads the necessary middleware and sends it off to webpack:

const neutrino = require('neutrino');

module.exports = neutrino().webpack();

You can now start webpack using normal mechanisms, writing the Node.js application in a src directory.

ESLint

To have runtime and build-time linting with ESLint using Conduit rules, add the relevant Airbnb middleware as the first entry in the .neutrinorc.js use array.

Note: Use airbnb for React projects, and airbnb-base for Node.js projects.

React .neutrinorc.js

module.exports = {
  options: {
    root: __dirname,
  },
  use: [
    '@conduitvc/build/airbnb',
    ['@conduitvc/build/react', {
      // ...
    }],
  ],
};

Node.js .neutrinorc.js

module.exports = {
  options: {
    root: __dirname,
  },
  use: [
    '@conduitvc/build/airbnb-base',
    ['@conduitvc/build/node', {
      // ...
    }],
  ],
};

Next, create a .eslintrc.js file in the root of the project with the following code to ensure that Neutrino loads the necessary middleware and sends it off to ESLint:

const neutrino = require('neutrino');

module.exports = neutrino().eslintrc();

You can now start webpack, webpack-dev-server, or ESLint using normal mechanisms, with linting errors and warnings. The following is the recommended ESLint command to use for one-off lint checks:

eslint --cache --format codeframe src

If you need to override any ESLint rules or settings, pass an array pair with options according to the @neutrinojs/eslint, @neutrinojs/airbnb, or @neutrinojs/airbnb-base docs.

module.exports = {
  // ...
  use: [
    ['@conduitvc/build/airbnb', {
      eslint: {
        baseConfig: {
          rules: {
            semi: 'error',
          },
        },
      },
    }],
    // ...
  ],
};