Creates a new StubsManager instance.
The application instance
Absolute directory path where stubs should be published
Creates a Stub instance by locating and loading a stub file. Searches in publishTarget first, then optional source or package locations.
Name of the stub file to build (e.g., 'controller.stub')
Optionaloptions: { source?: string; pkg?: string }
Optional configuration for stub source
Optionalsource?: stringCustom file system path to search for stubs
Optionalpkg?: stringPackage name to source stubs from
Promise that resolves to a Stub instance
Copies stub files from a source location to the publish target directory. Can copy individual files or entire directories recursively.
Relative path to the stub file or directory to copy
Copy configuration options
Optionaloverwrite?: booleanWhether to overwrite existing files
Source file system path (mutually exclusive with pkg)
Package name to copy from (mutually exclusive with source)
Promise that resolves to an array of copied file paths
StubsManager handles reading, copying, and building stubs from various sources. Stubs are template files used for code generation in AdonisJS applications.
The manager can source stubs from:
Example