@raftlabs/raftstack 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.npm.md CHANGED
@@ -1,180 +1,37 @@
1
1
  # RaftStack
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@raftlabs/raftstack.svg)](https://www.npmjs.com/package/@raftlabs/raftstack)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
-
6
- A CLI tool for setting up Git hooks, commit conventions, and GitHub integration in your projects.
7
-
8
- RaftStack automates the setup of development best practices including:
9
- - **Git hooks** with Husky (pre-commit, commit-msg, pre-push)
10
- - **Commit conventions** with Commitlint and cz-git
11
- - **Code formatting** with lint-staged and Prettier
12
- - **Branch naming** validation
13
- - **GitHub workflows** for PR checks
14
- - **CODEOWNERS** for automatic reviewer assignment
3
+ CLI tool for setting up Git hooks, commit conventions, and GitHub integration.
15
4
 
16
5
  ## Installation
17
6
 
18
7
  ```bash
19
- # Using pnpm (recommended)
20
8
  pnpm dlx @raftlabs/raftstack init
21
-
22
- # Using npx
9
+ # or
23
10
  npx @raftlabs/raftstack init
24
-
25
- # Using yarn
26
- yarn dlx @raftlabs/raftstack init
27
-
28
- # Or install globally
29
- pnpm add -g @raftlabs/raftstack
30
- raftstack init
31
- ```
32
-
33
- ## Quick Start
34
-
35
- Run the interactive setup wizard in your project directory:
36
-
37
- ```bash
38
- raftstack init
39
11
  ```
40
12
 
41
- The wizard will:
42
- 1. Detect your project type (NX, Turborepo, pnpm workspace, or single package)
43
- 2. Detect your package manager (npm, pnpm, Yarn)
44
- 3. Configure AI code review tools (optional)
45
- 4. Set up CODEOWNERS for automatic PR reviewers
46
- 5. Generate all configuration files
13
+ ## Usage
47
14
 
48
- ## Commands
49
-
50
- ### `raftstack init`
51
-
52
- Interactive setup wizard that configures all tools.
15
+ Run the interactive setup wizard in your project:
53
16
 
54
17
  ```bash
55
18
  raftstack init
56
19
  ```
57
20
 
58
- ### `raftstack setup-protection`
59
-
60
- Configure GitHub branch protection rules via the GitHub API.
61
-
62
- ```bash
63
- raftstack setup-protection
64
- ```
65
-
66
- **Requirements:**
67
- - GitHub CLI (`gh`) installed and authenticated
68
- - Admin access to the repository
69
-
70
- ### `raftstack metrics`
71
-
72
- Analyze repository compliance with RaftStack conventions.
73
-
74
- ```bash
75
- raftstack metrics
76
- ```
77
-
78
- This command checks:
79
- - **Commit compliance** - Percentage of commits with task links
80
- - **Branch naming** - Percentage following naming conventions
81
- - **Overall compliance score** - Combined metrics
82
-
83
- ## What Gets Generated
84
-
85
- ### Git Hooks (via Husky)
86
-
87
- | Hook | Purpose |
88
- |------|---------|
89
- | `pre-commit` | Runs lint-staged to format and lint staged files |
90
- | `commit-msg` | Validates commit messages with Commitlint |
91
- | `pre-push` | Validates branch naming conventions |
92
-
93
- ### Configuration Files
94
-
95
- | File | Purpose |
96
- |------|---------|
97
- | `.husky/*` | Git hooks |
98
- | `commitlint.config.js` | Commit message validation rules |
99
- | `.czrc` + `cz.config.js` | Interactive commit wizard |
100
- | `.lintstagedrc.js` | Pre-commit file processing |
101
- | `.prettierrc` | Code formatting rules |
102
-
103
- ### GitHub Integration
104
-
105
- | File | Purpose |
106
- |------|---------|
107
- | `.github/PULL_REQUEST_TEMPLATE.md` | PR template with checklist |
108
- | `.github/workflows/pr-checks.yml` | CI workflow for PR validation |
109
- | `.github/CODEOWNERS` | Automatic reviewer assignment |
110
-
111
- ## Commit Convention
112
-
113
- RaftStack enforces [Conventional Commits](https://www.conventionalcommits.org/):
114
-
115
- ```
116
- <type>(<scope>): <subject>
117
- ```
118
-
119
- ### Commit Types
120
-
121
- | Type | Description |
122
- |------|-------------|
123
- | `feat` | New feature |
124
- | `fix` | Bug fix |
125
- | `docs` | Documentation changes |
126
- | `style` | Code style changes (formatting) |
127
- | `refactor` | Code refactoring |
128
- | `perf` | Performance improvements |
129
- | `test` | Adding or updating tests |
130
- | `build` | Build system changes |
131
- | `ci` | CI configuration changes |
132
- | `chore` | Other changes |
21
+ This will configure:
22
+ - Git hooks (pre-commit, commit-msg, pre-push)
23
+ - Commit message validation
24
+ - Code formatting with Prettier
25
+ - Branch naming validation
26
+ - GitHub PR workflows and CODEOWNERS
133
27
 
134
- ### Example Commits
28
+ ## Other Commands
135
29
 
136
30
  ```bash
137
- feat(auth): add social login support
138
- fix(api): handle null response from server
139
- docs(readme): update installation instructions
31
+ raftstack setup-protection # Configure GitHub branch protection
32
+ raftstack metrics # Check repository compliance
140
33
  ```
141
34
 
142
- ## Branch Naming Convention
143
-
144
- RaftStack validates branch names on push:
145
-
146
- | Pattern | Example |
147
- |---------|---------|
148
- | `feature/*` | `feature/user-authentication` |
149
- | `fix/*` | `fix/login-validation` |
150
- | `hotfix/*` | `hotfix/security-patch` |
151
- | `bugfix/*` | `bugfix/form-submission` |
152
- | `release/*` | `release/v1.2.0` |
153
- | `chore/*` | `chore/update-dependencies` |
154
- | `docs/*` | `docs/api-reference` |
155
- | `refactor/*` | `refactor/auth-module` |
156
- | `test/*` | `test/user-service` |
157
-
158
- Protected branches: `main`, `master`, `develop`, `staging`, `production`
159
-
160
- ## Requirements
161
-
162
- - Node.js >= 18
163
- - Git repository initialized
164
- - Package manager: npm, pnpm, or yarn
165
-
166
35
  ## Documentation
167
36
 
168
- For complete documentation including:
169
- - Getting Started workflow
170
- - Troubleshooting
171
- - AI Code Review setup
172
- - Claude Code Skills
173
- - Organization rollout guide
174
- - Contributing guidelines
175
-
176
- Visit the [GitHub repository](https://github.com/Raft-Labs/raftstack).
177
-
178
- ## License
179
-
180
- MIT
37
+ Full documentation: [github.com/Raft-Labs/raftstack](https://github.com/Raft-Labs/raftstack)