Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakjdev committed Oct 25, 2023
1 parent 130fa65 commit a7ea864
Show file tree
Hide file tree
Showing 31 changed files with 380 additions and 158 deletions.
93 changes: 93 additions & 0 deletions .github/commit_convention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 📘 Commit and Branch Conventions

At `wapi.js`, we follow a strict set of conventions for commit messages and branch names to ensure that our repository stays organized, and our commit history remains crystal clear. Here's a guide on our conventions:

---

## 🚀 Conventional Commits

Conventional commits ensure our commit messages are clear and useful.

📋 **Benefits**:
- 📜 Automatic changelog generation
- 🔢 Simplified versioning
- 🧐 Improved readability of commit messages

### 📄 Commit Message Format

Each commit message should follow this format:

```
<type>(<scope>): <short summary>
<BLANK LINE>
<optional body>
<BLANK LINE>
<optional footer>
```

- **`<type>`**: Describes the purpose of the commit:
- 🆕 `feat`: Introduces a new feature
- 🐞 `fix`: Addresses a bug
- 📚 `docs`: Updates documentation
- 🎨 `style`: Code that relates to styling, not affecting logic
- 🔧 `refactor`: Refactoring existing code
- 🚀 `perf`: Improving performance
- 🧪 `test`: All about tests
- 🧽 `chore`: Maintenance tasks

- **`<scope>`**: (Optional) Specifies which part of the codebase is affected.

- **`<short summary>`**: A concise summary of the changes made.

### 📝 Examples:

1. Introducing a new feature:
```
feat(auth): implement social login
```

2. Addressing a bug:
```
fix(button): resolve alignment issue
```

---

## 🌲 Conventional Branching

A standardized naming system for branches helps everyone quickly understand a branch's purpose.

### 📄 Branch Naming Format

Branch names should adhere to:

```
<type>/<short-description>
```

- **`<type>`**: Purpose of the branch, common ones being:
- 🆕 `feature`: Developing a new feature.
- 🐞 `fix`: Addressing a bug.
- 🧽 `chore`: Regular maintenance tasks.
- 🔥 `hotfix`: Immediate fixes, often tied to production issues.
- 📚 `docs`: Documentation enhancements.

- **`<short-description>`**: A brief, kebab-cased (words separated by hyphens) description of the branch's objective.

### 📝 Examples:

1. Developing a new user dashboard:
```
feature/user-dashboard
```

2. Resolving a login issue:
```
fix/login-issue
```

---

🙌 Thanks for contributing to `wapi.js`! By adhering to these conventions, we're making our repository a better place. If you're new, welcome aboard, and if you've been here, thanks for sticking around!

---
5 changes: 5 additions & 0 deletions .github/label-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bug:
comment: |
Thanks for pointing out this bug!
We'll take a look and see what's going on.
If you can, please give us a step-by-step on how it happens and any other info that could help.
12 changes: 12 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: good-first-issue
color: ''
- name: level1-issue
color: ''
- name: level2-issue
color: ''
- name: level3-issue
color: ''
- name: feature
color: ''
- name: docs
color: ''
18 changes: 18 additions & 0 deletions .github/workflows/auto-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Auto Comment on New Issue Label
# This workflow is triggered when a label is added to an issue.
on:
issues:
types: [labeled]

jobs:
processLabelAction:
name: Process Label Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Process Label Action
uses: hramos/respond-to-issue-based-on-label@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: '.github/label-actions.yml'
4 changes: 2 additions & 2 deletions .github/workflows/staging.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/github-script@v5
with:
script: |
const { pullRequestData: data } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
Expand All @@ -57,7 +57,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: pnpm install

- name: Build the packages
run: pnpm build
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Changelog

on:
pull_request:
branches:
- master

jobs:
changelog:
runs-on: ubuntu-latest
# skip this workflow if no-changelog label has been added to the pull request
if: ${{ contains( github.event.pull_request.labels.*.name, 'no-changelog') != true }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check Changelog Updated
uses: awharn/check_changelog_action@v1
with:
header: '## Recent Changes'
file: 'CHANGELOG.md'
lerna: true
ignoreFiles: 'package.json|pnpm-lock.json|*.md'
Empty file added .github/workflows/labeler.yaml
Empty file.
File renamed without changes.
Empty file added .github/workflows/test.yaml
Empty file.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. "$(dirname "$0")/_/husky.sh"

# lint the commit as per the config defined in .commitlintrc.json
yarn commitlint --edit $1
pnpm commitlint --edit $1

# If not a merge commit, require commit to be signed off
if [ ! -e .git/MERGE_MSG ] && ! grep -q "^Signed-off-by: " "$1"; then
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if [ "$branch" = "refs/heads/master" ]; then
exit 1
fi

yarn lint-staged --quiet
pnpm lint-staged --quiet
Loading

0 comments on commit a7ea864

Please sign in to comment.