Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog는 우리는 사용하지 않고 있습니다

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- GORM exporter (`--orm gorm`): generates Go structs with GORM tags from schema definitions
- Full type mapping: all SQL types to Go equivalents (`int32`, `int64`, `float32`, `float64`, `string`, `bool`, `time.Time`, `uuid.UUID`, `datatypes.JSON`, `decimal.Decimal`, etc.)
- String and integer enum support with Go type aliases and `const` blocks
- Foreign key relations with `foreignKey` and `constraint` tags
- Reverse (HasMany) relations when schema context is provided
- Composite primary keys, unique indexes, and named indexes
- `TableName()` method generated when table name differs from GORM convention
- Smart import generation (only includes `time`, `gorm.io/datatypes`, `github.com/google/uuid`, `github.com/shopspring/decimal` when needed)
2 changes: 1 addition & 1 deletion CLAUDE.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

불 필요한 변경사항입니다

Original file line number Diff line number Diff line change
@@ -1 +1 @@
@AGENTS.md
@AGENTS.md
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Declarative database schema management. Define your schemas in JSON, and Vespert
- **Enum Types**: Native string enums and integer enums (no migration needed for new values)
- **Zero-Runtime Migrations**: Compile-time macro generates database-specific SQL
- **JSON Schema Validation**: Ships with JSON Schemas for IDE autocompletion and validation
- **ORM Export**: Export schemas to SeaORM, SQLAlchemy, SQLModel
- **ORM Export**: Export schemas to SeaORM, SQLAlchemy, SQLModel, GORM

## Installation

