@bwg-ui/core
v2.0.20
Published
bankwareglobal UI 라이브러리입니다.
Readme
@bwg-ui/core
Vite 기반 React UI 라이브러리입니다.
설치
npm install @bwg-ui/core사용법
전체 import
import { BwgButton, BwgGrid, formatDate } from "@bwg-ui/core";카테고리별 import
import { BwgGrid, BwgButtonGroup, BwgTable } from "@bwg-ui/core/common";
import { BwgButton, BwgInput, BwgForm } from "@bwg-ui/core/core";
import { formatDate, validateEmail, realFormat } from "@bwg-ui/core/utils";
import { useCodeStore, useMenuDataStore } from "@bwg-ui/core/stores";
import { CommonCodeProvider, UtilsProvider } from "@bwg-ui/core/provider";
import "@bwg-ui/core/styles/main.css";
import iconUrl from "@bwg-ui/core/styles/assets/images/icon.png";
import config from "@bwg-ui/core/public/config.json";개발
npm install
npm run dev # 로컬 개발 서버
npm run build # dist 빌드
npm run type-check # 타입 검사로컬 tgz 배포 (레지스트리 없이)
소비 프로젝트에 tgz 파일로 바로 넘길 때:
npm run pack # build + tgz → libs/
npm run build:dev # pack + 소비 프로젝트 libs/ 복사
npm run copy-tgz-to-dev -- --target=kiam # 복사 대상 프로젝트 지정생성 파일: libs/bwg-ui-core-{version}.tgz
소비 프로젝트 package.json:
"@bwg-ui/core": "file:./libs/bwg-ui-core/bwg-ui-core-1.6.17.tgz"자세한 스크립트 설명은 scripts/README.md를 참고하세요.
BwgEditor 관련 (필독)
BwgEditor 사용 시 소비 프로젝트에서 아래 버전을 반드시 고정해야 합니다.
npm i -E [email protected] [email protected] [email protected]{
"dependencies": {
"quill": "1.3.7",
"react-quill": "2.0.0",
"quill-image-resize-module-react": "3.0.0"
}
}버전이 다르면
Uncaught TypeError: moduleClass is not a constructor오류가 발생할 수 있습니다.
배포
외부 npm과 내부 Gitea를 병행합니다.
외부망 개발/검증 → npm publish → 안정화 → 소스 내부망 반입 → Gitea publish스크립트 요약
| 스크립트 | 대상 | 설명 |
|----------|------|------|
| publish:patch / minor / major | npmjs.com | 외부망 개발·검증용. 버전 bump + 빌드 + publish |
| publish:gitea | Gitea | 버전 bump 없이 현재 버전을 Gitea에 올림 |
| publish:gitea:patch / minor / major | Gitea | 버전 bump + 빌드 + Gitea publish |
1. 외부망 — npm
npm run publish:patch # 1.6.17 → 1.6.18 + npmjs publish
npm run publish:minor
npm run publish:majorpublish:npm은--registry=https://registry.npmjs.org/를 명시합니다.
2. 내부망 — Gitea
소스 반입 후 내부망 PC에서:
npm install
npm run install:icons # @bwg-ui/icons 만 Gitea에서 install (빌드용, icons 선행 배포 필요)
# 외부 npm과 같은 버전을 Gitea에 반영
npm run publish:gitea
# 내부망에서 버전을 새로 올릴 때
npm run publish:gitea:patch
npm run publish:gitea:minor
npm run publish:gitea:major설정: Gitea 주소·토큰은 scripts/publish-gitea.mjs 상단에 하드코딩되어 있습니다. 변경 시 해당 파일만 수정하면 됩니다.
const GITEA_HOST = 'http://218.232.105.112:7001';
const GITEA_OWNER = 'bwg-ui';
const GITEA_TOKEN = '...';동작:
- Gitea 레지스트리에 동일 버전 존재 여부 확인 (있으면 중단)
prepublishOnly로 자동 빌드npm publish --registry=...실행
레지스트리: http://{IP}:{PORT}/api/packages/bwg-ui/npm/
CI 배포 (선택)
.gitea/workflows/package-regist.yml — deploy-* 태그 push 시 Gitea Actions로 자동 배포.
로컬 publish:gitea*를 사용하면 태그 push는 필요 없습니다.
