Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Latest commit

 

History

History
83 lines (69 loc) · 2.43 KB

File metadata and controls

83 lines (69 loc) · 2.43 KB

🥋 uniformly

Uniformly exists to remove all the setup time required when getting new projects up and running. Inspired by Create React App, it provides an opinionated Babel, Jest, Prettier and ESLint configuration so you can just get started with writing code.

Installing

npm install --save-dev @nuel/uniformly

How do I use it?

Just update your package.json file with some scripts:

{
    "scripts": {
        "build": "uniformly build",
        "postbuild": "uniformly declare-types",
        "test": "uniformly test",
        "tidyup": "uniformly tidyup",
        "lint": "uniformly lint"
    }
}

Options

We'll add full documentation for options here soon™, for now you can get a list of available options using the CLI.

npx uniformly --help        # lists commands
npx uniformly build --help  # lists options for the build command

build

Transpiles the project.

uniformly build [-i src/] [-o lib/] [-t "current"] [-cjs 3]
option aliases default description
source src, in, i src/ the directory to transpile
output out, o lib/ where to put the transpiled files
target t current the environment to target
corejs cjs 3 the version of core-js Babel should use

declare-types

Generates TypeScript declaration files.

uniformly declare-types [-o lib/]
option aliases default description
output out, o lib/ where to put the declaration files

But I'm using a library that needs custom Babel configs...

No need to worry, we currently detect and apply sensible default Babel and ESLint configs for these libraries.

  • ✅ React
  • ✅ Vue
  • ✅ TypeScript

Using custom configs

If you need more control over what's happening, create a .uniformlyrc file within your project and you'll be able to override the default configuration for as many of the tools as you'd like.

{
    "babel": {
        "config": "/path/to/babel.config.js"
    },
    "jest": {
        "roots": [ "custom/jest/root" ],
        "config": "/path/to/jest.config.js",
        "setupFiles": ["<rootDir>/setupTests.js"]
    },
    "prettier": {
        "config": "/path/to/prettier.config.js"
    },
    "eslint": {
        "config": "/path/to/.eslintrc"
    }
}