Dagger
Search

typescript-sdk

No long description provided.

Installation

dagger install github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c

Entrypoint

Return Type
TypescriptSdkModConfig !
Arguments
NameTypeDefault ValueDescription
pathString !-Workspace-relative path of the module root.
wsWorkspace -The workspace this module belongs to.
Example
dagger -m github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c call \
 --path string
func (m *MyModule) Example(path string) *dagger.TypescriptSdkModConfig  {
	return dag.
			TypescriptSdk(path)
}
@function
def example(path: str, ) -> dagger.TypescriptSdkModConfig:
	return (
		dag.typescript_sdk(path)
	)
@func()
example(path: string, ): TypescriptSdkModConfig {
	return dag
		.typescriptSdk(path)
}

Entrypoint

Return Type
TypescriptSdk !
Arguments
NameTypeDefault ValueDescription
skipGenerateFilenameString -Marker filename that skips generate when found at or above a TypeScript SDK module root.
Example
dagger -m github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c call \
func (m *MyModule) Example() *dagger.TypescriptSdk  {
	return dag.
			TypescriptSdk()
}
@function
def example() -> dagger.TypescriptSdk:
	return (
		dag.typescript_sdk()
	)
@func()
example(): TypescriptSdk {
	return dag
		.typescriptSdk()
}

Entrypoint

Return Type
TypescriptSdkMod !
Arguments
NameTypeDefault ValueDescription
pathString !-Workspace-relative path of this module root.
wsWorkspace -Workspace containing this module.
skipGenerateFilenameString !-Marker filename that skips generate when found at or above this module root.
Example
dagger -m github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c call \
 --path string --skip-generate-filename string
func (m *MyModule) Example(path string, skipGenerateFilename string) *dagger.TypescriptSdkMod  {
	return dag.
			TypescriptSdk(path, skipGenerateFilename)
}
@function
def example(path: str, skip_generate_filename: str) -> dagger.TypescriptSdkMod:
	return (
		dag.typescript_sdk(path, skip_generate_filename)
	)
@func()
example(path: string, skipGenerateFilename: string): TypescriptSdkMod {
	return dag
		.typescriptSdk(path, skipGenerateFilename)
}

Entrypoint

Return Type
TypescriptSdkTemplate !
Arguments
NameTypeDefault ValueDescription
nameString !-Template name passed to init.
sourceDirectory !-Template source files materialized into the new module before generation.
Example
Function TypescriptSdkTemplate.Constructor is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.Constructor is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.Constructor is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.Constructor is not accessible from the typescript-sdk module

Types

TypescriptSdkModConfig 🔗

TypeScript SDK build configuration stored in a module’s package.json or deno.json.

packageManager() 🔗

The Node-standard packageManager field (e.g. “pnpm@8.15.4”), read from package.json. Empty when unset, or when the module has no package.json.

Return Type
String !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			TypescriptSdk().
			Mod().
			Config().
			PackageManager(ctx)
}
@function
async def example() -> str:
	return await (
		dag.typescript_sdk()
		.mod()
		.config()
		.package_manager()
	)
@func()
async example(): Promise<string> {
	return dag
		.typescriptSdk()
		.mod()
		.config()
		.packageManager()
}

baseImage() 🔗

The base container image override, read from dagger.baseImage. For Deno modules (deno.json present) the value comes from deno.json; otherwise from package.json. Empty when no override is set.

Return Type
String !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			TypescriptSdk().
			Mod().
			Config().
			BaseImage(ctx)
}
@function
async def example() -> str:
	return await (
		dag.typescript_sdk()
		.mod()
		.config()
		.base_image()
	)
@func()
async example(): Promise<string> {
	return dag
		.typescriptSdk()
		.mod()
		.config()
		.baseImage()
}

set() 🔗

Configure this module’s package manager and/or base image in a single call. Pass at least one of packageManager or baseImage; passing both applies both edits to the same Changeset.

packageManager is only supported for the Node runtime (Bun and Deno bundle their own); setting it on a Bun or Deno module is rejected. The value follows the Node name@version convention (e.g. pnpm@8.15.4); pass just the name to use the engine’s default version.

