Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e3e2ec6
feat(translations): added i18n cli tools
ciiay Dec 4, 2025
96224fd
fixed bugs
ciiay Dec 5, 2025
7b92c67
feat(translations-cli): add download and deploy commands with multi-r…
ciiay Dec 12, 2025
2705b2c
fix(translations-cli): resolve SonarQube security and code quality is…
ciiay Dec 12, 2025
4dc1d0f
fix SonarQube issue p1
ciiay Dec 23, 2025
3c48663
updated the workflow to address comments
ciiay Jan 13, 2026
f0b3165
chore: update yarn.lock to sync with package.json
ciiay Jan 13, 2026
f70b3ce
resolve failed ci checks
ciiay Jan 14, 2026
975345b
resolve failed ci checks
ciiay Jan 14, 2026
36da4b5
resolve failed ci checks
ciiay Jan 14, 2026
4b4a9c5
yarn dedupe
ciiay Jan 14, 2026
125dd9d
resolve failed ci checks
ciiay Jan 14, 2026
642319b
resolved sonarCloud issues
ciiay Jan 14, 2026
a053aab
resolved sonarCloud issues
ciiay Jan 14, 2026
9df60d3
resolved sonarCloud issues
ciiay Jan 14, 2026
b65d956
resolved security hotspots issues
ciiay Jan 15, 2026
cb9cef7
resolved security hotspots issues
ciiay Jan 15, 2026
c3b0bde
resolved security hotspots issues
ciiay Jan 15, 2026
0421406
resolved security hotspots issues
ciiay Jan 15, 2026
4986f36
resolved security hotspots issues
ciiay Jan 15, 2026
c8e0118
resolved security hotspots issues
ciiay Jan 15, 2026
c547254
code cleanup
ciiay Jan 15, 2026
ffadf16
improvements
ciiay Jan 24, 2026
efb5304
updated deploy command to copy translation to BCP
ciiay Jan 24, 2026
ca7b5ec
fixed sonarQube issue
ciiay Jan 24, 2026
347c993
fixed failed CI check
ciiay Jan 24, 2026
bcebaf2
code cleanup
ciiay Jan 27, 2026
5cae9d4
fixed tsc issue
ciiay Jan 27, 2026
64071d9
added red hat plugin filter to generate command
ciiay Jan 28, 2026
a47d6e1
fixed tsc:full errors
ciiay Jan 28, 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
20 changes: 20 additions & 0 deletions workspaces/translations/packages/cli/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const baseConfig = require('@backstage/cli/config/eslint-factory')(__dirname);

module.exports = {
...baseConfig,
rules: {
...baseConfig.rules,
// CLI packages need runtime dependencies in dependencies, not devDependencies
'@backstage/no-undeclared-imports': 'off',
},
overrides: [
...(baseConfig.overrides || []),
{
files: ['src/**/*.ts'],
rules: {
'@backstage/no-undeclared-imports': 'off',
},
},
],
};

4 changes: 4 additions & 0 deletions workspaces/translations/packages/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Developer-facing docs (kept locally, not in repo)
docs/CI_COMPATIBILITY.md
docs/i18n-solution-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createTranslationRef } from '@backstage/core-plugin-api/alpha';
export const messages = createTranslationRef({
id: 'test',
messages: { title: 'Test' },
});
209 changes: 209 additions & 0 deletions workspaces/translations/packages/cli/TESTING-GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
# Testing Guide for Translations CLI

Complete guide for testing the translations CLI before release.

## Quick Test Commands

```bash
# Quick smoke test (fastest)
yarn test:quick

# Full integration test
yarn test:integration

# Unit tests (vitest)
yarn test

# Manual testing checklist
# See: test/manual-test-checklist.md
```

## Testing Strategy

### 1. Automated Tests

#### Quick Test (Recommended First)

```bash
yarn test:quick
```

- Builds the CLI
- Tests help command
- Tests generate command with sample files
- Verifies output structure
- Takes ~10 seconds

#### Integration Test

```bash
yarn test:integration
```

- Creates full test fixture
- Tests generate command
- Verifies English-only filtering
- Verifies non-English words are excluded
- Takes ~30 seconds

#### Unit Tests

```bash
yarn test
```

- Runs vitest test suite
- Tests individual functions
- Fast feedback during development

### 2. Manual Testing

Follow the comprehensive checklist:

```bash
# View checklist
cat test/manual-test-checklist.md
```

Key areas to test:

- ✅ All commands work
- ✅ Help text is correct
- ✅ Generate only includes English
- ✅ Non-English words excluded
- ✅ Error messages are helpful

### 3. Real Repository Testing

#### Test in community-plugins

```bash
cd /Users/yicai/redhat/community-plugins

# Build and link CLI first
cd /Users/yicai/redhat/rhdh-plugins/workspaces/translations/packages/cli
yarn build
yarn link # or use: node bin/translations-cli

# Test generate
cd /Users/yicai/redhat/community-plugins
translations-cli i18n generate --source-dir . --output-dir i18n

# Verify:
# 1. reference.json only contains English
# 2. No Italian/German/French words
# 3. All plugins included
# 4. Language files excluded
```

#### Test in rhdh-plugins

```bash
cd /Users/yicai/redhat/rhdh-plugins/workspaces/translations
translations-cli i18n generate --source-dir . --output-dir i18n
```

## Pre-Release Checklist

### Build & Lint

- [ ] `yarn build` succeeds
- [ ] `yarn lint` passes (no errors)
- [ ] No TypeScript errors

### Automated Tests

- [ ] `yarn test:quick` passes
- [ ] `yarn test:integration` passes
- [ ] `yarn test` passes (if unit tests exist)

### Manual Tests

- [ ] All commands work (`--help` for each)
- [ ] Generate creates correct output
- [ ] Only English in reference.json
- [ ] Non-English words excluded
- [ ] Error handling works

### Real Repository Tests

- [ ] Tested in community-plugins
- [ ] Tested in rhdh-plugins (or similar)
- [ ] Output verified manually

### Documentation

- [ ] README is up to date
- [ ] TESTING.md is accurate
- [ ] All examples work

## Common Issues & Solutions

### Build Fails

```bash
# Clean and rebuild
yarn clean
rm -rf dist node_modules
yarn install
yarn build
```

### Tests Fail

```bash
# Ensure scripts are executable
chmod +x test/*.sh

# Rebuild
yarn build
```

### Command Not Found

```bash
# Use direct path
node bin/translations-cli i18n --help

# Or link globally
yarn link
```

## Testing Workflow

### Daily Development

1. `yarn test:quick` - before committing
2. `yarn lint` - ensure code quality

### Before PR

1. `yarn test:integration` - full test
2. Manual testing of key features
3. Test in at least one real repo

### Before Release

1. Complete pre-release checklist
2. Test in 2+ real repositories
3. Verify all documentation
4. Check version numbers

## Test Files Structure

```
test/
├── README.md # This guide
├── test-helpers.ts # Test utilities
├── generate.test.ts # Unit tests
├── integration-test.sh # Full integration test
├── quick-test.sh # Quick smoke test
└── manual-test-checklist.md # Manual testing guide
```

## Next Steps

1. Run `yarn test:quick` to verify basic functionality
2. Review `test/manual-test-checklist.md` for comprehensive testing
3. Test in a real repository before release
4. Fix any issues found during testing
Loading