Skip to content

improvement(monorepo): added tsconfig package, resolved type errors in testing package - #2613

Merged
waleedlatif1 merged 1 commit into
stagingfrom
improvement/monorepo
Dec 28, 2025
Merged

improvement(monorepo): added tsconfig package, resolved type errors in testing package#2613
waleedlatif1 merged 1 commit into
stagingfrom
improvement/monorepo

Conversation

@waleedlatif1

Copy link
Copy Markdown
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

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown

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

ProjectDeploymentReviewUpdated (UTC)
docsReadyReadyPreview, CommentDec 28, 2025 8:30am

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

Copy link
Copy Markdown
Contributor

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

FilenameOverview
packages/tsconfig/package.jsonadded new shared tsconfig package with proper exports for base, nextjs, library, and library-build configurations
packages/tsconfig/base.jsoncreated base TypeScript configuration with ES2022 target, strict mode, and modern bundler module resolution
packages/testing/src/types/index.tsrelaxed types to use any with index signatures to prevent conflicts with app-specific types
packages/testing/src/builders/workflow.builder.tsconverted to use any return type for build() method to be assignable to any app's workflow type
packages/testing/src/factories/block.factory.tschanged all factory functions to return any type to accept any app type without conflicts
apps/sim/tsconfig.jsonmigrated to extend from shared tsconfig/nextjs.json, significantly reducing duplicate configuration
docker/app.Dockerfileadded tsconfig package to Docker build and updated isolated-vm path to match Bun's new structure
apps/sim/package.jsonadded 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 stagingDec 28, 2025
11 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/monorepo branch December 28, 2025 08:36
Sign up for freeto 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.

1 participant

@waleedlatif1