@adeficior/data-modifier-create 2.0.0-rc.20260814115618
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 +3 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +2 -0
- package/dist/module.js +13 -0
- package/dist/module.js.map +1 -0
- package/dist/registration.d.ts +2 -0
- package/dist/registration.js +22 -0
- package/dist/registration.js.map +1 -0
- package/dist/serializer/assembly.d.ts +24 -0
- package/dist/serializer/assembly.js +49 -0
- package/dist/serializer/assembly.js.map +1 -0
- package/dist/serializer/processing.d.ts +8 -0
- package/dist/serializer/processing.js +4 -0
- package/dist/serializer/processing.js.map +1 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
|
package/dist/module.d.ts
ADDED
package/dist/module.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineModule } from "@adeficior/data-modifier-core";
|
|
2
|
+
import { name } from "../package.json";
|
|
3
|
+
import { registerParsers } from "./registration";
|
|
4
|
+
export default defineModule({
|
|
5
|
+
importModule: name,
|
|
6
|
+
dependencies: {
|
|
7
|
+
"@adeficior/data-modifier-recipes": "required",
|
|
8
|
+
},
|
|
9
|
+
setup: (pack) => {
|
|
10
|
+
pack.hook("recipes:register-parser", registerParsers);
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAe,YAAY,CAAC;IAC1B,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE;QACZ,kCAAkC,EAAE,UAAU;KAC/C;IACD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;QACd,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {} from "@adeficior/data-modifier-recipes";
|
|
2
|
+
import { ShapedParser } from "@adeficior/data-modifier-recipes";
|
|
3
|
+
import { AssemblyRecipeParser } from "./serializer/assembly";
|
|
4
|
+
import { CreateProcessingRecipeParser } from "./serializer/processing";
|
|
5
|
+
export function registerParsers(event) {
|
|
6
|
+
event.register("create:mixing", new CreateProcessingRecipeParser());
|
|
7
|
+
event.register("create:pressing", new CreateProcessingRecipeParser());
|
|
8
|
+
event.register("create:emptying", new CreateProcessingRecipeParser());
|
|
9
|
+
event.register("create:crushing", new CreateProcessingRecipeParser());
|
|
10
|
+
event.register("create:milling", new CreateProcessingRecipeParser());
|
|
11
|
+
event.register("create:compacting", new CreateProcessingRecipeParser());
|
|
12
|
+
event.register("create:filling", new CreateProcessingRecipeParser());
|
|
13
|
+
event.register("create:cutting", new CreateProcessingRecipeParser());
|
|
14
|
+
event.register("create:item_application", new CreateProcessingRecipeParser());
|
|
15
|
+
event.register("create:sandpaper_polishing", new CreateProcessingRecipeParser());
|
|
16
|
+
event.register("create:deploying", new CreateProcessingRecipeParser());
|
|
17
|
+
event.register("create:splashing", new CreateProcessingRecipeParser());
|
|
18
|
+
event.register("create:haunting", new CreateProcessingRecipeParser());
|
|
19
|
+
event.register("create:mechanical_crafting", new ShapedParser());
|
|
20
|
+
event.register("create:sequenced_assembly", new AssemblyRecipe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CAAC,CAAC;IACvE,KAAK,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,4BAA4B,EAAE,CAAC,CAAC;IACvE,KAAK,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,4BAA4B,EAAE,CAAC,CAAC;IACtE,KAAK,CAAC,QAAQ,CAAC,4BAA4B,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC;IACjE,KAAK,CAAC,QAAQ,CAAC,2BAA2B,EAAE,IAAI,oBAAoB,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Ingredient, type Result } from "@adeficior/data-modifier-ingredients";
|
|
2
|
+
import { Recipe, RecipeParser, type RecipeDefinition, type RecipeHolder, type RecipeModifier, type RecipeParseContext } from "@adeficior/data-modifier-recipes";
|
|
3
|
+
export type AssemblyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
4
|
+
ingredient: unknown;
|
|
5
|
+
transitionalItem: unknown;
|
|
6
|
+
transitional_item: unknown;
|
|
7
|
+
results: unknown[];
|
|
8
|
+
loops?: number;
|
|
9
|
+
sequence: RecipeDefinition[];
|
|
10
|
+
}>;
|
|
11
|
+
export declare class AssemblyRecipe extends Recipe {
|
|
12
|
+
private readonly ingredient;
|
|
13
|
+
private readonly transitionalItem;
|
|
14
|
+
private readonly results;
|
|
15
|
+
private readonly sequence;
|
|
16
|
+
constructor(ingredient: Ingredient, transitionalItem: Ingredient, results: Result[], sequence: RecipeHolder[]);
|
|
17
|
+
getIngredients(): Ingredient[];
|
|
18
|
+
getResults(): Result[];
|
|
19
|
+
modify(modifier: RecipeModifier): AssemblyRecipe;
|
|
20
|
+
serialize(context: RecipeParseContext): Partial<AssemblyRecipeDefinition>;
|
|
21
|
+
}
|
|
22
|
+
export declare class AssemblyRecipeParser extends RecipeParser<AssemblyRecipeDefinition, AssemblyRecipe> {
|
|
23
|
+
deserialize(definition: AssemblyRecipeDefinition, context: RecipeParseContext): AssemblyRecipe;
|
|
24
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {} from "@adeficior/data-modifier-ingredients";
|
|
2
|
+
import { Recipe, RecipeParser, } from "@adeficior/data-modifier-recipes";
|
|
3
|
+
export class AssemblyRecipe extends Recipe {
|
|
4
|
+
ingredient;
|
|
5
|
+
transitionalItem;
|
|
6
|
+
results;
|
|
7
|
+
sequence;
|
|
8
|
+
constructor(ingredient, transitionalItem, results, sequence) {
|
|
9
|
+
super();
|
|
10
|
+
this.ingredient = ingredient;
|
|
11
|
+
this.transitionalItem = transitionalItem;
|
|
12
|
+
this.results = results;
|
|
13
|
+
this.sequence = sequence;
|
|
14
|
+
}
|
|
15
|
+
getIngredients() {
|
|
16
|
+
return [
|
|
17
|
+
this.ingredient,
|
|
18
|
+
this.transitionalItem,
|
|
19
|
+
...this.sequence.flatMap((it) => it.getIngredients()),
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
getResults() {
|
|
23
|
+
return [...this.results, ...this.sequence.flatMap((it) => it.getResults())];
|
|
24
|
+
}
|
|
25
|
+
modify(modifier) {
|
|
26
|
+
return new AssemblyRecipe(modifier.ingredient(this.ingredient), modifier.ingredient(this.transitionalItem), this.results.map(modifier.result), this.sequence.map((it) => it.modify(modifier)));
|
|
27
|
+
}
|
|
28
|
+
serialize(context) {
|
|
29
|
+
return {
|
|
30
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
31
|
+
transitionalItem: context.results.serialize(this.transitionalItem.asResult()),
|
|
32
|
+
results: context.results.serializeList(this.results),
|
|
33
|
+
sequence: this.sequence.map((it) => context.recipes.serialize(it)),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class AssemblyRecipeParser extends RecipeParser {
|
|
38
|
+
deserialize(definition, context) {
|
|
39
|
+
const ingredient = context.ingredients.deserialize(definition.ingredient);
|
|
40
|
+
const rawTransitionalItem = definition.transitionalItem ?? definition.transitional_item;
|
|
41
|
+
const transitionalItem = context.results
|
|
42
|
+
.deserialize(rawTransitionalItem)
|
|
43
|
+
.asIngredient();
|
|
44
|
+
const results = context.results.deserializeList(definition.results);
|
|
45
|
+
const sequence = definition.sequence.map((it) => context.recipes.deserialize(it));
|
|
46
|
+
return new AssemblyRecipe(ingredient, transitionalItem, results, sequence);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=assembly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../src/serializer/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,YAAY,GAKb,MAAM,kCAAkC,CAAC;AAY1C,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,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,cAAc,CACvB,QAAQ,CAAC,UAAU,CAAC,IAAI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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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ManyToManyRecipeParser, type ManyToManyRecipeDefinition } from "@adeficior/data-modifier-recipes";
|
|
2
|
+
export type CreateProcessingRecipeDefinition = ManyToManyRecipeDefinition & Readonly<{
|
|
3
|
+
heatRequirement?: string;
|
|
4
|
+
processingTime?: number;
|
|
5
|
+
keepHeldItem?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare class CreateProcessingRecipeParser extends ManyToManyRecipeParser<CreateProcessingRecipeDefinition> {
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processing.js","sourceRoot":"","sources":["../../src/serializer/processing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,kCAAkC,CAAC;AAS1C,MAAM,OAAO,4BAA6B,SAAQ,sBAAwD;CAAG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adeficior/data-modifier-create",
|
|
3
|
+
"version": "2.0.0-rc.20260814115618",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": "./dist/index.js"
|
|
6
|
+
},
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc --project tsconfig.build.json",
|
|
14
|
+
"check": "tsc --noEmit",
|
|
15
|
+
"dev": "bun run build --watch",
|
|
16
|
+
"lint": "eslint {src,test}",
|
|
17
|
+
"test": "bun test --timeout 10000",
|
|
18
|
+
"prune": "bun run datamod-dev --prune",
|
|
19
|
+
"prepare": "datamod-dev --configs && datamod-dev --types",
|
|
20
|
+
"test:ci": "bun run lint && bun run check && bun run test --coverage"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@adeficior/configs": "workspace:*",
|
|
24
|
+
"@adeficior/testing": "workspace:*",
|
|
25
|
+
"@adeficior/data-modifier-recipes": "workspace:*"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@adeficior/pack-resolver": "catalog:",
|
|
29
|
+
"typescript": "catalog:",
|
|
30
|
+
"@adeficior/data-modifier-core": "workspace:*",
|
|
31
|
+
"@adeficior/data-modifier-recipes": "workspace:*",
|
|
32
|
+
"@adeficior/data-modifier-ingredients": "workspace:*",
|
|
33
|
+
"@adeficior/data-modifier-tags": "workspace:*"
|
|
34
|
+
}
|
|
35
|
+
}
|