web

package
v0.0.0-...-a95bb51 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLanguage

func NewLanguage() language.Language

Types

type Web

type Web struct {
	language.BaseLang

	Verbose bool
}

func (*Web) AfterResolvingDeps

func (language *Web) AfterResolvingDeps(ctx context.Context)

Called when finished resolving all dependencies with all extensions

func (*Web) Before

func (language *Web) Before(ctx context.Context)

Called after initializing all extensions, but before visiting any package

func (*Web) Configure

func (language *Web) Configure(config *config.Config, rel string, file *rule.File)

Read configuration from current directory's BUILD file, and apply changes from inherited configuration. Called in each directory when first entering it. c is the configuration for the current directory. It starts out as a copy of the configuration for the parent directory.

rel is the slash-separated relative path from the repository root to the current directory. It is "" for the root directory itself.

f is the build file for the current directory or nil if there is no existing build file.

func (*Web) DoneGeneratingRules

func (language *Web) DoneGeneratingRules()

Called when finished generating all rules in all packages with all extensions, but before resolving imports

func (*Web) GenerateRules

func (lang *Web) GenerateRules(args language.GenerateArgs) language.GenerateResult

GenerateRules extracts build metadata from source files in a directory. Called in each directory where an update is requested in depth-first post-order.

func (*Web) Imports

func (lang *Web) Imports(c *config.Config, r *rule.Rule, f *rule.File) []resolve.ImportSpec

Imports returns a list of ImportSpecs that can be used to import the rule r. This is used to populate RuleIndex.

If nil is returned, the rule will not be indexed. If any non-nil slice is returned, including an empty slice, the rule will be indexed.

func (*Web) Kinds

func (*Web) Kinds() map[string]rule.KindInfo

func (*Web) KnownDirectives

func (*Web) KnownDirectives() []string

KnownDirectives returns a list of directive keys that this Configurer can interpret. Gazelle prints errors for directives that are not recoginized by any Configurer.

func (*Web) Loads

func (lang *Web) Loads() []rule.LoadInfo

Loads returns .bzl files and symbols they define

func (*Web) Name

func (*Web) Name() string

Name returns the name of the language. This should be a prefix of the kinds of rules generated by the language whenever possible.

func (*Web) Resolve

func (lang *Web) Resolve(c *config.Config, ix *resolve.RuleIndex, rc *repo.RemoteCache, r *rule.Rule,
	imports interface{}, from label.Label)

https://www.typescriptlang.org/docs/handbook/module-resolution.html#classic Resolve translates imported libraries for a given rule into Bazel dependencies. Information about imported libraries is returned for each rule generated by language.GenerateRules in language.GenerateResult.Imports. Resolve generates a "deps" attribute (or the appropriate language-specific equivalent) for each import according to language-specific rules and heuristics.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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