A set of command line tools to measure and report developer experience metrics.
Before you begin, ensure you have installed Node.js and pnpm on your system.
To start using this CLI TypeScript starter, follow these steps:
pnpm install
pnpm start prs
Create a .env
file in the root directory and configure your environment variables as needed.
- In development mode, use
pnpm start [command name]
to run any command. This utilizests-node
for a seamless development experience. - In production, execute the CLI application directly with
dx [command name]
to run the desired command from the built project (the name of command should be provided inpackage.json
inbin
).
prs
: Prints information describing a Github user's pull requests.
All commands are located in the src/commands/
folder. This organization makes it easy to find and modify commands or
add new ones as needed.
This project comes with several predefined scripts to help with development:
pnpm build
- Build the project usingtsup
.pnpm build:watch
- Automatically rebuild the project on file changes.pnpm commit
- runcommitizen
tool for helping with commit messages.pnpm commitlint
- lint commit messages.pnpm compile
- Compile TypeScript files usingtsc
.pnpm clean
- Remove compiled code from thedist/
directory.pnpm format
- Check files for code style issues using Prettier.pnpm format:fix
- Automatically fix code formatting issues with Prettier.pnpm lint
- Check code for style issues with ESLint.pnpm lint:fix
- Automatically fix code style issues with ESLint.pnpm start [command]
- Run the CLI application usingts-node
.pnpm start:node [command]
- Run the CLI application from thedist/
directory.pnpm test
- Run unit tests.pnpm test:watch
- Run tests and watch for file changes.
This project utilizes semantic-release
to automate version management and the NPM publishing
process. Semantic-release
automates the workflow of releasing new versions, including the generation of detailed
release notes based on commit messages that follow the conventional commit format.
The publishing process is triggered automatically when changes are merged into the main branch. Here's how it works:
- Automated Versioning: Based on the commit messages,
semantic-release
determines the type of version change ( major, minor, or patch) and updates the version accordingly. - Release Notes: It then generates comprehensive release notes detailing new features, bug fixes, and any breaking changes, enhancing clarity and communication with users.
- NPM Publishing: Finally,
semantic-release
publishes the new version to the NPM registry and creates a GitHub release with the generated notes.
To ensure a smooth semantic-release
process:
- Merge feature or fix branches into the main branch following thorough review and testing.
- Use conventional commit messages to help
semantic-release
accurately determine version changes and generate meaningful release notes. - Configure an NPM access token as a GitHub secret under the name
NPM_TOKEN
for authentication during the publication process.
By integrating semantic-release
, this project streamlines its release process, ensuring that versions are managed
efficiently and that users are well-informed of each update through automatically generated release notes.
To contribute to this project or customize it for your needs, consider the following guidelines:
- Code Styling: Follow the predefined code style, using Prettier for formatting and ESLint for linting, to ensure consistency.
- Commit Messages: We use
commitizen
andcommitlint
to ensure our commit messages are consistent and follow the conventional commit format, recommended by@commitlint/config-conventional
. To make a commit, you can runpnpm commit
, which will guide you through creating a conventional commit message. - Testing: Write unit tests for new features or bug fixes using Jest. Make sure to run tests before pushing any changes.
- Environment Variables: Use the
.env
file for local development. For production, ensure you configure the environment variables in your deployment environment. - Husky Git Hooks: This project utilizes Husky to automate linting, formatting, and commit message verification via
git hooks. This ensures that code commits meet our quality and style standards without manual checks. The hooks set
up include pre-commit hooks for running ESLint and Prettier, and commit-msg hooks for validating commit messages
with
commitlint
.
Contributions are welcome! If you'd like to improve this CLI , please follow the standard fork-and-pull request workflow. Here are a few guidelines to keep in mind:
- Make sure your code adheres to the project's coding standards, including using Prettier for code formatting and ESLint for linting.
- Follow the conventional commit format for your commit messages. This project uses
commitizen
andcommitlint
with the@commitlint/config-conventional
configuration, enforced by Husky git hooks. - Include tests for new features or bug fixes when applicable.
- Ensure your changes are properly formatted and linted before submitting a pull request.
By adhering to these guidelines, you help maintain the quality and consistency of the project, making it easier for others to contribute and for users to understand and utilize the project effectively.
To add a new command,
- Create a new file within
src/commands
named as the command you seek to add - Add a reference to this file within the
commands
constant insrc/commands/index.ts
This project is licensed under the MIT License - see the LICENSE file for details.
Dustin Pauze
- GitHub: @dustinlessard-wf
This project is build on CLI TypeScript Starter