Skip to content

Commit 72c1cf5

Browse files
committed
docs: Consolidate documentation and update all folder references
- Remove CONTRIBUTING.md (merged into README-for-developers.md) - Add "Getting Started" section to README-for-developers.md - Update all references: comparison-test-harness → tests/comparison - Update all references: src/test → tests/unit - Update all references: manual-test-cases → tests/manual - Update project structure diagram - Rename package from "comparison-test-harness" to "comparison-tests" - Update .vscodeignore to use tests/** pattern
1 parent b4d4394 commit 72c1cf5

11 files changed

Lines changed: 52 additions & 124 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: runner.os != 'Linux'
3838
run: npm test
3939

40-
- name: Install comparison test harness dependencies
40+
- name: Install comparison tests dependencies
4141
run: npm install
4242
working-directory: ./tests/comparison
4343

.vscodeignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ esbuild.js
1919
.yarnrc
2020

2121
# Test infrastructure (DO NOT SHIP)
22-
comparison-test-harness/**
23-
manual-test-cases/**
22+
tests/**
2423

2524
# Documentation - exclude all .md and .txt files EXCEPT user-facing docs
2625
**/*.md

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
**Terminology**:
1313
- **Old extension** = Original "TypeScript Hero" by Christoph Bühler (deprecated, uses typescript-parser)
14-
- Included as git submodule at `comparison-test-harness/old-typescript-hero/`
14+
- Included as git submodule at `tests/comparison/old-typescript-hero/`
1515
- Used by comparison tests to verify backward compatibility
1616
- **New extension** = This project "Mini TypeScript Hero" (modern, uses ts-morph)
1717

@@ -123,7 +123,7 @@ const result = await organizeImports(input, config);
123123
assert.equal(result, expected, 'Must produce correct output'); // ✅ Validates correctness!
124124
```
125125

126-
**For Comparison Tests (test harness):**
126+
**For Comparison Tests:**
127127
```typescript
128128
// CORRECT - Validates BOTH extensions against known-good expected output
129129
const input = `...source code...`;
@@ -263,7 +263,7 @@ The `tests/workspaces` folder MUST be excluded from TypeScript compilation:
263263

264264
## 🔧 Two Test Environments
265265

266-
### 1. General Extension Tests (`src/test/`)
266+
### 1. General Extension Tests (`tests/unit/`)
267267

268268
**Purpose**: Ensure the new extension has high reliability and catches all known bugs
269269

@@ -329,7 +329,7 @@ The `activationEvents` array is **required and correct**:
329329

330330
---
331331

332-
### 2. Test Harness Tests (`comparison-test-harness/`)
332+
### 2. Comparison Tests (`tests/comparison/`)
333333

334334
**Purpose**: Validate backward compatibility between old and new extension
335335

@@ -506,8 +506,8 @@ TypeScript 3.8+ `import type` syntax affects runtime semantics and bundling. Con
506506
# Main extension tests
507507
npm test
508508

509-
# Comparison test harness
510-
cd comparison-test-harness
509+
# Comparison tests
510+
cd tests/comparison
511511
npm test
512512

513513
# Watch mode (during development)
@@ -546,7 +546,7 @@ and of the old typescript hero
546546

547547
```
548548
gitingest -e "*node_modules*,*vscode-test*,*.js,*logo*,*old-typescript*,*package*,CLAUDE*,*logo*,.claude,*.DS_Store*,digest.txt,*out*" ./
549-
cd comparison-test-harness/old-typescript-hero && gitingest -e "*node_modules*,*vscode-test*,*.DS_Store*,digest.txt" ./ && cd ../..
549+
cd tests/comparison/old-typescript-hero && gitingest -e "*node_modules*,*vscode-test*,*.DS_Store*,digest.txt" ./ && cd ../../..
550550
{
551551
echo "*** MINI TYPESCRIPT HERO FOLDER CONTENT ***"
552552
echo ""
@@ -555,6 +555,6 @@ cd comparison-test-harness/old-typescript-hero && gitingest -e "*node_modules*,*
555555
echo ""
556556
echo "*** OLD TYPESCRIPT HERO FOLDER CONTENT ***"
557557
echo ""
558-
cat comparison-test-harness/old-typescript-hero/digest.txt
558+
cat tests/comparison/old-typescript-hero/digest.txt
559559
} > digest-combined.txt && mv digest-combined.txt digest.txt
560560
```

CONTRIBUTING.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

README-for-developers.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
This guide is for developers working on the Mini TypeScript Hero extension.
44

5+
## Getting Started
6+
7+
```bash
8+
# Clone the repository
9+
git clone https://github.com/angular-schule/mini-typescript-hero.git
10+
cd mini-typescript-hero
11+
12+
# Install dependencies
13+
npm install
14+
15+
# Compile and watch for changes
16+
npm run watch
17+
18+
# Run tests
19+
npm test
20+
```
21+
522
## Running Unit Tests
623

724
### Run Tests
@@ -18,8 +35,8 @@ This will:
1835
**Note:** These are integration tests that run in a real VS Code environment with the full TypeScript/JavaScript language server. Tests use real file I/O (temp files in `os.tmpdir()`), real VS Code APIs (`workspace.openTextDocument`, `workspace.applyEdit`), and real ts-morph parsing. This makes them slower than unit tests but ensures accurate testing of the actual user experience.
1936

