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

@mparulski/es-project-maker

v0.31.1

Published

Common scripts for projects

Downloads

174

Readme

es-project-maker

Usage

We don't really plan on documenting or testing it well because it's specific to our needs.

How to run

npx @mparulski/es-project-maker

eg.

npx @mparulski/es-project-maker --babelConfig=<secial_babel_options_config.js> --verbose

Run @mparulski/es-project-maker with passed babel options in config, disable typescript and run verbose mode

args

| arg | required | default | desc | |---------------------|----------|---------|--------------------------------------------------------------------------------------------------------------------------| | --addTasks | No | false | add tasks to package.json | | --babelConfig | No | | path to project config options (described below) | | --noEslint | No | false | if it is set then do not generate the configuration file and do not install dependencies | | --eslintConfig | No | | path to project config options (described below) | | --noPrettier | No | false | if it is set then do not generate the configuration file and do not install dependencies | | --prettierConfig | No | | path to project config options (described below) | | --noReact | No | false | if it is set then do not generate the configuration file and do not install dependencies | | --noTests | No | false | if it is set then do not generate the configuration file and do not install dependencies for jest, testing-library, etc. | | --jestConfig | No | | path to project config options (described below) | | --typescriptConfig | No | | path to project config options (described below) | | --noWebpack | No | false | if it is set then do not generate the configuration file and do not install dependencies | | --webpackDevConfig | No | | path to webpack dev config | | --webpackProdConfig | No | | path to webpack prod config | | --noDeps | No | false | do not install dependencies | | --verbose | No | false | would really be useful to enable end users to diagnose their own issues |

project configs

  • For args:
    • --babelConfig
    • --eslintConfig
    • --prettierConfig
    • --typescriptConfig

config's file is a function that arg (named 'config') is config calculated by es-project-maker with std settings. It must return config:

    /*
     * Values passed in the body of callback configuration will extend, delete or overwrite default values
     * 
     * babelConfig
     *
     * Configuration body eg.
     * "presets": [], it will be concatenated to the base presets
     * "plugins": [], it will be concatenated to the base plugins
     * 
     * eslintConfig (How to configure in IntelliJ: https://www.jetbrains.com/help/idea/eslint.html)
     * 
     * prettierConfig (How to configure in IntelliJ: https://www.jetbrains.com/help/idea/prettier.html#ws_prettier_install)
     * if that key exists, then:  
     * - install dependencies and add dependencies to package.json/package-lock.json
     * - enables New JSX Transform in babel configuration
     * - enables ReactJS/JSX options in prettier configuration
     *
     * typescriptConfig
     */

module.exports = (config) => { return config }
  • For arg:

    • --webpackConfig
  • If react is enabled:

    • install dependencies and add dependencies to package.json/package-lock.json
    • enable rules for eslint
    • enable New JSX Transform in babel configuration
    • enable ReactJS/JSX options in prettier configuration

webpack configuration example

const path = require("path")
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = projectRootDir => {
    "entry": {index: path.resolve(__dirname, "../src/js/appInit.js")},
    "output": {
        "path": path.resolve(__dirname, "../src/js-dist"),
        "filename": "app.bundle.js"
    },
    "module": {
        "rules": [            
            {
                "test": /\.(png|svg|jpg|jpeg|gif|woff|eot|ttf)$/i,
                "type": 'asset/inline',
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: path.resolve(__dirname, "../src/templates/index.html")
        })
      ],
    "resolve": {
        "extensions": [".js", ".jsx"]
    }
}

webpack local build

Run npm script "start"

webpack production build

Run npm script "build"

webpack enableBundleAnalyzer

Ypu can run webpack-bundle-analyzer via command npm webpack:build --enableBundleAnalyzer

Inspired

This is inspired by react-scripts and kcd-scripts