@blastlabs/utils 1.16.0 → 1.17.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.
@@ -94,10 +94,13 @@ function parseFrontmatter(content) {
94
94
  const body = match[2];
95
95
 
96
96
  const frontmatter = {};
97
+ let currentKey = null;
98
+
97
99
  for (const line of yamlBlock.split("\n")) {
100
+ // 키-값 쌍 파싱
98
101
  const kvMatch = line.match(/^(\w+):\s*(.*)$/);
99
102
  if (kvMatch) {
100
- const key = kvMatch[1];
103
+ currentKey = kvMatch[1];
101
104
  let value = kvMatch[2].trim();
102
105
 
103
106
  if (value === "true") value = true;
@@ -112,7 +115,18 @@ function parseFrontmatter(content) {
112
115
  }
113
116
 
114
117
  if (value !== undefined) {
115
- frontmatter[key] = value;
118
+ frontmatter[currentKey] = value;
119
+ }
120
+ } else if (line.startsWith(" -") && currentKey) {
121
+ // 배열 값 처리 (paths 등)
122
+ const arrayValueMatch = line.match(/^\s*-\s*"([^"]+)"\s*$/);
123
+ if (arrayValueMatch) {
124
+ const arrayValue = arrayValueMatch[1];
125
+ // 현재 키의 값이 배열이 아니면 배열로 초기화
126
+ if (!Array.isArray(frontmatter[currentKey])) {
127
+ frontmatter[currentKey] = [];
128
+ }
129
+ frontmatter[currentKey].push(arrayValue);
116
130
  }
117
131
  }
118
132
  }
@@ -140,9 +154,16 @@ function serializeClaudeFrontmatter(frontmatter) {
140
154
  if (frontmatter.description) {
141
155
  yaml += `description: "${frontmatter.description}"\n`;
142
156
  }
143
- // globsalwaysApply가 true가 아닌 경우에만 포함
144
- if (frontmatter.globs && frontmatter.alwaysApply !== true) {
145
- yaml += `globs: "${frontmatter.globs}"\n`;
157
+ // paths항상 적용되지 않는 경우에만 포함
158
+ if (frontmatter.paths && frontmatter.alwaysApply !== true) {
159
+ if (Array.isArray(frontmatter.paths)) {
160
+ yaml += "paths:\n";
161
+ for (const p of frontmatter.paths) {
162
+ yaml += ` - "${p}"\n`;
163
+ }
164
+ } else {
165
+ yaml += `paths:\n - "${frontmatter.paths}"\n`;
166
+ }
146
167
  }
147
168
  // alwaysApply는 Claude에서 사용하지 않으므로 생략
148
169
  yaml += "---\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blastlabs/utils",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Entities 레이어 구조 및 API 패턴"
3
- globs: "**/entities/**"
3
+ paths:
4
+ - "**/entities/**"
4
5
  ---
5
6
 
6
7
  # Entities Layer (엔티티)
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  description: "React Hooks 개발 규칙 및 SSR 안전성"
3
- globs: "**/use*.ts,**/use*.tsx"
4
- alwaysApply: false
3
+ paths:
4
+ - "src/hooks/**/*.ts"
5
+ - "src/hooks/**/*.tsx"
6
+ - "**/use*.ts"
7
+ - "**/use*.tsx"
5
8
  ---
6
9
 
7
10
  # React Hooks Rules
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Shared 레이어 구조 및 lib vs utils 구분"
3
- globs: "**/shared/**"
3
+ paths:
4
+ - "**/shared/**"
4
5
  ---
5
6
 
6
7
  # Shared Layer (공유 레이어)
package/rules/testing.md CHANGED
@@ -1,7 +1,9 @@
1
1
  ---
2
2
  description: "테스트 작성 가이드라인"
3
- globs: "**/*.test.ts,**/*.test.tsx,**/__tests__/**"
4
- alwaysApply: false
3
+ paths:
4
+ - "**/*.test.ts"
5
+ - "**/*.test.tsx"
6
+ - "**/__tests__/**"
5
7
  ---
6
8
 
7
9
  # Testing Guidelines
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  description: "TypeScript 코딩 표준 및 타입 규칙"
3
- globs: "**/*.ts,**/*.tsx"
4
- alwaysApply: false
3
+ paths:
4
+ - "**/*.ts"
5
+ - "**/*.tsx"
5
6
  ---
6
7
 
7
8
  # TypeScript Standards
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: "Views 레이어 (페이지) 구조"
3
- globs: "**/views/**"
3
+ paths:
4
+ - "**/views/**"
4
5
  ---
5
6
 
6
7
  # Views Layer (페이지 레이어)