diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55be68e..314bca6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - name: Determine Bun version id: bun-version - run: echo "BUN_VERSION=$(cat package.json | grep 'bun-types' | head -1 | awk -F'"' '{print $4}')" >> $GITHUB_OUTPUT + run: echo "BUN_VERSION=$(jq -r '.engines."bun"' package.json)" >> $GITHUB_OUTPUT - name: Setup Bun uses: oven-sh/setup-bun@v2 diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 23aefcc..c27e066 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -14,7 +14,7 @@ jobs: - name: Determine Bun version id: bun-version - run: echo "BUN_VERSION=$(cat package.json | grep 'bun-types' | head -1 | awk -F'"' '{print $4}')" >> $GITHUB_OUTPUT + run: echo "BUN_VERSION=$(jq -r '.engines."bun"' package.json)" >> $GITHUB_OUTPUT - name: Setup Bun uses: oven-sh/setup-bun@v2 diff --git a/.trae/rules/code-conventions.md b/.trae/rules/code-conventions.md deleted file mode 120000 index 8dd2dbf..0000000 --- a/.trae/rules/code-conventions.md +++ /dev/null @@ -1 +0,0 @@ -../../.kiro/steering/code-conventions.md \ No newline at end of file diff --git a/.trae/rules/code-conventions.md b/.trae/rules/code-conventions.md new file mode 100644 index 0000000..d775d0d --- /dev/null +++ b/.trae/rules/code-conventions.md @@ -0,0 +1,182 @@ +# Coding Guidelines + +## General Standards + +- **Function Declarations**: Always use arrow functions (`const fn = () => {}`) instead of function declarations (`function fn() {}`) +- **TypeScript**: Use strict typing throughout the codebase +- **Path Aliases**: Always use `@frontend/` and `@backend/` instead of relative paths + +## Testing Standards + +### Test Framework + +- **Bun Test**: Use Bun's native test runner for all tests +- **Import Pattern**: `import { describe, test, expect } from 'bun:test'` +- **File Naming**: Tests must use `.test.ts` or `.spec.ts` suffix + +### Test Structure + +- **Frontend Tests**: Place in `src/**/__tests__/` directories +- **Backend Tests**: Place in `tests/` directory mirroring `src/` structure +- **Test Organization**: Group related tests using `describe` blocks +- **Test Naming**: Use descriptive names that explain the behavior being tested + +### Testing Approach + +- **Logic Testing**: Focus on testing component logic, business rules, and data transformations +- **Type Validation**: Test TypeScript interfaces and type definitions +- **State Management**: Test store interactions and state mutations +- **Integration**: Test composable interactions and data flow +- **Avoid DOM Testing**: Prefer logic testing over complex DOM manipulation tests + +### Test Examples + +```typescript +import { describe, test, expect } from 'bun:test' + +describe('Component Logic', () => { + test('should compute values correctly', () => { + const input = 'test' + const result = processInput(input) + expect(result).toBe('expected') + }) + + test('should handle edge cases', () => { + const emptyInput = '' + const result = processInput(emptyInput) + expect(result).toBe('default') + }) +}) +``` + +## Vue Component Standards + +### Single File Component Structure + +Vue components MUST follow this exact order: + +1. **`