-
Notifications
You must be signed in to change notification settings - Fork 2
Feat: 모노레포 인프라 설정 #88
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
Changes from 4 commits
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,74 @@ | ||
| # Changesets | ||
|
|
||
| 이 프로젝트는 [Changesets](https://github.com/changesets/changesets)를 사용하여 버전 관리 및 배포를 자동화합니다. | ||
|
|
||
| ## 📝 Changeset 생성하기 | ||
|
|
||
| 패키지를 변경한 후 다음 명령어를 실행하세요: | ||
|
|
||
| ```bash | ||
| pnpm changeset | ||
| ``` | ||
|
|
||
| 대화형 프롬프트가 나타나면: | ||
|
|
||
| 1. 변경된 패키지 선택 | ||
| 2. 버전 범프 타입 선택 (major/minor/patch) | ||
| 3. 변경사항 요약 작성 | ||
|
|
||
| ## 🔖 버전 업데이트 | ||
|
|
||
| Release PR을 생성하려면: | ||
|
|
||
| ```bash | ||
| pnpm version-packages | ||
| ``` | ||
|
|
||
| 이 명령어는: | ||
|
|
||
| - 패키지 버전 업데이트 | ||
| - CHANGELOG.md 생성 | ||
| - changeset 파일 제거 | ||
|
|
||
| ## 🚀 배포 | ||
|
|
||
| Release PR이 머지되면, GitHub Actions가 자동으로: | ||
|
|
||
| 1. 패키지 빌드 | ||
| 2. npm에 배포 | ||
| 3. GitHub Release 생성 | ||
|
|
||
| ## 📚 Semantic Versioning | ||
|
|
||
| - **Major (1.0.0)**: Breaking changes | ||
| - **Minor (0.1.0)**: 새로운 기능 추가 (하위 호환) | ||
| - **Patch (0.0.1)**: 버그 수정 | ||
|
|
||
| ## 예시 | ||
|
|
||
| ### 1. 새로운 기능 추가 | ||
|
|
||
| ```bash | ||
| pnpm changeset | ||
| # Select: @soso/ui | ||
| # Bump: minor | ||
| # Summary: "Add Checkbox component" | ||
| ``` | ||
|
|
||
| ### 2. 버그 수정 | ||
|
|
||
| ```bash | ||
| pnpm changeset | ||
| # Select: @soso/ui | ||
| # Bump: patch | ||
| # Summary: "Fix Button disabled state" | ||
| ``` | ||
|
|
||
| ### 3. Breaking Change | ||
|
|
||
| ```bash | ||
| pnpm changeset | ||
| # Select: @soso/ui | ||
| # Bump: major | ||
| # Summary: "Remove deprecated props from Button" | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||
| { | ||||||
| "$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||||||
| "changelog": "@changesets/cli/changelog", | ||||||
| "commit": false, | ||||||
| "fixed": [], | ||||||
| "linked": [], | ||||||
| "access": "public", | ||||||
| "baseBranch": "main", | ||||||
| "updateInternalDependencies": "patch", | ||||||
| "ignore": ["@soso/web", "@soso/docs", "@soso/storybook"] | ||||||
|
||||||
| "ignore": ["@soso/web", "@soso/docs", "@soso/storybook"] | |
| "ignore": ["@soso/web"] |
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.
추가할겁니다
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,25 @@ | ||
| # ESLint ignore patterns | ||
| # Node modules | ||
| node_modules/ | ||
|
|
||
| # Build outputs | ||
| dist/ | ||
| build/ | ||
| .next/ | ||
| .turbo/ | ||
| build/ | ||
| out/ | ||
| storybook-static/ | ||
|
|
||
| # Dependencies | ||
| node_modules/ | ||
| pnpm-lock.yaml | ||
|
|
||
| # Config files that don't need linting | ||
| *.config.js | ||
| *.config.cjs | ||
| *.config.mjs | ||
|
|
||
| # Specific config files | ||
| commitlint.config.cjs | ||
| next.config.js | ||
| tailwind.config.js | ||
| postcss.config.js | ||
| # Config files (JSON) | ||
| **/*.json | ||
| !package.json | ||
|
|
||
| # Test coverage | ||
| coverage/ | ||
|
|
||
| # Cache directories | ||
| .turbo/ | ||
| .cache/ | ||
| # Temporary files | ||
| *.log | ||
| .DS_Store | ||
|
|
||
| # Environment files | ||
| .env* | ||
| !.env.example | ||
| # ESLint config packages (JavaScript config files) | ||
| packages/eslint-config/*.cjs | ||
| packages/tsconfig/*.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,15 +6,22 @@ | |
| "packageManager": "[email protected]", | ||
| "scripts": { | ||
| "dev": " turbo run dev --parallel", | ||
| "dev:storybook": "pnpm --filter @soso/storybook dev", | ||
| "dev:docs": "pnpm --filter @soso/docs dev", | ||
| "build": " turbo run build", | ||
| "build:packages": "turbo run build --filter='./packages/*'", | ||
| "lint": " turbo run lint", | ||
| "lint:fix": " turbo run lint -- --fix", | ||
| "typecheck": " turbo run typecheck", | ||
| "test": " turbo run test", | ||
| "test:ci": " turbo run test:coverage", | ||
| "test:packages": "turbo run test --filter='./packages/*'", | ||
| "commitlint": "commitlint --from HEAD~1 --to HEAD --verbose", | ||
| "hooks:help": "sh .husky/help.sh", | ||
| "validate": "pnpm lint && pnpm typecheck && pnpm test", | ||
| "changeset": "changeset", | ||
| "version-packages": "changeset version", | ||
| "release": "pnpm build:packages && changeset publish", | ||
| "prepare": "husky install" | ||
| }, | ||
| "keywords": [], | ||
|
|
@@ -39,6 +46,7 @@ | |
| ] | ||
| }, | ||
| "devDependencies": { | ||
| "@changesets/cli": "^2.29.8", | ||
| "@commitlint/cli": "^19.8.1", | ||
| "@commitlint/config-conventional": "^19.8.1", | ||
| "@typescript-eslint/eslint-plugin": "^8.35.1", | ||
|
|
@@ -54,6 +62,5 @@ | |
| "lint-staged": "^16.1.2", | ||
| "prettier": "^3.6.2", | ||
| "turbo": "^2.5.4" | ||
| }, | ||
| "dependencies": {} | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* packages/eslint-config/.eslintrc.cjs ───── ESLint 설정 패키지 자체의 ESLint 설정 */ | ||
|
|
||
| module.exports = { | ||
| root: true, | ||
| // JavaScript 파일이므로 TypeScript 파서 사용 안 함 | ||
| parser: '@typescript-eslint/parser', | ||
| parserOptions: { | ||
| // 타입 체크 비활성화 (설정 파일은 JS만 사용) | ||
| project: null, | ||
| sourceType: 'module', | ||
| }, | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'prettier', | ||
| ], | ||
| env: { | ||
| node: true, | ||
| es2020: true, | ||
| }, | ||
| rules: { | ||
| // Node.js require 허용 | ||
| '@typescript-eslint/no-var-requires': 'off', | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # @soso/eslint-config | ||
|
|
||
| SOSO 모노레포를 위한 공유 ESLint 설정 패키지 | ||
|
|
||
| ## 📦 포함된 설정 | ||
|
|
||
| ### index.cjs | ||
|
|
||
| Next.js 앱용 ESLint 설정 | ||
|
|
||
| **사용 대상**: | ||
|
|
||
| - `apps/web` | ||
| - `apps/docs` | ||
|
|
||
| **특징**: | ||
|
|
||
| - Airbnb 스타일 가이드 | ||
| - TypeScript 지원 | ||
| - Next.js 규칙 | ||
| - Prettier 통합 | ||
|
|
||
| ### library.cjs | ||
|
|
||
| React 라이브러리용 ESLint 설정 | ||
|
|
||
| **사용 대상**: | ||
|
|
||
| - `packages/ui` | ||
| - `packages/hooks` | ||
| - `apps/storybook` | ||
|
|
||
| **특징**: | ||
|
|
||
| - Next.js 규칙 제외 | ||
| - devDependencies import 허용 | ||
| - 라이브러리 개발에 최적화 | ||
|
|
||
| ## 🔧 사용법 | ||
|
|
||
| ### Next.js 앱 | ||
|
|
||
| ```js | ||
| // apps/web/.eslintrc.cjs | ||
| module.exports = { | ||
| root: true, | ||
| extends: ['@soso/eslint-config'], | ||
| }; | ||
| ``` | ||
|
|
||
| ### React 라이브러리 | ||
|
|
||
| ```js | ||
| // packages/ui/.eslintrc.cjs | ||
| module.exports = { | ||
| root: true, | ||
| extends: ['@soso/eslint-config/library'], | ||
| }; | ||
| ``` | ||
|
|
||
| ## 📚 참고 | ||
|
|
||
| - [ESLint Documentation](https://eslint.org/docs/latest/) | ||
| - [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) | ||
| - [터보레포 ESLint 설정](https://turborepo.com/docs/guides/tools/eslint) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||
| /* tools/eslint-config/index.cjs ───── 공통 ESLint preset */ | ||||||
|
||||||
| /* tools/eslint-config/index.cjs ───── 공통 ESLint preset */ | |
| /* packages/eslint-config/index.cjs ───── 공통 ESLint preset */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* packages/eslint-config/library.cjs ───── React 라이브러리용 ESLint preset */ | ||
|
|
||
| const path = require('path'); | ||
|
|
||
| module.exports = { | ||
| root: false, | ||
|
|
||
| parser: '@typescript-eslint/parser', | ||
| parserOptions: { | ||
| project: [path.resolve(__dirname, '../../tsconfig.json')], | ||
| tsconfigRootDir: path.resolve(__dirname, '../../'), | ||
| sourceType: 'module', | ||
| }, | ||
|
|
||
| plugins: ['@typescript-eslint'], | ||
|
|
||
| extends: [ | ||
| 'airbnb', | ||
| 'airbnb-typescript', | ||
| 'plugin:@typescript-eslint/recommended', | ||
| 'prettier', | ||
| ], | ||
|
|
||
| rules: { | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }], | ||
| '@typescript-eslint/lines-between-class-members': 'off', | ||
| '@typescript-eslint/no-throw-literal': 'off', | ||
| '@typescript-eslint/dot-notation': 'off', | ||
| '@typescript-eslint/no-implied-eval': 'off', | ||
| '@typescript-eslint/return-await': 'off', | ||
| // 라이브러리에서는 devDependencies import 허용 | ||
| 'import/no-extraneous-dependencies': [ | ||
| 'error', | ||
| { | ||
| devDependencies: true, | ||
| }, | ||
| ], | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "@soso/eslint-config", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "description": "Shared ESLint configurations for SOSO monorepo", | ||
| "main": "./index.cjs", | ||
| "files": [ | ||
| "index.cjs", | ||
| "library.cjs" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* packages/tsconfig/.eslintrc.cjs ───── TypeScript 설정 패키지의 ESLint 설정 */ | ||
|
|
||
| module.exports = { | ||
| root: true, | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'prettier', | ||
| ], | ||
| env: { | ||
| node: true, | ||
| }, | ||
| // JSON 파일이므로 ESLint 비활성화 | ||
| ignorePatterns: ['*.json'], | ||
| }; |
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.
문서에서 GitHub Actions를 통한 자동 배포를 언급하고 있지만, 현재
.github/workflows디렉토리에는 changesets 관련 워크플로우가 없는 것으로 보입니다. 실제 구현이 아직 완료되지 않았다면 이 부분을 "추후 구현 예정"으로 명시하거나 제거하는 것이 좋습니다.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.
곧 합니다