@famgia/omnify-ai-guides 2.0.20 → 2.0.22

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.
@@ -126,47 +126,50 @@ Use cases:
126
126
 
127
127
  ```yaml
128
128
  # schemas/PostStatus.yaml
129
- name: PostStatus
130
129
  kind: enum
131
130
  displayName:
132
131
  ja: 投稿ステータス
133
132
  en: Post Status
134
133
  values:
135
- draft:
136
- ja: 下書き
137
- en: Draft
138
- published:
139
- ja: 公開済み
140
- en: Published
141
- archived:
142
- ja: アーカイブ
143
- en: Archived
134
+ - value: draft
135
+ label:
136
+ ja: 下書き
137
+ en: Draft
138
+ - value: published
139
+ label:
140
+ ja: 公開済み
141
+ en: Published
142
+ - value: archived
143
+ label:
144
+ ja: アーカイブ
145
+ en: Archived
144
146
  ```
145
147
 
146
148
  Generated:
147
149
  ```typescript
148
- export const PostStatus = {
149
- draft: 'draft',
150
- published: 'published',
151
- archived: 'archived',
152
- } as const;
153
-
154
- export type PostStatus = typeof PostStatus[keyof typeof PostStatus];
155
-
156
- // Multi-locale labels
157
- export const PostStatusLabels: Record<PostStatus, Record<string, string>> = {
158
- draft: { ja: '下書き', en: 'Draft' },
159
- published: { ja: '公開済み', en: 'Published' },
160
- archived: { ja: 'アーカイブ', en: 'Archived' },
150
+ export enum PostStatus {
151
+ Draft = 'draft',
152
+ Published = 'published',
153
+ Archived = 'archived',
154
+ }
155
+
156
+ // Multi-locale labels (when locale config has multiple locales)
157
+ const postStatusLabels: Partial<Record<PostStatus, Record<string, string>>> = {
158
+ [PostStatus.Draft]: { 'ja': '下書き', 'en': 'Draft' },
159
+ [PostStatus.Published]: { 'ja': '公開済み', 'en': 'Published' },
160
+ [PostStatus.Archived]: { 'ja': 'アーカイブ', 'en': 'Archived' },
161
161
  };
162
162
 
163
- // Get label for specific locale
164
- export function getPostStatusLabel(value: PostStatus, locale: string = 'en'): string {
165
- return PostStatusLabels[value]?.[locale] ?? PostStatusLabels[value]?.['en'] ?? value;
163
+ // Get label for specific locale (fallback: ja → en → value)
164
+ export function getPostStatusLabel(value: PostStatus, locale?: string): string {
165
+ const labels = postStatusLabels[value];
166
+ if (!labels) return value;
167
+ if (locale && labels[locale]) return labels[locale];
168
+ return labels['ja'] ?? labels['en'] ?? Object.values(labels)[0] ?? value;
166
169
  }
167
170
 
168
171
  // Helper functions
169
- export const PostStatusValues = Object.values(PostStatus);
172
+ export const PostStatusValues = Object.values(PostStatus) as PostStatus[];
170
173
  export function isPostStatus(value: unknown): value is PostStatus {
171
174
  return PostStatusValues.includes(value as PostStatus);
172
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@famgia/omnify-ai-guides",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "AI Guides generator plugin for Omnify - generates Cursor rules, Claude guides, and Antigravity rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "yaml": "^2.7.1",
29
- "@famgia/omnify-types": "2.0.20"
29
+ "@famgia/omnify-types": "2.0.22"
30
30
  },
31
31
  "devDependencies": {
32
32
  "tsup": "^8.5.1",