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

wildfire-variant

v1.0.4

Published

Variant support package for the Wildland Fire Simulator

Downloads

1

Readme

wildfire-variant

Variant package for the Wildland Fire Simulator

Wildfire Variant

This package supports the Wildland Fire Simulator project.

A Variant is a specification for a Node value. A Variant does not actually hold a value itself, rather it holds specifications for:

  • the type of value held by a Node,
  • all input filters, validators, and validation specs to be applied to a Node's value, and
  • all display transformers, converters, and decorators for a Node's value.

For example, in the Wildfire package, a fire SpreadRate Variant is a specialized Velocity Variant with filters and display decorators that are applied to all the system's fire spread rate Nodes.

How to Build a Modern JS Project

YouTube How to Build a Modern JS Project

  • #1 Intro

  • #2 What is a Build Process? (CI/CD)

  • #3 ESLint, Prettier & EditorConfig

  • #4 Pre-commit with Husky & lint-staged

  • #5 Rollup with CJS, ESM & UMD

  • #6 Babel & React

  • #7 Components & Styling

  • #8 Module Systems

  • #9 Storybook

  • #10 Snapshot Tests

  • GitHub

    • Select a package name that is not yet in use on NPM
    • Create a new repository
      • Public
      • initialize this repository with a README,
      • MIT License
      • Add a Node .gitignore
      • Create Repository
      • Click 'Clone or Download' and copy repository link to clipboard
  • Setup Project Folder

    • Change to parent directory of soon-to-be project

      c:\cbevins\dev\node> git clone https://github.com/cbevins/wildfire-variant.git
      c:\cbevins\dev\node>cd wildfire-variant
      c:\cbevins\dev\node\wildfire-variant> npm init -y
      c:\cbevins\dev\node\wildfire-variant> code .
    • Create src folder and index.js ...

      c:\cbevins\dev\node\wildfire-variant> mkdir src
      c:\cbevins\dev\node\wildfire-variant> cd src
      c:\cbevins\dev\node\wildfire-variant\src> touch index.js
      c:\cbevins\dev\node\wildfire-variant\src> code .
    • Enable Eslint and Prettier extensions in VSCode

    • Update the package.json file with keywords, etc.

  • Install and Configure 'eslint'

    • From the project directory ...

      npm install eslint --save-dev
      npm install eslint-plugin-react --save-dev
      npx eslint --init

      or

      npm i -D eslint
      npm i -D eslint-plugin-react
      npx eslint --init
    • Create/edit .eslintrc.json ...

      {
        "extends": [
          "plugin:react/recommended",
          "standard"
        ],
      }
    • Create .eslintignore (and .prettierignore)...

      README.md
      
      dist
      
      node_modules
  • Install and configure prettier-eslint

  • From the project directory...

    npm install prettier-eslint --save-dev
    npm install prettier-eslint-cli --save-dev

    or

    npm i -D prettier-eslint
    npm i -D prettier-eslint-cli
    
  • Install and Configure Jest

    • From project folder ...

      npm i -D jest
      npm i -D eslint-plugin-jest
    • To enable import/export in Jest, create a .babelrc file ...

      {
        "env": {
          "test": {
            "presets": ["@babel/env"]
          }
        }
      }
  • Install and configure rollup

    • From project folder ...

      npm i -D rollup
      npm i -D rollup-plugin-node-resolve
      npm i -D rollup-plugin-terser
      npm i -D rollup-plugin-babel @babel/core @babel/preset-env @bable/preset-react
      npm i -D rimraf
    • Create a 'rollup.config.js' in project folder ...

        import { terser } from 'rollup-plugin-terser'
      
        const bundle = 'dist/variant'
        // const bundle = 'dist/foo'
      
        export default {
          input: 'src/index.js',
          output: [
            {
              file: `${bundle}.esm.js`,
              format: 'esm'
            },
            {
              file: `${bundle}.esm.min.js`,
              format: 'esm',
              plugins: [terser()]
            },
            {
              file: `${bundle}.cjs.js`,
              format: 'cjs'
            },
            {
              file: `${bundle}.cjs.min.js`,
              format: 'cjs',
              plugins: [terser()]
            }
          ]
        }
    • In package.json, add

      "type": "module",
      "scripts": {
          "prebuild": "rimraf dist",
          "build": "rollup -c",
      }
    • Create .babelrc in project folder ...

    {
      "presets": [
        ["@babel/env", {
          "modules": false,
          "targets": {
            "browsers": "> 0.25%, ie11, not op_mini, not dead",
            "node": 10
          }
        }],
        "@babel/react"
      ]
    }

    See Build a Modern JS Project - #6 Babel & React for configuring rollup for React and ReactDOM using external and globals properties.