3.0.4 • Published 4 years ago

@nuel/uniformly v3.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

🥋 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]
optionaliasesdefaultdescription
sourcesrc, in, isrc/the directory to transpile
outputout, olib/where to put the transpiled files
targettcurrentthe environment to target
corejscjs3the version of core-js Babel should use

declare-types

Generates TypeScript declaration files.

uniformly declare-types [-o lib/]
optionaliasesdefaultdescription
outputout, olib/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"
    }
}