A monorepo containing the in-agent UI application and shared packages for the Migration Planner project.
This project is organized as a monorepo using Yarn workspaces, which allows us to manage multiple related packages and applications in a single repository. The structure is divided into two main directories:
apps/- Contains standalone applications (e.g.,agent-ui)packages/- Contains reusable packages that can be shared across applications
This monorepo structure provides several benefits:
- Code sharing: Common functionality can be extracted into packages and reused across multiple apps
- Consistent tooling: Shared development tools and configurations ensure consistency across the codebase
- Atomic changes: Related changes across packages and apps can be made in a single commit
- Simplified dependency management: Dependencies are hoisted and shared where possible, reducing duplication
The root package.json provides workspace-wide scripts and dev dependencies that standardize development across all packages and apps:
Available Scripts:
yarn build:all- Build all packages and appsyarn bundle:all- Bundle all packages for publishingyarn clean:all- Clean all build artifactsyarn check:all- Run linting checks across all workspacesyarn check:fix:all- Auto-fix linting issuesyarn format:all- Format code across all workspaces
Shared Dev Dependencies:
@biomejs/biome- Linting and formatting (configured inbiome.json)typescript- TypeScript compiler (version ~5.5.0)vite- Build tool for applications- Various type definitions (
@types/*)
Each package and app can define its own scripts and dependencies, but they inherit the shared tooling from the root. This separation is intentional and serves to:
- Standardize packages: All packages follow similar patterns (build, bundle, clean scripts)
- Align dependency versions: Shared dev dependencies ensure consistent TypeScript versions, build tools, and linting rules across the entire monorepo
- Reduce duplication: Common tools are defined once at the root level rather than in each package
Common Package Scripts:
build- Compile TypeScript to JavaScriptbundle- Build and package for distributionclean- Remove build artifactscheck- Run linting checks using Biomecheck:fix- Auto-fix linting issues using Biomeformat- Format code using Biome
App-Specific Scripts:
Apps may include additional scripts like start and preview for development workflows.
Key Features:
- Generated from OpenAPI spec using
typescript-fetchgenerator - Type-safe API calls and models
- ES6 module support
- Isomorphic code: Works in both Node.js and browser environments
A lightweight dependency injection (IoC) container solution for React applications, inspired by InversifyJS. Provides a simple way to manage dependencies and inject them into React components.
Key Features:
- Singleton-scoped dependency injection container
- React Context-based provider pattern
useInjectionhook for accessing dependencies in components- Minimal API surface for easy adoption
A React-based user interface application for the Migration Planner Agent. Built with Vite, React Router, and PatternFly components.
Key Technologies:
- React 18
- Vite
- React Router
- PatternFly React components
- Emotion CSS
The best approach for adding a new package or app is to copy an existing similar one and adapt it to your needs. This ensures consistency with existing patterns and configurations.
Steps:
-
Choose a similar package/app as a template (e.g., copy
packages/api-clientfor a new client package, orapps/agent-uifor a new app) -
Copy the directory to your desired location (
packages/for packages,apps/for apps) -
Update the following:
package.json: Updatename,description, and any package-specific dependenciestsconfig.json: Adjust TypeScript configuration if needed- Source code: Replace with your implementation
- README.md: Update documentation
-
Add TypeScript project reference in the root
tsconfig.json:{ "references": [{ "path": "./your-new-package/tsconfig.json" }] } -
Ensure scripts follow conventions:
build– Compile TypeScriptbundle– Build and package (for packages)clean– Remove build artifactscheck– Run static analysis/linting (e.g., type checks, code lint)format– Format code automatically
-
Run from root to verify:
yarn install yarn build:all
-
Install dependencies:
yarn install
-
Build all packages:
yarn build:all
-
Start an application:
cd apps/agent-ui yarn start -
Run linting:
yarn check:all
For detailed instructions on setting up a complete local development environment with the Migration Planner backend and Agent, see:
docs/DEVELOPMENT.md
- Making changes: Work in the appropriate package or app directory
- Testing: Run package-specific scripts or use workspace scripts from root
- Linting/Formatting: Use
yarn check:allandyarn format:allfrom root