class ModuleSource extends AbstractObject implements IdAble, Node, Syncer

The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc.

Properties

$lastQuery from  AbstractObject

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

asModule()

Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation

string
asString()

A human readable ref string representation of this module source.

blueprint()

The blueprint referenced by the module source.

clientSchemaIntrospectionJSON()

The client-facing introspection schema JSON file for this module source.

string
cloneRef()

The ref to clone the root of the git repo from. Only valid for git sources.

string
commit()

The resolved commit of the git repo this source points to.

array
configClients()

The clients generated for the module.

bool
configExists()

Whether an existing module config file was found.

contextDirectory()

The full directory loaded for the module source, including the source code as a subdirectory.

array
dependencies()

The dependencies of the module source.

string
digest()

A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.

directory(string $path)

The directory containing the module configuration and source code (source code may be in a subdir).

string
engineVersion()

The engine version of the module.

generatedContextChangeset()

The generated files and directories made on top of the module source's context directory, returned as a Changeset.

generatedContextDirectory()

The generated files and directories made on top of the module source's context directory.

string
htmlRepoURL()

The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).

string
htmlURL()

The URL to the source's git repo in a web browser. Only valid for git sources.

Id
id()

A unique identifier for this ModuleSource.

introspectionSchemaJSON()

The introspection schema JSON file for this module source.

ModuleSourceKind
kind()

The kind of module source (currently local, git or dir).

string
localContextDirectoryPath()

The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.

string
moduleName()

The name of the module, including any setting via the withName API.

string
moduleOriginalName()

The original name of the module as read from the module config file (or set for the first time with the withName API).

string
originalSubpath()

The original subpath used when instantiating this module source, relative to the context directory.

string
pin()

The pinned version of this module source.

string
repoRootPath()

The import path corresponding to the root of the git repo this source points to. Only valid for git sources.

sdk()

The SDK configuration of the module.

string
sourceRootSubpath()

The path, relative to the context directory, that contains the module config.

string
sourceSubpath()

The path to the directory containing the module's source code, relative to the context directory.

sync()

Forces evaluation of the module source, including any loading into the engine and associated validation.

array
toolchains()

The toolchains referenced by the module source.

updatedConfigDirectory()

The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.

userDefaults()

User-defined defaults read from local .env files

string
version()

The specified version of the git repo this source points to.

withBlueprint(ModuleSource $blueprint)

Set a blueprint for the module source.

withClient(string $generator, string $outputDir)

Update the module source with a new client to generate.

withDependencies(array $dependencies)

Append the provided dependencies to the module source's dependency list.

withEngineVersion(string $version)

Upgrade the engine version of the module to the given value.

withExperimentalFeatures(array $features)

Enable the experimental features for the module source.

withIncludes(array $patterns)

Update the module source with additional include patterns for files+directories from its context that are required for building it

withName(string $name)

Update the module source with a new name.

withSDK(string $source)

Update the module source with a new SDK.

withSourceSubpath(string $path)

Update the module source with a new source subpath.

withToolchains(array $toolchains)

Add toolchains to the module source.

withUpdateBlueprint()

Update the blueprint module to the latest version.

withUpdateDependencies(array $dependencies)

Update one or more module dependencies.

withUpdateToolchains(array $toolchains)

Update one or more toolchains.

withUpdatedClients(array $clients)

Update one or more clients.

withoutBlueprint()

Remove the current blueprint from the module source.

withoutClient(string $path)

Remove a client from the module source.

withoutDependencies(array $dependencies)

Remove the provided dependencies from the module source's dependency list.

withoutExperimentalFeatures(array $features)

Disable experimental features for the module source.

withoutToolchains(array $toolchains)

Remove the provided toolchains from the module source.

Details

in AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

Parameters

AbstractClient $client
QueryBuilderChain $queryBuilderChain

in AbstractObject at line 19
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

Parameters

QueryBuilder $leafQueryBuilder
string $leafKey

Return Value

null|array|string|int|float|bool

at line 19
Module asModule()

Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation

Return Value

Module

at line 28
string asString()

A human readable ref string representation of this module source.

Return Value

string

at line 37
ModuleSource blueprint()

The blueprint referenced by the module source.

Return Value

ModuleSource

at line 48
File clientSchemaIntrospectionJSON()

The client-facing introspection schema JSON file for this module source.

This is the schema consumed by client codegen: unlike introspectionSchemaJSON (the module-facing schema), it hides no core types and installs this module (reached via dag.) so a generated client can bind it. The module's dependencies are excluded: a client is generated for a single module plus core, not its dependency graph.

Return Value

File

at line 57
string cloneRef()

The ref to clone the root of the git repo from. Only valid for git sources.

Return Value

string

at line 66
string commit()

The resolved commit of the git repo this source points to.

Return Value

string

at line 75
array configClients()

The clients generated for the module.

Return Value

array

at line 84
bool configExists()

Whether an existing module config file was found.

Return Value

bool

at line 93
Directory contextDirectory()

The full directory loaded for the module source, including the source code as a subdirectory.

Return Value

Directory

at line 102
array dependencies()

The dependencies of the module source.

Return Value

array

at line 111
string digest()

A content-hash of the module source. Module sources with the same digest will output the same generated context and convert into the same module instance.

Return Value

string

at line 120
Directory directory(string $path)

The directory containing the module configuration and source code (source code may be in a subdir).

Parameters

string $path

Return Value

Directory

at line 130
string engineVersion()

The engine version of the module.

Return Value

string

at line 139
Changeset generatedContextChangeset()

