A highly-opinionated, zero-config CLI for consistent infra for Ben Ilegbodu's Typescript-based libraries.
npx @benmvp/cli create my-awesome-lib
Installs the latest version of @benmvp/cli
as a dev dependency and updates the package.json
as follows:
{
"name": "my-awesome-lib",
"scripts": {
"start": "benmvp start",
"test": "benmvp test",
"build": "benmvp build",
"integrate": "benmvp integrate"
}
}
NOTE: More fields within the
package.json
will be updated to set up the library for proper releasing.
Read the API docs for more on benmvp create
.
npm test
In your continuous integration (CI) environment, run npm test
(or yarn test
) to do a one-time pass of Typescript typings, ESLint linting, and Jest unit tests. This can also be run locally (i.e. for commit hooks).
Read the API docs for more on benmvp test
.
npm start
When developing, run npm start
(or yarn start
) which will validate Typescript typings, ESLint linting, and Jest unit tests as you develop and change code.
Read the API docs for more on benmvp start
.
npm run build
In your continuous integration (CI) environment, run npm run build
(or yarn build
) to generate transpiled versions of your code in ESM (ECMAScript module) and CJS (CommonJS), as well as TypeScript definition files.
Read the API docs for more on benmvp build
.
npm run integrate
In your continuous integration (CI) environment, run npm run integrate
(or yarn integrate
) to run additional integration tests for the library. The integration "project" will also be typed and linted. This can also be run locally (i.e. for commit hooks but is not recommended).
Read the API docs for more on benmvp integrate
.
@benmvp/cli
has two interfaces: a CLI and a Node API. View the full docs.
The CLI has been tested to work in Node 8+.
- TypeScript (type-checking)
- Babel (transpiling)
- Jest (testing & code coverage)
- React testing library (testing React components)
- ESLint (linting)
- Prettier (code formatting)
- Yargs (command line argument parsing)
Contributions are welcome! See Contributing Guidelines for more details.
We take the stability of this library very seriously. @benmvp/cli
follows the SemVer standard for versioning.
All updates must pass the CI build.
The library is available as open source under the terms of the MIT License.