Documentation
¶
Overview ¶
Package nodejs provides Node.js-specific functionality for librarian.
Index ¶
- func Clean(lib *config.Library) error
- func DefaultLibraryName(api string) string
- func DefaultOutput(name, defaultOutput string) string
- func DerivePackageName(library *config.Library) string
- func FindExistingLibraryForNewAPI(libraries []*config.Library, apiPath string) *config.Library
- func Generate(ctx context.Context, cfg *config.Config, library *config.Library, ...) error
- func Install(ctx context.Context) error
- func IsMixedLibrary(lib *config.Library) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clean ¶ added in v0.14.0
Clean removes all generated code from beneath the given library's output directory. If the output directory does not currently exist, this function is a no-op.
func DefaultLibraryName ¶ added in v0.14.0
DefaultLibraryName derives a library name from an API path by stripping the version suffix and replacing "/" with "-". For example: "google/cloud/secretmanager/v1" -> "google-cloud-secretmanager".
func DefaultOutput ¶
DefaultOutput returns the output path for a library.
func DerivePackageName ¶
DerivePackageName returns the npm package name for a library. It uses nodejs.package_name if set, otherwise derives it by splitting the library name on the second dash (e.g. "google-cloud-batch" → "@google-cloud/batch").
func FindExistingLibraryForNewAPI ¶ added in v0.14.0
FindExistingLibraryForNewAPI attempts to find an existing library that should contain the given new API path. The rule is currently for matching against a candidate library is currently as simple as "if any API path within the library matches the given API path, having removed the version from both of them, the API should be added to that library". If no such library is found, nil is returned.
func Generate ¶
func Generate(ctx context.Context, cfg *config.Config, library *config.Library, srcs *sources.Sources) error
Generate generates a Node.js client library.
func IsMixedLibrary ¶ added in v0.14.0
IsMixedLibrary reports whether the library has handwritten code wrapping generated or librarian-managed code.
Types ¶
This section is empty.