helpers

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMetadataFilePaths

func GenerateMetadataFilePaths(dirName, baseName, metaExt, codeExt string, xmlContent, codeContent []byte) map[string][]byte

GenerateMetadataFilePaths generates the file paths for metadata and companion files.

Parameters:

  • dirName: The canonical directory name (e.g., "classes")
  • baseName: The base file name without extension (e.g., "MyClass")
  • metaExt: The metadata file extension (e.g., ".cls-meta.xml")
  • codeExt: The code file extension (e.g., ".cls")
  • xmlContent: The marshalled XML content
  • codeContent: The code content (can be nil)

Returns a map of file paths to content.

func LoadBundleFiles

func LoadBundleFiles(sourcePath string, skipPatterns ...string) (map[string][]byte, error)

LoadBundleFiles loads all files from a bundle directory (like LWC or Aura).

Parameters:

  • sourcePath: The path to the metadata file (e.g., "myComponent.js-meta.xml")
  • skipPatterns: Patterns to skip (e.g., "__tests__", "-meta.xml")

Returns a map of relative path to file content.

func LoadCompanionFile

func LoadCompanionFile(sourcePath, metaSuffix, fileExt string) []byte

LoadCompanionFile loads a companion file for metadata that has separate code files. For example, ApexClass has .cls-meta.xml (metadata) and .cls (code).

Parameters:

  • sourcePath: The path to the metadata file (e.g., "MyClass.cls-meta.xml")
  • metaSuffix: The metadata suffix to remove (e.g., "-meta.xml")
  • fileExt: The companion file extension (e.g., ".cls")

Returns the file content or nil if the file doesn't exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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