@vyriy/scripts
v0.9.3
Published
Shared scripts package for Vyriy projects
Readme
@vyriy/scripts
Part of Vyriy - a calm architecture toolkit for TypeScript, React, SSR, SSG, APIs, and cloud-ready apps.
Full documentation: https://vyriy.dev/docs/scripts/
Shared script factories for Vyriy projects.
Purpose
This package collects reusable deployment, build, smoke-test, and post-deploy script factories.
Every export is built on @vyriy/script, the common process wrapper used by Vyriy scripts. The wrapper keeps script execution consistent by centralizing process lifecycle behavior such as logging, timeout handling, and error reporting.
The package is meant for CI/CD and project-local automation where a project needs small, composable scripts instead of one large deployment framework.
Install
With npm:
npm install @vyriy/scriptsWith Yarn:
yarn add @vyriy/scriptsScript Groups
API Smoke Scripts
lambdainvokes a Lambda function directly with the shared smoke payload. Run this first when an API is backed by Lambda, because it shows whether the function is alive and its dependencies can load.healthcheckcalls the standard API Gateway healthcheck endpoint. This is the narrow API smoke check and is a good next step afterlambda.apiresolves the API Gateway URL and passes it to a callback for custom API smoke scenarios across one or more endpoints.
Deployment Scripts
deployruns AWS CDK synth, diff, and deploy in CI mode.dockerbuilds and pushes a Docker image to ECR with Docker Buildx.kanikobuilds and pushes a Docker image to ECR with Kaniko, usually for container-native CI.
docker and kaniko can be part of a deployment flow for services such as AWS Fargate tasks.
Static Smoke Scripts
mfechecks a static MFE distribution by requesting the distribution URL,index.html, andindex.js.sitechecks a static website by requesting the site URL,robots.txt,sitemap.xml, and every URL listed in the sitemap.
Both scripts are smoke tests, but at different static delivery levels: mfe is focused on a widget/application bundle, while site is focused on a complete static website.
Post-Deploy Scripts
webhookstriggers API webhook endpoints after deployment.
Use webhooks for environment preparation after a deployment. For example, a feature environment may need to call API webhooks that generate translations, warm content, or start a Fargate task before manual or automated testing begins.
Exports
import { api, deploy, docker, healthcheck, kaniko, lambda, mfe, site, webhooks } from '@vyriy/scripts';Subpath imports are also supported:
import { api } from '@vyriy/scripts/api';
import { deploy } from '@vyriy/scripts/deploy';
import { docker } from '@vyriy/scripts/docker';
import { healthcheck } from '@vyriy/scripts/healthcheck';
import { kaniko } from '@vyriy/scripts/kaniko';
import { lambda } from '@vyriy/scripts/lambda';
import { mfe } from '@vyriy/scripts/mfe';
import { site } from '@vyriy/scripts/site';
import { webhooks } from '@vyriy/scripts/webhooks';Examples
Lambda Smoke Test
import { lambda } from '@vyriy/scripts/lambda';
await lambda('my-function');API Healthcheck
import { healthcheck } from '@vyriy/scripts/healthcheck';
await healthcheck();
await healthcheck('CustomApiUrl', 'status');API Scenario
import { api } from '@vyriy/scripts/api';
await api(async (url) => {
await fetch(`${url}healthcheck`);
await fetch(`${url}users/me`);
});CDK Deployment
import { deploy } from '@vyriy/scripts/deploy';
await deploy();Docker Image Deployment
import { docker } from '@vyriy/scripts/docker';
await docker('./apps/api');Kaniko Image Deployment
import { kaniko } from '@vyriy/scripts/kaniko';
await kaniko('./apps/api');MFE Smoke Test
import { mfe } from '@vyriy/scripts/mfe';
await mfe();
await mfe('CustomDistributionUrl');Static Site Smoke Test
import { site } from '@vyriy/scripts/site';
await site();
await site('CustomSiteUrl');Webhook Execution
import { webhooks } from '@vyriy/scripts/webhooks';
await webhooks(['webhooks/build', 'webhooks/deploy']);