Documentation
¶
Index ¶
- func NodeTypeRoots(dirs ...string) []string
- func NodeTypesPresent(dirs ...string) bool
- type Owner
- func (o *Owner) EnsureNodeAmbientTypes() Result
- func (o *Owner) EnsurePackageJSON() Result
- func (o *Owner) FindTool(name string) (string, error)
- func (o *Owner) RunTool(ctx context.Context, phase Phase, dir string, name string, args ...string) Result
- func (o *Owner) WorkDir() string
- func (o *Owner) WriteFile(phase Phase, name string, data string) Result
- func (o *Owner) WriteJSON(phase Phase, name string, value any) Result
- type Phase
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeTypeRoots ¶
NodeTypeRoots returns existing @types roots visible from the provided dirs.
func NodeTypesPresent ¶
NodeTypesPresent reports whether @types/node is visible from any provided directory.
Types ¶
type Owner ¶
type Owner struct {
// contains filtered or unexported fields
}
Owner owns TypeScript test workspace files, tool discovery, and execution.
func (*Owner) EnsureNodeAmbientTypes ¶
EnsureNodeAmbientTypes writes host runtime declarations needed by emitted tests.
func (*Owner) EnsurePackageJSON ¶
EnsurePackageJSON writes the module package metadata used by Bun.
func (*Owner) RunTool ¶
func (o *Owner) RunTool(ctx context.Context, phase Phase, dir string, name string, args ...string) Result
RunTool finds and executes a TypeScript workspace tool.
type Phase ¶
type Phase string
Phase names a TypeScript workspace execution phase.
const ( // PhaseWorkspace covers workspace file preparation and tool discovery. PhaseWorkspace Phase = "workspace" // PhaseTypeCheck covers TypeScript type checking. PhaseTypeCheck Phase = "typecheck" // PhaseRuntime covers TypeScript runtime execution. PhaseRuntime Phase = "runtime" // NodeAmbientTypesFile names the GoScript runtime ambient declarations. NodeAmbientTypesFile = "goscript-node.d.ts" )
Click to show internal directories.
Click to hide internal directories.