Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
} >> "$GITHUB_OUTPUT"

- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
title: $(sed "s/\${TAG}/${{ github.ref_name }}/g" .github/RELEASE_TITLE.txt)
name: $(sed "s/\${TAG}/${{ github.ref_name }}/g" .github/RELEASE_TITLE.txt)
body: ${{ steps.generate_notes.outputs.FINAL_BODY }}
tag_name: ${{ github.ref_name }}
draft: false
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[![Run Tests](https://github.com/attogram/base/actions/workflows/ci.yml/badge.svg)](https://github.com/attogram/base/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/attogram/base?style=flat)](https://github.com/attogram/base/releases)
[![GitHub stars](https://img.shields.io/github/stars/attogram/base?style=flat)](https://github.com/attogram/base/stargazers)
[![GitHub watchers](https://img.shields.io/github/watchers/attogram/base?style=flat)](https://github.com/attogram/base/watchers)
[![Forks](https://img.shields.io/github/forks/attogram/base?style=flat)](https://github.com/attogram/base/forks)
[![Issues](https://img.shields.io/github/issues/attogram/base?style=flat)](https://github.com/attogram/base/issues)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/t/attogram/base?style=flat)](https://github.com/attogram/base/commits/main/)
[![License](https://img.shields.io/github/license/attogram/base?style=flat)](./LICENSE)

Welcome to [base](./docs/base.md).

Your starting point for new GitHub projects.
Expand Down
103 changes: 103 additions & 0 deletions docs/badges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Badges

Badges are a common way to display the status of your project in your `README.md` file. They can provide information about your build status, code coverage, version, license, and more. They serve as a quick visual indicator of the health and status of your project.

## Badge Sources

While [Shields.io](https://shields.io/) is very popular because it offers a huge variety of badges with a consistent style, many services provide their own free badges directly. Here are a few examples of common sources:

- **GitHub Actions:** As seen in the examples below, GitHub provides its own status badges for workflows. You can get the markdown for this directly from the "Actions" tab in your repository.

- **CI/CD Services:** Services like [Travis CI](https://travis-ci.org/), [CircleCI](https://circleci.com/), and others provide status badges that you can embed in your README.

- **Code Coverage Tools:** Services like [Codecov](https://codecov.io/) or [Coveralls](https://coveralls.io/) give you badges to show your test coverage percentage.

- **Package Registries:** If your project is a package, registries like [npm](https://www.npmjs.com/), [PyPI](https://pypi.org/), [RubyGems](https://rubygems.org/), etc., offer badges to show the latest version, number of downloads, and more.

[Shields.io](https://shields.io/) is a great one-stop-shop that can create badges for all of the services above and many more, all with a consistent style. It can also be used to create completely custom badges.

## Common Badge Categories

Here are some of the most common categories of badges you might see in a project's `README.md`.

### Build Status

These badges show the status of your continuous integration (CI) builds. This is one of the most important badges as it tells contributors whether the project is currently in a working state.

**GitHub Actions**

[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/attogram/base/ci.yml?branch=main)](https://github.com/attogram/base/actions/workflows/ci.yml)

```markdown
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/attogram/base/ci.yml?branch=main)](https://github.com/attogram/base/actions/workflows/ci.yml)
```

### Releases

These badges show the latest release version of your project.

**GitHub Release**

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/attogram/base)](https://github.com/attogram/base/releases)

```markdown
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/attogram/base)](https://github.com/attogram/base/releases)
```

### Social

These badges show statistics from social coding platforms like GitHub.

**GitHub Stars**

[![GitHub Repo stars](https://img.shields.io/github/stars/attogram/base?style=social)](https://github.com/attogram/base/stargazers)

```markdown
[![GitHub Repo stars](https://img.shields.io/github/stars/attogram/base?style=social)](https://github.com/attogram/base/stargazers)
```

**GitHub Forks**

[![GitHub forks](https://img.shields.io/github/forks/attogram/base?style=social)](https://github.com/attogram/base/network/members)

```markdown
[![GitHub forks](https://img.shields.io/github/forks/attogram/base?style=social)](https://github.com/attogram/base/network/members)
```

### License

It's a good practice to include a badge for your project's license.

**GitHub License**

[![GitHub](https://img.shields.io/github/license/attogram/base)](./LICENSE)

```markdown
[![GitHub](https://img.shields.io/github/license/attogram/base)](./LICENSE)
```

## How many badges is too many?

While badges are useful, having too many can clutter your `README.md` and make it difficult to read. A good rule of thumb is to include badges that are most relevant to your project and its contributors.

Consider these questions when deciding which badges to include:

- **Is it important for contributors to see this information at a glance?** (e.g., build status, license)
- **Does this badge provide a link to a useful resource?** (e.g., documentation, releases)
- **Does this badge add value to the project?** (e.g., code coverage, version)

If the answer to these questions is "yes," then the badge is probably worth including.

## Custom Badges

You can also create your own custom badges using Shields.io. This is useful for linking to things that don't have a pre-made badge.

For example, you could create a badge to link to your project's documentation:

[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](./docs/README.md)

```markdown
[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](./docs/README.md)
```

You can create your own badges by visiting the [Shields.io](https://shields.io/) website and using their badge creation tool.
82 changes: 82 additions & 0 deletions docs/prettier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Prettier

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.

This document provides instructions on how to install and run Prettier in your project.

## Installation

The recommended approach is to install Prettier locally as a development dependency.

### npm

```bash
npm install --save-dev --save-exact prettier
```

### yarn

```bash
yarn add --dev --exact prettier
```

### pnpm

```bash
pnpm add --save-dev --save-exact prettier
```

### bun

```bash
bun add --dev --exact prettier
```

After installing Prettier, you should create a configuration file to let editors and other tools know that you are using Prettier.

```bash
echo {} > .prettierrc
```

It is also useful to create a `.prettierignore` file to specify which files should not be formatted by Prettier.

```bash
echo "# Ignore artifacts:\nbuild\ncoverage" > .prettierignore
```

## Usage

Once Prettier is installed, you can run it from the command line to format your files.

### Format all files

To format all files in your project, run the following command:

```bash
npx prettier . --write
```

### Format specific files or directories

You can also format specific files or directories:

```bash
# Format all files in the 'app' directory
npx prettier app --write

# Format a single file
npx prettier app/components/Button.js --write

# Format all test files in a directory using a glob pattern
npx prettier "app/**/*.test.js" --write
```

### Check for formatting issues

In a Continuous Integration (CI) environment, you can use the `--check` flag to verify that all files are formatted correctly without actually modifying them. This is useful for enforcing a consistent code style.

```bash
npx prettier . --check
```

For more information, please refer to the official [Prettier documentation](https://prettier.io/docs/en/install.html).