@rencar-dev/feature-modules-public
v1.2.2
Published
Rencar feature modules - hooks, utils, and UI components
Maintainers
Readme
@rencar-dev/feature-modules-public
Rencar 기능 모듈 모음 - hooks, utils, UI 컴포넌트 등을 포함합니다.
설치
npm install @rencar-dev/feature-modules-public
# 또는
yarn add @rencar-dev/feature-modules-public모듈 목록
| 모듈 | 설명 | 문서 | | -------- | ---------------------- | ------------------------------------ | | hooks | 유틸리티 React 훅 | docs/hooks.md | | presence | 실시간 접속자 프레즌스 | docs/presence.md |
// hooks 모듈 import
import { useExample } from "@rencar-dev/feature-modules-public/hooks";
// presence 모듈 import
import {
usePresence,
PresenceFloating,
} from "@rencar-dev/feature-modules-public/presence";
import "@rencar-dev/feature-modules-public/presence/styles.css";개발 가이드
로컬 개발
# 개발 모드 (watch)
npm run dev
# 빌드
npm run build다른 프로젝트에서 테스트 (npm link)
패키지를 npm에 배포하지 않고 다른 프로젝트에서 실시간으로 테스트하려면:
Step 1: 이 패키지에서 글로벌 링크 생성
npm linkStep 2: 다른 프로젝트에서 링크 연결
cd your-project
npm link @rencar-dev/feature-modules-publicStep 3: 연결 확인
npm ls @rencar-dev/feature-modules-public
# 출력에 -> 심볼릭 링크 경로가 표시되면 성공Step 4: Next.js 프로젝트의 경우 추가 설정
next.config.js (또는 .mjs)에 다음 설정 추가:
webpack: (config, { isServer }) => {
// 심볼릭 링크 해결을 위한 설정
config.resolve.symlinks = false;
// ... 기존 webpack 설정 ...
return config;
},Note: 설정 변경 후
.next폴더를 삭제하고 dev 서버를 재시작하세요.
테스트 완료 후 링크 해제:
cd your-project
npm unlink @rencar-dev/feature-modules-public
npm install # 원래 패키지로 복원새 모듈 추가하기
폴더 생성:
src/[모듈명]/폴더 생성Entry 파일:
src/[모듈명]/index.ts생성 및 export 정의tsup 설정:
tsup.config.ts에 entry 추가entry: { "hooks/index": "src/hooks/index.ts", "presence/index": "src/presence/index.ts", "[모듈명]/index": "src/[모듈명]/index.ts", // 추가 },package.json exports 추가:
"./[모듈명]": { "types": "./dist/[모듈명]/index.d.ts", "import": "./dist/[모듈명]/index.js", "require": "./dist/[모듈명]/index.cjs" }typesVersions 추가:
"[모듈명]": ["./dist/[모듈명]/index.d.ts"]문서 작성:
docs/[모듈명].md생성README 업데이트: 모듈 목록 테이블에 추가
배포
자동 배포 (권장):
master 브랜치에 push하면 semantic-release가 자동으로:
- 커밋 메시지 분석 (
fix:,feat:등) - 버전 번호 결정 및 package.json 업데이트
- Git 태그 생성
- npm 배포
- GitHub Release 생성
| 커밋 접두사 | 버전 변경 | 예시 |
| ----------- | ------------- | ------------------------ |
| fix: | patch (0.0.X) | fix: 버그 수정 |
| feat: | minor (0.X.0) | feat: 새 기능 추가 |
| feat!: | major (X.0.0) | feat!: breaking change |
Note:
chore:,docs:,style:등은 릴리즈를 트리거하지 않습니다.
수동 배포:
npm version patch # 또는 minor, major
npm publish라이선스
MIT
