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.
npm install --save-dev @nuel/uniformly
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"
}
}
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
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 |
Generates TypeScript declaration files.
uniformly declare-types [-o lib/]
option | aliases | default | description |
---|---|---|---|
output | out, o | lib/ | where to put the declaration files |
No need to worry, we currently detect and apply sensible default Babel and ESLint configs for these libraries.
- ✅ React
- ✅ Vue
- ✅ TypeScript
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"
}
}