@c-time/frelio-data-json-recipe 1.0.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.
- package/dist/index.d.ts +323 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* カスタムフィールドのフォーマット種別(変換系)
|
|
3
|
+
*/
|
|
4
|
+
export type CustomFieldFormatType = 'string' | 'date' | 'number' | 'escape' | 'toc' | 'truncate' | 'stripHtml' | 'slug' | 'lowercase' | 'uppercase' | 'default' | 'count' | 'first' | 'last' | 'join' | 'url' | 'picture' | 'img' | 'srcset' | 'fileLink' | 'relationList';
|
|
5
|
+
/**
|
|
6
|
+
* カスタムフィールド(変換系)
|
|
7
|
+
* source 式を元に値を変換・整形する
|
|
8
|
+
*/
|
|
9
|
+
export type CustomFieldTransform = {
|
|
10
|
+
/** 出力フィールド名 */
|
|
11
|
+
field: string;
|
|
12
|
+
/** 元となる式(例: "{$this.title} - {$this.subtitle}") */
|
|
13
|
+
source: string;
|
|
14
|
+
/** フォーマット種別 */
|
|
15
|
+
type?: Exclude<CustomFieldFormatType, 'relationList'>;
|
|
16
|
+
/** フォーマット文字列(例: "YYYY年MM月DD日", "#,###円") */
|
|
17
|
+
format?: string;
|
|
18
|
+
/** truncate用の文字数 */
|
|
19
|
+
length?: number;
|
|
20
|
+
/** truncate用の末尾文字列(デフォルト: "...") */
|
|
21
|
+
suffix?: string;
|
|
22
|
+
/** join用の区切り文字(デフォルト: ", ") */
|
|
23
|
+
separator?: string;
|
|
24
|
+
/** default用のデフォルト値 */
|
|
25
|
+
defaultValue?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* カスタムフィールド(RelationList)
|
|
29
|
+
* 任意のコンテンツタイプのリストを参照し、埋め込む
|
|
30
|
+
* RecipeInclude に似た構造を持つ
|
|
31
|
+
*/
|
|
32
|
+
export type CustomFieldRelationList = {
|
|
33
|
+
/** 出力フィールド名 */
|
|
34
|
+
field: string;
|
|
35
|
+
/** フォーマット種別(relationList 固定) */
|
|
36
|
+
type: 'relationList';
|
|
37
|
+
/** 参照先コンテンツタイプID */
|
|
38
|
+
contentTypeId: string;
|
|
39
|
+
/** 最大件数 */
|
|
40
|
+
limit?: number;
|
|
41
|
+
/** スキップ件数 */
|
|
42
|
+
offset?: number;
|
|
43
|
+
/** ソート設定 */
|
|
44
|
+
sort?: RecipeSort | RecipeSort[];
|
|
45
|
+
/** フィルター設定 */
|
|
46
|
+
filters?: RecipeFilter[];
|
|
47
|
+
/** 取得するフィールド(null = 全て) */
|
|
48
|
+
listFields?: string[] | null;
|
|
49
|
+
/** リレーション展開設定 */
|
|
50
|
+
expand?: RelationExpand[];
|
|
51
|
+
/** ネストしたカスタムフィールド */
|
|
52
|
+
customFields?: CustomField[];
|
|
53
|
+
/** ページネーション設定(任意) */
|
|
54
|
+
pagination?: RelationListPaginationConfig;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* カスタムフィールド設定
|
|
58
|
+
* 変換系(CustomFieldTransform)または RelationList(CustomFieldRelationList)のユニオン型
|
|
59
|
+
*/
|
|
60
|
+
export type CustomField = CustomFieldTransform | CustomFieldRelationList;
|
|
61
|
+
/**
|
|
62
|
+
* Relation 展開設定
|
|
63
|
+
* リレーションフィールドを展開し、さらにネストした relation も展開可能
|
|
64
|
+
* 入れ子で「取得フィールド」「カスタムフィールド」「並び替え」「オフセット」等を設定可能
|
|
65
|
+
*/
|
|
66
|
+
export type RelationExpand = {
|
|
67
|
+
/** relation フィールド名 */
|
|
68
|
+
field: string;
|
|
69
|
+
/** 含めるフィールド(undefined = 全て) */
|
|
70
|
+
fields?: string[];
|
|
71
|
+
/** カスタムフィールド定義 */
|
|
72
|
+
customFields?: CustomField[];
|
|
73
|
+
/** ソート設定 */
|
|
74
|
+
sort?: RecipeSort | RecipeSort[];
|
|
75
|
+
/** 取得件数 */
|
|
76
|
+
limit?: number;
|
|
77
|
+
/** スキップ件数 */
|
|
78
|
+
offset?: number;
|
|
79
|
+
/** フィルター設定 */
|
|
80
|
+
filters?: RecipeFilter[];
|
|
81
|
+
/** ネストした展開設定(参照先の relation をさらに展開する場合) */
|
|
82
|
+
expand?: RelationExpand[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* ソート設定
|
|
86
|
+
*/
|
|
87
|
+
export type RecipeSort = {
|
|
88
|
+
/** ソート対象フィールド */
|
|
89
|
+
field: string;
|
|
90
|
+
/** ソート方向 */
|
|
91
|
+
direction: 'asc' | 'desc';
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* フィルター演算子
|
|
95
|
+
*/
|
|
96
|
+
export type RecipeFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'regex' | 'isNull' | 'isNotNull';
|
|
97
|
+
/**
|
|
98
|
+
* フィルター設定
|
|
99
|
+
*/
|
|
100
|
+
export type RecipeFilter = {
|
|
101
|
+
/** フィルター対象フィールド */
|
|
102
|
+
field: string;
|
|
103
|
+
/** 演算子 */
|
|
104
|
+
operator: RecipeFilterOperator;
|
|
105
|
+
/** 比較値(isNull/isNotNull の場合は不要) */
|
|
106
|
+
value?: unknown;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* ページネーション設定の基底型
|
|
110
|
+
*/
|
|
111
|
+
export type PaginationConfigBase = {
|
|
112
|
+
/** 1ページあたりの件数 */
|
|
113
|
+
perPage: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* ListPageRecipe 用ページネーション設定
|
|
117
|
+
* outputPath にページ番号パターン(例: "articles/page/{$page}.json")を含めることを前提とする
|
|
118
|
+
*/
|
|
119
|
+
export type ListPageRecipePaginationConfig = PaginationConfigBase & {
|
|
120
|
+
/**
|
|
121
|
+
* ページ番号のゼロ埋め桁数
|
|
122
|
+
* 例: 3 なら "001", "002", ... "999"
|
|
123
|
+
*/
|
|
124
|
+
numberFormatCount: number;
|
|
125
|
+
/**
|
|
126
|
+
* 1ページ目の固定パス(任意)
|
|
127
|
+
* 例: "articles/index.json"
|
|
128
|
+
* 指定しない場合は outputPath のパターンがそのまま適用される
|
|
129
|
+
*/
|
|
130
|
+
startPath?: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* カスタムフィールド RelationList 用ページネーション設定
|
|
134
|
+
* 将来の拡張に備えて予約
|
|
135
|
+
*/
|
|
136
|
+
export type RelationListPaginationConfig = PaginationConfigBase & {};
|
|
137
|
+
/**
|
|
138
|
+
* 親をたどるリピート設定
|
|
139
|
+
* カテゴリ階層などで親をたどってパスを生成する
|
|
140
|
+
*/
|
|
141
|
+
export type RecipeRepeat = {
|
|
142
|
+
/** 変数名(例: "parent")→ {$parent.xxx} でアクセス */
|
|
143
|
+
as: string;
|
|
144
|
+
/** たどる relation フィールド名(例: "parentCategory") */
|
|
145
|
+
field: string;
|
|
146
|
+
/** リピート時の出力パス(例: "{$parent.slug}/{$this.slug}/index.json") */
|
|
147
|
+
outputPath: string;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* 詳細データ設定
|
|
151
|
+
* 個別コンテンツの詳細データを生成するための設定
|
|
152
|
+
*/
|
|
153
|
+
export type DetailPageRecipe = {
|
|
154
|
+
type: 'detail';
|
|
155
|
+
/** 出力パス(例: "article/{$this.slug}.json") */
|
|
156
|
+
outputPath: string;
|
|
157
|
+
/** テンプレートファイルのパス */
|
|
158
|
+
templatePath: string;
|
|
159
|
+
/** リレーション展開設定 */
|
|
160
|
+
expand?: RelationExpand[];
|
|
161
|
+
/** 親をたどるリピート設定 */
|
|
162
|
+
repeat?: RecipeRepeat;
|
|
163
|
+
/** カスタムフィールド定義 */
|
|
164
|
+
customFields?: CustomField[];
|
|
165
|
+
/** 追加で含めるデータ */
|
|
166
|
+
include?: {
|
|
167
|
+
/** サイト設定を含める */
|
|
168
|
+
site?: boolean;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* 一覧データ設定の共通プロパティ(内部用)
|
|
173
|
+
*/
|
|
174
|
+
type ListPageRecipeBase = {
|
|
175
|
+
type: 'list';
|
|
176
|
+
/** 出力パス(例: "articles/index.json" または "articles/page/{$page}.json") */
|
|
177
|
+
outputPath: string;
|
|
178
|
+
/** テンプレートファイルのパス */
|
|
179
|
+
templatePath: string;
|
|
180
|
+
/** スキップ件数 */
|
|
181
|
+
offset?: number;
|
|
182
|
+
/** ソート設定(単一または複数) */
|
|
183
|
+
sort?: RecipeSort | RecipeSort[];
|
|
184
|
+
/** フィルター設定 */
|
|
185
|
+
filters?: RecipeFilter[];
|
|
186
|
+
/** カスタムフィールド定義 */
|
|
187
|
+
customFields?: CustomField[];
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* 一覧データ設定(ページネーション無効)
|
|
191
|
+
* - listFields で出力フィールドを制御
|
|
192
|
+
* - expand でリレーションを展開
|
|
193
|
+
*/
|
|
194
|
+
export type ListPageRecipeWithoutPagination = ListPageRecipeBase & {
|
|
195
|
+
pagination?: undefined;
|
|
196
|
+
/** 最大件数 */
|
|
197
|
+
limit?: number;
|
|
198
|
+
/** 一覧に含めるフィールド(null = 全て) */
|
|
199
|
+
listFields?: string[] | null;
|
|
200
|
+
/** リレーション展開設定 */
|
|
201
|
+
expand?: RelationExpand[];
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* 一覧データ設定(ページネーション有効)
|
|
205
|
+
*
|
|
206
|
+
* ページネーション有効時の出力構造は固定:
|
|
207
|
+
* {
|
|
208
|
+
* "nextPage": "articles/page-002.json",
|
|
209
|
+
* "prevPage": null,
|
|
210
|
+
* "pageNumber": 1,
|
|
211
|
+
* "totalPages": 10,
|
|
212
|
+
* "totalItems": 95,
|
|
213
|
+
* "pagedItems": [ ... ]
|
|
214
|
+
* }
|
|
215
|
+
*
|
|
216
|
+
* - listFields は使用しない(pagedItems の構造に固定)
|
|
217
|
+
* - items.fields / items.expand で pagedItems 内のアイテムに対する設定を行う
|
|
218
|
+
*/
|
|
219
|
+
export type ListPageRecipeWithPagination = ListPageRecipeBase & {
|
|
220
|
+
pagination: ListPageRecipePaginationConfig;
|
|
221
|
+
/** pagedItems に適用する設定 */
|
|
222
|
+
items?: {
|
|
223
|
+
/** 一覧に含めるフィールド(null = 全て) */
|
|
224
|
+
fields?: string[] | null;
|
|
225
|
+
/** リレーション展開設定 */
|
|
226
|
+
expand?: RelationExpand[];
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* 一覧データ設定
|
|
231
|
+
* コンテンツの一覧データを生成するための設定
|
|
232
|
+
*/
|
|
233
|
+
export type ListPageRecipe = ListPageRecipeWithoutPagination | ListPageRecipeWithPagination;
|
|
234
|
+
/**
|
|
235
|
+
* 固定ページレシピ(単体固定モード)
|
|
236
|
+
* 1つのJSONファイルを出力
|
|
237
|
+
*/
|
|
238
|
+
export type StaticPageRecipe = {
|
|
239
|
+
type: 'static';
|
|
240
|
+
/** 出力パス(例: "site-config.json") */
|
|
241
|
+
outputPath: string;
|
|
242
|
+
/** テンプレートファイルのパス */
|
|
243
|
+
templatePath: string;
|
|
244
|
+
/** カスタムフィールド定義 */
|
|
245
|
+
customFields?: CustomField[];
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* コンテンツタイプ別レシピ
|
|
249
|
+
*/
|
|
250
|
+
export type ContentTypeRecipe = {
|
|
251
|
+
/** 詳細データ設定(複数可:通常版、AMP版、印刷用など) */
|
|
252
|
+
details?: DetailPageRecipe[];
|
|
253
|
+
/** 一覧データ設定(複数可) */
|
|
254
|
+
lists?: ListPageRecipe[];
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* テンプレートのパーツ化ファイル定義
|
|
258
|
+
* パーツファイルの変更が影響するテンプレートを定義
|
|
259
|
+
* 例: { "_parts/*.html": ["*"] } → パーツ変更で全ビルド
|
|
260
|
+
*/
|
|
261
|
+
export type TemplateIncludes = {
|
|
262
|
+
/** キー: パーツファイルのglobパターン、値: 影響を受けるテンプレートパス配列("*"で全て) */
|
|
263
|
+
[partsPattern: string]: string[];
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* 目次エントリ(toc フォーマットの出力形式)
|
|
267
|
+
*/
|
|
268
|
+
export type TocEntry = {
|
|
269
|
+
/** 見出しレベル(1-6) */
|
|
270
|
+
level: number;
|
|
271
|
+
/** 見出しのID属性 */
|
|
272
|
+
id: string;
|
|
273
|
+
/** 見出しのテキスト */
|
|
274
|
+
text: string;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* サイト全体のビルドデータレシピ(メタデータ含む)
|
|
278
|
+
*/
|
|
279
|
+
export type SiteRecipe = {
|
|
280
|
+
/** バージョン */
|
|
281
|
+
version: '1.0';
|
|
282
|
+
/** コンテンツタイプ別レシピ */
|
|
283
|
+
contentTypes: Record<string, ContentTypeRecipe>;
|
|
284
|
+
/** 固定ページレシピ */
|
|
285
|
+
staticPages?: StaticPageRecipe[];
|
|
286
|
+
/** テンプレートパーツ依存関係 */
|
|
287
|
+
templateIncludes?: TemplateIncludes;
|
|
288
|
+
/** 最終更新日時 */
|
|
289
|
+
lastUpdatedAt: string;
|
|
290
|
+
/** 最終更新者 */
|
|
291
|
+
lastUpdatedBy: string;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* ページネーション有効時の出力 JSON 構造
|
|
295
|
+
*/
|
|
296
|
+
export type PaginatedListOutput<T = unknown> = {
|
|
297
|
+
/** 現在のページ番号(1始まり) */
|
|
298
|
+
currentPageNumber: number;
|
|
299
|
+
/** 総ページ数 */
|
|
300
|
+
totalPagesCount: number;
|
|
301
|
+
/** 総アイテム数 */
|
|
302
|
+
totalItemsCount: number;
|
|
303
|
+
/** このページのアイテム配列 */
|
|
304
|
+
pagedItems: T[];
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* ListPageRecipe がページネーション有効かどうかを判定
|
|
308
|
+
*/
|
|
309
|
+
export declare function isListPageRecipeWithPagination(recipe: ListPageRecipe): recipe is ListPageRecipeWithPagination;
|
|
310
|
+
/**
|
|
311
|
+
* ListPageRecipe がページネーション無効かどうかを判定
|
|
312
|
+
*/
|
|
313
|
+
export declare function isListPageRecipeWithoutPagination(recipe: ListPageRecipe): recipe is ListPageRecipeWithoutPagination;
|
|
314
|
+
/**
|
|
315
|
+
* CustomField が RelationList かどうかを判定
|
|
316
|
+
*/
|
|
317
|
+
export declare function isCustomFieldRelationList(field: CustomField): field is CustomFieldRelationList;
|
|
318
|
+
/**
|
|
319
|
+
* CustomField が変換系(Transform)かどうかを判定
|
|
320
|
+
*/
|
|
321
|
+
export declare function isCustomFieldTransform(field: CustomField): field is CustomFieldTransform;
|
|
322
|
+
export {};
|
|
323
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,UAAU,GACV,WAAW,GACX,MAAM,GACN,WAAW,GACX,WAAW,GACX,SAAS,GACT,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,GACN,KAAK,GAEL,SAAS,GACT,KAAK,GACL,QAAQ,GACR,UAAU,GAEV,cAAc,CAAA;AAElB;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,eAAe;IACf,KAAK,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,eAAe;IACf,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAA;IACrD,4CAA4C;IAC5C,MAAM,CA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gBAAgB,CAAA;IACnC,aAAa;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC7C,qBAAqB;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa;IACb,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB;IACnB,UAAU,EAAE,CAAC,EAAE,CAAA;CAChB,CAAA;AAID;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,cAAc,GACrB,MAAM,IAAI,4BAA4B,CAExC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,cAAc,GACrB,MAAM,IAAI,+BAA+B,CAE3C;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,uBAAuB,CAElC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,oBAAoB,CAE/B"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// === Build Data Recipe ===
|
|
2
|
+
// === 型ガード関数 ===
|
|
3
|
+
/**
|
|
4
|
+
* ListPageRecipe がページネーション有効かどうかを判定
|
|
5
|
+
*/
|
|
6
|
+
export function isListPageRecipeWithPagination(recipe) {
|
|
7
|
+
return recipe.pagination !== undefined;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ListPageRecipe がページネーション無効かどうかを判定
|
|
11
|
+
*/
|
|
12
|
+
export function isListPageRecipeWithoutPagination(recipe) {
|
|
13
|
+
return recipe.pagination === undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* CustomField が RelationList かどうかを判定
|
|
17
|
+
*/
|
|
18
|
+
export function isCustomFieldRelationList(field) {
|
|
19
|
+
return field.type === 'relationList';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* CustomField が変換系(Transform)かどうかを判定
|
|
23
|
+
*/
|
|
24
|
+
export function isCustomFieldTransform(field) {
|
|
25
|
+
return field.type !== 'relationList';
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AA8W5B,iBAAiB;AAEjB;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC5C,MAAsB;IAEtB,OAAO,MAAM,CAAC,UAAU,KAAK,SAAS,CAAA;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAAsB;IAEtB,OAAO,MAAM,CAAC,UAAU,KAAK,SAAS,CAAA;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAkB;IAElB,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAA;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAkB;IAElB,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAA;AACtC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@c-time/frelio-data-json-recipe",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Type definitions for frelio data JSON recipe",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json",
|
|
20
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"frelio",
|
|
25
|
+
"recipe",
|
|
26
|
+
"typescript",
|
|
27
|
+
"types",
|
|
28
|
+
"cms"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"typescript": "^5.7.0"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
}
|
|
37
|
+
}
|