staydevops-ts
No long description provided.
Installation
dagger install github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6cEntrypoint
Return Type
StaydevopsTs Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c 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 Release Automation**: main-aware PR patch bumps and main-branch npm publishing. - 📂 **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.
checkPrTitle() 🔗
Validates the PR title according to Conventional Commits naming convention.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| eventFile | File | - | - Optional GitHub event JSON file containing the PR title. |
| githubToken | Secret | - | - Optional GitHub token to post a comment if validation fails. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
check-pr-titlefunc (m *MyModule) Example(ctx context.Context) {
return dag.
StaydevopsTs().
CheckPrTitle(ctx)
}@function
async def example() -> None:
return await (
dag.staydevops_ts()
.check_pr_title()
)@func()
async example(): Promise<void> {
return dag
.staydevopsTs()
.checkPrTitle()
}checks() 🔗
Returns the collection of repository checks.
Return Type
StaydevopsTsChecks ! Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
checksfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - The repository source directory. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. |
| packagePaths | String ! | "." | - The target package path (or CSV list) relative to the source root. |
| testSelector | String ! | "" | - Optional selector expression (path or tag) passed to Playwright via `--`. |
| testScript | String ! | "test:e2e" | - The npm script to invoke for testing. Defaults to 'test:e2e'. |
| runBuild | Boolean ! | true | - When true, ensures 'npm run build' completes before test execution. Highly recommended for TypeScript projects. |
| registryScope | String ! | "staytunedllp" | - The GitHub Packages organization scope (e.g. 'staytunedllp'). |
| browsers | String ! | "chromium" | - Comma-separated list of browsers to provision (supported: 'chromium', 'firefox', 'webkit'). |
| runAffected | Boolean ! | false | - Enable intelligent test discovery to run only tests affected by your current git diff. |
| base | String ! | "origin/main" | - The base git ref to compare against for affected discovery (e.g. 'origin/main'). |
| listOnly | Boolean ! | false | - Disables test execution and instead returns the discovered test selectors as a string. |
| changedFiles | String ! | "" | - Manually specify a list of changed files to use for affected discovery, bypassing git diff. |
| skipReferenceChecks | Boolean ! | true | No description provided |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c 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 --skip-reference-checks booleanfunc (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, skipReferenceChecks bool) string {
return dag.
StaydevopsTs().
TestPlaywright(ctxpackagePaths, testSelector, testScript, runBuild, registryScope, browsers, runAffected, base, listOnly, changedFiles, skipReferenceChecks)
}@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, skip_reference_checks: bool) -> 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, skip_reference_checks)
)@func()
async example(packagePaths: string, testSelector: string, testScript: string, runBuild: boolean, registryScope: string, browsers: string, runAffected: boolean, base: string, listOnly: boolean, changedFiles: string, skipReferenceChecks: boolean): Promise<string> {
return dag
.staydevopsTs()
.testPlaywright(packagePaths, testSelector, testScript, runBuild, registryScope, browsers, runAffected, base, listOnly, changedFiles, skipReferenceChecks)
}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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - The source directory to check for changed files. |
| mode | String ! | "staged" | - The diffing strategy: 'staged' (uncommitted), 'previous' (last commit), or 'between' (custom range). |
| commitRange | String ! | "" | - The specific git range string (e.g. "HEAD~2..HEAD"). Required if mode is 'between'. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
git-diff --mode string --commit-range stringfunc (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).
When buildBeforeDeploy is enabled for deploys, it prepares the source
for the selected frontend profile by writing env files from the Firebase
web app config and running the package build before Firebase deploys the
backend.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| action | String ! | - | - The backend lifecycle action: 'deploy' or 'delete'. |
| projectId | String ! | - | - The unique identifier of your Firebase/GCP project. |
| backendId | String ! | - | - The unique identifier for this specific App Hosting backend. |
| source | Directory | - | - Repository source directory (required for 'deploy' action). |
| rootDir | String ! | "." | - Root directory of the application inside your repository. Defaults to '.'. |
| appId | String ! | "" | - Associate this backend with a specific Firebase Web App ID (deploy only). |
| region | String ! | "asia-southeast1" | - The GCP region to provision the backend in (e.g. 'us-central1'). |
| gcpCredentials | Secret | - | - Optional secret containing GCP service account JSON content. |
| webappConfig | Secret | - | - Optional secret JSON containing the full Firebase web app configuration. |
| extraEnv | Secret | - | - Optional secret containing extra environment variables for the frontend build. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. |
| registryScope | String | - | - The GitHub Packages organization scope (e.g. 'staytunedllp'). |
| buildProfile | String ! | "vite" | - Frontend build profile for env file generation. Use 'staystack' for Staystack apps. |
| wifProvider | String ! | "" | - Full resource name of the WIF provider (deploy only). |
| wifServiceAccount | String ! | "" | - Email of the service account to impersonate via WIF (deploy only). |
| wifOidcToken | Secret | - | - OIDC token secret required for WIF authentication in CI environments. |
| wifAudience | String ! | "" | - Optional specific audience for the WIF OIDC token. |
| buildBeforeDeploy | Boolean ! | false | - When true, installs dependencies, writes env files, and runs the package build before deploy. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
fb-apphosting --action string --project-id string --backend-id string --root-dir string --app-id string --region string --build-profile string --wif-provider string --wif-service-account string --wif-audience string --build-before-deploy booleanfunc (m *MyModule) Example(ctx context.Context, action string, projectId string, backendId string, rootDir string, appId string, region string, buildProfile string, wifProvider string, wifServiceAccount string, wifAudience string, buildBeforeDeploy bool) string {
return dag.
StaydevopsTs().
FbApphosting(ctx, action, projectId, backendId, rootDir, appId, region, buildProfile, wifProvider, wifServiceAccount, wifAudience, buildBeforeDeploy)
}@function
async def example(action: str, project_id: str, backend_id: str, root_dir: str, app_id: str, region: str, build_profile: str, wif_provider: str, wif_service_account: str, wif_audience: str, build_before_deploy: bool) -> str:
return await (
dag.staydevops_ts()
.fb_apphosting(action, project_id, backend_id, root_dir, app_id, region, build_profile, wif_provider, wif_service_account, wif_audience, build_before_deploy)
)@func()
async example(action: string, projectId: string, backendId: string, rootDir: string, appId: string, region: string, buildProfile: string, wifProvider: string, wifServiceAccount: string, wifAudience: string, buildBeforeDeploy: boolean): Promise<string> {
return dag
.staydevopsTs()
.fbApphosting(action, projectId, backendId, rootDir, appId, region, buildProfile, wifProvider, wifServiceAccount, wifAudience, buildBeforeDeploy)
}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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - Repository source directory containing the Firebase project and application packages. |
| projectId | String ! | - | - The target Firebase project ID. |
| gcpCredentials | Secret ! | - | - Secret container for the GCP service account JSON key. |
| appId | String | - | - Optional Firebase App ID to inject as NEXT_PUBLIC_FIREBASE_APP_ID or similar. |
| only | String | - | - Optional deployment filter (e.g. 'hosting', 'functions'). |
| frontendDir | String | - | - Relative path to the frontend package directory. |
| backendDir | String | - | - Relative path to a backend or secondary package directory to prepare. |
| firebaseDir | String | - | - Directory containing 'firebase.json'. Defaults to the workspace root. |
| webappConfig | Secret | - | - Optional secret JSON containing the full Firebase web app configuration. |
| extraEnv | Secret | - | - Optional secret containing extra environment variables for the frontend build. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
fb-webhosting --project-id string --gcp-credentials env:MYSECRETfunc (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)
}releasePackage() 🔗
Production package release pipeline with deterministic PR version sync and main-only publishing.
Use sync-pr-version in pull request workflows to keep package.json and package-lock.json
ahead of the latest base branch patch version without overwriting manual major/minor bumps.
When a bump is needed, the function commits and pushes the update back to the PR branch.
Use publish on the main branch to validate the canonical package version, detect registry
conflicts, publish the package, and push the release tag.
This flow assumes branch protection requires pull requests to be up to date before merging.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| action | String ! | - | - Release pipeline action to run. |
| source | Directory | - | - Repository source directory to operate on. |
| githubToken | Secret ! | - | - GitHub token with repository read access and package write access. |
| repoOwner | String ! | - | - The GitHub organization or user (for example, `StaytunedLLP`). |
| repoName | String ! | - | - The repository name. |
| registryScope | String | - | - The organization scope for the npm package. Defaults to the package scope. |
| baseBranch | String | - | - Authoritative base branch for PR version synchronization. Defaults to `main`. |
| packagePath | String | - | - Repo-relative path to the package folder on the base branch. Defaults to the repository root. |
| prBranch | String | - | - Pull request branch name being synchronized. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
release-package --action string --github-token env:MYSECRET --repo-owner string --repo-name stringfunc (m *MyModule) Example(ctx context.Context, action string, githubToken *dagger.Secret, repoOwner string, repoName string) string {
return dag.
StaydevopsTs().
ReleasePackage(ctx, action, githubToken, repoOwner, repoName)
}@function
async def example(action: str, github_token: dagger.Secret, repo_owner: str, repo_name: str) -> str:
return await (
dag.staydevops_ts()
.release_package(action, github_token, repo_owner, repo_name)
)@func()
async example(action: string, githubToken: Secret, repoOwner: string, repoName: string): Promise<string> {
return dag
.staydevopsTs()
.releasePackage(action, 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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - Repository source directory to install into the workspace container. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. Required for private packages. |
| packagePaths | String ! | "." | - Relative path (or CSV list of paths) where npm installs should run. Defaults to the source root. |
| playwrightInstall | Boolean ! | false | - Enable to install Playwright browsers and OS-level system dependencies into the container. |
| firebaseTools | Boolean ! | false | - Enable to install the Firebase CLI (firebase-tools) into the prepared workspace. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
checks \
install --package-paths string --playwright-install boolean --firebase-tools booleanfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - Repository source directory to validate. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. Required for private packages. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
checks \
formatfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - Repository source directory to lint. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. Required for private packages. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
checks \
lintfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - Repository source directory to build. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. Required for private packages. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
checks \
buildfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | - Repository source directory to test. |
| nodeAuthToken | Secret | - | - Optional secret token for GitHub Packages npm authentication. Required for private packages. |
Example
dagger -m github.com/StaytunedLLP/daggerverse@aab6ad52c6c00210532b2e586df1770799fc5a6c call \
checks \
testfunc (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()
}