Returns a Changeset, so the diff is shown for confirmation before any file is written.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
packageManagerString -No description provided
baseImageString -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			Mod().
			Config().
			Set()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.mod()
		.config()
		.set()
	)
@func()
example(): Changeset {
	return dag
		.typescriptSdk()
		.mod()
		.config()
		.set()
}

unsetPackageManager() 🔗

Remove the packageManager field from package.json.

Return Type
Changeset !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			Mod().
			Config().
			UnsetPackageManager()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.mod()
		.config()
		.unset_package_manager()
	)
@func()
example(): Changeset {
	return dag
		.typescriptSdk()
		.mod()
		.config()
		.unsetPackageManager()
}

unsetBaseImage() 🔗

Remove the base image override and fall back to the SDK default. Edits whichever file currently holds dagger.baseImage.

Return Type
Changeset !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			Mod().
			Config().
			UnsetBaseImage()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.mod()
		.config()
		.unset_base_image()
	)
@func()
example(): Changeset {
	return dag
		.typescriptSdk()
		.mod()
		.config()
		.unsetBaseImage()
}

TypescriptSdk 🔗

skipGenerateFilename() 🔗

Marker filename that skips generate when found at or above a TypeScript SDK module root.

Return Type
String !
Example
dagger -m github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c call \
 skip-generate-filename
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			TypescriptSdk().
			SkipGenerateFilename(ctx)
}
@function
async def example() -> str:
	return await (
		dag.typescript_sdk()
		.skip_generate_filename()
	)
@func()
async example(): Promise<string> {
	return dag
		.typescriptSdk()
		.skipGenerateFilename()
}

targetRuntime() 🔗

Runtime source to write into modules created by this SDK.

Return Type
String !
Example
dagger -m github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c call \
 target-runtime
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			TypescriptSdk().
			TargetRuntime(ctx)
}
@function
async def example() -> str:
	return await (
		dag.typescript_sdk()
		.target_runtime()
	)
@func()
async example(): Promise<string> {
	return dag
		.typescriptSdk()
		.targetRuntime()
}

modules() 🔗

Return every legacy dagger.json Dagger module whose sdk.source is “typescript”.

Return Type
[TypescriptSdkMod ! ] !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() []*dagger.TypescriptSdkMod  {
	return dag.
			TypescriptSdk().
			Modules()
}
@function
def example() -> List[dagger.TypescriptSdkMod]:
	return (
		dag.typescript_sdk()
		.modules()
	)
@func()
example(): TypescriptSdkMod[] {
	return dag
		.typescriptSdk()
		.modules()
}

mod() 🔗

Return the TypeScript SDK module at or above a workspace path.

When findUp is true, path may point inside the module.

Return Type
TypescriptSdkMod !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
pathString -No description provided
findUpBoolean -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.TypescriptSdkMod  {
	return dag.
			TypescriptSdk().
			Mod()
}
@function
def example() -> dagger.TypescriptSdkMod:
	return (
		dag.typescript_sdk()
		.mod()
	)
@func()
example(): TypescriptSdkMod {
	return dag
		.typescriptSdk()
		.mod()
}

initModule() 🔗

Initialize TypeScript-owned files for a new Dagger module.

The engine resolves the destination path and owns the module’s dagger.json; this function only returns the SDK-owned files to layer onto path (the rendered template plus runtime-specific config).

Pass template to materialize files from templates/. The empty default uses this module’s default template.

Pass packageManager or baseImage to customize the generated config. Defaults leave the template unconfigured: no packageManager field is written, and no base image override is set. packageManager is only supported with runtime = NODE; Bun and Deno bundle their own. packageManager accepts the Node-standard name@version syntax (e.g. pnpm@8.15.4), or just the name if you want the engine’s default version.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
nameString !-No description provided
pathString !-No description provided
templateString -No description provided
runtimeEnum -No description provided
packageManagerString -No description provided
baseImageString -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(name string, path string) *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			InitModule(name, path)
}
@function
def example(name: str, path: str) -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.init_module(name, path)
	)
@func()
example(name: string, path: string): Changeset {
	return dag
		.typescriptSdk()
		.initModule(name, path)
}

initClient() 🔗

Register a typed TypeScript client for module at path.

