Dagger
Search

staydevops-ts

No long description provided.

Installation

dagger install github.com/StaytunedLLP/daggerverse@v1.3.0

Entrypoint

Return Type
StaydevopsTs
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
func (m *MyModule) Example() *dagger.StaydevopsTs  {
	return dag.
			StaydevopsTs()
}
@function
def example() -> dagger.StaydevopsTs:
	return (
		dag.staydevops_ts()
	)
@func()
example(): StaydevopsTs {
	return dag
		.staydevopsTs()
}

Types

StaydevopsTs 🔗

Shared Dagger module for Node/TypeScript repository checks and deployment helpers. `Staydevops-TS` is a comprehensive toolkit designed to streamline CI/CD pipelines for modern TypeScript applications. It provides a suite of high-level Dagger functions for: - 🔍 **Repository Health**: Automated linting, formatting, and build verification. - 🧪 **Advanced Testing**: Integrated Playwright E2E testing with built-in "Affected Test" discovery. - 🚀 **Firebase Deployment**: Streamlined pipelines for Firebase Hosting and App Hosting. - 📦 **Package Publishing**: Deterministic npm publishing with automatic GitHub Release integration. - 📂 **Git Utilities**: Helpers for discovering changed files and diff ranges. Built with performance and security in mind, this module leverages Dagger's advanced caching and secure secret handling to provide a robust foundation for staytunedllp infrastructure and beyond.

checks() 🔗

Returns the collection of repository checks.

Return Type
StaydevopsTsChecks !
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 checks
func (m *MyModule) Example() *dagger.StaydevopsTsChecks  {
	return dag.
			StaydevopsTs().
			Checks()
}
@function
def example() -> dagger.StaydevopsTsChecks:
	return (
		dag.staydevops_ts()
		.checks()
	)
@func()
example(): StaydevopsTsChecks {
	return dag
		.staydevopsTs()
		.checks()
}

testPlaywright() 🔗

Orchestrates high-performance Playwright E2E test execution.

Includes advanced features like dependency layering, browser caching, and Staytuned’s “Affected Test” discovery for lightning-fast feedback loops.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- The repository source directory.
nodeAuthTokenSecret -- Optional secret token for GitHub Packages npm authentication.
packagePathsString !"."- The target package path (or CSV list) relative to the source root.
testSelectorString !""- Optional selector expression (path or tag) passed to Playwright via `--`.
testScriptString !"test:e2e"- The npm script to invoke for testing. Defaults to 'test:e2e'.
runBuildBoolean !true- When true, ensures 'npm run build' completes before test execution. Highly recommended for TypeScript projects.
registryScopeString !"staytunedllp"- The GitHub Packages organization scope (e.g. 'staytunedllp').
browsersString !"chromium"- Comma-separated list of browsers to provision (supported: 'chromium', 'firefox', 'webkit').
runAffectedBoolean !false- Enable intelligent test discovery to run only tests affected by your current git diff.
baseString !"origin/main"- The base git ref to compare against for affected discovery (e.g. 'origin/main').
listOnlyBoolean !false- Disables test execution and instead returns the discovered test selectors as a string.
changedFilesString !""- Manually specify a list of changed files to use for affected discovery, bypassing git diff.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 test-playwright --package-paths string --test-selector string --test-script string --run-build boolean --registry-scope string --browsers string --run-affected boolean --base string --list-only boolean --changed-files string
func (m *MyModule) Example(ctx context.Context, packagePaths string, testSelector string, testScript string, runBuild bool, registryScope string, browsers string, runAffected bool, base string, listOnly bool, changedFiles string) string  {
	return dag.
			StaydevopsTs().
			TestPlaywright(ctxpackagePaths, testSelector, testScript, runBuild, registryScope, browsers, runAffected, base, listOnly, changedFiles)
}
@function
async def example(package_paths: str, test_selector: str, test_script: str, run_build: bool, registry_scope: str, browsers: str, run_affected: bool, base: str, list_only: bool, changed_files: str) -> str:
	return await (
		dag.staydevops_ts()
		.test_playwright(package_paths, test_selector, test_script, run_build, registry_scope, browsers, run_affected, base, list_only, changed_files)
	)