2037
- Tests run on: Ubuntu, macOS, Windows (via GitHub Actions)
21-
- Main extension tests location: `src/test/`
22-
- Comparison tests location: `comparison-test-harness/test-cases/`
38+
- Main extension tests location: `tests/unit/`
39+
- Comparison tests location: `tests/comparison/test-cases/`
2340

2441
## Manual Testing
2542

@@ -33,7 +50,7 @@ This will:
3350

3451
### Manual Test Cases
3552

36-
The `manual-test-cases/` folder contains 10 test scenarios:
53+
The `tests/manual/` folder contains 10 test scenarios:
3754

3855
#### Case 01: Basic Unused Imports (`case01-basic-unused-imports.ts`)
3956
**Tests:** Basic unused import removal
@@ -88,7 +105,7 @@ The `manual-test-cases/` folder contains 10 test scenarios:
88105
### Testing Workflow
89106

90107
1. Open Extension Development Host (F5)
91-
2. Open a test case file from `manual-test-cases/`
108+
2. Open a test case file from `tests/manual/`
92109
3. Press `Ctrl+Alt+O` (or `Cmd+Alt+O`)
93110
4. Verify:
94111
- ✅ Unused imports are removed
@@ -168,13 +185,14 @@ mini-typescript-hero/
168185
│ │ ├── import-organizer.ts # VSCode integration
169186
│ │ ├── import-types.ts # Import representations
170187
│ │ └── import-utilities.ts # Sorting/precedence
171-
│ ├── test/ # Unit tests
172-
│ │ ├── configuration/ # Migration tests
173-
│ │ └── imports/ # Import logic tests
174188
│ └── extension.ts # Extension entry point
175-
├── manual-test-cases/ # Manual testing scenarios
176-
│ ├── case01-*.ts # Test case files
177-
│ └── helpers/ # Mock modules
189+
├── tests/
190+
│ ├── unit/ # Main extension tests
191+
│ ├── comparison/ # Old vs new extension comparison
192+
│ ├── manual/ # Manual testing scenarios
193+
│ │ ├── case01-*.ts # Test case files
194+
│ │ └── helpers/ # Mock modules
195+
│ └── workspaces/ # Pre-configured test workspaces
178196
├── package.json # Extension manifest
179197
├── tsconfig.json # TypeScript config
180198
└── esbuild.js # Build configuration
@@ -208,7 +226,7 @@ mini-typescript-hero/
208226
### TypeScript Configuration
209227

210228
- **Extension runtime** (`src/`): Compiled with `strict: true`, `noUnusedLocals: true`
211-
- **Comparison test harness** (`comparison-test-harness/`): Uses relaxed `tsconfig.json` with `strict: false` so we can compile the original TypeScript Hero code without rewriting it
229+
- **Comparison tests** (`tests/comparison/`): Uses relaxed `tsconfig.json` with `strict: false` so we can compile the original TypeScript Hero code without rewriting it
212230
- **Manual test cases**: Simple demonstration files, may use `any` for clarity
213231

214232
## Debugging

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Original work Copyright (c) Christoph Bühler
264264

265265
- [Configuration Reference](README-configuration.md) — Complete settings documentation
266266
- [Migration Guide](README-migration.md) — Migrating from TypeScript Hero
267-
- [Contributing](CONTRIBUTING.md) — Development setup and debugging
267+
- [Developer Guide](README-for-developers.md) — Development setup, debugging, and contributing
268268
- [Report Issues](https://github.com/angular-schule/mini-typescript-hero/issues)
269269
- [Request Features](https://github.com/angular-schule/mini-typescript-hero/issues)
270270

tests/comparison/.vscode-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from '@vscode/test-cli';
33
export default defineConfig({
44
files: 'out/tests/comparison/test-cases/**/*.test.js',
55
// Use shorter user-data-dir to avoid macOS socket path length issues (103 char limit)
6-
launchArgs: ['--user-data-dir=/tmp/vscode-test-harness'],
6+
launchArgs: ['--user-data-dir=/tmp/vscode-comparison-tests'],
77
mocha: {
88
timeout: 10000 // Increased from default 2000ms for slower CI environments (especially macOS)
99
}

tests/comparison/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Comparison Test Harness
1+
# Comparison Tests
22

33
Verifies behavioral compatibility between old TypeScript Hero and new Mini TypeScript Hero.
44

@@ -7,7 +7,7 @@ Verifies behavioral compatibility between old TypeScript Hero and new Mini TypeS
77
## Structure
88

99
```
10-
comparison-test-harness/
10+
tests/comparison/
1111
├── old-typescript-hero/ # Git submodule to buehler/typescript-hero
1212
├── old-extension/adapter.ts # Wrapper for old extension
1313
├── new-extension/adapter.ts # Wrapper for new extension

tests/comparison/package-lock.json

Lines changed: 6 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/comparison/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "comparison-test-harness",
2+
"name": "comparison-tests",
33
"version": "1.0.0",
4-
"description": "Test harness comparing old vs new TypeScript Hero",
4+
"description": "Comparison tests: old vs new TypeScript Hero",
55
"private": true,
66
"engines": {
77
"vscode": "^1.85.0",

0 commit comments

Comments
 (0)