@adeficior/data-modifier-create 2.0.0-rc.20260816171656 → 2.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.
@@ -0,0 +1,14 @@
1
+ import type { IdInput, NormalizedId } from "@adeficior/data-modifier-core";
2
+ import type { IngredientInput, IngredientSerializer, ResultInput, ResultSerializer } from "@adeficior/data-modifier-ingredients";
3
+ import type { RecipeEmitter } from "@adeficior/data-modifier-recipes";
4
+ export type CreateRecipeHelper = {
5
+ mixing(id: IdInput, ingredients: IngredientInput[], results: ResultInput[]): NormalizedId;
6
+ mixing(ingredients: IngredientInput[], results: ResultInput[]): NormalizedId;
7
+ };
8
+ export declare class CreateRecipeHelperImpl implements CreateRecipeHelper {
9
+ private readonly emitter;
10
+ private readonly ingredients;
11
+ private readonly results;
12
+ constructor(emitter: RecipeEmitter, ingredients: IngredientSerializer, results: ResultSerializer);
13
+ readonly mixing: CreateRecipeHelper["mixing"];
14
+ }
package/dist/helper.js ADDED
@@ -0,0 +1,18 @@
1
+ import { createResultId, withDefaultId, } from "@adeficior/data-modifier-recipes/helper";
2
+ import { ProcessingRecipe } from "./serializer/processing";
3
+ export class CreateRecipeHelperImpl {
4
+ emitter;
5
+ ingredients;
6
+ results;
7
+ constructor(emitter, ingredients, results) {
8
+ this.emitter = emitter;
9
+ this.ingredients = ingredients;
10
+ this.results = results;
11
+ }
12
+ mixing = withDefaultId((id, ingredientsInput, resultsInput) => {
13
+ const ingredients = this.ingredients.deserializeList(ingredientsInput);
14
+ const results = this.results.deserializeList(resultsInput);
15
+ return this.emitter.add(id ?? createResultId(results), "create:mixing", new ProcessingRecipe(ingredients, results));
16
+ });
17
+ }
18
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,cAAc,EACd,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAW3D,MAAM,OAAO,sBAAsB;IAEd;IACA;IACA;IAHnB,YACmB,OAAsB,EACtB,WAAiC,EACjC,OAAyB;QAFzB,YAAO,GAAP,OAAO,CAAe;QACtB,gBAAW,GAAX,WAAW,CAAsB;QACjC,YAAO,GAAP,OAAO,CAAkB;IACzC,CAAC;IAEK,MAAM,GAAiC,aAAa,CAC3D,CACE,EAAkB,EAClB,gBAAmC,EACnC,YAA2B,EAC3B,EAAE;QACF,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;QACvE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAE3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,EAAE,IAAI,cAAc,CAAC,OAAO,CAAC,EAC7B,eAAe,EACf,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAC3C,CAAC;IACJ,CAAC,CACF,CAAC;CACH"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type { CreateRecipeHelper } from "./helper";
1
2
  export { default } from "./module";
2
3
  export * from "./serializer/assembly";
3
4
  export * from "./serializer/processing";
package/dist/index.js.map CHANGED
@@ -1 +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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
package/dist/module.d.ts CHANGED
@@ -1,2 +1,7 @@
1
- declare const _default: import("@adeficior/data-modifier-core").ModuleConfig<import("@adeficior/data-modifier-core").ModuleTypes>;
1
+ import type { CreateRecipeHelper } from "./helper";
2
+ declare const _default: import("@adeficior/data-modifier-core").ModuleConfig<{
3
+ services: {
4
+ "helper:recipes:create": CreateRecipeHelper;
5
+ };
6
+ }>;
2
7
  export default _default;
package/dist/module.js CHANGED
@@ -1,13 +1,21 @@
1
1
  import { defineModule } from "@adeficior/data-modifier-core";
2
2
  import { name } from "../package.json";
3
+ import { CreateRecipeHelperImpl } from "./helper";
3
4
  import { registerSerializers } from "./registration";
4
5
  export default defineModule({
5
6
  importModule: name,
6
7
  dependencies: {
7
8
  "@adeficior/data-modifier-recipes": "required",
8
9
  },
10
+ types: {
11
+ services: {
12
+ "helper:recipes:create": "CreateRecipeHelper",
13
+ },
14
+ },
15
+ promote: [{ service: "helper:recipes:create", key: "recipes.create" }],
9
16
  setup: (pack) => {
10
17
  pack.hook("recipes:register-serializer", registerSerializers);
18
+ pack.service("helper:recipes:create", (container) => new CreateRecipeHelperImpl(container.get("emitter:recipes"), container.get("serializer:ingredients"), container.get("serializer:results")));
11
19
  },
12
20
  });
13
21
  //# sourceMappingURL=module.js.map
@@ -1 +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,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,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,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;IAChE,CAAC;CACF,CAAC,CAAC"}
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,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAe,YAAY,CAIxB;IACD,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE;QACZ,kCAAkC,EAAE,UAAU;KAC/C;IACD,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,uBAAuB,EAAE,oBAAoB;SAC9C;KACF;IACD,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC;IACtE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;QACd,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC;QAE9D,IAAI,CAAC,OAAO,CACV,uBAAuB,EACvB,CAAC,SAAS,EAAE,EAAE,CACZ,IAAI,sBAAsB,CACxB,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAChC,SAAS,CAAC,GAAG,CAAC,wBAAwB,CAAC,EACvC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,CACpC,CACJ,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,22 +1,21 @@
1
1
  {
2
2
  "name": "@adeficior/data-modifier-create",
3
3
  "description": "data-modifier module adding compatibility for create",
4
- "version": "2.0.0-rc.20260816171656",
4
+ "version": "2.0.0",
5
5
  "exports": { ".": "./dist/index.js" },
6
- "types": "./dist/index.d.ts",
7
- "files": ["dist"],
8
6
  "type": "module",
9
- "devDependencies": {
10
- "@adeficior/data-modifier-recipes": "^2.0.0-rc.20260816171656"
11
- },
7
+ "devDependencies": { "@adeficior/data-modifier-recipes": "^2.0.0" },
12
8
  "peerDependencies": {
13
- "@adeficior/pack-resolver": "^2.0.0",
9
+ "@adeficior/pack-resolver": "^2.0.1",
14
10
  "typescript": "^5",
15
- "@adeficior/data-modifier-core": "^2.0.0-rc.20260816171656",
16
- "@adeficior/data-modifier-recipes": "^2.0.0-rc.20260816171656",
17
- "@adeficior/data-modifier-ingredients": "^2.0.0-rc.20260816171656",
18
- "@adeficior/data-modifier-tags": "^2.0.0-rc.20260816171656"
11
+ "@adeficior/data-modifier-core": "^2.0.0",
12
+ "@adeficior/data-modifier-recipes": "^2.0.0",
13
+ "@adeficior/data-modifier-ingredients": "^2.0.0",
14
+ "@adeficior/data-modifier-tags": "^2.0.0"
19
15
  },
16
+ "typesVersions": { "*": {} },
17
+ "types": "./dist/index.d.ts",
18
+ "files": ["dist"],
20
19
  "bugs": { "url": "https://github.com/Adeficior/DataModifier/issues" },
21
20
  "homepage": "https://github.com/Adeficior/DataModifier#readme",
22
21
  "license": "LGPL-3.0-or-later",