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

@jbknowledge/react-dev

v0.6.0

Published

JBKnowledge React Standard Dev Dependency

Downloads

8

Readme

JBKnowledge React Development

Installation

npm install @jbknowledge/react-dev

package.json

{
  "scripts": {
    "lint": "jbk-scripts lint src/*",
    "start": "jbk-scripts start",
    "build": "jbk-scripts build",
    "configure": "jbk-scripts configure",
    "eject": "jbk-scripts eject"
  },
}

jbk-scripts

@jbknowledge/react-dev provides a handful of scripts for your development environment.

Environment:

All scripts are configured to read a .env file for configuration. Further documentation for what environment variables options are available can be seen below.

lint

jbk-scripts lint [options] <paths>

lint will run both prettier and eslint on your behalf.

options:

  • --fix: Auto fix lint errors

paths:

  • A list of file patterns to match. i.e. index.js, src/**, !node_modules, etc

available overrides:

  • eslint config
  • eslint ignore
  • prettier config
  • prettier ignore

start

jbk-scripts start

start will spin up a webpack dev server on your behalf pointing to your entry point with the following precedence:

  • --entry-point optional option
  • package.json#main
  • src/index.js

options:

  • --entry-point: Change entrypoint js path. i.e. ./packages/client/index.js

available overrides:

  • webpack config
  • babel config

.env options:

  • each of ENV_<key> will replace the value of window.env.<key> if it exists

build

jbk-scripts build

build will generate a production bundle of your site and output to dist/* using the entry point you define with the following precedence:

  • --entry-point optional option
  • package.json#main
  • src/index.js

options:

  • --entry-point: Change entrypoint js path. i.e. ./packages/client/index.js

available overrides:

  • webpack config
  • babel config

options

  • --build-path <projectRootRelativePath>
    • By default, jbk-scripts builds to ./dist. If you need to change this path, i.e. to ./build, you can do so using this option.

configure

jbk-scripts configure

configure will inject ENV_* into your <build>/env.js file for releases.

options

  • --build-path <projectRootRelativePath>
    • By default, jbk-scripts assumes you built to dist and looks for an env.js file at that location. If your build location is different, i.e. ./build, you can declare that using this option.

.env options:

  • each of ENV_<key> will replace the value of window.env.<key> if it exists

eject

jbk-scripts eject [options] <provider>

eject allows you to manage your configuration yourself. This will both eject the config and install the relevant dev dependencies by default.

Note: If you eject configuration, you will want to periodically re-eject to catch internal configuration updates of react-dev. Just make sure you retain any modifications you make.

options:

  • --config-only
    • By default, running eject for a provider will also eject control of the dev dependencies for that provider. For example, if you eject prettier it will also install prettier the package as a dev dependency. The --config-only flag will skip this step only copying out the config files themselves. This will allow you to extend react-dev's configuration without managing the associated dev dependencies; future executions of related jbk-scripts commands will utilize your ejected config with the dev dependencies that react-dev retains control over.

available ejectable providers:

  • eslint
  • prettier
  • babel
  • webpack

reversing eject:

You can undo a provider ejection by completing the following:

  • delete all ejected config files
    • i.e. babel.config.js for babel, etc
  • uninstall ejected dev dependencies
    • i.e. prettier for prettier, etc
    • you may want to wipe out node_modules and install fresh

Overriding Configuration

Eslint

In order of precedence, each of the following paths will override the eslint configuration provided by @jbknowledge/react-dev

  • .eslintrc
  • .eslintrc.json
  • .eslintrc.yml
  • .eslintrc.yaml
  • package.json#eslintConfig

You can reference the eslint user guide for how to do so.

Prettier

In order of precedence, each of the following paths will override the prettier configuration provided by @jbknowledge/react-dev

  • .prettierrc
  • .prettierrc.json
  • .prettierrc.yaml
  • .prettierrc.yml
  • .prettierrc.js
  • prettier.config.js
  • .prettierrc.toml
  • package.json#prettier

You can reference prettier's options documentation for how to do so.

Extension of prettier configuration is not supported at this time. If customization is desired, feel free to copy the contents of the built in config.

Babel

In order of precedence, each of the following paths will override the babel configuration provided by @jbknowledge/react-dev

  • babel.config.js
  • .babelrc
  • .babelrc.js
  • package.json#babel

You can reference the standard babel documentation for how to do so.

Webpack

At this time, the only way to override webpack configuration provided by @jbknowledge/react-dev is to define a webpack.config.js file.

You can reference the standard webpack documentation for how to to so.

Contributors

@jbknowledge/react-dev was built and is maintained by JBKLabs, JBKnowledge Inc's research and development team.

Licensing

This package is licensed under Apache License, Version 2.0. See LICENSE for the full license text.