Skip to content

Commit dff1c9d

Browse files
authored
v0.5.64: unsubscribe, search improvements, metrics, additional SSO configuration
2 parents b09f683 + e4ad31b commit dff1c9d

File tree

186 files changed

+16085
-3024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+16085
-3024
lines changed

.claude/rules/emcn-components.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
paths:
3+
- "apps/sim/components/emcn/**"
4+
---
5+
6+
# EMCN Components
7+
8+
Import from `@/components/emcn`, never from subpaths (except CSS files).
9+
10+
## CVA vs Direct Styles
11+
12+
**Use CVA when:** 2+ variants (primary/secondary, sm/md/lg)
13+
14+
```tsx
15+
const buttonVariants = cva('base-classes', {
16+
variants: { variant: { default: '...', primary: '...' } }
17+
})
18+
export { Button, buttonVariants }
19+
```
20+
21+
**Use direct className when:** Single consistent style, no variations
22+
23+
```tsx
24+
function Label({ className, ...props }) {
25+
return <Primitive className={cn('style-classes', className)} {...props} />
26+
}
27+
```
28+
29+
## Rules
30+
31+
- Use Radix UI primitives for accessibility
32+
- Export component and variants (if using CVA)
33+
- TSDoc with usage examples
34+
- Consistent tokens: `font-medium`, `text-[12px]`, `rounded-[4px]`
35+
- `transition-colors` for hover states

.claude/rules/global.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Global Standards
2+
3+
## Logging
4+
Import `createLogger` from `sim/logger`. Use `logger.info`, `logger.warn`, `logger.error` instead of `console.log`.
5+
6+
## Comments
7+
Use TSDoc for documentation. No `====` separators. No non-TSDoc comments.
8+
9+
## Styling
10+
Never update global styles. Keep all styling local to components.
11+
12+
## Package Manager
13+
Use `bun` and `bunx`, not `npm` and `npx`.

.claude/rules/sim-architecture.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
paths:
3+
- "apps/sim/**"
4+
---
5+
6+
# Sim App Architecture
7+
8+
## Core Principles
9+
1. **Single Responsibility**: Each component, hook, store has one clear purpose
10+
2. **Composition Over Complexity**: Break down complex logic into smaller pieces
11+
3. **Type Safety First**: TypeScript interfaces for all props, state, return types
12+
4. **Predictable State**: Zustand for global state, useState for UI-only concerns
13+
14+
## Root-Level Structure
15+
16+
```
17+
apps/sim/
18+
├── app/ # Next.js app router (pages, API routes)
19+
├── blocks/ # Block definitions and registry
20+
├── components/ # Shared UI (emcn/, ui/)
21+
├── executor/ # Workflow execution engine
22+
├── hooks/ # Shared hooks (queries/, selectors/)
23+
├── lib/ # App-wide utilities
24+
├── providers/ # LLM provider integrations
25+
├── stores/ # Zustand stores
26+
├── tools/ # Tool definitions
27+
└── triggers/ # Trigger definitions
28+
```
29+
30+
## Feature Organization
31+
32+
Features live under `app/workspace/[workspaceId]/`:
33+
34+
```
35+
feature/
36+
├── components/ # Feature components
37+
├── hooks/ # Feature-scoped hooks
38+
├── utils/ # Feature-scoped utilities (2+ consumers)
39+
├── feature.tsx # Main component
40+
└── page.tsx # Next.js page entry
41+
```
42+
43+
## Naming Conventions
44+
- **Components**: PascalCase (`WorkflowList`)
45+
- **Hooks**: `use` prefix (`useWorkflowOperations`)
46+
- **Files**: kebab-case (`workflow-list.tsx`)
47+
- **Stores**: `stores/feature/store.ts`
48+
- **Constants**: SCREAMING_SNAKE_CASE
49+
- **Interfaces**: PascalCase with suffix (`WorkflowListProps`)
50+
51+
## Utils Rules
52+
53+
- **Never create `utils.ts` for single consumer** - inline it
54+
- **Create `utils.ts` when** 2+ files need the same helper
55+
- **Check existing sources** before duplicating (`lib/` has many utilities)
56+
- **Location**: `lib/` (app-wide) → `feature/utils/` (feature-scoped) → inline (single-use)