The engine resolves module, records the client (generator + directory) in workspace config and the target dagger.json, and generates the client files itself. The SDK contributes no files of its own, so this returns an empty Changeset. dev selects the local development client instead of a pinned release.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
pathString !-No description provided
moduleString !-No description provided
devBoolean -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(path string, module string) *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			InitClient(path, module)
}
@function
def example(path: str, module: str) -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.init_client(path, module)
	)
@func()
example(path: string, module: string): Changeset {
	return dag
		.typescriptSdk()
		.initClient(path, module)
}

templates() 🔗

Return init templates tracked by this module.

Templates live under templates/ and are materialized into the new module. Passing an empty template to init uses the module default.

Return Type
[TypescriptSdkTemplate ! ] !
Example
dagger -m github.com/dagger/typescript-sdk@08aa5bd8dd7d1d2ad8e16cb69a23804ea26e2a1c call \
 templates
func (m *MyModule) Example() []*dagger.TypescriptSdkTemplate  {
	return dag.
			TypescriptSdk().
			Templates()
}
@function
def example() -> List[dagger.TypescriptSdkTemplate]:
	return (
		dag.typescript_sdk()
		.templates()
	)
@func()
example(): TypescriptSdkTemplate[] {
	return dag
		.typescriptSdk()
		.templates()
}

generateAll() 🔗

Generate all discovered legacy dagger.json TypeScript SDK modules.

This discovery path is obsolete for workspace-managed modules; the engine owns the modules..as-sdk.modules source of truth.

Modules with the generate skip marker are skipped.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			GenerateAll()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.generate_all()
	)
@func()
example(): Changeset {
	return dag
		.typescriptSdk()
		.generateAll()
}

TypescriptSdkMod 🔗

A Dagger module that uses the TypeScript SDK.

path() 🔗

Workspace-relative path of this module root.

Return Type
String !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			TypescriptSdk().
			Mod().
			Path(ctx)
}
@function
async def example() -> str:
	return await (
		dag.typescript_sdk()
		.mod()
		.path()
	)
@func()
async example(): Promise<string> {
	return dag
		.typescriptSdk()
		.mod()
		.path()
}

skipGenerate() 🔗

Whether this module or an ancestor contains the configured generate skip marker.

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example(ctx context.Context) bool  {
	return dag.
			TypescriptSdk().
			Mod().
			SkipGenerate(ctx)
}
@function
async def example() -> bool:
	return await (
		dag.typescript_sdk()
		.mod()
		.skip_generate()
	)
@func()
async example(): Promise<boolean> {
	return dag
		.typescriptSdk()
		.mod()
		.skipGenerate()
}

config() 🔗

Manage this module’s TypeScript SDK build configuration (package.json, deno.json).

Return Type
TypescriptSdkModConfig !
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.TypescriptSdkModConfig  {
	return dag.
			TypescriptSdk().
			Mod().
			Config()
}
@function
def example() -> dagger.TypescriptSdkModConfig:
	return (
		dag.typescript_sdk()
		.mod()
		.config()
	)
@func()
example(): TypescriptSdkModConfig {
	return dag
		.typescriptSdk()
		.mod()
		.config()
}

generate() 🔗

Generate this module. If the generate skip marker is present, the changeset is empty.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
wsWorkspace -No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *MyModule) Example() *dagger.Changeset  {
	return dag.
			TypescriptSdk().
			Mod().
			Generate()
}
@function
def example() -> dagger.Changeset:
	return (
		dag.typescript_sdk()
		.mod()
		.generate()
	)
@func()
example(): Changeset {
	return dag
		.typescriptSdk()
		.mod()
		.generate()
}

TypescriptSdkTemplate 🔗

An init template tracked by this module.

name() 🔗

Template name passed to init.

Return Type
String !
Example
Function TypescriptSdkTemplate.name is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.name is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.name is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.name is not accessible from the typescript-sdk module

source() 🔗

Template source files materialized into the new module before generation.

Return Type
Directory !
Example
Function TypescriptSdkTemplate.source is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.source is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.source is not accessible from the typescript-sdk module
Function TypescriptSdkTemplate.source is not accessible from the typescript-sdk module