Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4278fc9
chore: standardize package workflows and ci/cd configuration
Zaiidmo Mar 3, 2026
1f1f0fc
ops: added sonarqube_mcp-instructions
Zaiidmo Mar 3, 2026
abd24dd
chore: standardize npm scripts (lint, format, typecheck, test, build,…
Zaiidmo Mar 3, 2026
60174d4
chore: Standardize ESLint and Prettier configs with best practices
Zaiidmo Mar 3, 2026
5849509
chore: added comprehensive changesets for release automation
Zaiidmo Mar 3, 2026
242268e
docs: add standardized instruction files structure
Zaiidmo Mar 3, 2026
32fbed8
refactor: move instruction files to .github/instructions/
Zaiidmo Mar 3, 2026
01c6680
Merge branch 'develop' of github.com:CISCODE-MA/AuthKit-UI into develop
Zaiidmo Mar 4, 2026
21e78f1
ops: UPDATED publish workflow and dependabot PR limits
Zaiidmo Mar 12, 2026
6afb8bc
ops (ci): standardize publish validation and dependabot across all pa…
Zaiidmo Mar 30, 2026
47bb5fb
security: added CODEOWNER file for branches security
Zaiidmo Mar 30, 2026
a0ec3aa
ops: updated relese check workflow#
Zaiidmo Mar 31, 2026
5bcecc4
ci: update release check workflow
Zaiidmo Apr 6, 2026
74328f8
ops: updated release check jobs ]
Zaiidmo Apr 7, 2026
c8e5d3c
feat(auth): add dynamic signup fields and custom endpoints
SAAD-MOUMOU Apr 14, 2026
b9e29d8
refactor(ui): cleanup imports and formatting in auth pages
SAAD-MOUMOU Apr 14, 2026
fad2355
fix(auth): remove accessToken from bootstrap useEffect deps to preven…
SAAD-MOUMOU Apr 16, 2026
12563c4
fix: resolve merge conflicts with develop (scripts + vitest versions)
SAAD-MOUMOU Apr 17, 2026
f4f745c
fix: resolve lint errors, test failures and add eslint + prettier dev…
SAAD-MOUMOU Apr 17, 2026
0d0fb37
chore: bump version to 1.0.15
SAAD-MOUMOU Apr 17, 2026
2e96948
test: enhance coverage for AuthKit-UI + fix typecheck and test:cov sc…
SAAD-MOUMOU Apr 20, 2026
b7293e7
fix: replace deprecated JSX.Element with React.ReactElement in AuthPr…
SAAD-MOUMOU Apr 20, 2026
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
11 changes: 11 additions & 0 deletions .changeset/authkit_ui_71368.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@ciscode/ui-authentication-kit": minor
---

## Summary
Added SonarQube MCP integration instructions for code quality analysis and automated quality gates

## Changes
- Updated package configuration and workflows
- Enhanced code quality and automation tooling
- Improved CI/CD integration and monitoring capabilities
Comment on lines +5 to +11
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changeset describes only SonarQube/CI tooling, but this PR also adds consumer-facing API changes (e.g., new AuthConfigProps fields and a new useCanAny hook). Please update the changeset to reflect the actual public-facing changes so release notes are accurate.

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @CISCODE-MA/devops
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 1
groups:
npm-dependencies:
patterns:
- "*"
assignees:
- CISCODE-MA/cloud-devops
labels:
- "dependencies"
- "npm"
commit-message:
prefix: "chore(deps)"
include: "scope"
rebase-strategy: auto
273 changes: 273 additions & 0 deletions .github/instructions/bugfix.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
# Bugfix Instructions - UI Kit Module

> **Last Updated**: February 2026

---

## 🔍 Bug Investigation Process

### Phase 1: Reproduce

**Before writing any code:**

1. **Understand the issue** - Read bug report carefully
2. **Reproduce locally** - Create minimal reproduction
3. **Verify it's a bug** - Not expected behavior
4. **Check browser compatibility** - Test across browsers

**Create failing test FIRST:**

```typescript
describe('Bug: Button not disabled when loading', () => {
it('should disable button during loading', () => {
render(<Button isLoading>Click</Button>);

// This SHOULD pass but currently FAILS
expect(screen.getByRole('button')).toBeDisabled();
});
});
```

### Phase 2: Identify Root Cause

**Investigation tools:**

- **React DevTools** - Inspect component tree
- **Console logs** - Debug state changes
- **Debugger** - Breakpoints in code
- **Browser DevTools** - Check DOM/styles

```typescript
// Debug component props/state
useEffect(() => {
console.log('Props changed:', props);
}, [props]);
```

### Phase 3: Understand Impact

**Critical questions:**

- Which browsers affected?
- Does it break accessibility?
- Is there a workaround?
- Does it affect other components?

---

## 🐛 Common Bug Categories

### 1. State Management Issues