The generated files and directories made on top of the module source's context directory, returned as a Changeset.

Return Value

Changeset

at line 148
Directory generatedContextDirectory()

The generated files and directories made on top of the module source's context directory.

Return Value

Directory

at line 157
string htmlRepoURL()

The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).

Return Value

string

at line 166
string htmlURL()

The URL to the source's git repo in a web browser. Only valid for git sources.

Return Value

string

at line 175
Id id()

A unique identifier for this ModuleSource.

Return Value

Id

at line 188
File introspectionSchemaJSON()

The introspection schema JSON file for this module source.

This file represents the schema visible to the module's source code, including all core types and those from the dependencies.

Note: this is in the context of a module, so some core types may be hidden.

Return Value

File

at line 197
ModuleSourceKind kind()

The kind of module source (currently local, git or dir).

Return Value

ModuleSourceKind

at line 206
string localContextDirectoryPath()

The full absolute path to the context directory on the caller's host filesystem that this module source is loaded from. Only valid for local module sources.

Return Value

string

at line 215
string moduleName()

The name of the module, including any setting via the withName API.

Return Value

string

at line 224
string moduleOriginalName()

The original name of the module as read from the module config file (or set for the first time with the withName API).

Return Value

string

at line 233
string originalSubpath()

The original subpath used when instantiating this module source, relative to the context directory.

Return Value

string

at line 242
string pin()

The pinned version of this module source.

Return Value

string

at line 251
string repoRootPath()

The import path corresponding to the root of the git repo this source points to. Only valid for git sources.

Return Value

string

at line 260
SDKConfig sdk()

The SDK configuration of the module.

Return Value

SDKConfig

at line 269
string sourceRootSubpath()

The path, relative to the context directory, that contains the module config.

Return Value

string

at line 278
string sourceSubpath()

The path to the directory containing the module's source code, relative to the context directory.

Return Value

string

at line 287
Syncer sync()

Forces evaluation of the module source, including any loading into the engine and associated validation.

Return Value

Syncer

at line 297
array toolchains()

The toolchains referenced by the module source.

Return Value

array

at line 308
Directory updatedConfigDirectory()

The module's dagger.json with any in-memory edits from with* APIs applied, as a diff relative to the source's context directory.

Unlike generatedContextDirectory, this does not run codegen and does not validate the engine version against the running engine, so it can be used to declare an engine requirement newer than the running engine. Loading or serving such a module still fails at moduleSource.asModule.

Return Value

Directory

at line 317
EnvFile userDefaults()

User-defined defaults read from local .env files

Return Value

EnvFile

at line 326
string version()

The specified version of the git repo this source points to.

Return Value

string

at line 335
ModuleSource withBlueprint(ModuleSource $blueprint)

Set a blueprint for the module source.

Parameters

ModuleSource $blueprint

Return Value

ModuleSource

at line 345
ModuleSource withClient(string $generator, string $outputDir)

Update the module source with a new client to generate.

Parameters

string $generator
string $outputDir

Return Value

ModuleSource

at line 356
ModuleSource withDependencies(array $dependencies)

Append the provided dependencies to the module source's dependency list.

Parameters

array $dependencies

Return Value

ModuleSource

at line 366
ModuleSource withEngineVersion(string $version)

Upgrade the engine version of the module to the given value.

Parameters

string $version

Return Value

ModuleSource

at line 376
ModuleSource withExperimentalFeatures(array $features)

Enable the experimental features for the module source.

Parameters

array $features

Return Value

ModuleSource

at line 386
ModuleSource withIncludes(array $patterns)

Update the module source with additional include patterns for files+directories from its context that are required for building it

Parameters

array $patterns

Return Value

ModuleSource

at line 396
ModuleSource withName(string $name)

Update the module source with a new name.

Parameters

string $name

Return Value

ModuleSource

at line 406
ModuleSource withSDK(string $source)

Update the module source with a new SDK.

Parameters

string $source

Return Value

ModuleSource

at line 416
ModuleSource withSourceSubpath(string $path)

Update the module source with a new source subpath.

Parameters

string $path

Return Value

ModuleSource

at line 426
ModuleSource withToolchains(array $toolchains)

Add toolchains to the module source.

Parameters

array $toolchains

Return Value

ModuleSource

at line 436
ModuleSource withUpdateBlueprint()

Update the blueprint module to the latest version.

Return Value

ModuleSource

at line 445
ModuleSource withUpdateDependencies(array $dependencies)

Update one or more module dependencies.

Parameters

array $dependencies

Return Value

ModuleSource

at line 455
ModuleSource withUpdateToolchains(array $toolchains)

Update one or more toolchains.

Parameters

array $toolchains

Return Value

ModuleSource

at line 465
ModuleSource withUpdatedClients(array $clients)

Update one or more clients.

Parameters

array $clients

Return Value

ModuleSource

at line 475
ModuleSource withoutBlueprint()

Remove the current blueprint from the module source.

Return Value

ModuleSource

at line 484
ModuleSource withoutClient(string $path)

Remove a client from the module source.

Parameters

string $path

Return Value

ModuleSource

at line 494
ModuleSource withoutDependencies(array $dependencies)

Remove the provided dependencies from the module source's dependency list.

Parameters

array $dependencies

Return Value

ModuleSource

at line 504
ModuleSource withoutExperimentalFeatures(array $features)

Disable experimental features for the module source.

Parameters

array $features

Return Value

ModuleSource

at line 514
ModuleSource withoutToolchains(array $toolchains)

Remove the provided toolchains from the module source.

Parameters

array $toolchains

Return Value

ModuleSource