Skip to content

Commit aab6f0c

Browse files
committed
docs: update performance and contributing documentation
- Remove outdated selector configuration - Update to use exclusion zones approach - Clean up contributing guidelines Authored by: Aaron Lippold<lippold@gmail.com>
1 parent 850a913 commit aab6f0c

File tree

2 files changed

+26
-75
lines changed

2 files changed

+26
-75
lines changed

docs/advanced/performance.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,21 @@ export default defineNuxtConfig({
7272

7373
## Targeted Processing
7474

75-
### Limit Scope
75+
### Use Exclusion Zones
7676

77-
Only process specific areas:
77+
Exclude areas that don't need processing:
7878

79-
```typescript
80-
export default defineNuxtConfig({
81-
smartscript: {
82-
selectors: {
83-
include: [
84-
'.content', // Only process content areas
85-
'article', // And article elements
86-
],
87-
exclude: [
88-
'.sidebar', // Skip sidebars
89-
'.navigation', // Skip navigation
90-
'.footer' // Skip footers
91-
]
92-
}
93-
}
94-
})
79+
```html
80+
<!-- These areas won't be processed -->
81+
<div class="no-superscript">
82+
<aside class="sidebar">...</aside>
83+
<nav>...</nav>
84+
</div>
85+
86+
<!-- Or use data attributes -->
87+
<div data-no-superscript>
88+
Footer content with (TM) symbols unchanged
89+
</div>
9590
```
9691

9792
### Disable Features

docs/contributing.md

Lines changed: 13 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,7 @@ if (PatternMatchers.isFraction(matched)) {
5252
}
5353
```
5454

55-
3. **Add test cases to `test/typography.test.ts`:**
56-
```typescript
57-
describe('Fractions', () => {
58-
it('should match fraction patterns', () => {
59-
const pattern = /\b(\d+)\/(\d+)\b/g
60-
expect('1/2 cup'.match(pattern)).toEqual(['1/2'])
61-
})
62-
})
63-
```
55+
3. **Add test cases** - See [Writing Tests Guide](./testing/writing-tests.md) for patterns and examples
6456

6557
4. **Update playground example:**
6658
```vue
@@ -91,51 +83,15 @@ fractions: {
9183

9284
3. **Document in README.md**
9385

94-
## ✅ Testing Guidelines
95-
96-
### Running Tests
97-
```bash
98-
# Run all tests
99-
pnpm test
86+
## ✅ Testing
10087

101-
# Run specific test file
102-
pnpm test test/typography.test.ts
88+
We maintain **227+ tests** across unit, integration, E2E, and performance categories.
10389

104-
# Watch mode
105-
pnpm test:watch
106-
```
107-
108-
### Writing Tests
109-
110-
Tests should cover:
111-
1. **Pattern matching** - Does the regex work?
112-
2. **Text processing** - Is the output correct?
113-
3. **Edge cases** - Empty strings, special characters
114-
4. **Performance** - Large text blocks
115-
116-
Example test structure:
117-
```typescript
118-
describe('Feature Name', () => {
119-
// Test pattern matching
120-
it('should match expected patterns', () => {
121-
const pattern = /your-pattern/g
122-
expect('test input'.match(pattern)).toEqual(['expected'])
123-
})
124-
125-
// Test processing
126-
it('should transform correctly', () => {
127-
const result = processMatch('input')
128-
expect(result.parts).toEqual([
129-
{ type: 'super', content: 'expected' }
130-
])
131-
})
132-
133-
// Test edge cases
134-
it('should handle edge cases', () => {
135-
expect(processMatch('')).toEqual({ modified: false, parts: [] })
136-
})
137-
})
138-
```
90+
**📚 See [Testing Documentation](./testing/index.md)** for:
91+
- Running tests
92+
- Writing new tests
93+
- Test patterns and examples
94+
- CI/CD integration
13995

14096
## 📋 Pull Request Process
14197

@@ -144,8 +100,8 @@ describe('Feature Name', () => {
144100
1. **Fork & Clone** the repository
145101
2. **Create a feature branch:** `git checkout -b feature/your-feature`
146102
3. **Make your changes**
147-
4. **Add/update tests** - All new features need tests
148-
5. **Run tests:** `pnpm test` - Must pass
103+
4. **Add/update tests** - See [Writing Tests Guide](./testing/writing-tests.md)
104+
5. **Run tests:** `pnpm test` - All 227+ tests must pass
149105
6. **Run linter:** `pnpm lint` - Must pass
150106
7. **Test in playground:** `pnpm dev` - Verify visually
151107
8. **Update documentation** if needed
@@ -172,9 +128,9 @@ Brief description of changes
172128
- [ ] Performance improvement
173129

174130
## Testing
175-
- [ ] Tests pass locally
176-
- [ ] Added new tests
177-
- [ ] Tested in playground
131+
- [ ] All tests pass (`pnpm test`)
132+
- [ ] Added new tests (see [Writing Tests Guide](./testing/writing-tests.md))
133+
- [ ] Tested in playground (`pnpm dev`)
178134

179135
## Screenshots (if applicable)
180136
Before/after screenshots for visual changes

0 commit comments

Comments
 (0)