js

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func MakeJsLanguage

func MakeJsLanguage(entrypoint string, cfg *Config) (language.Language[js_grammar.File], error)

Types

type CompilerOptions

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

type Config added in v0.17.4

type Config struct {
	TsConfigPaths bool `yaml:"tsConfigPaths"`
	Workspaces    bool `yaml:"workspaces"`
}

type ExportsCacheKey

type ExportsCacheKey string

type Language

type Language struct {
	Workspaces *Workspaces
	Cfg        *Config
}

func (*Language) ParseExports

func (l *Language) ParseExports(file *js_grammar.File) (*language.ExportsEntries, 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"`
	// contains filtered or unexported fields
}

func ParseTsConfig

func ParseTsConfig(filePath string) (TsConfig, error)

func (*TsConfig) ResolveFromBaseUrl added in v0.17.4

func (t *TsConfig) ResolveFromBaseUrl(unresolved string) string

func (*TsConfig) ResolveFromPaths added in v0.17.4

func (t *TsConfig) ResolveFromPaths(unresolved string) (string, error)

type WorkspaceEntry added in v0.17.4

type WorkspaceEntry struct {
	// contains filtered or unexported fields
}

type Workspaces added in v0.17.4

type Workspaces struct {
	// contains filtered or unexported fields
}

func NewWorkspaces added in v0.17.4

func NewWorkspaces(searchPath string) (*Workspaces, error)

func (*Workspaces) ResolveFromWorkspaces added in v0.17.4

func (w *Workspaces) ResolveFromWorkspaces(unresolved string) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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