@func()
async example(packagePaths: string, testSelector: string, testScript: string, runBuild: boolean, registryScope: string, browsers: string, runAffected: boolean, base: string, listOnly: boolean, changedFiles: string): Promise<string> {
	return dag
		.staydevopsTs()
		.testPlaywright(packagePaths, testSelector, testScript, runBuild, registryScope, browsers, runAffected, base, listOnly, changedFiles)
}

gitDiff() 🔗

Retrieves an array of changed file paths using git diff.

This is a powerful helper for automating logic based on PR changes.

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- The source directory to check for changed files.
modeString !"staged"- The diffing strategy: 'staged' (uncommitted), 'previous' (last commit), or 'between' (custom range).
commitRangeString !""- The specific git range string (e.g. "HEAD~2..HEAD"). Required if mode is 'between'.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 git-diff --mode string --commit-range string
func (m *MyModule) Example(ctx context.Context, mode string, commitRange string) []string  {
	return dag.
			StaydevopsTs().
			GitDiff(ctxmode, commitRange)
}
@function
async def example(mode: str, commit_range: str) -> List[str]:
	return await (
		dag.staydevops_ts()
		.git_diff(mode, commit_range)
	)
@func()
async example(mode: string, commitRange: string): Promise<string[]> {
	return dag
		.staydevopsTs()
		.gitDiff(mode, commitRange)
}

fbApphosting() 🔗

Unified management of Firebase App Hosting backends.

This function automates the creation, deployment, and deletion of App Hosting backends, supporting both Personal Access Tokens and Workload Identity Federation (WIF).

Return Type
String !
Arguments
NameTypeDefault ValueDescription
actionString !-- The backend lifecycle action: 'deploy' or 'delete'.
projectIdString !-- The unique identifier of your Firebase/GCP project.
backendIdString !-- The unique identifier for this specific App Hosting backend.
sourceDirectory -- Repository source directory (required for 'deploy' action).
rootDirString !"."- Root directory of the application inside your repository. Defaults to '.'.
appIdString !""- Associate this backend with a specific Firebase Web App ID (deploy only).
regionString !"asia-southeast1"- The GCP region to provision the backend in (e.g. 'us-central1').
gcpCredentialsSecret -- Optional secret containing GCP service account JSON content.
wifProviderString !""- Full resource name of the WIF provider (deploy only).
wifServiceAccountString !""- Email of the service account to impersonate via WIF (deploy only).
wifOidcTokenSecret -- OIDC token secret required for WIF authentication in CI environments.
wifAudienceString !""- Optional specific audience for the WIF OIDC token.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 fb-apphosting --action string --project-id string --backend-id string --root-dir string --app-id string --region string --wif-provider string --wif-service-account string --wif-audience string
func (m *MyModule) Example(ctx context.Context, action string, projectId string, backendId string, rootDir string, appId string, region string, wifProvider string, wifServiceAccount string, wifAudience string) string  {
	return dag.
			StaydevopsTs().
			FbApphosting(ctx, action, projectId, backendId, rootDir, appId, region, wifProvider, wifServiceAccount, wifAudience)
}
@function
async def example(action: str, project_id: str, backend_id: str, root_dir: str, app_id: str, region: str, wif_provider: str, wif_service_account: str, wif_audience: str) -> str:
	return await (
		dag.staydevops_ts()
		.fb_apphosting(action, project_id, backend_id, root_dir, app_id, region, wif_provider, wif_service_account, wif_audience)
	)
