Skip to content

Commit a419adb

Browse files
docs(workflow): add Git Flow and npm version requirements (#6)
- Add Git Flow branching strategy (develop/master) - Document npm version command before push - Add prepublishOnly hook recommendation - Update workflow with proper branch management - Clear warnings about PR targeting Co-authored-by: Reda Channa <r.channa@ciscod.com>
1 parent b11b921 commit a419adb

1 file changed

Lines changed: 70 additions & 3 deletions

File tree

.github/copilot-instructions.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,44 @@ Move to archive:
316316
docs/tasks/archive/by-release/v2.0.0/MODULE-123-add-refresh-token.md
317317
```
318318

319+
### Git Flow - Module Specific
320+
321+
**Branch Structure:**
322+
- `master` - Production releases only
323+
- `develop` - Active development
324+
- `feature/MODULE-*` - New features
325+
- `bugfix/MODULE-*` - Bug fixes
326+
327+
**Workflow:**
328+
```bash
329+
# 1. Stacca da develop
330+
git checkout develop
331+
git pull origin develop
332+
git checkout -b feature/MODULE-123-add-refresh-token
333+
334+
# 2. Sviluppo
335+
# ... implementa, testa, documenta ...
336+
337+
# 3. Bump version e push
338+
npm version minor
339+
git push origin feature/MODULE-123-add-refresh-token --tags
340+
341+
# 4. PR verso develop
342+
gh pr create --base develop
343+
344+
# 5. Dopo merge in develop, per release:
345+
git checkout master
346+
git merge develop
347+
git push origin master --tags
348+
npm publish
349+
```
350+
351+
**⚠️ IMPORTANTE:**
352+
- ✅ Feature branch da `develop`
353+
- ✅ PR verso `develop`
354+
-`master` solo per release
355+
- ❌ MAI PR dirette a `master`
356+
319357
### Development Workflow
320358

321359
**Simple changes** (bug fix, small improvements):
@@ -379,6 +417,22 @@ docs/tasks/archive/by-release/v2.0.0/MODULE-123-add-refresh-token.md
379417
- Token expiration validation
380418
```
381419

420+
### Version Bump Command
421+
**ALWAYS run before pushing:**
422+
```bash
423+
npm version patch # Bug fixes (0.0.x)
424+
npm version minor # New features (0.x.0)
425+
npm version major # Breaking changes (x.0.0)
426+
427+
# This automatically:
428+
# - Updates package.json version
429+
# - Creates git commit "vX.X.X"
430+
# - Creates git tag
431+
432+
# Then push:
433+
git push && git push --tags
434+
```
435+
382436
---
383437

384438
## 🚫 Restrictions - Require Approval
@@ -413,18 +467,31 @@ Before publishing:
413467
- [ ] Breaking changes highlighted
414468
- [ ] Integration tested with sample app
415469

470+
### Pre-Publish Hook (Recommended)
471+
472+
Aggiungi al `package.json` per bloccare pubblicazioni con errori:
473+
474+
```json
475+
"scripts": {
476+
"prepublishOnly": "npm run verify && npm run test:cov"
477+
}
478+
```
479+
480+
Questo esegue automaticamente tutti i controlli prima di `npm publish` e blocca se qualcosa fallisce.
481+
416482
---
417483

418484
## 🔄 Development Workflow
419485

420486
### Working on Module:
421487
1. Clone module repo
422-
2. Create branch: `feature/TASK-123-description`
488+
2. Create branch: `feature/MODULE-123-description`
423489
3. Implement with tests
424490
4. Verify checklist
425491
5. Update CHANGELOG
426-
6. Bump version in package.json
427-
7. Create PR
492+
6. **Bump version**: `npm version patch` (or `minor`/`major`)
493+
7. Push: `git push && git push --tags`
494+
8. Create PR
428495

429496
### Testing in App:
430497
```bash

0 commit comments

Comments
 (0)