vite-plugin-jsx-source-attrs 0.1.1-pre.main.30.1df4a2f6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +0 -53
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -31,59 +31,6 @@ npm install -D vite-plugin-jsx-source-attrs
31
31
 
32
32
  프로덕션 빌드에서도 `vite.config.ts`를 평가해야 하므로 CI/CD가 `devDependencies`를 포함해 설치해야 합니다. `npm ci --omit=dev`처럼 devDependency를 제외한 상태에서 빌드를 실행하는 환경이라면 이 패키지를 찾을 수 없습니다. 이 경우 빌드 단계에서는 devDependency를 포함해 설치하고, 배포 런타임 이미지나 서버 산출물에서만 devDependency를 제외하세요.
33
33
 
34
- ### LLM 적용 가이드 프롬프트
35
-
36
- 다른 Vite React 프로젝트에 이 패키지를 설치하고 `vite.config.ts`까지 자동 반영하려면 아래 프롬프트를 LLM/AI 에이전트에게 그대로 전달하세요. 더 자세한 지침은 [`README.llm.txt`](README.llm.txt)를 참고하세요.
37
-
38
- ````text
39
- Vite React 프로젝트에 `vite-plugin-jsx-source-attrs`를 설치하고 설정해줘.
40
-
41
- 요구사항:
42
- 1. 프로젝트 루트에서 패키지 매니저를 확인해줘.
43
- - `packageManager` 필드가 있으면 해당 도구를 우선 사용해줘.
44
- - `packageManager`가 없으면 lockfile 기준으로 판단해줘: `bun.lock` → Bun, `package-lock.json` → npm, `pnpm-lock.yaml` → pnpm, `yarn.lock` → Yarn.
45
- - 그래도 판단할 수 없으면 npm을 사용해줘.
46
- 2. `vite-plugin-jsx-source-attrs`를 devDependency로 설치해줘.
47
- - stable 검증이면 `vite-plugin-jsx-source-attrs` 또는 `vite-plugin-jsx-source-attrs@latest`를 설치해줘.
48
- - MR 검증본이 필요하면 `vite-plugin-jsx-source-attrs@dev`를 설치해줘.
49
- - main prerelease 검증본이 필요하면 `vite-plugin-jsx-source-attrs@pre`를 설치해줘.
50
- 3. `vite.config.ts` 또는 `vite.config.mts`를 찾아 `@vitejs/plugin-react`보다 앞에 `vitePluginJsxSourceAttrs()`를 추가해줘.
51
- 4. 기존 `react()` 설정, 기존 Babel plugin, alias, server, build 설정은 보존해줘.
52
- 5. 이미 `react({ babel: { plugins: [...] } })`를 지원하는 구버전 조합이면 `jsxSourceAttrs()`를 기존 Babel 플러그인 배열 끝에 추가해도 돼.
53
- 6. Vite 8 + `@vitejs/plugin-react` 6처럼 `babel` 옵션이 없는 조합에서는 `react({ babel: ... })` 형태로 바꾸지 말고 Vite 플러그인 방식을 사용해줘.
54
- 7. `defineConfig`가 객체 형태이고 `mode`가 필요하면 `defineConfig(({ mode }) => ({ ... }))` 형태로 바꿔줘. 단, 기존 설정 의미는 보존해줘.
55
- 8. 기본 설정은 아래 값을 사용해줘.
56
-
57
- ```ts
58
- vitePluginJsxSourceAttrs({
59
- enabled: mode === 'development',
60
- attributeName: 'data-source-location',
61
- componentAttributeName: null,
62
- })
63
- ```
64
-
65
- 9. import를 추가해줘.
66
-
67
- ```ts
68
- import { vitePluginJsxSourceAttrs } from 'vite-plugin-jsx-source-attrs';
69
- ```
70
-
71
- 10. 기존 로컬 JSX source attrs 플러그인이 있으면 새 패키지로 대체해줘.
72
- - 제거 후보: `resources/scripts/jsx-source-attrs.js`, `resources/babel/jsx-source-attrs.js`, `src/resources/babel/jsx-source-attrs.js`, `@wix/babel-plugin-jsx-source-attrs` 직접 설정.
73
- - 단, 실제 import가 제거된 뒤에만 파일/의존성을 삭제해줘.
74
- 11. 빌드 단계에서는 devDependencies가 설치되어야 한다는 점을 CI 설정에서 확인해줘.
75
- 12. 변경 후 프로젝트의 기존 검증 스크립트를 실행해줘.
76
- - 가능한 경우: lint, typecheck, test, build 순서.
77
- - 없는 스크립트는 억지로 만들지 말고 건너뛰었다고 보고해줘.
78
- 13. 최종 보고에는 설치한 버전/tag, 수정한 파일, 실행한 검증 명령, 남은 주의사항을 요약해줘.
79
-
80
- 주의사항:
81
- - unrelated 파일은 수정하지 마.
82
- - 기존 변경사항을 되돌리지 마.
83
- - 문자열/주석에 있는 예시는 실제 import나 실행 코드가 아니면 함부로 삭제하지 마.
84
- - 프로덕션 빌드 산출물에는 `data-source-location`이 없어야 해.
85
- ````
86
-
87
34
 
88
35
  ## 사용법
89
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-jsx-source-attrs",
3
- "version": "0.1.1-pre.main.30.1df4a2f6",
3
+ "version": "0.2.0",
4
4
  "description": "Vite React 개발 환경에서 JSX 요소에 소스 위치 attribute를 주입하는 Vite/Babel 플러그인",
5
5
  "type": "module",
6
6
  "license": "MIT",