{"id":15089306,"url":"https://github.com/younyikim/yaml-react-component","last_synced_at":"2026-02-12T06:03:37.823Z","repository":{"id":254212096,"uuid":"845829569","full_name":"younyikim/yaml-react-component","owner":"younyikim","description":"YAML 구성 파일을 통해 React 컴포넌트 생성 프로세스를 자동화하는 Command-line tool입니다.","archived":false,"fork":false,"pushed_at":"2024-09-17T07:38:33.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-02T10:45:09.695Z","etag":null,"topics":["component","react","yaml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/younyikim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-22T02:23:27.000Z","updated_at":"2024-09-17T07:38:37.000Z","dependencies_parsed_at":"2024-09-17T07:54:27.716Z","dependency_job_id":null,"html_url":"https://github.com/younyikim/yaml-react-component","commit_stats":{"total_commits":102,"total_committers":2,"mean_commits":51.0,"dds":0.196078431372549,"last_synced_commit":"a599dc86ce1ad00cf3046f5c658020ba637e5ded"},"previous_names":["younyikim/yaml-react-component"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/younyikim/yaml-react-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younyikim%2Fyaml-react-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younyikim%2Fyaml-react-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younyikim%2Fyaml-react-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younyikim%2Fyaml-react-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/younyikim","download_url":"https://codeload.github.com/younyikim/yaml-react-component/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/younyikim%2Fyaml-react-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29360295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","react","yaml"],"created_at":"2024-09-25T08:44:28.116Z","updated_at":"2026-02-12T06:03:37.797Z","avatar_url":"https://github.com/younyikim.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yaml React Component Generator\n\n![Safari (1)](https://github.com/user-attachments/assets/ba3530c7-ed18-4113-a2b2-5cce11030636)\n\n## 개요\n\nYaml React Component Generator는 YAML 구성 파일을 통해 React 컴포넌트 생성 프로세스를 간소화하는 Command-line tool입니다. 이 도구는 복잡한 YAML 구조를 파싱하고, YAML 파일을 기반으로 TypeScript 타입을 추론하여 적절한 props와 상태를 가진 React 컴포넌트를 생성합니다. 또한 컴포넌트 동적 컴포넌트 로딩, 의존성 분석을 지원합니다.\n\n---\n\n## 주요 기능\n\n- **YAML Parser**\n\n  YAML 파일을 파싱하여 컴포넌트의 구조, props, 상태 및 관계를 정의합니다.\n\n- **React 컴포넌트 생성기**\n  \n  YAML 파일에 기반한 TypeScript 타입을 포함한 함수형 React 컴포넌트를 자동으로 생성합니다.\n\n- **타입 추론 시스템**\n  \n  YAML 파일로부터 TypeScript 타입을 추론하고 인터페이스 및 타입 정의를 생성합니다.\n\n- **의존성 분석**\n  \n  위상 정렬을 통해 컴포넌트 간의 의존성을 분석하여 최적의 렌더링 순서를 결정합니다.\n\n- **동적 컴포넌트 로딩**\n  \n  React.lazy() 및 Suspense를 사용하여 지연 로딩이 필요한 컴포넌트를 처리합니다.\n\n- **오류 처리**\n  \n  잘못된 YAML 파일에 대해 명확한 오류 메시지를 제공하고, 컴포넌트 파일 생성 시 적절한 오류 처리를 수행합니다.\n\n[📓 시스템 아키텍처 및 주요 결정 사항 Docs 바로가기 \u003e\u003e](https://github.com/younyikim/yaml-react-component/blob/main/docs/SYSTEM.md)\n\n## Demo\n\n\nhttps://github.com/user-attachments/assets/8f4f10de-4292-41bf-a3a8-2f40d4fb6aa2\n\n---\n\n## 폴더 구조\n\n```bash\n📦 react-yaml-component-generator/\n├── package.json             # 프로젝트 설정 파일 및 스크립트\n├── src/                     # 주요 소스 코드 디렉토리\n│   ├── cli.ts               # CLI 엔트리 포인트\n│   ├── components/          # 생성된 React 컴포넌트 디렉토리\n│   ├── config/              # YAML 구성 파일\n│   ├── generators/          # 컴포넌트 및 상태 생성 관련 함수들\n│   ├── tests/               # 테스트 파일 디렉토리\n│   ├── types/               # 타입 정의 파일\n│   └── utils/               # 유틸리티 함수\n└── example/                 # 예제 프로젝트 디렉토리\n    └── src/                 # 예제 소스 코드\n        └── components/      # 예제 프로젝트에서 생성된 React 컴포넌트 디렉토리\n```\n\n---\n\n## 설치 및 사용법\n\n### 1. 설치\n\n프로젝트에 라이브러리를 설치하려면 아래 명령어를 사용하세요.\n\n```bash\n# npm 사용\nnpm install yaml-react-component\n\n# pnpm 사용\npnpm install yaml-react-component\n```\n\n### 2. YAML 구성 파일 작성\n\nReact 컴포넌트를 생성하려면 YAML 구성 파일을 작성해야 합니다. 기본적으로 gcpt 명령어는 `src/config/config.yaml` 위치의 YAML 파일을 읽습니다.\n\nCLI 명령어 옵션을 사용하여 YAML 파일의 경로를 직접 지정할 수도 있습니다. `-f` 또는 `--file` 옵션을 사용하면 다른 위치의 YAML 파일을 지정할 수 있습니다.\n\n```yaml\n# 예시\ncomponents:\n  Dashboard:\n    props:\n      user: object\n    state:\n      data: object\n      loading: boolean\n    children:\n      - Header\n      - MainContent\n      - Footer\n```\n\n예시 YAML 파일 : [config.yaml](https://github.com/younyikim/yaml-react-component/blob/main/src/config/config.yaml)\n\n### 3. 실행\n\nYAML 파일을 기반으로 컴포넌트를 생성하려면 CLI 명령어인 gcpt를 사용합니다.\n\n```bash\nnpx gcpt [options]\n```\n\n###### 옵션\n\n- `-f, --file \u003cpath\u003e` : YAML 구성 파일의 경로를 지정합니다. 기본값은 `src/config/config.yaml`입니다.\n\n  ```bash\n  # 예시\n  npx gcpt -f ./my-config/custom-config.yaml\n  ```\n\n- `-d, --outDir \u003cpath\u003e` : 생성된 컴포넌트의 출력 디렉토리를 지정합니다. 기본값은 `src/components`입니다.\n  ```bash\n  # 예시\n  npx gcpt -f ./src/config/sample-config.yaml -d ./src/generatedComponents\n  ```\n\n---\n\n## 주요 의존성\n\n이 프로젝트는 다음과 같은 주요 의존성에 의존하고 있습니다:\n\n- **[typescript](https://www.npmjs.com/package/typescript)**\n- **[commander](https://www.npmjs.com/package/commander)**: CLI 명령어를 쉽게 작성할 수 있게 도와주는 라이브러리.\n- **[fs-extra](https://www.npmjs.com/package/fs-extra)**: Node.js 파일 시스템 작업을 위한 유틸리티 라이브러리.\n- **[jest](https://www.npmjs.com/package/jest)**: JavaScript 테스트 프레임워크.\n- **[js-yaml](https://www.npmjs.com/package/js-yaml)**: YAML 파일을 파싱하고 생성하는 라이브러리.\n- **[tsc-alias](https://www.npmjs.com/package/tsc-alias)**: TypeScript 컴파일 시 경로 별칭을 처리하는 도구.\n- **[tsx](https://www.npmjs.com/package/tsx)**: TypeScript 및 JSX/TSX 파일을 실행할 수 있는 도구.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounyikim%2Fyaml-react-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyounyikim%2Fyaml-react-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyounyikim%2Fyaml-react-component/lists"}