Expand Down Expand Up @@ -199,6 +199,7 @@ The only exception is adding `fill_with` values when prompted (for NOT NULL colu
vespertide export --orm seaorm # Rust - SeaORM entities
vespertide export --orm sqlalchemy # Python - SQLAlchemy models
vespertide export --orm sqlmodel # Python - SQLModel (FastAPI)
vespertide export --orm gorm # Go - GORM models
```

## Runtime Migrations (Macro)
Expand Down
72 changes: 72 additions & 0 deletions apps/landing/src/app/_components/code-tabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use client'

import { Box, Flex, Text } from '@devup-ui/react'
import { useState } from 'react'

import { CodeWindow, HighlightedCode } from './code-window'

export interface CodeExample {
key: string
label: string
file: string
html: string
}

export function CodeTabs({ examples }: { examples: CodeExample[] }) {
const [active, setActive] = useState(examples[0]?.key ?? '')
const current = examples.find((e) => e.key === active) ?? examples[0]

if (!current) return null

return (
<CodeWindow
tabs={examples.map((ex) => (
<Box
key={ex.key}
as="button"
bg={ex.key === active ? '$containerBackground' : 'transparent'}
border={ex.key === active ? '1px solid $border' : '1px solid transparent'}
borderRadius="4px"
cursor="pointer"
onClick={() => setActive(ex.key)}
px="12px"
py="5px"
transition="color .15s, background .15s"
>
<Text
color={ex.key === active ? '$title' : '$caption'}
fontFamily="D2Coding"
fontSize="11px"
>
{ex.label}
</Text>
</Box>
))}
title={current.file}
>
<HighlightedCode html={current.html} />
</CodeWindow>
)
}

export function StaticCodeBlock({
title,
html,
}: {
title: string
html: string
}) {
return (
<CodeWindow title={title}>
<HighlightedCode html={html} />
</CodeWindow>
)
}

export function HeroCodeWrapper({ children }: { children: React.ReactNode }) {
return (
<Flex justifyContent={[null, null, null, 'flex-end']} w="100%">
{children}
</Flex>
)
}
Comment on lines +52 to +72
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use client 가 필요 없는 코드들이 use client가 선언된 파일 내에 정의되어 있는 것은 피해야 합니다

19 changes: 19 additions & 0 deletions apps/landing/src/app/_components/code-theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { globalCss } from '@devup-ui/react'

globalCss({
'.shiki, .shiki span': {
fontFamily: 'D2Coding',
fontSize: '13px',
lineHeight: '1.65',
},
'.shiki': {
background: 'transparent !important',
padding: '0',
margin: '0',
overflowX: 'auto',
},
'[data-theme="dark"] .shiki, [data-theme="dark"] .shiki span': {
color: 'var(--shiki-dark) !important',
backgroundColor: 'transparent !important',
},
})
Comment on lines +1 to +19
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-window.tsx에서 밖에 사용되지 않으므로 해당 파일 안에 정의되는 것이 더욱 적절해 보입니다

71 changes: 71 additions & 0 deletions apps/landing/src/app/_components/code-window.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Box, Flex, Text } from '@devup-ui/react'
import type { ComponentProps, ReactNode } from 'react'

import './code-theme'

export function CodeWindow({
title,
tabs,
children,
...props
}: {
title: string
tabs?: ReactNode
children: ReactNode
} & ComponentProps<typeof Box<'div'>>) {
return (
<Box
bg="$cardBase"
border="1px solid $border"
borderRadius="$borderRadiusRadius12"
boxShadow="0 30px 60px -30px rgba(0,0,0,.25)"
overflow="hidden"
w="100%"
{...props}
>
<Flex
alignItems="center"
bg="$vespertideBg"
borderBottom="1px solid $border"
gap="10px"
px="14px"
py="10px"
>
<Flex gap="6px">
{[0, 1, 2].map((i) => (
<Box
key={i}
bg="$caption"
borderRadius="50%"
boxSize="10px"
opacity="0.5"
/>
))}
</Flex>
<Text
color="$caption"
fontFamily="D2Coding"
fontSize="12px"
ml="4px"
overflow="hidden"
textOverflow="ellipsis"
whiteSpace="nowrap"
>
{title}
</Text>
{tabs && (
<Flex gap="2px" ml="auto">
{tabs}
</Flex>
)}
</Flex>
<Box overflowX="auto" px="22px" py="20px">
{children}
</Box>
</Box>
)
}

export function HighlightedCode({ html }: { html: string }) {
return <div dangerouslySetInnerHTML={{ __html: html }} />
}
61 changes: 61 additions & 0 deletions apps/landing/src/app/_components/copy-install.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use client'

import { Box, Flex, Text } from '@devup-ui/react'
import { useState } from 'react'

export function CopyInstall({
command = 'cargo install vespertide-cli',
}: {
command?: string
}) {
const [copied, setCopied] = useState(false)

const copy = () => {
navigator.clipboard?.writeText(command)
setCopied(true)
setTimeout(() => setCopied(false), 1400)
}

return (
<Flex
_hover={{ borderColor: '$caption' }}
alignItems="center"
bg="$vespertideBg"
border="1px solid $border"
borderRadius="$borderRadiusRadius08"
cursor="pointer"
gap="12px"
onClick={copy}
px="$spacingSpacing16"
py="$spacingSpacing08"
transition="border-color .15s"
w="fit-content"
>
<Text color="$caption" fontFamily="D2Coding" fontSize="13px">
$
</Text>
<Text color="$title" fontFamily="D2Coding" fontSize="13px">
{command}
</Text>
<Box
as="button"
bg="$containerBackground"
border="1px solid $border"
borderRadius="4px"
color="$textSub"
cursor="pointer"
fontFamily="D2Coding"
fontSize="11px"
onClick={(e) => {
e.stopPropagation()
copy()
}}
px="9px"
py="5px"
transition="color .15s, border-color .15s"
>
{copied ? 'copied' : 'copy'}
</Box>
</Flex>
)
}
102 changes: 0 additions & 102 deletions apps/landing/src/app/_components/example.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions apps/landing/src/app/_components/join-icon-button.tsx

This file was deleted.

Loading