@adeficior/data-modifier-recipes 2.1.0 → 2.1.1
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/emitter.d.ts +3 -4
- package/dist/emitter.js +4 -13
- package/dist/emitter.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +4 -3
- package/dist/loader.js.map +1 -1
- package/dist/module.d.ts +2 -0
- package/dist/module.js +4 -2
- package/dist/module.js.map +1 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.js +1 -0
- package/dist/registry.js.map +1 -0
- package/dist/rule.js +3 -3
- package/dist/rule.js.map +1 -1
- package/package.json +5 -5
package/dist/emitter.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { Conditions, IdInput, NormalizedId,
|
|
1
|
+
import type { Conditions, IdInput, NormalizedId, SemVerInput } from "@adeficior/data-modifier-core";
|
|
2
2
|
import { SimpleEmitter } from "@adeficior/data-modifier-core";
|
|
3
3
|
import type { IngredientFilter, IngredientInput, IngredientSerializer, Predicates, ResultInput, ResultSerializer } from "@adeficior/data-modifier-ingredients";
|
|
4
4
|
import type { RecipeSerializerId } from "@adeficior/data-modifier/generated";
|
|
5
5
|
import type { Logger } from "@adeficior/pack-resolver";
|
|
6
6
|
import type { Recipe } from "./model";
|
|
7
|
+
import type { RecipeRegistry } from "./registry";
|
|
7
8
|
import type { RecipeFilter, RecipeRules } from "./rule";
|
|
8
9
|
import type { RecipeDefinition } from "./schema";
|
|
9
10
|
import type { RecipesSerializer } from "./serializer/abstract";
|
|
@@ -17,15 +18,13 @@ export type RecipeEmitter = {
|
|
|
17
18
|
};
|
|
18
19
|
export declare const EMPTY_RECIPE: RecipeDefinition;
|
|
19
20
|
export declare class RecipeEmitterImpl extends SimpleEmitter<RecipeHolder, RecipeDefinition> implements RecipeEmitter {
|
|
20
|
-
private readonly logger;
|
|
21
21
|
private readonly packFormat;
|
|
22
22
|
private readonly resultSerializer;
|
|
23
23
|
private readonly ingredientSerializer;
|
|
24
24
|
private readonly predicates;
|
|
25
25
|
private readonly rules;
|
|
26
26
|
private readonly serializer;
|
|
27
|
-
constructor(logger: Logger, packFormat: SemVerInput, registry:
|
|
28
|
-
private addHolder;
|
|
27
|
+
constructor(logger: Logger, packFormat: SemVerInput, registry: RecipeRegistry, resultSerializer: ResultSerializer, ingredientSerializer: IngredientSerializer, predicates: Predicates, rules: RecipeRules, serializer: RecipesSerializer);
|
|
29
28
|
add(id: IdInput, arg: RecipeDefinition | IdInput<RecipeSerializerId>, arg2?: Recipe, conditions?: Conditions): NormalizedId;
|
|
30
29
|
remove(filter: RecipeFilter): void;
|
|
31
30
|
replaceResult(filter: IngredientFilter, input: ResultInput, additionalFilters?: RecipeFilter): void;
|
package/dist/emitter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimpleEmitter, withDisabledConditions, } from "@adeficior/data-modifier-core";
|
|
2
2
|
import { createReplacer } from "@adeficior/data-modifier-core/serializer";
|
|
3
3
|
import { recipePath } from "./schema";
|
|
4
4
|
import { createFakeHolder, RecipeHolder } from "./serializer/holder";
|
|
@@ -6,7 +6,6 @@ export const EMPTY_RECIPE = withDisabledConditions({
|
|
|
6
6
|
type: "minecraft:disabled",
|
|
7
7
|
});
|
|
8
8
|
export class RecipeEmitterImpl extends SimpleEmitter {
|
|
9
|
-
logger;
|
|
10
9
|
packFormat;
|
|
11
10
|
resultSerializer;
|
|
12
11
|
ingredientSerializer;
|
|
@@ -14,8 +13,7 @@ export class RecipeEmitterImpl extends SimpleEmitter {
|
|
|
14
13
|
rules;
|
|
15
14
|
serializer;
|
|
16
15
|
constructor(logger, packFormat, registry, resultSerializer, ingredientSerializer, predicates, rules, serializer) {
|
|
17
|
-
super("recipes", registry, (it) => recipePath(this.packFormat, it), EMPTY_RECIPE, (it) => this.serializer.serialize(it));
|
|
18
|
-
this.logger = logger;
|
|
16
|
+
super("recipes", registry, logger, (it) => recipePath(this.packFormat, it), EMPTY_RECIPE, (it) => this.serializer.serialize(it));
|
|
19
17
|
this.packFormat = packFormat;
|
|
20
18
|
this.resultSerializer = resultSerializer;
|
|
21
19
|
this.ingredientSerializer = ingredientSerializer;
|
|
@@ -23,22 +21,15 @@ export class RecipeEmitterImpl extends SimpleEmitter {
|
|
|
23
21
|
this.rules = rules;
|
|
24
22
|
this.serializer = serializer;
|
|
25
23
|
}
|
|
26
|
-
addHolder(id, holder) {
|
|
27
|
-
if (this.custom.has(id))
|
|
28
|
-
this.logger.error(`Overwriting custom recipe with ID ${encodeId(id)}`);
|
|
29
|
-
// TODO add to custom registry so recipe graph can use it
|
|
30
|
-
this.custom.add(id, holder);
|
|
31
|
-
return encodeId(id);
|
|
32
|
-
}
|
|
33
24
|
add(id, arg, arg2, conditions) {
|
|
34
25
|
if (typeof arg === "string" || "namespace" in arg) {
|
|
35
26
|
const holder = RecipeHolder.of(arg, arg2, conditions);
|
|
36
|
-
return this.
|
|
27
|
+
return this.addCustom(id, holder);
|
|
37
28
|
}
|
|
38
29
|
else {
|
|
39
30
|
const definition = arg;
|
|
40
31
|
const holder = createFakeHolder(definition);
|
|
41
|
-
return this.
|
|
32
|
+
return this.addCustom(id, holder);
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
35
|
remove(filter) {
|
package/dist/emitter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../src/emitter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../src/emitter.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAe1E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,gBAAgB,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ACE,SAAS,EAAE,oBAAoB;YAC/B,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,iBAAiB;SAC1B,CACF,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type * from "./hooks";
|
|
|
4
4
|
export type { RecipeLoader } from "./loader";
|
|
5
5
|
export type * from "./model";
|
|
6
6
|
export { default } from "./module";
|
|
7
|
+
export type * from "./registry";
|
|
7
8
|
export type { RecipeFilter, RecipeRules } from "./rule";
|
|
8
9
|
export * from "./schema";
|
|
9
10
|
export type { RecipesSerializer } from "./serializer/abstract";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,WAAW,CAAC;AAK7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,WAAW,CAAC;AAK7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,cAAc,UAAU,CAAC;AAEzB,cAAc,gCAAgC,CAAC;AAE/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC"}
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ConditionContext,
|
|
1
|
+
import type { ConditionContext, ResourceFolder } from "@adeficior/data-modifier-core";
|
|
2
2
|
import { JsonLoader } from "@adeficior/data-modifier-core";
|
|
3
|
+
import type { RecipeRegistry } from "./registry";
|
|
3
4
|
import type { RecipeDefinition } from "./schema";
|
|
4
5
|
import type { RecipesSerializer } from "./serializer/abstract";
|
|
5
6
|
import type { RecipeHolder } from "./serializer/holder";
|
|
6
|
-
export type RecipeLoader = {
|
|
7
|
+
export type RecipeLoader = RecipeRegistry & {
|
|
7
8
|
ignoreType(pattern: string): void;
|
|
8
|
-
}
|
|
9
|
+
};
|
|
9
10
|
export declare class RecipeLoaderImpl extends JsonLoader<RecipeHolder> implements RecipeLoader {
|
|
10
11
|
private readonly serializer;
|
|
11
12
|
private readonly ignoredRecipeTypePatterns;
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAUtC,MAAM,OAAO,gBACX,SAAQ,UAAwB;IAMb;IAHF,yBAAyB,GAAa,EAAE,CAAC;IAE1D,YACmB,UAA6B,EAC9C,MAAsB,EACtB,OAA0B;QAE1B,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAJN,eAAU,GAAV,UAAU,CAAmB;QAM9C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,UAAU,CAAC,OAAe;QACxB,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEQ,KAAK,CAAC,UAA4B;QACzC,IACE,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CACzC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/B,EACD,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CACxB,UAAU,EACV,MAAM,EACN,UAAU,EACV,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,CACtB,CAAC;QAEF,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEzD,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;CACF"}
|
package/dist/module.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { RecipeEmitter } from "./emitter";
|
|
|
2
2
|
import type { VanillaRecipeHelper } from "./helper/vanilla";
|
|
3
3
|
import type { RegisterRecipeSerializer } from "./hooks";
|
|
4
4
|
import type { RecipeLoader } from "./loader";
|
|
5
|
+
import type { RecipeRegistry } from "./registry";
|
|
5
6
|
import type { RecipeRules } from "./rule";
|
|
6
7
|
import type { RecipesSerializer } from "./serializer/abstract";
|
|
7
8
|
declare const _default: import("@adeficior/data-modifier-core").ModuleConfig<{
|
|
@@ -18,6 +19,7 @@ declare const _default: import("@adeficior/data-modifier-core").ModuleConfig<{
|
|
|
18
19
|
"serializer:recipes": RecipesSerializer;
|
|
19
20
|
"rules:recipes": RecipeRules;
|
|
20
21
|
"helper:recipes:vanilla": VanillaRecipeHelper;
|
|
22
|
+
"registry:recipes": RecipeRegistry;
|
|
21
23
|
};
|
|
22
24
|
}>;
|
|
23
25
|
export default _default;
|
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineModule } from "@adeficior/data-modifier-core";
|
|
1
|
+
import { defineModule, PatchedRegistry } from "@adeficior/data-modifier-core";
|
|
2
2
|
import { name } from "../package.json";
|
|
3
3
|
import { RecipeEmitterImpl } from "./emitter";
|
|
4
4
|
import { VanillaRecipeHelperImpl } from "./helper/vanilla";
|
|
@@ -26,6 +26,7 @@ export default defineModule({
|
|
|
26
26
|
"serializer:recipes": "RecipesSerializer",
|
|
27
27
|
"rules:recipes": "RecipeRules",
|
|
28
28
|
"helper:recipes:vanilla": "VanillaRecipeHelper",
|
|
29
|
+
"registry:recipes": "RecipeRegistry",
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
promote: [
|
|
@@ -36,7 +37,8 @@ export default defineModule({
|
|
|
36
37
|
const serializer = instance.service("serializer:recipes", (container) => new RecipeSerializerImpl(container.get("serializer:results"), container.get("serializer:ingredients")));
|
|
37
38
|
const loader = instance.loader("recipes", () => new RecipeLoaderImpl(serializer(), recipeFolder(instance.options.packFormat)), recipePattern(instance.options.packFormat));
|
|
38
39
|
const rules = instance.service("rules:recipes", (container) => new RecipeRulesImpl(container.get("predicates")));
|
|
39
|
-
const
|
|
40
|
+
const registry = instance.service("registry:recipes", () => new PatchedRegistry(loader()));
|
|
41
|
+
const emitter = instance.emitter("recipes", (container) => new RecipeEmitterImpl(container.get("logger"), instance.options.packFormat, registry(), container.get("serializer:results"), container.get("serializer:ingredients"), container.get("predicates"), rules(), serializer()));
|
|
40
42
|
instance.service("helper:recipes:vanilla", (container) => new VanillaRecipeHelperImpl(emitter(), container.get("serializer:ingredients"), container.get("serializer:results")));
|
|
41
43
|
instance.hook("recipes:register-serializer", registerDefaultSerializers);
|
|
42
44
|
instance.hook("setup:after", ({ callHook }) => {
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,M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WAAW,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":""}
|
package/dist/rule.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createId } from "@adeficior/data-modifier-core";
|
|
2
|
-
import { always, every,
|
|
2
|
+
import { always, every, some } from "@adeficior/data-modifier-core/serializer";
|
|
3
3
|
import { notNull } from "@adeficior/pack-resolver";
|
|
4
4
|
class RecipeRule {
|
|
5
5
|
idPredicate;
|
|
@@ -31,9 +31,9 @@ export class RecipeRulesImpl {
|
|
|
31
31
|
const ingredient = [];
|
|
32
32
|
const result = [];
|
|
33
33
|
if (test.id)
|
|
34
|
-
id.push(
|
|
34
|
+
id.push(this.predicates.id(test.id));
|
|
35
35
|
if (test.type)
|
|
36
|
-
type.push(
|
|
36
|
+
type.push(this.predicates.id(test.type));
|
|
37
37
|
if (test.namespace)
|
|
38
38
|
id.push((id) => id.namespace === test.namespace);
|
|
39
39
|
if (test.output)
|
package/dist/rule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../src/rule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../src/rule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKzD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAQ/E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,MAAM,UAAU;IAEK;IACA;IACA;IACA;IAJnB,YACmB,WAA0B,EAC1B,aAA4B,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AC,CAAC,iBAAiB,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CACxE,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adeficior/data-modifier-recipes",
|
|
3
3
|
"description": "data-modifier module for recipes",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
7
7
|
"./serializer": "./dist/serializer/index.js",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/lodash-es": "^4.17.12",
|
|
14
|
-
"@adeficior/data-modifier-ingredients": "^2.0.
|
|
14
|
+
"@adeficior/data-modifier-ingredients": "^2.0.4"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@adeficior/pack-resolver": "^2.0.1",
|
|
18
18
|
"typescript": "^5",
|
|
19
19
|
"minimatch": "^10.2.6",
|
|
20
20
|
"lodash-es": "^4.18.1",
|
|
21
|
-
"@adeficior/data-modifier-core": "^2.
|
|
22
|
-
"@adeficior/data-modifier-ingredients": "^2.0.
|
|
23
|
-
"@adeficior/data-modifier-tags": "^2.0.
|
|
21
|
+
"@adeficior/data-modifier-core": "^2.2.0",
|
|
22
|
+
"@adeficior/data-modifier-ingredients": "^2.0.4",
|
|
23
|
+
"@adeficior/data-modifier-tags": "^2.0.4"
|
|
24
24
|
},
|
|
25
25
|
"typesVersions": {
|
|
26
26
|
"*": {
|