@adeficior/data-modifier 1.0.0-rc.37 → 1.0.0-rc.39
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/common/fields.js +1 -1
- package/dist/common/fields.js.map +1 -1
- package/dist/common/ingredient/index.d.ts +12 -0
- package/dist/common/ingredient/index.js +26 -0
- package/dist/common/ingredient/index.js.map +1 -1
- package/dist/common/result/index.d.ts +6 -0
- package/dist/common/result/index.js +13 -0
- package/dist/common/result/index.js.map +1 -1
- package/dist/error.js +2 -2
- package/dist/error.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/loader/context.d.ts +2 -2
- package/dist/loader/pack.d.ts +1 -1
- package/dist/loader/pack.js +4 -4
- package/dist/loader/pack.js.map +1 -1
- package/dist/loader/recipe.d.ts +2 -2
- package/dist/loader/recipe.js +22 -45
- package/dist/loader/recipe.js.map +1 -1
- package/dist/parser/recipe/adAstra/inputOutput.js +1 -0
- package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.js +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
- package/dist/parser/recipe/botania/apothecary.js +1 -1
- package/dist/parser/recipe/botania/apothecary.js.map +1 -1
- package/dist/parser/recipe/botania/blocks.d.ts +14 -8
- package/dist/parser/recipe/botania/blocks.js +39 -61
- package/dist/parser/recipe/botania/blocks.js.map +1 -1
- package/dist/parser/recipe/botania/brew.js +1 -1
- package/dist/parser/recipe/botania/brew.js.map +1 -1
- package/dist/parser/recipe/botania/elvenTrade.js +2 -2
- package/dist/parser/recipe/botania/elvenTrade.js.map +1 -1
- package/dist/parser/recipe/botania/gogWrapper.d.ts +2 -2
- package/dist/parser/recipe/botania/manaInfusion.d.ts +3 -0
- package/dist/parser/recipe/botania/manaInfusion.js +6 -5
- package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
- package/dist/parser/recipe/botania/nbtWrapper.d.ts +2 -2
- package/dist/parser/recipe/botania/pureDaisy.d.ts +4 -0
- package/dist/parser/recipe/botania/pureDaisy.js +15 -0
- package/dist/parser/recipe/botania/pureDaisy.js.map +1 -1
- package/dist/parser/recipe/botania/runicAltar.js +1 -1
- package/dist/parser/recipe/botania/runicAltar.js.map +1 -1
- package/dist/parser/recipe/create/assembly.d.ts +1 -0
- package/dist/parser/recipe/create/assembly.js +6 -3
- package/dist/parser/recipe/create/assembly.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cooking.js +3 -6
- package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cutting.js +2 -2
- package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
- package/dist/parser/recipe/forge/conditional.d.ts +2 -2
- package/dist/parser/recipe/index.d.ts +9 -3
- package/dist/parser/recipe/index.js +17 -2
- package/dist/parser/recipe/index.js.map +1 -1
- package/dist/parser/recipe/ingredientMap.d.ts +2 -5
- package/dist/parser/recipe/ingredientMap.js +0 -3
- package/dist/parser/recipe/ingredientMap.js.map +1 -1
- package/dist/parser/recipe/manyToMany.js +2 -2
- package/dist/parser/recipe/manyToMany.js.map +1 -1
- package/dist/parser/recipe/manyToOne.js +1 -1
- package/dist/parser/recipe/manyToOne.js.map +1 -1
- package/dist/parser/recipe/roots/component.js +1 -1
- package/dist/parser/recipe/roots/component.js.map +1 -1
- package/dist/parser/recipe/roots/ritual.js +2 -2
- package/dist/parser/recipe/roots/ritual.js.map +1 -1
- package/dist/parser/recipe/thermal/index.d.ts +3 -0
- package/dist/parser/recipe/thermal/index.js +10 -6
- package/dist/parser/recipe/thermal/index.js.map +1 -1
- package/dist/parser/recipe/thermal/module.d.ts +4 -0
- package/dist/parser/recipe/thermal/module.js +36 -0
- package/dist/parser/recipe/thermal/module.js.map +1 -0
- package/dist/parser/recipe/vanilla/shaped.d.ts +1 -1
- package/dist/parser/recipe/vanilla/shaped.js +2 -2
- package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
- package/dist/parser/recipe/vanilla/smithing.d.ts +4 -2
- package/dist/parser/recipe/vanilla/smithing.js +12 -7
- package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
- package/dist/serializer/checks.d.ts +2 -0
- package/dist/serializer/checks.js +13 -0
- package/dist/serializer/checks.js.map +1 -0
- package/dist/serializer/index.d.ts +23 -0
- package/dist/serializer/index.js +19 -0
- package/dist/serializer/index.js.map +1 -0
- package/dist/serializer/ingredients/15.d.ts +2 -0
- package/dist/{common/ingredient/serializer.js → serializer/ingredients/15.js} +14 -26
- package/dist/serializer/ingredients/15.js.map +1 -0
- package/dist/serializer/ingredients/44.d.ts +2 -0
- package/dist/serializer/ingredients/44.js +46 -0
- package/dist/serializer/ingredients/44.js.map +1 -0
- package/dist/serializer/ingredients/common.d.ts +3 -0
- package/dist/serializer/ingredients/common.js +13 -0
- package/dist/serializer/ingredients/common.js.map +1 -0
- package/dist/serializer/ingredients/index.d.ts +20 -0
- package/dist/serializer/ingredients/index.js +36 -0
- package/dist/serializer/ingredients/index.js.map +1 -0
- package/dist/serializer/module.d.ts +23 -0
- package/dist/serializer/module.js +42 -0
- package/dist/serializer/module.js.map +1 -0
- package/dist/serializer/results/15.d.ts +2 -0
- package/dist/{common/result/serializer.js → serializer/results/15.js} +9 -14
- package/dist/serializer/results/15.js.map +1 -0
- package/dist/serializer/results/44.d.ts +2 -0
- package/dist/serializer/results/44.js +21 -0
- package/dist/serializer/results/44.js.map +1 -0
- package/dist/serializer/results/common.d.ts +3 -0
- package/dist/serializer/results/common.js +6 -0
- package/dist/serializer/results/common.js.map +1 -0
- package/dist/serializer/results/index.d.ts +6 -0
- package/dist/serializer/results/index.js +21 -0
- package/dist/serializer/results/index.js.map +1 -0
- package/dist/serializer/versioned.d.ts +19 -0
- package/dist/serializer/versioned.js +55 -0
- package/dist/serializer/versioned.js.map +1 -0
- package/dist/serializer/wrapped.d.ts +12 -0
- package/dist/serializer/wrapped.js +32 -0
- package/dist/serializer/wrapped.js.map +1 -0
- package/package.json +1 -1
- package/dist/common/ingredient/serializer.d.ts +0 -9
- package/dist/common/ingredient/serializer.js.map +0 -1
- package/dist/common/result/serializer.d.ts +0 -7
- package/dist/common/result/serializer.js.map +0 -1
- package/dist/common/serializer.d.ts +0 -32
- package/dist/common/serializer.js +0 -95
- package/dist/common/serializer.js.map +0 -1
- package/dist/parser/recipe/thermal/ingredient.d.ts +0 -4
- package/dist/parser/recipe/thermal/ingredient.js +0 -50
- package/dist/parser/recipe/thermal/ingredient.js.map +0 -1
|
@@ -1,76 +1,54 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { IdSchema } from "../../../common/id.js";
|
|
3
3
|
import { BlockIngredient, BlockTagIngredient, } from "../../../common/ingredient/index.js";
|
|
4
4
|
import { BlockResult } from "../../../common/result/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { hasType } from "../../../serializer/checks.js";
|
|
6
|
+
import { createSerializerModule } from "../../../serializer/module.js";
|
|
6
7
|
import RecipeParser, {} from "../index.js";
|
|
7
8
|
import { OneToOneRecipe } from "../oneToOne.js";
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
if (ingredient instanceof BlockTagIngredient)
|
|
29
|
-
return {
|
|
30
|
-
type: "tag",
|
|
31
|
-
tag: encodeId(ingredient.tag),
|
|
32
|
-
};
|
|
33
|
-
throw new IllegalShapeError("invalid botania block input ingredient", ingredient);
|
|
34
|
-
}
|
|
35
|
-
export function serializeBlockOutput(result) {
|
|
36
|
-
if (result instanceof BlockResult)
|
|
37
|
-
return {
|
|
38
|
-
name: encodeId(result.id),
|
|
39
|
-
};
|
|
40
|
-
if (result instanceof BlockIngredient)
|
|
41
|
-
return {
|
|
42
|
-
name: encodeId(result.id),
|
|
43
|
-
};
|
|
44
|
-
throw new IllegalShapeError("invalid botania block output result", result);
|
|
45
|
-
}
|
|
46
|
-
export function deserializeBlockInput(ingredients, input) {
|
|
47
|
-
const parsed = BlockInputSchema.parse(input);
|
|
48
|
-
switch (parsed.type) {
|
|
49
|
-
case "block":
|
|
50
|
-
return ingredients.validated(new BlockIngredient(parsed.block));
|
|
51
|
-
case "tag":
|
|
52
|
-
return ingredients.validated(new BlockTagIngredient(parsed.tag));
|
|
53
|
-
default:
|
|
54
|
-
throw new IllegalShapeError(`invalid block input type`, input);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
export function deserializeBlockOutput(results, output) {
|
|
58
|
-
const parsed = BlockOutputSchema.parse(output);
|
|
59
|
-
const id = typeof parsed === "string" ? parsed : parsed.name;
|
|
60
|
-
return results.deserialize(new BlockResult(id));
|
|
61
|
-
}
|
|
9
|
+
const ingredientSerializer15 = createSerializerModule((builder) => {
|
|
10
|
+
const blockType = "block";
|
|
11
|
+
builder.register(BlockIngredient, hasType(blockType), z.object({
|
|
12
|
+
type: z.literal(blockType),
|
|
13
|
+
block: IdSchema,
|
|
14
|
+
}), ({ block }) => new BlockIngredient(block), ({ id }) => ({ block: id, type: blockType }));
|
|
15
|
+
const tagType = "tag";
|
|
16
|
+
builder.register(BlockTagIngredient, hasType(tagType), z.object({
|
|
17
|
+
type: z.literal(tagType),
|
|
18
|
+
tag: IdSchema,
|
|
19
|
+
}), ({ tag }) => new BlockTagIngredient(tag), ({ tag }) => ({ tag, type: tagType }));
|
|
20
|
+
});
|
|
21
|
+
const resultSerializer15 = createSerializerModule((builder) => {
|
|
22
|
+
const blockType = "block";
|
|
23
|
+
builder.register(BlockResult, hasType(blockType), z.object({
|
|
24
|
+
type: z.literal(blockType),
|
|
25
|
+
block: IdSchema,
|
|
26
|
+
}), ({ block }) => new BlockResult(block), ({ id }) => ({ block: id, type: blockType }));
|
|
27
|
+
});
|
|
62
28
|
export class BotaniaBlockRecipe extends OneToOneRecipe {
|
|
63
|
-
serialize() {
|
|
29
|
+
serialize(context) {
|
|
64
30
|
return {
|
|
65
|
-
output:
|
|
66
|
-
input:
|
|
31
|
+
output: context.results.serialize(this.result),
|
|
32
|
+
input: context.ingredients.serialize(this.ingredient),
|
|
67
33
|
};
|
|
68
34
|
}
|
|
69
35
|
}
|
|
36
|
+
export const resultSerializerModules = {
|
|
37
|
+
15: resultSerializer15,
|
|
38
|
+
};
|
|
39
|
+
export const ingredientSerializerModules = {
|
|
40
|
+
15: ingredientSerializer15,
|
|
41
|
+
};
|
|
70
42
|
export default class BotaniaBlockRecipeParser extends RecipeParser {
|
|
43
|
+
resultModules() {
|
|
44
|
+
return resultSerializerModules;
|
|
45
|
+
}
|
|
46
|
+
ingredientModules() {
|
|
47
|
+
return ingredientSerializerModules;
|
|
48
|
+
}
|
|
71
49
|
deserialize(definition, context) {
|
|
72
|
-
const ingredient =
|
|
73
|
-
const result =
|
|
50
|
+
const ingredient = context.ingredients.deserialize(definition.input);
|
|
51
|
+
const result = context.results.deserialize(definition.output);
|
|
74
52
|
return new BotaniaBlockRecipe(ingredient, result);
|
|
75
53
|
}
|
|
76
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EACL,eAAe,EACf,kBAAkB,GAC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,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -22,7 +22,7 @@ export class BrewRecipe extends Recipe {
|
|
|
22
22
|
}
|
|
23
23
|
export class BrewRecipeParser extends RecipeParser {
|
|
24
24
|
deserialize(definition, context) {
|
|
25
|
-
const ingredients = context.ingredients.
|
|
25
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
26
26
|
return new BrewRecipe(ingredients);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brew.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/brew.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,UAAW,SAAQ,MAAM;IACP;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,YAGrC;IACC,WAAW,CACT,UAAgC,EAChC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"brew.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/brew.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,UAAW,SAAQ,MAAM;IACP;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,YAGrC;IACC,WAAW,CACT,UAAgC,EAChC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CACrD,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -8,8 +8,8 @@ export class ElvenTradeRecipe extends ManyToManyRecipe {
|
|
|
8
8
|
}
|
|
9
9
|
export class ElvenTradeRecipeParser extends RecipeParser {
|
|
10
10
|
deserialize(definition, context) {
|
|
11
|
-
const ingredients = context.ingredients.
|
|
12
|
-
const results = context.results.
|
|
11
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
12
|
+
const results = context.results.deserializeList(definition.output);
|
|
13
13
|
return new ElvenTradeRecipe(ingredients, results);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elvenTrade.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/elvenTrade.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAA2B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AASpD,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAC3C,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"elvenTrade.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/elvenTrade.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAA2B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AASpD,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAC3C,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CACrD,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACnE,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -10,8 +10,8 @@ export declare class GogWrapperRecipe extends Recipe {
|
|
|
10
10
|
private readonly base;
|
|
11
11
|
private readonly gog;
|
|
12
12
|
constructor(base: RecipeHolder, gog: RecipeHolder);
|
|
13
|
-
getIngredients(): import("../../../
|
|
14
|
-
getResults(): import("../../../
|
|
13
|
+
getIngredients(): import("../../../index.js").Ingredient[];
|
|
14
|
+
getResults(): import("../../../index.js").Result[];
|
|
15
15
|
modify(modifier: RecipeModifier): GogWrapperRecipe;
|
|
16
16
|
serialize(context: RecipeParseContext): Partial<GogWrapperRecipeDefinition>;
|
|
17
17
|
}
|
|
@@ -20,5 +20,8 @@ export declare class ManaInfusionRecipe extends Recipe {
|
|
|
20
20
|
serialize(context: RecipeParseContext): Partial<ManaInfusionRecipeDefinition>;
|
|
21
21
|
}
|
|
22
22
|
export declare class ManaInfusionRecipeParser extends RecipeParser<ManaInfusionRecipeDefinition, ManaInfusionRecipe> {
|
|
23
|
+
ingredientModules(): {
|
|
24
|
+
15: import("../../../serializer/module.js").SerializerModule<Ingredient, unknown>;
|
|
25
|
+
};
|
|
23
26
|
deserialize(definition: ManaInfusionRecipeDefinition, context: RecipeParseContext): ManaInfusionRecipe;
|
|
24
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { exists } from "@adeficior/pack-resolver";
|
|
2
2
|
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ingredientSerializerModules } from "./blocks.js";
|
|
4
4
|
export class ManaInfusionRecipe extends Recipe {
|
|
5
5
|
ingredient;
|
|
6
6
|
result;
|
|
@@ -24,15 +24,16 @@ export class ManaInfusionRecipe extends Recipe {
|
|
|
24
24
|
return {
|
|
25
25
|
input: context.ingredients.serialize(this.ingredient),
|
|
26
26
|
output: context.results.serialize(this.result),
|
|
27
|
-
catalyst:
|
|
27
|
+
catalyst: context.ingredients.serializeOptional(this.catalyst),
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
export class ManaInfusionRecipeParser extends RecipeParser {
|
|
32
|
+
ingredientModules() {
|
|
33
|
+
return ingredientSerializerModules;
|
|
34
|
+
}
|
|
32
35
|
deserialize(definition, context) {
|
|
33
|
-
const catalyst = definition.catalyst
|
|
34
|
-
? undefined
|
|
35
|
-
: deserializeBlockInput(context.ingredients, definition.catalyst);
|
|
36
|
+
const catalyst = context.ingredients.deserializeOptional(definition.catalyst);
|
|
36
37
|
const ingredient = context.ingredients.deserialize(definition.input);
|
|
37
38
|
const result = context.results.deserialize(definition.output);
|
|
38
39
|
return new ManaInfusionRecipe(ingredient, result, catalyst);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manaInfusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/manaInfusion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"manaInfusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/manaInfusion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAU1D,MAAM,OAAO,kBAAmB,SAAQ,MAAM;IAEzB;IACA;IACA;IAHnB,YACmB,UAAsB,EACtB,MAAc,EACd,QAAqB;QAEtC,KAAK,EAAE,CAAC;QAJS,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM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,CAAC,CAAC;QAC9D,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -8,8 +8,8 @@ export type NbtWrapperRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
8
8
|
export declare class NbtWrapperRecipe extends Recipe {
|
|
9
9
|
private readonly recipe;
|
|
10
10
|
constructor(recipe: RecipeHolder);
|
|
11
|
-
getIngredients(): import("../../../
|
|
12
|
-
getResults(): import("../../../
|
|
11
|
+
getIngredients(): import("../../../index.js").Ingredient[];
|
|
12
|
+
getResults(): import("../../../index.js").Result[];
|
|
13
13
|
modify(modifier: RecipeModifier): NbtWrapperRecipe;
|
|
14
14
|
serialize(context: RecipeParseContext): Partial<NbtWrapperRecipeDefinition>;
|
|
15
15
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { type Result } from "../../../common/result/index.js";
|
|
1
2
|
import BotaniaBlockRecipeParser, { type BotaniaBlockRecipeDefinition } from "./blocks.js";
|
|
2
3
|
export type PureDaisyRecipeDefinition = BotaniaBlockRecipeDefinition;
|
|
3
4
|
export declare class PureDaisyRecipeParser extends BotaniaBlockRecipeParser<PureDaisyRecipeDefinition> {
|
|
5
|
+
resultModules(): {
|
|
6
|
+
15: import("../../../serializer/module.js").SerializerModule<Result, unknown>;
|
|
7
|
+
};
|
|
4
8
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { IdSchema } from "../../../common/id.js";
|
|
3
|
+
import { BlockResult } from "../../../common/result/index.js";
|
|
4
|
+
import { isObjectWith } from "../../../serializer/checks.js";
|
|
5
|
+
import { createSerializerModule } from "../../../serializer/module.js";
|
|
1
6
|
import BotaniaBlockRecipeParser, {} from "./blocks.js";
|
|
7
|
+
const resultSerializer15 = createSerializerModule((builder) => {
|
|
8
|
+
builder.register(BlockResult, isObjectWith("name"), z.object({
|
|
9
|
+
name: IdSchema,
|
|
10
|
+
}), ({ name }) => new BlockResult(name), ({ id }) => ({ name: id }));
|
|
11
|
+
});
|
|
2
12
|
export class PureDaisyRecipeParser extends BotaniaBlockRecipeParser {
|
|
13
|
+
resultModules() {
|
|
14
|
+
return {
|
|
15
|
+
15: resultSerializer15,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
3
18
|
}
|
|
4
19
|
//# sourceMappingURL=pureDaisy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDaisy.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/pureDaisy.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,EAAE,EAEhC,MAAM,aAAa,CAAC;AAIrB,MAAM,OAAO,qBAAsB,SAAQ,wBAAmD;
|
|
1
|
+
{"version":3,"file":"pureDaisy.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/pureDaisy.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAe,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,wBAAwB,EAAE,EAEhC,MAAM,aAAa,CAAC;AAIrB,MAAM,kBAAkB,GAAG,sBAAsB,CAAS,CAAC,OAAO,EAAE,EAAE;IACpE,OAAO,CAAC,QAAQ,CACd,WAAW,EACX,YAAY,CAAC,MAAM,CAAC,EACpB,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,QAAQ;KACf,CAAC,EACF,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,EACnC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAC3B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,OAAO,qBAAsB,SAAQ,wBAAmD;IACnF,aAAa;QACpB,OAAO;YACL,EAAE,EAAE,kBAAkB;SACvB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -8,7 +8,7 @@ export class RunicAltarRecipe extends ManyToOneRecipe {
|
|
|
8
8
|
}
|
|
9
9
|
export class RunicAltarRecipeParser extends RecipeParser {
|
|
10
10
|
deserialize(definition, context) {
|
|
11
|
-
const ingredients = context.ingredients.
|
|
11
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
12
12
|
const result = context.results.deserialize(definition.output);
|
|
13
13
|
return new RunicAltarRecipe(ingredients, result);
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runicAltar.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/runicAltar.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAA2B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AASlD,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAC1C,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACrD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"runicAltar.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/runicAltar.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAA2B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AASlD,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAC1C,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACrD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CACrD,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -6,6 +6,7 @@ import RecipeParser, { Recipe } from "../index.js";
|
|
|
6
6
|
export type AssemblyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
ingredient: unknown;
|
|
8
8
|
transitionalItem: unknown;
|
|
9
|
+
transitional_item: unknown;
|
|
9
10
|
results: unknown[];
|
|
10
11
|
loops?: number;
|
|
11
12
|
sequence: RecipeDefinition[];
|
|
@@ -27,7 +27,7 @@ export class AssemblyRecipe extends Recipe {
|
|
|
27
27
|
serialize(context) {
|
|
28
28
|
return {
|
|
29
29
|
ingredient: context.ingredients.serialize(this.ingredient),
|
|
30
|
-
transitionalItem: context.
|
|
30
|
+
transitionalItem: context.results.serialize(this.transitionalItem.asResult()),
|
|
31
31
|
results: context.results.serializeList(this.results),
|
|
32
32
|
sequence: this.sequence.map((it) => context.recipes.serialize(it)),
|
|
33
33
|
};
|
|
@@ -36,8 +36,11 @@ export class AssemblyRecipe extends Recipe {
|
|
|
36
36
|
export class AssemblyRecipeParser extends RecipeParser {
|
|
37
37
|
deserialize(definition, context) {
|
|
38
38
|
const ingredient = context.ingredients.deserialize(definition.ingredient);
|
|
39
|
-
const
|
|
40
|
-
const
|
|
39
|
+
const rawTransitionalItem = definition.transitionalItem ?? definition.transitional_item;
|
|
40
|
+
const transitionalItem = context.results
|
|
41
|
+
.deserialize(rawTransitionalItem)
|
|
42
|
+
.asIngredient();
|
|
43
|
+
const results = context.results.deserializeList(definition.results);
|
|
41
44
|
const sequence = definition.sequence.map((it) => context.recipes.deserialize(it));
|
|
42
45
|
return new AssemblyRecipe(ingredient, transitionalItem, results, sequence);
|
|
43
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/assembly.ts"],"names":[],"mappings":"AAQA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/assembly.ts"],"names":[],"mappings":"AAQA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAErB;IACA;IACA;IACA;IAJnB,YACmB,UAAsB,EACtB,gBAA4B,EAC5B,OAAiB,EACjB,QAAwB;QAEzC,KAAK,EAAE,CAAC;QALS,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAY;QAC5B,YAAO,GAAP,OAAO,CAAU;QACjB,aAAQ,GAAR,QAAQ,CAAgB;IAG3C,CAAC;IAED,cAAc;QACZ,OAAO;YACL,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,gBAAgB;YACrB,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC;SACtD,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,O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9D,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO;aACrC,WAAW,CAAC,mBAAmB,CAAC;aAChC,YAAY,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACpE,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAC9C,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,CAChC,CAAC;QACF,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -23,18 +23,15 @@ export class CookingRecipe extends Recipe {
|
|
|
23
23
|
return {
|
|
24
24
|
ingredients: context.ingredients.serializeList(this.ingredients),
|
|
25
25
|
result: context.results.serialize(this.result),
|
|
26
|
-
container:
|
|
26
|
+
container: context.ingredients.serializeOptional(this.container),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
export default class CookingRecipeParser extends RecipeParser {
|
|
31
31
|
deserialize(definition, context) {
|
|
32
|
-
const ingredients = context.ingredients.
|
|
32
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
33
33
|
const result = context.results.deserialize(definition.result);
|
|
34
|
-
|
|
35
|
-
const container = definition.container === undefined
|
|
36
|
-
? undefined
|
|
37
|
-
: context.ingredients.deserialize(definition.container);
|
|
34
|
+
const container = context.ingredients.deserializeOptional(definition.container);
|
|
38
35
|
return new CookingRecipe(ingredients, result, container);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cooking.js","sourceRoot":"","sources":["../../../../src/parser/recipe/farmersdelight/cooking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKlD,OAAO,Y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AAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CACvD,UAAU,CAAC,SAAS,CACrB,CAAC;QACF,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -32,8 +32,8 @@ export class CuttingRecipe extends ManyToManyRecipe {
|
|
|
32
32
|
}
|
|
33
33
|
export default class CuttingRecipeParser extends RecipeParser {
|
|
34
34
|
deserialize(definition, context) {
|
|
35
|
-
const ingredients = context.ingredients.
|
|
36
|
-
const result = context.results.
|
|
35
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
36
|
+
const result = context.results.deserializeList(definition.result);
|
|
37
37
|
const tool = context.ingredients.deserialize(definition.tool);
|
|
38
38
|
return new CuttingRecipe(ingredients, result, tool);
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/farmersdelight/cutting.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,EAAE,EAGpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAgB1B,2BAA2B;AAC3B,sEAAsE;AACtE,aAAa;AACb,iBAAiB;AACjB,mCAAmC;AACnC,yBAAyB;AACzB,kDAAkD;AAClD,OAAO;AACP,IAAI;AAEJ,MAAM,OAAO,aAAc,SAAQ,gBAAgB;IAI9B;IAHnB,YACE,WAAyB,EACzB,OAAiB,EACA,IAAgB;QAEjC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAFX,SAAI,GAAJ,IAAI,CAAY;IAGnC,CAAC;IAEQ,cAAc;QACrB,OAAO,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,aAAa,CACtB,I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;IAChD,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,aAAa,CACtB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EACjC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAC/B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAGhD;IACC,WAAW,CACT,UAAmC,EACnC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CACrD,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAClE,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC9D,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -11,8 +11,8 @@ export type ForgeConditionalRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
11
11
|
export declare class ForgeConditionalRecipe extends Recipe {
|
|
12
12
|
private readonly recipes;
|
|
13
13
|
constructor(recipes: WithConditions<RecipeHolder>[]);
|
|
14
|
-
getIngredients(): import("../../../
|
|
15
|
-
getResults(): import("../../../
|
|
14
|
+
getIngredients(): import("../../../index.js").Ingredient[];
|
|
15
|
+
getResults(): import("../../../index.js").Result[];
|
|
16
16
|
modify(modifier: RecipeModifier): ForgeConditionalRecipe;
|
|
17
17
|
serialize(context: RecipeParseContext): Partial<ForgeConditionalRecipeDefinition>;
|
|
18
18
|
additionalTypes(): `${string}:${string}`[];
|
|
@@ -4,17 +4,19 @@ import type { Ingredient } from "../../common/ingredient/index.js";
|
|
|
4
4
|
import type { Result } from "../../common/result/index.js";
|
|
5
5
|
import type { PackContext } from "../../loader/context.js";
|
|
6
6
|
import type { RecipeDefinition } from "../../schema/data/recipe.js";
|
|
7
|
+
import type { WithSerializerModules } from "../../serializer/module.js";
|
|
7
8
|
export type Replacer<T> = (value: T) => T;
|
|
8
9
|
export declare function createReplacer<T>(from: Predicate<T>, to: T): Replacer<T>;
|
|
9
10
|
export type RecipeModifier = {
|
|
10
11
|
result: Replacer<Result>;
|
|
11
12
|
ingredient: Replacer<Ingredient>;
|
|
12
13
|
};
|
|
13
|
-
export declare class RecipeHolder {
|
|
14
|
+
export declare class RecipeHolder implements WithSerializerModules {
|
|
14
15
|
private readonly definition;
|
|
15
16
|
private readonly recipe;
|
|
17
|
+
private readonly modules?;
|
|
16
18
|
private readonly type;
|
|
17
|
-
constructor(definition: RecipeDefinition, recipe: Recipe);
|
|
19
|
+
constructor(definition: RecipeDefinition, recipe: Recipe, modules?: WithSerializerModules | undefined);
|
|
18
20
|
serialize(context: RecipeParseContext): {
|
|
19
21
|
type: import("@adeficior/data-modifier/generated").RecipeSerializerId;
|
|
20
22
|
conditions?: import("../../index.js").ForgeCondition[];
|
|
@@ -26,6 +28,8 @@ export declare class RecipeHolder {
|
|
|
26
28
|
replaceIngredient(replace: Replacer<Ingredient>): RecipeHolder;
|
|
27
29
|
replaceResult(replace: Replacer<Result>): RecipeHolder;
|
|
28
30
|
getTypes(): NormalizedId[];
|
|
31
|
+
ingredientModules(): Record<string, import("../../serializer/module.js").SerializerModule<Ingredient, unknown>>;
|
|
32
|
+
resultModules(): Record<string, import("../../serializer/module.js").SerializerModule<Result, unknown>>;
|
|
29
33
|
}
|
|
30
34
|
export declare abstract class Recipe {
|
|
31
35
|
abstract getIngredients(): Ingredient[];
|
|
@@ -41,6 +45,8 @@ export type RecipeSerializer = {
|
|
|
41
45
|
export type RecipeParseContext = Pick<PackContext, "ingredients" | "results"> & {
|
|
42
46
|
recipes: RecipeSerializer;
|
|
43
47
|
};
|
|
44
|
-
export default abstract class RecipeParser<TDefinition extends RecipeDefinition, TRecipe extends Recipe> {
|
|
48
|
+
export default abstract class RecipeParser<TDefinition extends RecipeDefinition = RecipeDefinition, TRecipe extends Recipe = Recipe> implements WithSerializerModules {
|
|
49
|
+
ingredientModules(): {};
|
|
50
|
+
resultModules(): {};
|
|
45
51
|
abstract deserialize(definition: TDefinition, context: RecipeParseContext): TRecipe;
|
|
46
52
|
}
|
|
@@ -12,10 +12,12 @@ function keep() {
|
|
|
12
12
|
export class RecipeHolder {
|
|
13
13
|
definition;
|
|
14
14
|
recipe;
|
|
15
|
+
modules;
|
|
15
16
|
type;
|
|
16
|
-
constructor(definition, recipe) {
|
|
17
|
+
constructor(definition, recipe, modules) {
|
|
17
18
|
this.definition = definition;
|
|
18
19
|
this.recipe = recipe;
|
|
20
|
+
this.modules = modules;
|
|
19
21
|
this.type = encodeId(definition.type);
|
|
20
22
|
}
|
|
21
23
|
serialize(context) {
|
|
@@ -32,7 +34,7 @@ export class RecipeHolder {
|
|
|
32
34
|
}
|
|
33
35
|
modify(modifier) {
|
|
34
36
|
const modified = this.recipe.modify(modifier);
|
|
35
|
-
return new RecipeHolder(this.definition, modified);
|
|
37
|
+
return new RecipeHolder(this.definition, modified, this.modules);
|
|
36
38
|
}
|
|
37
39
|
replaceIngredient(replace) {
|
|
38
40
|
return this.modify({
|
|
@@ -49,6 +51,13 @@ export class RecipeHolder {
|
|
|
49
51
|
getTypes() {
|
|
50
52
|
return [this.type, ...this.recipe.additionalTypes()];
|
|
51
53
|
}
|
|
54
|
+
ingredientModules() {
|
|
55
|
+
return this.modules?.ingredientModules() ?? {};
|
|
56
|
+
}
|
|
57
|
+
resultModules() {
|
|
58
|
+
// TODO this will not work with custom recipes, serialize needs to be done by RecipeParser
|
|
59
|
+
return this.modules?.resultModules() ?? {};
|
|
60
|
+
}
|
|
52
61
|
}
|
|
53
62
|
export class Recipe {
|
|
54
63
|
additionalTypes() {
|
|
@@ -56,5 +65,11 @@ export class Recipe {
|
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
export default class RecipeParser {
|
|
68
|
+
ingredientModules() {
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
resultModules() {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
59
74
|
}
|
|
60
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parser/recipe/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parser/recipe/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AASjE,MAAM,UAAU,cAAc,CAAI,IAAkB,EAAE,EAAK;IACzD,OAAO,CAAC,EAAK,EAAE,EAAE;QACf,IAAI,IAAI,CAAC,EAAE,CAAC;YAAE,OAAO,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,IAAI;IACX,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC;AAOD,MAAM,OAAO,YAAY;IAIJ;IACA;IACA;IALF,IAAI,CAAe;IAEpC,YACmB,UAA4B,EAC5B,MAAc,EACd,OAA+B;QAF/B,eAAU,GAAV,UAAU,CAAkB;QAC5B,WAAM,GAAN,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E,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,OAAgB,MAAM;IAO1B,eAAe;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;CAGF;AAcD,MAAM,CAAC,OAAO,OAAgB,YAAY;IAIxC,iBAAiB;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,aAAa;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;CAMF"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Replacer } from ".";
|
|
2
2
|
import type { Ingredient } from "../../common/ingredient";
|
|
3
3
|
export type IngredientMapInput = Record<string, unknown>;
|
|
4
4
|
export declare class IngredientMap {
|
|
5
|
-
|
|
5
|
+
readonly ingredients: Record<string, Ingredient>;
|
|
6
6
|
constructor(ingredients: Record<string, Ingredient>);
|
|
7
7
|
list(): Ingredient[];
|
|
8
8
|
replace(replace: Replacer<Ingredient>): IngredientMap;
|
|
9
|
-
serialize(context: RecipeParseContext): {
|
|
10
|
-
[x: string]: unknown;
|
|
11
|
-
};
|
|
12
9
|
}
|
|
@@ -10,8 +10,5 @@ export class IngredientMap {
|
|
|
10
10
|
replace(replace) {
|
|
11
11
|
return new IngredientMap(mapValues(this.ingredients, replace));
|
|
12
12
|
}
|
|
13
|
-
serialize(context) {
|
|
14
|
-
return mapValues(this.ingredients, (it) => context.ingredients.serialize(it));
|
|
15
|
-
}
|
|
16
13
|
}
|
|
17
14
|
//# sourceMappingURL=ingredientMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingredientMap.js","sourceRoot":"","sources":["../../../src/parser/recipe/ingredientMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMtC,MAAM,OAAO,aAAa;
|
|
1
|
+
{"version":3,"file":"ingredientMap.js","sourceRoot":"","sources":["../../../src/parser/recipe/ingredientMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMtC,MAAM,OAAO,aAAa;IACI;IAA5B,YAA4B,WAAuC;QAAvC,gBAAW,GAAX,WAAW,CAA4B;IAAG,CAAC;IAEvE,IAAI;QACF,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,OAA6B;QACnC,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -25,8 +25,8 @@ export class ManyToManyRecipe extends Recipe {
|
|
|
25
25
|
}
|
|
26
26
|
export class ManyToManyRecipeParser extends RecipeParser {
|
|
27
27
|
deserialize(definition, context) {
|
|
28
|
-
const ingredients = context.ingredients.
|
|
29
|
-
const results = context.results.
|
|
28
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
29
|
+
const results = context.results.deserializeList(definition.results);
|
|
30
30
|
return new ManyToManyRecipe(ingredients, results);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToMany.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,gBAAiB,SAAQ,MAAM;IAErB;IACA;IAFrB,YACqB,WAAyB,EACzB,OAAiB;QAEpC,KAAK,EAAE,CAAC;QAHW,gBAAW,GAAX,WAAW,CAAc;QACzB,YAAO,GAAP,OAAO,CAAU;IAGtC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC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AAC,OAAO,CAAC;YACpD,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAEX,SAAQ,YAA2C;IACnD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CACrD,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACpE,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -25,7 +25,7 @@ export class ManyToOneRecipe extends Recipe {
|
|
|
25
25
|
}
|
|
26
26
|
export class ManyToOneRecipeParser extends RecipeParser {
|
|
27
27
|
deserialize(definition, context) {
|
|
28
|
-
const ingredients = context.ingredients.
|
|
28
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
29
29
|
const result = context.results.deserialize(definition.result);
|
|
30
30
|
return new ManyToOneRecipe(ingredients, result);
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manyToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,eAAgB,SAAQ,MAAM;IAEpB;IACA;IAFrB,YACqB,WAAyB,EACzB,MAAc;QAEjC,KAAK,EAAE,CAAC;QAHW,gBAAW,GAAX,WAAW,CAAc;QACzB,WAAM,GAAN,MAAM,CAAQ;IAGnC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACv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S,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,qBAEX,SAAQ,YAA0C;IAClD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CACrD,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -22,7 +22,7 @@ export class RootComponentRecipe extends Recipe {
|
|
|
22
22
|
}
|
|
23
23
|
export class RootComponentRecipeParser extends RecipeParser {
|
|
24
24
|
deserialize(definition, context) {
|
|
25
|
-
const ingredients = context.ingredients.
|
|
25
|
+
const ingredients = context.ingredients.deserializeList(definition.ingredients);
|
|
26
26
|
return new RootComponentRecipe(ingredients);
|
|
27
27
|
}
|
|
28
28
|
}
|