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.jsonconfiguration - Generates TODO lists for failed checks
pre-push-validation
Runs validation checks on changed files before push.
bun run pre-push-validationFeatures:
- 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 workflowsci- Run the main CI workflowjob <workflow> <job>- Run specific jobdry-run <workflow>- Perform dry runsetup- 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 ciact-component-test
Test specific components with act.
bun run act-component-test <command>Commands:
list- List available componentstest <component> <type>- Test specific componenttest-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 lintPerformance & 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/:
| Script | Purpose |
|---|---|
create-new-feature.sh | Scaffolds feature directories and templates |
get-feature-paths.sh | Resolves canonical paths for artifacts |
setup-plan.sh | Prepares context for plan generation |
update-agent-context.sh | Refreshes derived context for agents |
check-task-prerequisites.sh | Validates environment before task implementation |
common.sh | Shared 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 runinstead ofpnpm 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 buildType Checking
cd packages/scripts
bun run typecheckLinting
cd packages/scripts
bun run lintTroubleshooting
Permission Issues
Ensure shell scripts are executable:
chmod +x packages/scripts/src/spec-kit/*.sh
chmod +x packages/scripts/src/*.shBun Not Found
Install bun globally:
curl -fsSL https://bun.sh/install | bashMissing Dependencies
Install package dependencies:
cd packages/scripts
bun install