0.31.1 • Published 2 years ago

@mparulski/es-project-maker v0.31.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

argrequireddefaultdesc
--addTasksNofalseadd tasks to package.json
--babelConfigNopath to project config options (described below)
--noEslintNofalseif it is set then do not generate the configuration file and do not install dependencies
--eslintConfigNopath to project config options (described below)
--noPrettierNofalseif it is set then do not generate the configuration file and do not install dependencies
--prettierConfigNopath to project config options (described below)
--noReactNofalseif it is set then do not generate the configuration file and do not install dependencies
--noTestsNofalseif it is set then do not generate the configuration file and do not install dependencies for jest, testing-library, etc.
--jestConfigNopath to project config options (described below)
--typescriptConfigNopath to project config options (described below)
--noWebpackNofalseif it is set then do not generate the configuration file and do not install dependencies
--webpackDevConfigNopath to webpack dev config
--webpackProdConfigNopath to webpack prod config
--noDepsNofalsedo not install dependencies
--verboseNofalsewould 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

0.30.0

2 years ago

0.31.1

2 years ago

0.28.0

2 years ago

0.27.0

3 years ago

0.25.0

3 years ago

0.26.1

3 years ago

0.23.0

3 years ago

0.24.0

3 years ago

0.20.0

3 years ago

0.21.1

3 years ago

0.21.0

3 years ago

0.22.3

3 years ago

0.22.2

3 years ago

0.22.1

3 years ago

0.22.0

3 years ago

0.19.0

3 years ago

0.19.1

3 years ago

0.19.2

3 years ago

0.19.3

3 years ago

0.18.1

3 years ago

0.18.0

3 years ago

0.17.2

3 years ago

0.17.0

3 years ago

0.17.1

3 years ago

0.16.0

3 years ago

0.15.0

3 years ago

0.14.2

3 years ago

0.13.0

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.11.0

3 years ago

0.12.0

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.6.5

3 years ago

0.6.3

3 years ago

0.5.4

3 years ago

0.6.2

3 years ago

0.5.3

3 years ago

0.6.4

3 years ago

0.6.1

3 years ago

0.5.2

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1-alpha.19

3 years ago

0.0.1-alpha.18

3 years ago

0.0.1-alpha.17

3 years ago

0.0.1-alpha.14

3 years ago

0.0.1-alpha.16

3 years ago

0.0.1-alpha.15

3 years ago

0.0.1-alpha.12

3 years ago

0.0.1-alpha.11

3 years ago

0.0.1-alpha.13

3 years ago

0.0.1-alpha.10

3 years ago

0.0.1-alpha.9

3 years ago

0.0.1-alpha.8

3 years ago

0.0.1-alpha.7

3 years ago

0.0.1-alpha.6

3 years ago

0.0.1-alpha.5

3 years ago

0.0.1-alpha.4

3 years ago

0.0.1-alpha.2

3 years ago

0.0.1-alpha.3

3 years ago

0.0.1-alpha.1

3 years ago