@func()
async example(action: string, projectId: string, backendId: string, rootDir: string, appId: string, region: string, wifProvider: string, wifServiceAccount: string, wifAudience: string): Promise<string> {
	return dag
		.staydevopsTs()
		.fbApphosting(action, projectId, backendId, rootDir, appId, region, wifProvider, wifServiceAccount, wifAudience)
}

fbWebhosting() 🔗

High-level pipeline for building and deploying Firebase Web Hosting projects.

This function provides a complete “Build once, deploy anywhere” workflow by: 1. Preparing a Node workspace with all required dependencies. 2. Injecting Firebase App ID and Web App Config into the frontend environment. 3. Executing the frontend build (e.g. ‘npm run build’). 4. Authenticating with GCP and deploying to Firebase Hosting.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory containing the Firebase project and application packages.
projectIdString !-- The target Firebase project ID.
gcpCredentialsSecret !-- Secret container for the GCP service account JSON key.
appIdString -- Optional Firebase App ID to inject as NEXT_PUBLIC_FIREBASE_APP_ID or similar.
onlyString -- Optional deployment filter (e.g. 'hosting', 'functions').
frontendDirString -- Relative path to the frontend package directory.
backendDirString -- Relative path to a backend or secondary package directory to prepare.
firebaseDirString -- Directory containing 'firebase.json'. Defaults to the workspace root.
webappConfigSecret -- Optional secret JSON containing the full Firebase web app configuration.
extraEnvSecret -- Optional secret containing extra environment variables for the frontend build.
nodeAuthTokenSecret -- Optional secret token for GitHub Packages npm authentication.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 fb-webhosting --project-id string --gcp-credentials env:MYSECRET
func (m *MyModule) Example(ctx context.Context, projectId string, gcpCredentials *dagger.Secret) string  {
	return dag.
			StaydevopsTs().
			FbWebhosting(ctxprojectId, gcpCredentials)
}
@function
async def example(project_id: str, gcp_credentials: dagger.Secret) -> str:
	return await (
		dag.staydevops_ts()
		.fb_webhosting(project_id, gcp_credentials)
	)
@func()
async example(projectId: string, gcpCredentials: Secret): Promise<string> {
	return dag
		.staydevopsTs()
		.fbWebhosting(projectId, gcpCredentials)
}

publishPackage() 🔗

Deterministic and secure npm package publishing pipeline.

This function manages the full release lifecycle including: 1. Version validation and conflict checking against the GitHub Packages registry. 2. Automated PR-based pre-release versioning (e.g. 1.0.0-pre-pr42). 3. Collaborative release finalization for merged Pull Requests. 4. Creation of GitHub Releases and associated git tags.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory to publish from.
refString !-- The git ref triggering the release (e.g. 'refs/heads/main' or a tag).
eventNameString !-- The GitHub event name (allowed: 'workflow_dispatch', 'push').
githubTokenSecret !-- GitHub Personal Access Token (PAT) with repository and package write scopes.
repoOwnerString !-- The GitHub organization or user (e.g. 'StaytunedLLP').
repoNameString !-- The repository name.
inputBranchString -- The branch name to target when triggered via manual dispatch.
releasePrNumberInteger -- The Pull Request number associated with the release (for automated finalization).
registryScopeString -- The organization scope for the npm package. Defaults to 'staytunedllp'.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 publish-package --ref string --event-name string --github-token env:MYSECRET --repo-owner string --repo-name string
func (m *MyModule) Example(ctx context.Context, ref string, eventName string, githubToken *dagger.Secret, repoOwner string, repoName string) string  {
	return dag.
			StaydevopsTs().
			PublishPackage(ctxref, eventName, githubToken, repoOwner, repoName)
}
@function
async def example(ref: str, event_name: str, github_token: dagger.Secret, repo_owner: str, repo_name: str) -> str:
	return await (
		dag.staydevops_ts()
		.publish_package(ref, event_name, github_token, repo_owner, repo_name)
	)
