feat(turbo): restructured repo to be a standard turborepo monorepo (#341)

* added turborepo

* finished turbo migration

* updated gitignore

* use dotenv & run format

* fixed error in docs

* remove standalone deployment in prod

* fix ts error, remove ignore ts errors during build

* added formatter to the end of the docs generator
This commit is contained in:
Waleed Latif
2025-05-09 21:45:49 -07:00
committed by GitHub
parent 1438028982
commit a92ee8bf46
1072 changed files with 39956 additions and 22581 deletions

View File

@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behaviour that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologising to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologising to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behaviour include:
* The use of sexualised language or imagery, and sexual attention or advances
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- The use of sexualised language or imagery, and sexual attention or advances
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
@@ -112,4 +112,4 @@ the community.
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
and was generated by [contributing.md](https://contributing.md/generator).
and was generated by [contributing.md](https://contributing.md/generator).

View File

@@ -3,7 +3,7 @@
Thank you for your interest in contributing to Sim Studio! Our goal is to provide developers with a powerful, user-friendly platform for building, testing, and optimizing agentic workflows. We welcome contributions in all forms—from bug fixes and design improvements to brand-new features.
> **Project Overview:**
> Sim Studio is a monorepo containing the main application (`sim/`) and documentation (`docs/`). The main application is built with Next.js (app router), ReactFlow, Zustand, Shadcn, and Tailwind CSS. Please ensure your contributions follow our best practices for clarity, maintainability, and consistency.
> Sim Studio is a monorepo using Turborepo, containing the main application (`apps/sim/`), documentation (`apps/docs/`), and shared packages (`packages/`). The main application is built with Next.js (app router), ReactFlow, Zustand, Shadcn, and Tailwind CSS. Please ensure your contributions follow our best practices for clarity, maintainability, and consistency.
---
@@ -269,26 +269,26 @@ Sim Studio is built in a modular fashion where blocks and tools extend the platf
### Where to Add Your Code
- **Blocks:** Create your new block file under the `/sim/blocks/blocks` directory. The name of the file should match the provider name (e.g., `pinecone.ts`).
- **Tools:** Create a new directory under `/sim/tools` with the same name as the provider (e.g., `/sim/tools/pinecone`).
- **Blocks:** Create your new block file under the `/apps/sim/blocks/blocks` directory. The name of the file should match the provider name (e.g., `pinecone.ts`).
- **Tools:** Create a new directory under `/apps/sim/tools` with the same name as the provider (e.g., `/apps/sim/tools/pinecone`).
In addition, you will need to update the registries:
- **Block Registry:** Update the blocks index (`/sim/blocks/index.ts`) to include your new block.
- **Tool Registry:** Update the tools registry (`/sim/tools/index.ts`) to add your new tool.
- **Block Registry:** Update the blocks index (`/apps/sim/blocks/index.ts`) to include your new block.
- **Tool Registry:** Update the tools registry (`/apps/sim/tools/index.ts`) to add your new tool.
### How to Create a New Block
1. **Create a New File:**
Create a file for your block named after the provider (e.g., `pinecone.ts`) in the `/sim/blocks/blocks` directory.
Create a file for your block named after the provider (e.g., `pinecone.ts`) in the `/apps/sim/blocks/blocks` directory.
2. **Create a New Icon:**
Create a new icon for your block in the `/sim/components/icons.tsx` file. The icon should follow the same naming convention as the block (e.g., `PineconeIcon`).
Create a new icon for your block in the `/apps/sim/components/icons.tsx` file. The icon should follow the same naming convention as the block (e.g., `PineconeIcon`).
3. **Define the Block Configuration:**
Your block should export a constant of type `BlockConfig`. For example:
```typescript:/sim/blocks/blocks/pinecone.ts
```typescript:/apps/sim/blocks/blocks/pinecone.ts
import { PineconeIcon } from '@/components/icons'
import { PineconeResponse } from '@/tools/pinecone/types'
import { BlockConfig } from '../types'
@@ -313,11 +313,11 @@ In addition, you will need to update the registries:
```
4. **Register Your Block:**
Add your block to the blocks registry (`/sim/blocks/registry.ts`):
Add your block to the blocks registry (`/apps/sim/blocks/registry.ts`):
```typescript:/sim/blocks/registry.ts
```typescript:/apps/sim/blocks/registry.ts
import { PineconeBlock } from './blocks/pinecone'
// Registry of all available blocks
export const registry: Record<string, BlockConfig> = {
// ... existing blocks
@@ -333,7 +333,7 @@ In addition, you will need to update the registries:
### How to Create a New Tool
1. **Create a New Directory:**
Create a directory under `/sim/tools` with the same name as the provider (e.g., `/sim/tools/pinecone`).
Create a directory under `/apps/sim/tools` with the same name as the provider (e.g., `/apps/sim/tools/pinecone`).
2. **Create Tool Files:**
Create separate files for each tool functionality with descriptive names (e.g., `fetch.ts`, `generate_embeddings.ts`, `search_text.ts`) in your tool directory.
@@ -344,7 +344,7 @@ In addition, you will need to update the registries:
4. **Create an Index File:**
Create an `index.ts` file in your tool directory that imports and exports all tools:
```typescript:/sim/tools/pinecone/index.ts
```typescript:/apps/sim/tools/pinecone/index.ts
import { fetchTool } from './fetch'
import { generateEmbeddingsTool } from './generate_embeddings'
import { searchTextTool } from './search_text'
@@ -355,7 +355,7 @@ In addition, you will need to update the registries:
5. **Define the Tool Configuration:**
Your tool should export a constant with a naming convention of `{toolName}Tool`. The tool ID should follow the format `{provider}_{tool_name}`. For example:
```typescript:/sim/tools/pinecone/fetch.ts
```typescript:/apps/sim/tools/pinecone/fetch.ts
import { ToolConfig, ToolResponse } from '../types'
import { PineconeParams, PineconeResponse } from './types'
@@ -384,9 +384,9 @@ In addition, you will need to update the registries:
```
6. **Register Your Tool:**
Update the tools registry in `/sim/tools/index.ts` to include your new tool:
Update the tools registry in `/apps/sim/tools/index.ts` to include your new tool:
```typescript:/sim/tools/index.ts
```typescript:/apps/sim/tools/index.ts
import { fetchTool, generateEmbeddingsTool, searchTextTool } from './pinecone'
// ... other imports

View File

@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
title: '[BUG]'
labels: bug
assignees: ''
---
@@ -11,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -23,4 +24,4 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.

View File

@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[REQUEST]"
title: '[REQUEST]'
labels: feature
assignees: ''
---
@@ -16,4 +16,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.

4
.github/SECURITY.md vendored
View File

@@ -6,7 +6,6 @@
| ------- | ------------------ |
| 0.1.x | :white_check_mark: |
## Reporting a Vulnerability
We take the security of Sim Studio seriously. If you believe you've found a security vulnerability, please follow these steps:
@@ -16,6 +15,7 @@ We take the security of Sim Studio seriously. If you believe you've found a secu
2. **Email us directly** at security@simstudio.ai with details of the vulnerability.
3. **Include the following information** in your report:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
@@ -23,4 +23,4 @@ We take the security of Sim Studio seriously. If you believe you've found a secu
4. We will acknowledge receipt of your vulnerability report within 48 hours and provide an estimated timeline for a fix.
5. Once the vulnerability is fixed, we will notify you and publicly acknowledge your contribution (unless you prefer to remain anonymous).
5. Once the vulnerability is fixed, we will notify you and publicly acknowledge your contribution (unless you prefer to remain anonymous).

View File

@@ -1,98 +1,98 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/sim"
- package-ecosystem: 'npm'
directory: '/sim'
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
interval: 'weekly'
day: 'monday'
time: '09:00'
# Disable version updates
open-pull-requests-limit: 0
labels:
- "dependencies"
- "security"
- 'dependencies'
- 'security'
commit-message:
prefix: "fix(deps)"
prefix-development: "chore(deps)"
include: "scope"
prefix: 'fix(deps)'
prefix-development: 'chore(deps)'
include: 'scope'
groups:
dependencies:
applies-to: security-updates
patterns:
- "*"
- '*'
# Documentation site dependencies (/docs)
- package-ecosystem: "npm"
directory: "/docs"
- package-ecosystem: 'npm'
directory: '/docs'
schedule:
interval: "weekly"
day: "wednesday"
interval: 'weekly'
day: 'wednesday'
# Disable version updates
open-pull-requests-limit: 0
labels:
- "dependencies"
- "security"
- 'dependencies'
- 'security'
commit-message:
prefix: "docs(deps)"
include: "scope"
prefix: 'docs(deps)'
include: 'scope'
groups:
docs-dependencies:
applies-to: security-updates
patterns:
- "*"
- '*'
# Root-level dependencies (if any)
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
day: "friday"
interval: 'weekly'
day: 'friday'
# Disable version updates
open-pull-requests-limit: 0
labels:
- "dependencies"
- "security"
- 'dependencies'
- 'security'
commit-message:
prefix: "chore(deps)"
include: "scope"
prefix: 'chore(deps)'
include: 'scope'
groups:
root-dependencies:
applies-to: security-updates
patterns:
- "*"
- '*'
# GitHub Actions workflows
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "monthly"
interval: 'monthly'
# Disable version updates
open-pull-requests-limit: 0
labels:
- "dependencies"
- "security"
- 'dependencies'
- 'security'
commit-message:
prefix: "ci(deps)"
prefix: 'ci(deps)'
groups:
actions:
applies-to: security-updates
patterns:
- "*"
- '*'
# Docker containers (if applicable)
- package-ecosystem: "docker"
directory: "/"
- package-ecosystem: 'docker'
directory: '/'
schedule:
interval: "monthly"
interval: 'monthly'
# Disable version updates
open-pull-requests-limit: 0
labels:
- "dependencies"
- "security"
- 'dependencies'
- 'security'
commit-message:
prefix: "docker(deps)"
prefix: 'docker(deps)'
groups:
docker:
applies-to: security-updates
patterns:
- "*"
- '*'

View File

@@ -10,51 +10,45 @@ jobs:
test:
name: Test and Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './sim/package-lock.json'
cache-dependency-path: './package-lock.json'
- name: Install dependencies
working-directory: ./sim
run: npm ci
- name: Fix Rollup module issue
working-directory: ./sim
run: |
rm -rf node_modules package-lock.json
npm install
- name: Install Turbo globally
run: npm install -g turbo
- name: Run tests with coverage
working-directory: ./sim
env:
NODE_OPTIONS: "--no-warnings"
run: npm run test:coverage
NODE_OPTIONS: '--no-warnings'
run: npx turbo run test
- name: Build application
working-directory: ./sim
env:
NODE_OPTIONS: "--no-warnings"
NEXT_PUBLIC_APP_URL: "https://www.simstudio.ai"
STRIPE_SECRET_KEY: "dummy_key_for_ci_only"
STRIPE_WEBHOOK_SECRET: "dummy_secret_for_ci_only"
RESEND_API_KEY: "dummy_key_for_ci_only"
AWS_REGION: "us-west-2"
run: npm run build
NODE_OPTIONS: '--no-warnings'
NEXT_PUBLIC_APP_URL: 'https://www.simstudio.ai'
STRIPE_SECRET_KEY: 'dummy_key_for_ci_only'
STRIPE_WEBHOOK_SECRET: 'dummy_secret_for_ci_only'
RESEND_API_KEY: 'dummy_key_for_ci_only'
AWS_REGION: 'us-west-2'
run: npx turbo run build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./sim/coverage
directory: ./apps/sim/coverage
fail_ci_if_error: false
verbose: true
verbose: true
migrations:
name: Apply Database Migrations
@@ -64,20 +58,19 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './sim/package-lock.json'
cache-dependency-path: './package-lock.json'
- name: Install dependencies
working-directory: ./sim
run: npm ci
- name: Apply migrations
working-directory: ./sim
working-directory: ./apps/sim
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx drizzle-kit push
run: npx drizzle-kit push