Commit Graph

1 Commits

Author SHA1 Message Date
Matt Godbolt
b02e167baf Fix broken frontend import paths and add import validation
**The Problem:**
Frontend TypeScript files contained 70 broken import paths that referenced
non-existent directories. These imports were introduced in commit a60a3fc22
"Reorganise components interfaces and move implementation functions" during
the types reorganization work, and prevented proper TypeScript compilation
in test environments.

**Root Cause:**
The reorganization commit moved interface files but updated import paths to
reference non-existent `static/compilation/` and `static/execution/` directories.
The actual interface files are located in `types/compilation/` and `types/execution/`.

**Import Path Fixes:**
- Fixed `./compilation/` → `../types/compilation/` (compilation interfaces)
- Fixed `./execution/` → `../types/execution/` (execution interfaces)
- Fixed `./languages.interfaces.js` → `../types/languages.interfaces.js`
- Fixed `../compiler.interfaces.js` → `../../types/compiler.interfaces.js`
- Fixed `../instructionsets.js` → `../../types/instructionsets.js`
- Fixed `../resultline/` → `../../types/resultline/` (result line interfaces)
- Fixed `./libraries/` → `../../types/libraries/` (library interfaces)
- Fixed various other misplaced interface imports

**New Import Validation System:**
- Created `scripts/check-imports.js` to validate all frontend imports
- Handles TypeScript's `.js` import convention (maps to `.ts` source files)
- Added `npm run check-imports` command to package.json
- Integrated into pre-commit hooks via lint-staged.config.mjs
- Validates 181 TypeScript files in ~2 seconds

**Impact:**
-  All 70 broken import paths now resolved correctly
-  TypeScript compilation passes (frontend, backend, tests)
-  All 1091 tests pass with no regressions
-  Linting and code style maintained
-  Import validation prevents future issues

**Files Changed:** 41 TypeScript files across static/, static/panes/, static/widgets/

Fixes issue introduced in: a60a3fc22 ("Reorganise components interfaces and move implementation functions")

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-13 17:11:11 -05:00