| Bug Type | Symptoms | Solution |
| --------------------- | ---------------------- | --------------------------- |
| **Stale closure** | Old values in callback | Update dependencies |
| **Infinite loop** | Component re-renders | Fix useEffect dependencies |
| **Lost state** | State resets unexpectedly| Check component key |

**Example fix:**

```typescript
// ❌ BUG - Stale closure
const [count, setCount] = useState(0);

useEffect(() => {
const timer = setInterval(() => {
setCount(count + 1); // ❌ Always uses initial count
}, 1000);
return () => clearInterval(timer);
}, []); // Missing count dependency

// ✅ FIX - Functional update
useEffect(() => {
const timer = setInterval(() => {
setCount(prev => prev + 1); // ✅ Uses current count
}, 1000);
return () => clearInterval(timer);
}, []);
```

### 2. useEffect Issues

| Bug Type | Symptoms | Solution |
| --------------------- | --------------------- | --------------------------- |
| **Memory leak** | Performance degrades | Add cleanup function |
| **Missing cleanup** | Side effects persist | Return cleanup |
| **Wrong dependencies**| Unexpected behavior | Fix dependency array |

**Example fix:**

```typescript
// ❌ BUG - No cleanup
useEffect(() => {
const subscription = api.subscribe(handleData);
}, []);

// ✅ FIX - Cleanup on unmount
useEffect(() => {
const subscription = api.subscribe(handleData);
return () => subscription.unsubscribe();
}, []);
```

### 3. Event Handler Issues

| Bug Type | Symptoms | Solution |
| --------------------- | --------------------- | --------------------------- |
| **Handler not called**| Click doesn't work | Check event binding |
| **Multiple calls** | Handler fires twice | Remove duplicate listeners |
| **Wrong event** | Unexpected behavior | Use correct event type |

**Example fix:**

```typescript
// ❌ BUG - Handler called immediately
<button onClick={handleClick()}> // ❌ Calls on render

// ✅ FIX - Pass function reference
<button onClick={handleClick}> // ✅ Calls on click
<button onClick={() => handleClick(arg)}> // ✅ With arguments
```

### 4. Rendering Issues

| Bug Type | Symptoms | Solution |
| --------------------- | --------------------- | --------------------------- |
| **Conditional render**| Component disappears | Fix condition logic |
| **Key prop** | Wrong items update | Use stable unique keys |
| **Forced re-render** | Performance issues | Memoize expensive calcs |

**Example fix:**

```typescript
// ❌ BUG - Index as key
{items.map((item, index) => (
<div key={index}>{item.name}</div>
))}

// ✅ FIX - Unique stable key
{items.map(item => (
<div key={item.id}>{item.name}</div>
))}
```

### 5. Accessibility Bugs

| Bug Type | Symptoms | Solution |
| --------------------- | --------------------- | --------------------------- |
| **Missing ARIA** | Screen reader issues | Add ARIA attributes |
| **No keyboard nav** | Can't use keyboard | Add keyboard handlers |
| **Poor contrast** | Hard to read | Fix colors |

**Example fix:**

```typescript
// ❌ BUG - Div as button (not accessible)
<div onClick={handleClick}>
Submit
</div>

// ✅ FIX - Proper button element
<button onClick={handleClick} aria-label="Submit form">
Submit
</button>
```

---

## 🔧 Fix Implementation Process

### 1. Write Failing Test

```typescript
it('should fix the bug', async () => {
render(<Component />);

await userEvent.click(screen.getByRole('button'));

expect(screen.getByText(/expected/i)).toBeInTheDocument();
});
```

### 2. Implement Fix

```typescript
// Fix the component
export function Component() {
// Corrected implementation
return <div>Fixed!</div>;
}
```

### 3. Verify Test Passes

```bash
npm test -- Component.test.tsx
```

### 4. Test in Browser

```bash
npm run dev
# Manually test the fix
```

### 5. Update Documentation

```typescript
/**
* Component that was buggy
*
* @fixed v1.2.3 - Fixed click handler issue
*/
export function Component(props: Props): JSX.Element
```

---

## ⚠️ Common Gotchas

### 1. Prop Mutation

```typescript
// ❌ Bug - Mutating props
const sortedItems = props.items.sort(); // Mutates!

// ✅ Fix - Create copy
const sortedItems = [...props.items].sort();
```

### 2. Incorrect Comparison

```typescript
// ❌ Bug - Object comparison
if (user === prevUser) { } // Always false (different references)

// ✅ Fix - Compare values
if (user.id === prevUser.id) { }
```

### 3. Missing Null Checks

```typescript
// ❌ Bug - No null check
return user.profile.name; // Crashes if profile is null

// ✅ Fix - Optional chaining
return user?.profile?.name ?? 'Unknown';
```

---

## 📋 Bugfix Checklist

- [ ] Bug reproduced in browser
- [ ] Failing test created
- [ ] Root cause identified
- [ ] Fix implemented
- [ ] All tests pass
- [ ] Manually tested in browser
- [ ] Accessibility verified
- [ ] Documentation updated
- [ ] CHANGELOG updated
- [ ] No regression
Loading
Loading