NexisChat Docs
ActionsSetup

Scripts Package

Overview of the @repo/scripts package utilities for CI/CD, local testing, and automation.

The @repo/scripts package provides TypeScript-based utilities for CI/CD automation, local testing, and development workflows.

Package Overview

Location: packages/scripts/
Language: TypeScript (migrated from JavaScript)
Execution: Runs with bun for better performance
CI Integration: Removed from ci-ignores.json and fully integrated into CI workflows

Available Scripts

CI/CD Scripts

ci-validation

Validates packages across the monorepo with comprehensive checks.

bun run ci-validation [options]

Features:

  • TypeScript type checking
  • ESLint linting
  • Prettier formatting validation
  • Build verification
  • Respects ci-ignores.json configuration
  • Generates TODO lists for failed checks

pre-push-validation

Runs validation checks on changed files before push.

bun run pre-push-validation

Features:

  • Change detection based on git diff
  • Filtered validation of only changed workspaces
  • Prettier format checking
  • Quick feedback before pushing

update-dependencies

Automates dependency updates across the workspace.

bun run update-dependencies [options]

Local Testing Scripts

act-test

Helper script for running GitHub Actions locally using act.

bun run act-test <command>

Commands:

  • list - List available workflows
  • ci - Run the main CI workflow
  • job <workflow> <job> - Run specific job
  • dry-run <workflow> - Perform dry run
  • setup - Setup secrets file

Examples:

bun run act-test list
bun run act-test ci
bun run act-test job ci typecheck
bun run act-test dry-run ci

act-component-test

Test specific components with act.

bun run act-component-test <command>

Commands:

  • list - List available components
  • test <component> <type> - Test specific component
  • test-all <type> - Test all components

Examples:

bun run act-component-test list
bun run act-component-test test apps/client build
bun run act-component-test test-all lint

Performance & Analysis

measure-speed

Measures build and execution performance across packages.

bun run measure-speed [options]

compare-ui-components

Compares UI component implementations and provides analysis.

bun run compare-ui-components [options]

Git Utilities

add-subtree / pull-subtree

Git subtree management utilities.

# Located in packages/scripts/src/
./add-subtree.sh <remote> <prefix>
./pull-subtree.sh <prefix>

Spec Kit Scripts

The package includes specialized scripts for the Spec Kit workflow under packages/scripts/src/spec-kit/:

ScriptPurpose
create-new-feature.shScaffolds feature directories and templates
get-feature-paths.shResolves canonical paths for artifacts
setup-plan.shPrepares context for plan generation
update-agent-context.shRefreshes derived context for agents
check-task-prerequisites.shValidates environment before task implementation
common.shShared utility functions

See the Spec Kit documentation for detailed usage.

Configuration

CI Ignores

Scripts respect the ci-ignores.json configuration for skipping validation on specific packages or check types.

Package.json Integration

Scripts are available as workspace binaries and can be called from any package:

{
  "scripts": {
    "test:local": "bun run act-test ci"
  }
}

Migration Notes

From JavaScript to TypeScript

  • All scripts now use TypeScript for better type safety
  • Proper error handling and type definitions
  • Enhanced IDE support and refactoring capabilities

From pnpm exec to bun

  • Commands now use bun run instead of pnpm exec
  • Improved execution performance
  • Better TypeScript support

From Root to Package

  • Scripts moved from repository root to dedicated packages/scripts/ package
  • Spec Kit scripts organized under packages/scripts/src/spec-kit/
  • Cleaner repository structure and better organization

Development

Building the Package

cd packages/scripts
bun run build

Type Checking

cd packages/scripts
bun run typecheck

Linting

cd packages/scripts
bun run lint

Troubleshooting

Permission Issues

Ensure shell scripts are executable:

chmod +x packages/scripts/src/spec-kit/*.sh
chmod +x packages/scripts/src/*.sh

Bun Not Found

Install bun globally:

curl -fsSL https://bun.sh/install | bash

Missing Dependencies

Install package dependencies:

cd packages/scripts
bun install