recipe-scrapers-js 1.0.0-rc.4 → 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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +3 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ All notable changes to this project will be documented in this file.
|
|
|
6
6
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
7
7
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [1.0.0] - 2026-01-17
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Promote `1.0.0-rc.*` to stable `1.0.0`
|
|
14
|
+
- Update dependencies: `parse-ingredient@^1.3.3`, `zod@^4.3.5`, `tsdown@^0.19.0`, `@biomejs/biome@2.3.11`
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Allow ingredient items to have `parsed: null` when ingredient parsing fails
|
|
19
|
+
|
|
9
20
|
## [1.0.0-rc.4] - 2025-12-21
|
|
10
21
|
|
|
11
22
|
### Fixed
|
|
@@ -59,4 +70,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
59
70
|
|
|
60
71
|
Prior to version 1.0.0-rc.0, this project was in alpha development. No formal changelog was maintained during the alpha phase.
|
|
61
72
|
|
|
73
|
+
[1.0.0]: https://github.com/nerdstep/recipe-scrapers-js/releases/tag/v1.0.0
|
|
62
74
|
[1.0.0-rc.0]: https://github.com/nerdstep/recipe-scrapers-js/releases/tag/v1.0.0-rc.0
|
package/dist/index.d.mts
CHANGED
|
@@ -60,14 +60,14 @@ declare const ParsedIngredientSchema: z.ZodObject<{
|
|
|
60
60
|
*/
|
|
61
61
|
declare const IngredientItemSchema: z.ZodObject<{
|
|
62
62
|
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
63
|
-
parsed: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
parsed: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
64
64
|
quantity: z.ZodNullable<z.ZodNumber>;
|
|
65
65
|
quantity2: z.ZodNullable<z.ZodNumber>;
|
|
66
66
|
unitOfMeasureID: z.ZodNullable<z.ZodString>;
|
|
67
67
|
unitOfMeasure: z.ZodNullable<z.ZodString>;
|
|
68
68
|
description: z.ZodString;
|
|
69
69
|
isGroupHeader: z.ZodBoolean;
|
|
70
|
-
}, z.core.$strip
|
|
70
|
+
}, z.core.$strip>>>;
|
|
71
71
|
}, z.core.$strip>;
|
|
72
72
|
/**
|
|
73
73
|
* Schema for a group of ingredients
|
|
@@ -76,14 +76,14 @@ declare const IngredientGroupSchema: z.ZodObject<{
|
|
|
76
76
|
name: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
77
77
|
items: z.ZodArray<z.ZodObject<{
|
|
78
78
|
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
79
|
-
parsed: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
parsed: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
80
80
|
quantity: z.ZodNullable<z.ZodNumber>;
|
|
81
81
|
quantity2: z.ZodNullable<z.ZodNumber>;
|
|
82
82
|
unitOfMeasureID: z.ZodNullable<z.ZodString>;
|
|
83
83
|
unitOfMeasure: z.ZodNullable<z.ZodString>;
|
|
84
84
|
description: z.ZodString;
|
|
85
85
|
isGroupHeader: z.ZodBoolean;
|
|
86
|
-
}, z.core.$strip
|
|
86
|
+
}, z.core.$strip>>>;
|
|
87
87
|
}, z.core.$strip>>;
|
|
88
88
|
}, z.core.$strip>;
|
|
89
89
|
/**
|
|
@@ -94,14 +94,14 @@ declare const IngredientsSchema: z.ZodArray<z.ZodObject<{
|
|
|
94
94
|
name: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
95
95
|
items: z.ZodArray<z.ZodObject<{
|
|
96
96
|
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
97
|
-
parsed: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
parsed: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
98
98
|
quantity: z.ZodNullable<z.ZodNumber>;
|
|
99
99
|
quantity2: z.ZodNullable<z.ZodNumber>;
|
|
100
100
|
unitOfMeasureID: z.ZodNullable<z.ZodString>;
|
|
101
101
|
unitOfMeasure: z.ZodNullable<z.ZodString>;
|
|
102
102
|
description: z.ZodString;
|
|
103
103
|
isGroupHeader: z.ZodBoolean;
|
|
104
|
-
}, z.core.$strip
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
105
|
}, z.core.$strip>>;
|
|
106
106
|
}, z.core.$strip>>;
|
|
107
107
|
/**
|
|
@@ -161,14 +161,14 @@ declare const RecipeObjectBaseSchema: z.ZodObject<{
|
|
|
161
161
|
name: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
162
162
|
items: z.ZodArray<z.ZodObject<{
|
|
163
163
|
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
164
|
-
parsed: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
parsed: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
165
165
|
quantity: z.ZodNullable<z.ZodNumber>;
|
|
166
166
|
quantity2: z.ZodNullable<z.ZodNumber>;
|
|
167
167
|
unitOfMeasureID: z.ZodNullable<z.ZodString>;
|
|
168
168
|
unitOfMeasure: z.ZodNullable<z.ZodString>;
|
|
169
169
|
description: z.ZodString;
|
|
170
170
|
isGroupHeader: z.ZodBoolean;
|
|
171
|
-
}, z.core.$strip
|
|
171
|
+
}, z.core.$strip>>>;
|
|
172
172
|
}, z.core.$strip>>;
|
|
173
173
|
}, z.core.$strip>>;
|
|
174
174
|
instructions: z.ZodArray<z.ZodObject<{
|
|
@@ -242,7 +242,7 @@ declare const RecipeObjectSchema: z.ZodPipe<z.ZodType<{
|
|
|
242
242
|
unitOfMeasure: string | null;
|
|
243
243
|
description: string;
|
|
244
244
|
isGroupHeader: boolean;
|
|
245
|
-
} | undefined;
|
|
245
|
+
} | null | undefined;
|
|
246
246
|
}[];
|
|
247
247
|
}[];
|
|
248
248
|
instructions: {
|
|
@@ -290,7 +290,7 @@ declare const RecipeObjectSchema: z.ZodPipe<z.ZodType<{
|
|
|
290
290
|
unitOfMeasure: string | null;
|
|
291
291
|
description: string;
|
|
292
292
|
isGroupHeader: boolean;
|
|
293
|
-
} | undefined;
|
|
293
|
+
} | null | undefined;
|
|
294
294
|
}[];
|
|
295
295
|
}[];
|
|
296
296
|
instructions: {
|
|
@@ -338,7 +338,7 @@ declare const RecipeObjectSchema: z.ZodPipe<z.ZodType<{
|
|
|
338
338
|
unitOfMeasure: string | null;
|
|
339
339
|
description: string;
|
|
340
340
|
isGroupHeader: boolean;
|
|
341
|
-
} | undefined;
|
|
341
|
+
} | null | undefined;
|
|
342
342
|
}[];
|
|
343
343
|
}[];
|
|
344
344
|
instructions: {
|
|
@@ -386,7 +386,7 @@ declare const RecipeObjectSchema: z.ZodPipe<z.ZodType<{
|
|
|
386
386
|
unitOfMeasure: string | null;
|
|
387
387
|
description: string;
|
|
388
388
|
isGroupHeader: boolean;
|
|
389
|
-
} | undefined;
|
|
389
|
+
} | null | undefined;
|
|
390
390
|
}[];
|
|
391
391
|
}[];
|
|
392
392
|
instructions: {
|
|
@@ -824,7 +824,7 @@ declare abstract class AbstractScraper {
|
|
|
824
824
|
unitOfMeasure: string | null;
|
|
825
825
|
description: string;
|
|
826
826
|
isGroupHeader: boolean;
|
|
827
|
-
} | undefined;
|
|
827
|
+
} | null | undefined;
|
|
828
828
|
}[];
|
|
829
829
|
}[];
|
|
830
830
|
instructions: {
|
|
@@ -872,7 +872,7 @@ declare abstract class AbstractScraper {
|
|
|
872
872
|
unitOfMeasure: string | null;
|
|
873
873
|
description: string;
|
|
874
874
|
isGroupHeader: boolean;
|
|
875
|
-
} | undefined;
|
|
875
|
+
} | null | undefined;
|
|
876
876
|
}[];
|
|
877
877
|
}[];
|
|
878
878
|
instructions: {
|
|
@@ -920,7 +920,7 @@ declare abstract class AbstractScraper {
|
|
|
920
920
|
unitOfMeasure: string | null;
|
|
921
921
|
description: string;
|
|
922
922
|
isGroupHeader: boolean;
|
|
923
|
-
} | undefined;
|
|
923
|
+
} | null | undefined;
|
|
924
924
|
}[];
|
|
925
925
|
}[];
|
|
926
926
|
instructions: {
|
|
@@ -968,7 +968,7 @@ declare abstract class AbstractScraper {
|
|
|
968
968
|
unitOfMeasure: string | null;
|
|
969
969
|
description: string;
|
|
970
970
|
isGroupHeader: boolean;
|
|
971
|
-
} | undefined;
|
|
971
|
+
} | null | undefined;
|
|
972
972
|
}[];
|
|
973
973
|
}[];
|
|
974
974
|
instructions: {
|
package/dist/index.mjs
CHANGED
|
@@ -81,7 +81,7 @@ const ParsedIngredientSchema = z.object({
|
|
|
81
81
|
*/
|
|
82
82
|
const IngredientItemSchema = z.object({
|
|
83
83
|
value: zString("Ingredient value"),
|
|
84
|
-
parsed: ParsedIngredientSchema.optional()
|
|
84
|
+
parsed: ParsedIngredientSchema.optional().nullable()
|
|
85
85
|
});
|
|
86
86
|
/**
|
|
87
87
|
* Schema for a group of ingredients
|
|
@@ -585,11 +585,10 @@ var IngredientParserPlugin = class extends PostProcessorPlugin {
|
|
|
585
585
|
}));
|
|
586
586
|
}
|
|
587
587
|
parseItem(item) {
|
|
588
|
-
const
|
|
589
|
-
if (!result) return item;
|
|
588
|
+
const parsedIngredient = parseIngredient(item.value, this.options)[0] ?? null;
|
|
590
589
|
return {
|
|
591
590
|
value: item.value,
|
|
592
|
-
parsed:
|
|
591
|
+
parsed: parsedIngredient
|
|
593
592
|
};
|
|
594
593
|
}
|
|
595
594
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recipe-scrapers-js",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A recipe scrapers library",
|
|
6
6
|
"author": {
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"iso8601-duration": "^2.1.3",
|
|
56
|
-
"parse-ingredient": "^1.3.
|
|
56
|
+
"parse-ingredient": "^1.3.3",
|
|
57
57
|
"schema-dts": "^1.1.5"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@biomejs/biome": "2.3.
|
|
60
|
+
"@biomejs/biome": "2.3.11",
|
|
61
61
|
"@types/bun": "^1.3.0",
|
|
62
62
|
"cheerio": "^1.1.2",
|
|
63
|
-
"tsdown": "^0.
|
|
63
|
+
"tsdown": "^0.19.0",
|
|
64
64
|
"typescript": "^5.9.3",
|
|
65
|
-
"zod": "^4.
|
|
65
|
+
"zod": "^4.3.5"
|
|
66
66
|
}
|
|
67
67
|
}
|