.claude/rules/sim-components.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
paths:
3+
- "apps/sim/**/*.tsx"
4+
---
5+
6+
# Component Patterns
7+
8+
## Structure Order
9+
10+
```typescript
11+
'use client' // Only if using hooks
12+
13+
// Imports (external → internal)
14+
// Constants at module level
15+
const CONFIG = { SPACING: 8 } as const
16+
17+
// Props interface
18+
interface ComponentProps {
19+
requiredProp: string
20+
optionalProp?: boolean
21+
}
22+
23+
export function Component({ requiredProp, optionalProp = false }: ComponentProps) {
24+
// a. Refs
25+
// b. External hooks (useParams, useRouter)
26+
// c. Store hooks
27+
// d. Custom hooks
28+
// e. Local state
29+
// f. useMemo
30+
// g. useCallback
31+
// h. useEffect
32+
// i. Return JSX
33+
}
34+
```
35+
36+
## Rules
37+
38+
1. `'use client'` only when using React hooks
39+
2. Always define props interface
40+
3. Extract constants with `as const`
41+
4. Semantic HTML (`aside`, `nav`, `article`)
42+
5. Optional chain callbacks: `onAction?.(id)`
43+
44+
## Component Extraction
45+
46+
**Extract when:** 50+ lines, used in 2+ files, or has own state/logic
47+
48+
**Keep inline when:** < 10 lines, single use, purely presentational

.claude/rules/sim-hooks.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
paths:
3+
- "apps/sim/**/use-*.ts"
4+
- "apps/sim/**/hooks/**/*.ts"
5+
---
6+
7+
# Hook Patterns
8+
9+
## Structure
10+
11+
```typescript
12+
interface UseFeatureProps {
13+
id: string
14+
onSuccess?: (result: Result) => void
15+
}
16+
17+
export function useFeature({ id, onSuccess }: UseFeatureProps) {
18+
// 1. Refs for stable dependencies
19+
const idRef = useRef(id)
20+
const onSuccessRef = useRef(onSuccess)
21+
22+
// 2. State
23+
const [data, setData] = useState<Data | null>(null)
24+
const [isLoading, setIsLoading] = useState(false)
25+
26+
// 3. Sync refs
27+
useEffect(() => {
28+
idRef.current = id
29+
onSuccessRef.current = onSuccess
30+
}, [id, onSuccess])
31+
32+
// 4. Operations (useCallback with empty deps when using refs)
33+
const fetchData = useCallback(async () => {
34+
setIsLoading(true)
35+
try {
36+
const result = await fetch(`/api/${idRef.current}`).then(r => r.json())
37+
setData(result)
38+
onSuccessRef.current?.(result)
39+
} finally {
40+
setIsLoading(false)
41+
}
42+
}, [])
43+
44+
return { data, isLoading, fetchData }
45+
}
46+
```
47+
48+
## Rules
49+
50+
1. Single responsibility per hook
51+
2. Props interface required
52+
3. Refs for stable callback dependencies
53+
4. Wrap returned functions in useCallback
54+
5. Always try/catch async operations
55+
6. Track loading/error states

.claude/rules/sim-imports.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
paths:
3+
- "apps/sim/**/*.ts"
4+
- "apps/sim/**/*.tsx"
5+
---
6+
7+
# Import Patterns
8+
9+
## Absolute Imports
10+
11+
**Always use absolute imports.** Never use relative imports.
12+
13+
```typescript
14+
// ✓ Good
15+
import { useWorkflowStore } from '@/stores/workflows/store'
16+
import { Button } from '@/components/ui/button'
17+
18+
// ✗ Bad
19+
import { useWorkflowStore } from '../../../stores/workflows/store'
20+
```
21+
22+
## Barrel Exports
23+
24+
Use barrel exports (`index.ts`) when a folder has 3+ exports. Import from barrel, not individual files.
25+
26+
```typescript
27+
// ✓ Good
28+
import { Dashboard, Sidebar } from '@/app/workspace/[workspaceId]/logs/components'
29+
30+
// ✗ Bad
31+
import { Dashboard } from '@/app/workspace/[workspaceId]/logs/components/dashboard/dashboard'
32+
```
33+
34+
## No Re-exports
35+
36+
Do not re-export from non-barrel files. Import directly from the source.
37+
38+
```typescript
39+
// ✓ Good - import from where it's declared
40+
import { CORE_TRIGGER_TYPES } from '@/stores/logs/filters/types'
41+
42+
// ✗ Bad - re-exporting in utils.ts then importing from there
43+
import { CORE_TRIGGER_TYPES } from '@/app/workspace/.../utils'
44+
```
45+
46+
## Import Order
47+
48+
1. React/core libraries
49+
2. External libraries
50+
3. UI components (`@/components/emcn`, `@/components/ui`)
51+
4. Utilities (`@/lib/...`)
52+
5. Stores (`@/stores/...`)
53+
6. Feature imports
54+
7. CSS imports
55+
56+
## Type Imports
57+
58+
Use `type` keyword for type-only imports:
59+
60+
```typescript
61+
import type { WorkflowLog } from '@/stores/logs/types'
62+
```

0 commit comments

Comments
 (0)