d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
62 lines
1.4 KiB
Plaintext
62 lines
1.4 KiB
Plaintext
---
|
|
description: Import patterns for the Sim application
|
|
globs: ["apps/sim/**/*.ts", "apps/sim/**/*.tsx"]
|
|
---
|
|
|
|
# Import Patterns
|
|
|
|
## Absolute Imports
|
|
|
|
**Always use absolute imports.** Never use relative imports.
|
|
|
|
```typescript
|
|
// ✓ Good
|
|
import { useWorkflowStore } from '@/stores/workflows/store'
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
// ✗ Bad
|
|
import { useWorkflowStore } from '../../../stores/workflows/store'
|
|
```
|
|
|
|
## Barrel Exports
|
|
|
|
Use barrel exports (`index.ts`) when a folder has 3+ exports. Import from barrel, not individual files.
|
|
|
|
```typescript
|
|
// ✓ Good
|
|
import { Dashboard, Sidebar } from '@/app/workspace/[workspaceId]/logs/components'
|
|
|
|
// ✗ Bad
|
|
import { Dashboard } from '@/app/workspace/[workspaceId]/logs/components/dashboard/dashboard'
|
|
```
|
|
|
|
## No Re-exports
|
|
|
|
Do not re-export from non-barrel files. Import directly from the source.
|
|
|
|
```typescript
|
|
// ✓ Good - import from where it's declared
|
|
import { CORE_TRIGGER_TYPES } from '@/stores/logs/filters/types'
|
|
|
|
// ✗ Bad - re-exporting in utils.ts then importing from there
|
|
import { CORE_TRIGGER_TYPES } from '@/app/workspace/.../utils'
|
|
```
|
|
|
|
## Import Order
|
|
|
|
1. React/core libraries
|
|
2. External libraries
|
|
3. UI components (`@sim/emcn`, `@/components/ui`)
|
|
4. Utilities (`@/lib/...`)
|
|
5. Stores (`@/stores/...`)
|
|
6. Feature imports
|
|
7. CSS imports
|
|
|
|
## Type Imports
|
|
|
|
Use `type` keyword for type-only imports:
|
|
|
|
```typescript
|
|
import type { WorkflowLog } from '@/stores/logs/types'
|
|
```
|