js

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Extensions = []string{
	"js", "ts", "tsx", "jsx", "d.ts",
}

Functions

func MakeJsLanguage

func MakeJsLanguage(ctx context.Context, entrypoint string) (context.Context, language.Language[Data, js_grammar.File], error)

Types

type CompilerOptions

type CompilerOptions struct {
	BaseUrl string              `json:"baseUrl,omitempty"`
	Paths   map[string][]string `json:"paths,omitempty"`
}

type Data

type Data struct{}

type ExportsCacheKey

type ExportsCacheKey string

type Language

type Language struct {
	PackageJsonPath string
	ProjectRoot     string
	TsConfig        TsConfig
}

func (*Language) MakeNode

func (l *Language) MakeNode(path string) (*graph.Node[Data], error)

func (*Language) ParseExports

func (l *Language) ParseExports(file *js_grammar.File) (*language.ExportsResult, error)

func (*Language) ParseFile

func (l *Language) ParseFile(id string) (*js_grammar.File, error)

func (*Language) ParseImports

func (l *Language) ParseImports(file *js_grammar.File) (*language.ImportsResult, error)

func (*Language) ResolvePath

func (l *Language) ResolvePath(unresolved string, dir string) (string, error)

ResolvePath resolves an unresolved import based on the dir where the import was executed.

type TsConfig

type TsConfig struct {
	CompilerOptions CompilerOptions `json:"compilerOptions,omitempty"`
}

func ParseTsConfig

func ParseTsConfig(path string) (TsConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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