repoir
v0.1.0
Published
If your repo needs a checkup, you should probably repoir it
Downloads
2
Readme
Repoir
Repoir = Repository report and repair
In the real world, developers are opinionated, forgetful, and tend to overthink basic file organization. Multiple this by x repositories and y developers and clouds of sadness rain down. Repoir is here to help. It's simple. Configure repoir. Run repoir to find issues. Run repoir --fix to fix issues. Then get back to coding something your future self will be proud of.
Repoir follows a plug-in architectue to allow you to re-use, create, and / or configure your own repository ruleset.
install
npm i -g repoir
usage
repoir
To fix issues.
repoir -f
repoir --fix
To get help with cli uage, run the following.
repoir --help
configuration
There are three main ways to configure repoir.
#. You can provide plugins which establish new rules. #. You can configure rules that are provided by plugins. #. You can extend the configuration.
plugins
Repoir is based entirely off plugins. Without plugins, repoir does nothing.
Plugins should follow the npm naming convention of repoir-plugin-{name}.
To enable new plugins, you can add them to the plugins array in the configuration file.
"plugins": [
"npm-scripts",
"package-json-order"
]
The interface to define your own plugin.
export const meta = {
description: "lorem ipsum"
}
export const schema = {
// schema for config options in .repoir.json
// json schema?
}
export function test (options) {
return new Promise((resolve, reject) => {
// return a resolved or rejected promise to indicate status
// somehow report messages
});
}
export function fix (options) {
return new Promise((resolve, reject) => {
});
}
rules
Plugins are configured via _rules. If you don't define a ruleset for a plugin to follow, it will follow its default set.
extend
Finally,
ruleset
Rulesets are used by repoir to configure how it scans a project.
To provide your own ruleset, pass in a file with -r or --ruleset or place a .repoir config file in your project's root.
plugins
write your own
dependencies
Dependencies deal with checking the state of modules which are needed for your repo.
- check to see if dependencies are out of date
- check to see if dependencies haven't been installed
- check to make sure dependencies like webpack, jest, babel are in devDependencies
lint
For lint checking we want to check the following things.
- does npm run lint exist
- if we run npm run lint, do we get a style report
- if npm run lint doesn't product a report, does npm run lint:out
- read the report, are there errors?
- ensure an .eslintrc file is present and matches a pre-defined one in the ruleset
package.json
Will clean up package.json if necessary.
organize
Will alphabetize sort the package.json file and all sub properties.
script checker
This is for checking to make sure some basic npm scripts are in package.json and that they work.
- build
- clean
- healthcheck
- lint
- test
- test:coverage
webpack
Support for ensuring webpack config is consistent