Skip to content
Closed
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
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: '🐛 Bug report'
description: Report something that isn’t working
title: '[Bug]: '
labels: ['bug']
body:
- type: input
id: version
attributes:
label: Package version
description: What version are you using?
placeholder: 'e.g. 1.2.3'
validations:
required: true

- type: textarea
id: what_happened
attributes:
label: What happened?
description: Describe the bug clearly.
placeholder: 'Steps, logs, screenshots...'
validations:
required: true

- type: textarea
id: expected
attributes:
label: What did you expect?
validations:
required: true

- type: textarea
id: repro
attributes:
label: Reproduction steps
placeholder: |
1.
2.
3.
validations:
required: true

- type: textarea
id: env
attributes:
label: Environment
placeholder: |
Node:
NestJS:
OS:
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: '✨ Feature request'
description: Suggest an improvement or a new feature
title: '[Feature]: '
labels: ['enhancement']
body:
- type: textarea
id: problem
attributes:
label: Problem statement
description: What problem are you trying to solve?
validations:
required: true

- type: textarea
id: proposal
attributes:
label: Proposed solution
description: What do you want to happen?
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Other approaches you considered.
validations:
required: false

- type: textarea
id: context
attributes:
label: Additional context
description: Links, screenshots, examples.
validations:
required: false
180 changes: 180 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# Copilot Instructions - @ciscode/ui-translate-kit

> **Purpose**: Development guidelines for @ciscode/ui-translate-kit - centralized i18n provider and translation utilities for React apps.

---

## 🎯 Package Overview

**Package**: `@ciscode/ui-translate-kit`
**Type**: React Frontend i18n Library
**Purpose**: Centralized internationalization and translation management for React apps

### This Package Provides:

- `I18nProvider` - React context provider for i18n
- `useT` - Hook for accessing translation function
- Translation registration utilities
- Language selection components
- Type-safe translation keys
- RTL/LTR language support
- Multiple language management

---

## 🏗️ Project Structure

```
src/
├── I18nProvider.tsx # Main context provider
├── i18nSingleton.ts # Singleton instance
├── LanguageSelectedLang.tsx # Language selection component
├── registerTranslations.ts # Translation registration
├── useT.ts # Translation hook
└── index.ts # Public exports
```

---

## 📝 Naming Conventions

**Components**: `PascalCase.tsx`

- `I18nProvider.tsx`
- `LanguageSelectedLang.tsx`

**Hooks**: `camelCase.ts` with `use` prefix

- `useT.ts`

**Functions**: `camelCase.ts`

- `registerTranslations.ts`

**Utilities**: `camelCase.ts`

- `i18nSingleton.ts`

---

## 🧪 Testing Standards

### Coverage Target: 80%+

**Unit Tests:**

- ✅ Translation hook functionality
- ✅ Language switching
- ✅ Translation loading
- ✅ Context providers

**Integration Tests:**

- ✅ End-to-end translation flow
- ✅ Language persistence
- ✅ Multi-language switching

---

## 📚 Documentation

### JSDoc Required For:

- All exported components
- All exported hooks
- All exported functions
- All public utilities

### Example:

```typescript
/**
* Hook to access the translation function
* @returns Translation function (key: string) => string
*/
export function useT(): (key: string) => string;
```

---

## 🎨 Code Style

- ESLint with TypeScript support
- Prettier formatting
- TypeScript strict mode
- Functional components only
- Pure functions for translation logic

---

## 🔄 Development Workflow

### Branch Naming:

```bash
feature/TC-123-add-language
bugfix/TC-456-fix-translation
refactor/TC-789-improve-performance
```

### Before Publishing:

- [ ] All tests passing
- [ ] Coverage >= 80%
- [ ] ESLint checks pass
- [ ] TypeScript strict mode passes
- [ ] All public APIs documented
- [ ] Changeset created

---

## 📦 Versioning

**MAJOR** (x.0.0): Breaking API changes
**MINOR** (0.x.0): New features (backward compatible)
**PATCH** (0.0.x): Bug fixes

Always create a changeset using `npm run changeset`.

---

## 🔐 Security

- Never expose translation keys with sensitive data
- Validate language codes
- Sanitize user-provided strings in translations
- No eval() or dynamic code execution

---

## 🚫 Restrictions

**NEVER without approval:**

- Breaking changes to translation function signatures
- Removing language support
- Changing storage mechanism

**CAN do autonomously:**

- Adding new languages
- Bug fixes
- Performance improvements
- Documentation updates

---

## 💬 Communication

- Brief and direct
- This package affects all @ciscode/\* apps
- Coordinate language changes with design team
- Flag breaking changes immediately

---

---

_Last Updated: March 3, 2026_
_Version: 1.0.0_
_Package\*\*: @ciscode/ui-translate-kit_
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
# npm dependencies
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
day: 'monday'
time: '03:00'
open-pull-requests-limit: 5
rebase-strategy: 'auto'

# GitHub Actions
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'sunday'
time: '03:00'
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Summary

- What does this PR change?

## Why

- Why is this change needed?

## Checklist

- [ ] Added/updated tests (if behavior changed)
- [ ] `npm run lint` passes
- [ ] `npm run typecheck` passes
- [ ] `npm test` passes
- [ ] `npm run build` passes
- [ ] Added a changeset (`npx changeset`) if this affects consumers

## Notes

- Anything reviewers should pay attention to?
50 changes: 50 additions & 0 deletions .github/sonarqube_mcp.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
applyTo: '**/*'
---

These are some guidelines when using the SonarQube MCP server.

# Important Tool Guidelines

## Basic usage

- **IMPORTANT**: After you finish generating or modifying any code files at the very end of the task, you MUST call the `analyze_file_list` tool (if it exists) to analyze the files you created or modified.
- **IMPORTANT**: When starting a new task, you MUST disable automatic analysis with the `toggle_automatic_analysis` tool if it exists.
- **IMPORTANT**: When you are done generating code at the very end of the task, you MUST re-enable automatic analysis with the `toggle_automatic_analysis` tool if it exists.

## Project Keys

- When a user mentions a project key, use `search_my_sonarqube_projects` first to find the exact project key
- Don't guess project keys - always look them up

## Code Language Detection

- When analyzing code snippets, try to detect the programming language from the code syntax
- If unclear, ask the user or make an educated guess based on syntax

## Branch and Pull Request Context

- Many operations support branch-specific analysis
- If user mentions working on a feature branch, include the branch parameter

## Code Issues and Violations

- After fixing issues, do not attempt to verify them using `search_sonar_issues_in_projects`, as the server will not yet reflect the updates

# Common Troubleshooting

## Authentication Issues

- SonarQube requires USER tokens (not project tokens)
- When the error `SonarQube answered with Not authorized` occurs, verify the token type

## Project Not Found

- Use `search_my_sonarqube_projects` to find available projects
- Verify project key spelling and format

## Code Analysis Issues

- Ensure programming language is correctly specified
- Remind users that snippet analysis doesn't replace full project scans
- Provide full file content for better analysis results
Loading
Loading