Skip to main content

ModuleSource

API reference

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

Implements Node, Syncer

asString
A human readable ref string representation of this module source.
cloneRef
The ref to clone the root of the git repo from. Only valid for git sources.
commit
The resolved commit of the git repo this source points to.
configExists
Whether an existing module config file was found.
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.
engineVersion
The engine version of the module.
htmlRepoURL
The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
htmlURL
The URL to the source's git repo in a web browser. Only valid for git sources.
id
A unique identifier for this ModuleSource.
kind
The kind of module source (currently local, git or dir).
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.
moduleName
The name of the module, including any setting via the withName API.
moduleOriginalName
The original name of the module as read from the module config file (or set for the first time with the withName API).
originalSubpath
The original subpath used when instantiating this module source, relative to the context directory.
pin
The pinned version of this module source.
repoRootPath
The import path corresponding to the root of the git repo this source points to. Only valid for git sources.
sourceRootSubpath
The path, relative to the context directory, that contains the module config.
sourceSubpath
The path to the directory containing the module's source code, relative to the context directory.
version
The specified version of the git repo this source points to.
asModule
Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
blueprint
The blueprint referenced by the module source.
configClients
The clients generated for the module.
contextDirectory
The full directory loaded for the module source, including the source code as a subdirectory.
dependencies
The dependencies of the module source.
directory
The directory containing the module configuration and source code (source code may be in a subdir).
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.
introspectionSchemaJSON
The introspection schema JSON file for this module source.
sdk
The SDK configuration of the module.
sync
Forces evaluation of the module source, including any loading into the engine and associated validation.
toolchains
The toolchains referenced by the module source.
userDefaults
User-defined defaults read from local .env files
withBlueprint
Set a blueprint for the module source.
withClient
Update the module source with a new client to generate.
withDependencies
Append the provided dependencies to the module source's dependency list.
withEngineVersion
Upgrade the engine version of the module to the given value.
withExperimentalFeatures
Enable the experimental features for the module source.
withIncludes
Update the module source with additional include patterns for files+directories from its context that are required for building it
withName
Update the module source with a new name.
withoutBlueprint
Remove the current blueprint from the module source.
withoutClient
Remove a client from the module source.
withoutDependencies
Remove the provided dependencies from the module source's dependency list.
withoutExperimentalFeatures
Disable experimental features for the module source.
withoutToolchains
Remove the provided toolchains from the module source.
withSDK
Update the module source with a new SDK.
withSourceSubpath
Update the module source with a new source subpath.
withToolchains
Add toolchains to the module source.
withUpdateBlueprint
Update the blueprint module to the latest version.
withUpdatedClients
Update one or more clients.
withUpdateDependencies
Update one or more module dependencies.
withUpdateToolchains
Update one or more toolchains.

asString: String!

A human readable ref string representation of this module source.

cloneRef: String!

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

commit: String!

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

configExists: Boolean!

Whether an existing module config file was found.

digest: String!

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.

engineVersion: String!

The engine version of the module.

htmlRepoURL: String!

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

htmlURL: String!

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.

kind: ModuleSourceKind!

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

localContextDirectoryPath: String!

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.

moduleName: String!

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

moduleOriginalName: String!

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

originalSubpath: String!

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

pin: String!

The pinned version of this module source.

repoRootPath: String!

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

sourceRootSubpath: String!

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

sourceSubpath: String!

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

version: String!

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

asModule: Module!

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

blueprint: ModuleSource!Deprecated

The blueprint referenced by the module source.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

configClients: [ModuleConfigClient!]!

The clients generated for the module.

contextDirectory: Directory!

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

dependencies: [ModuleSource!]!

The dependencies of the module source.

directory(path: String!): Directory!

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

path: String!

A subpath from the source directory to select.

generatedContextChangeset: Changeset!

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

generatedContextDirectory: Directory!

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

introspectionSchemaJSON: File!

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.

sdk: SDKConfig

The SDK configuration of the module.

sync: ModuleSource!

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

toolchains: [ModuleSource!]!Deprecated

The toolchains referenced by the module source.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

userDefaults: EnvFile!

User-defined defaults read from local .env files

withBlueprint(blueprint: ModuleSource!): ModuleSource!Deprecated

Set a blueprint for the module source.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

blueprint: ModuleSource!

The blueprint module to set.

withClient(generator: String!, outputDir: String!): ModuleSource!

Update the module source with a new client to generate.

generator: String!

The generator to use

outputDir: String!

The output directory for the generated client.

withDependencies(dependencies: [ModuleSource!]!): ModuleSource!

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

dependencies: [ModuleSource!]!

The dependencies to append.

withEngineVersion(version: String!): ModuleSource!

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

version: String!

The engine version to upgrade to.

withExperimentalFeatures(features: [ModuleSourceExperimentalFeature!]!): ModuleSource!

Enable the experimental features for the module source.

features: [ModuleSourceExperimentalFeature!]!

The experimental features to enable.

withIncludes(patterns: [String!]!): ModuleSource!

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

patterns: [String!]!

The new additional include patterns.

withName(name: String!): ModuleSource!

Update the module source with a new name.

name: String!

The name to set.

withoutBlueprint: ModuleSource!Deprecated

Remove the current blueprint from the module source.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

withoutClient(path: String!): ModuleSource!

Remove a client from the module source.

path: String!

The path of the client to remove.

withoutDependencies(dependencies: [String!]!): ModuleSource!

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

dependencies: [String!]!

The dependencies to remove.

withoutExperimentalFeatures(features: [ModuleSourceExperimentalFeature!]!): ModuleSource!

Disable experimental features for the module source.

features: [ModuleSourceExperimentalFeature!]!

The experimental features to disable.

withoutToolchains(toolchains: [String!]!): ModuleSource!Deprecated

Remove the provided toolchains from the module source.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

toolchains: [String!]!

The toolchains to remove.

withSDK(source: String!): ModuleSource!

Update the module source with a new SDK.

source: String!

The SDK source to set.

withSourceSubpath(path: String!): ModuleSource!

Update the module source with a new source subpath.

path: String!

The path to set as the source subpath. Must be relative to the module source's source root directory.

withToolchains(toolchains: [ModuleSource!]!): ModuleSource!Deprecated

Add toolchains to the module source.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

toolchains: [ModuleSource!]!

The toolchain modules to add.

withUpdateBlueprint: ModuleSource!Deprecated

Update the blueprint module to the latest version.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

withUpdatedClients(clients: [String!]!): ModuleSource!

Update one or more clients.

clients: [String!]!

The clients to update

withUpdateDependencies(dependencies: [String!]!): ModuleSource!

Update one or more module dependencies.

dependencies: [String!]!

The dependencies to update.

withUpdateToolchains(toolchains: [String!]!): ModuleSource!Deprecated

Update one or more toolchains.

Deprecated: Legacy dagger.json field. Generic module loading no longer honors it; use workspace modules in dagger.toml instead.

toolchains: [String!]!

The toolchains to update.

References

Returned by

Accepted as an argument by