Skip to content

fix(transpiler): include diagnostic locations#37

Open
Photon101 wants to merge 1 commit into
SHShinSK:mainfrom
Photon101:fix/transpile-diagnostic-position
Open

fix(transpiler): include diagnostic locations#37
Photon101 wants to merge 1 commit into
SHShinSK:mainfrom
Photon101:fix/transpile-diagnostic-position

Conversation

@Photon101

Copy link
Copy Markdown

PR summary

Preserve line/column information from type-check diagnostics when transpileCellFile() returns build errors.

Change type

  • Bug fix
  • Feature
  • Refactoring
  • Docs
  • Test/build/CI
  • Other

Background / problem

transpileCellFile() already receives diagnostics with positions, but mapped them down to message strings. That meant cell build --json could not show where type-check failures came from.

Changes

  • Format compiler diagnostics as line N, column M: message before returning them in TranspileResult.errors.
  • Keep the existing errors: string[] shape so current CLI and runtime consumers continue to work.
  • Update fixtures/broken.cell to exercise a parse-valid, type-check-invalid input and assert the location in transpiler.test.ts.

Impact area

  • Runtime
  • Python Bridge
  • Viewer
  • DSL / Compiler
  • Docs

Verification

npm run typecheck
npm test
npm run pack:smoke
node --import tsx --test transpiler.test.ts
npm run cell:build -- --json fixtures/broken.cell
npm run cell:build -- --json ../examples/validator.cell
npm run cell:build -- fixtures/broken.cell
git diff --check

The broken build command exits non-zero as expected and now reports line 1, column 1 in both JSON and human output.

Test checklist

  • Local tests were run
  • Tests were added/updated for the changed behavior
  • Docs were updated where applicable
  • Migration guide was added for breaking changes

Screenshots / logs

Not applicable.

Related issue

Closes #32

@Photon101
Photon101 marked this pull request as ready for review June 11, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[good-first-issue] Transpiler: include line/column in diagnostics · Transpiler: 진단 메시지에 line/column 포함

1 participant