Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added tsconfig package, resolved type errors in testing package

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 28, 2025 8:30am

@waleedlatif1 waleedlatif1 marked this pull request as ready for review December 28, 2025 08:32
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 28, 2025

Greptile Summary

Created a centralized @sim/tsconfig package with four configuration presets (base, nextjs, library, library-build) and migrated all apps and packages to extend from these shared configs, eliminating ~200 lines of duplicate TypeScript configuration. Resolved type errors in the testing package by strategically relaxing types to use any with proper eslint directives, allowing the testing utilities to accept data shapes from any app without type conflicts. Updated all test files in apps/sim to work with the new testing package types.

Key Changes:

  • Created @sim/tsconfig package with reusable TypeScript configurations
  • Migrated 8 tsconfig.json files to extend from shared configs (apps/sim, apps/docs, 6 packages)
  • Fixed testing package type errors by using any types for flexibility across different app types
  • Updated Docker builds to include new tsconfig package and fixed isolated-vm path for Bun
  • Moved misplaced dependencies from root to apps/sim package.json
  • Updated User-Agent strings from "SimStudio" to "Sim" across 11 files for branding consistency

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • Well-architected monorepo improvement that centralizes TypeScript configuration following best practices. The testing package type changes are intentional and properly documented - using any with eslint directives is the correct approach for a shared testing library that needs to work across different app types. All changes are consistent, backward-compatible, and the Docker updates properly account for Bun's module structure.
  • No files require special attention

Important Files Changed

Filename Overview
packages/tsconfig/package.json added new shared tsconfig package with proper exports for base, nextjs, library, and library-build configurations
packages/tsconfig/base.json created base TypeScript configuration with ES2022 target, strict mode, and modern bundler module resolution
packages/testing/src/types/index.ts relaxed types to use any with index signatures to prevent conflicts with app-specific types
packages/testing/src/builders/workflow.builder.ts converted to use any return type for build() method to be assignable to any app's workflow type
packages/testing/src/factories/block.factory.ts changed all factory functions to return any type to accept any app type without conflicts
apps/sim/tsconfig.json migrated to extend from shared tsconfig/nextjs.json, significantly reducing duplicate configuration
docker/app.Dockerfile added tsconfig package to Docker build and updated isolated-vm path to match Bun's new structure
apps/sim/package.json added tsconfig dependency and moved root-level dependencies here, alphabetized imports

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Root as Root package.json
    participant TSConfig as @sim/tsconfig
    participant Apps as Apps (sim, docs)
    participant Pkgs as Packages (db, logger, cli, ts-sdk, testing)
    participant Docker as Docker Build

    Note over Dev,Docker: Phase 1: Create Shared TSConfig Package
    Dev->>TSConfig: Create new @sim/tsconfig package
    Dev->>TSConfig: Add base.json (ES2022, strict, bundler)
    Dev->>TSConfig: Add nextjs.json (extends base + DOM + jsx)
    Dev->>TSConfig: Add library.json (extends base + declarations, noEmit)
    Dev->>TSConfig: Add library-build.json (extends base + emit)
    Dev->>TSConfig: Define package.json exports

    Note over Dev,Docker: Phase 2: Update Testing Package Types
    Dev->>Pkgs: Relax testing package types to use 'any'
    Dev->>Pkgs: Add eslint-disable for @typescript-eslint/no-explicit-any
    Dev->>Pkgs: Update factories to return 'any' for flexibility
    Dev->>Pkgs: Add nanoid dependency to testing package
    Dev->>Pkgs: Update testing package tsconfig to extend @sim/tsconfig/library.json

    Note over Dev,Docker: Phase 3: Migrate All TSConfigs
    Dev->>Apps: Update apps/sim/tsconfig.json to extend @sim/tsconfig/nextjs.json
    Dev->>Apps: Update apps/docs/tsconfig.json to extend @sim/tsconfig/nextjs.json
    Dev->>Pkgs: Update packages/db to extend @sim/tsconfig/library.json
    Dev->>Pkgs: Update packages/logger to extend @sim/tsconfig/library.json
    Dev->>Pkgs: Update packages/cli to extend @sim/tsconfig/library-build.json
    Dev->>Pkgs: Update packages/ts-sdk to extend @sim/tsconfig/library-build.json

    Note over Dev,Docker: Phase 4: Fix App Test Type Errors
    Dev->>Apps: Update utils.test.ts to use legacySubBlocks() helper
    Dev->>Apps: Add explicit type assertions in store.test.ts
    Dev->>Apps: Import operation types for proper casting

    Note over Dev,Docker: Phase 5: Update Dependencies & Docker
    Dev->>Root: Move misplaced dependencies from root to apps/sim
    Dev->>Apps: Add @sim/tsconfig to all package devDependencies
    Dev->>Docker: Add tsconfig package to Docker build stages
    Dev->>Docker: Update isolated-vm path for Bun's new structure

    Note over Dev,Docker: Phase 6: Branding Consistency
    Dev->>Apps: Update User-Agent from "SimStudio" to "Sim" (11 files)
    
    Note over Dev,Docker: Result: Centralized TS config, resolved type errors
Loading

@waleedlatif1 waleedlatif1 merged commit 71130c8 into staging Dec 28, 2025
11 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/monorepo branch December 28, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants