typescript-go-internal

module
v0.0.0-...-bb8ca58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: Apache-2.0

README

typescript-go-internal

Test codecov Go Report Card Go Reference

Expose selected internal Go packages from microsoft/typescript-go under stable import paths so external modules can depend on them.

Overview

This repository mirrors and adapts microsoft/typescript-go/internal into pkg/... to make those packages importable as github.com/buke/typescript-go-internal/pkg/.... It keeps close parity with upstream while remaining self-contained for CI and external use.

Notes:

  • This project is independent and not affiliated with Microsoft.
  • The API surface is still evolving (v0 semantics): breaking changes may occur while tracking upstream.

What’s Inside

  • pkg/ — mirrored internal packages made public and importable.
  • testdata/ — upstream fixtures and baselines copied from microsoft/typescript-go/testdata for reproducible tests.
  • scripts/sync-internal.sh — sync script to copy sources, rewrite imports, normalize //go:generate, and bring testdata.
  • .github/workflows/ — CI workflows, including tests and coverage upload.

Syncing From Upstream (maintainers)

The sync script performs:

  • Copy microsoft/typescript-go/internalpkg
  • Rewrite imports from .../internal/....../pkg/...
  • Normalize //go:generate directives (use go run <module>@latest)
  • Copy microsoft/typescript-go/testdatatestdata
  • Run go mod tidy pre/post generation

Command:

./scripts/sync-internal.sh

After syncing, commit changes normally. Baseline files live under testdata/baselines.

Continuous Integration

License

See LICENSE.

Directories

Path Synopsis
pkg
api
ast
bundled
Package bundled provides access to files bundled with TypeScript.
Package bundled provides access to files bundled with TypeScript.
compiler
Package compiler implements the TypeScript compiler.
Package compiler implements the TypeScript compiler.
diagnostics
Package diagnostics contains generated localizable diagnostic messages.
Package diagnostics contains generated localizable diagnostic messages.
jsnum
Package jsnum provides JS-like number handling.
Package jsnum provides JS-like number handling.
ls
lsp
nodebuilder
Exports interfaces and types defining the node builder - concrete implementations are on top of the checker, but these types and interfaces are used by the emit resolver in the printer
Exports interfaces and types defining the node builder - concrete implementations are on top of the checker, but these types and interfaces are used by the emit resolver in the printer
printer
Package printer exports a Printer for pretty-printing TS ASTs and writer interfaces and implementations for using them Intended ultimate usage:
Package printer exports a Printer for pretty-printing TS ASTs and writer interfaces and implementations for using them Intended ultimate usage:
stringutil
Package stringutil Exports common rune utilities for parsing and emitting javascript
Package stringutil Exports common rune utilities for parsing and emitting javascript
testutil/race
Package israce reports if the Go race detector is enabled.
Package israce reports if the Go race detector is enabled.
vfs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL