-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat(exporter, landing): fix GORM bugs and redesign landing page #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
de1ec36
26d9a9b
dce9edf
b544ba0
965472c
8aca2aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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) |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use client 가 필요 없는 코드들이 use client가 선언된 파일 내에 정의되어 있는 것은 피해야 합니다 |
||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 }} /> | ||
| } |
| 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> | ||
| ) | ||
| } |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changelog는 우리는 사용하지 않고 있습니다