@func()
async example(ref: string, eventName: string, githubToken: Secret, repoOwner: string, repoName: string): Promise<string> {
	return dag
		.staydevopsTs()
		.publishPackage(ref, eventName, githubToken, repoOwner, repoName)
}

StaydevopsTsChecks 🔗

Collection of repository checks and validation tools for Node.js projects. This sub-module provides high-performance, cache-efficient workflows for common CI tasks such as formatting, linting, testing, and building. It is designed to work seamlessly in both standard repositories and monorepos.

install() 🔗

Fully prepares a Node.js workspace environment by: 1. Synchronizing repository manifests (.npmrc, package-lock.json). 2. Authenticating with the GitHub Packages registry. 3. Mounting persistent cache volumes for maximum performance. 4. Installing production and development dependencies via ‘npm ci’. 5. (Optional) Provisioning Playwright browsers and system dependencies. 6. (Optional) Bootstrapping Firebase CLI tooling.

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory to install into the workspace container.
nodeAuthTokenSecret -- Optional secret token for GitHub Packages npm authentication. Required for private packages.
packagePathsString !"."- Relative path (or CSV list of paths) where npm installs should run. Defaults to the source root.
playwrightInstallBoolean !false- Enable to install Playwright browsers and OS-level system dependencies into the container.
firebaseToolsBoolean !false- Enable to install the Firebase CLI (firebase-tools) into the prepared workspace.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 checks \
 install --package-paths string --playwright-install boolean --firebase-tools boolean
func (m *MyModule) Example(packagePaths string, playwrightInstall bool, firebaseTools bool) *dagger.Directory  {
	return dag.
			StaydevopsTs().
			Checks().
			Install(packagePaths, playwrightInstall, firebaseTools)
}
@function
def example(package_paths: str, playwright_install: bool, firebase_tools: bool) -> dagger.Directory:
	return (
		dag.staydevops_ts()
		.checks()
		.install(package_paths, playwright_install, firebase_tools)
	)
@func()
example(packagePaths: string, playwrightInstall: boolean, firebaseTools: boolean): Directory {
	return dag
		.staydevopsTs()
		.checks()
		.install(packagePaths, playwrightInstall, firebaseTools)
}

format() 🔗

Validates repository formatting using the standard npm run format:check command.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory to validate.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 checks \
 format
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			StaydevopsTs().
			Checks().
			Format(ctx)
}
@function
async def example() -> None:
	return await (
		dag.staydevops_ts()
		.checks()
		.format()
	)
@func()
async example(): Promise<void> {
	return dag
		.staydevopsTs()
		.checks()
		.format()
}

lint() 🔗

Executes the repository linter using the standard npm run lint command.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory to lint.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 checks \
 lint
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			StaydevopsTs().
			Checks().
			Lint(ctx)
}
@function
async def example() -> None:
	return await (
		dag.staydevops_ts()
		.checks()
		.lint()
	)
@func()
async example(): Promise<void> {
	return dag
		.staydevopsTs()
		.checks()
		.lint()
}

build() 🔗

Verifies that the repository builds successfully using the npm run build command.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory to build.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 checks \
 build
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			StaydevopsTs().
			Checks().
			Build(ctx)
}
@function
async def example() -> None:
	return await (
		dag.staydevops_ts()
		.checks()
		.build()
	)
@func()
async example(): Promise<void> {
	return dag
		.staydevopsTs()
		.checks()
		.build()
}

test() 🔗

Executes the standard repository test suite using the npm run test command.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -- Repository source directory to test.
Example
dagger -m github.com/StaytunedLLP/daggerverse@25c29b2752758097f0a37a10c52cfaf2ec491818 call \
 checks \
 test
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			StaydevopsTs().
			Checks().
			Test(ctx)
}
@function
async def example() -> None:
	return await (
		dag.staydevops_ts()
		.checks()
		.test()
	)
@func()
async example(): Promise<void> {
	return dag
		.staydevopsTs()
		.checks()
		.test()
}