@kaskad/core 0.0.7 → 0.0.8

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/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@kaskad/core",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "peerDependencies": {
5
- "@kaskad/types": "0.0.7",
6
- "@kaskad/config": "0.0.7",
7
- "@kaskad/definition": "0.0.7",
8
- "@kaskad/schema": "0.0.7",
9
- "@kaskad/component-tree": "0.0.7",
10
- "@kaskad/formula-parser": "0.0.7",
11
- "@kaskad/eval-tree": "0.0.7",
5
+ "@kaskad/types": "0.0.8",
6
+ "@kaskad/config": "0.0.8",
7
+ "@kaskad/definition": "0.0.8",
8
+ "@kaskad/schema": "0.0.8",
9
+ "@kaskad/component-tree": "0.0.8",
10
+ "@kaskad/formula-parser": "0.0.8",
11
+ "@kaskad/eval-tree": "0.0.8",
12
12
  "mobx": "^6.13.7",
13
13
  "rxjs": "~7.8.0",
14
14
  "yaml": "^2.0.0"
@@ -23,6 +23,10 @@
23
23
  ".": {
24
24
  "types": "./types/kaskad-core.d.ts",
25
25
  "default": "./fesm2022/kaskad-core.mjs"
26
+ },
27
+ "./testing": {
28
+ "types": "./types/kaskad-core-testing.d.ts",
29
+ "default": "./fesm2022/kaskad-core-testing.mjs"
26
30
  }
27
31
  },
28
32
  "dependencies": {
@@ -0,0 +1,34 @@
1
+ import { ComponentRecipe, TComponent, ComponentId } from '@kaskad/core';
2
+
3
+ declare function createView(rawSchema: ComponentRecipe): Promise<void>;
4
+ declare function loadYamlSchema(absolutePath: string): ComponentRecipe;
5
+ declare function loadYamlSchemaFrom(baseDir: string, relativePath: string): ComponentRecipe;
6
+ declare function createViewFromFile(baseDir: string, relativePath: string): Promise<void>;
7
+ /**
8
+ * Sets up a fetch mock that resolves `/recipes/{path}.yml` URLs to actual files.
9
+ * Use this when testing recipes that use `templateUrl` to load external templates.
10
+ *
11
+ * @param recipesBaseDir - The base directory where recipe files are located
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // In your test file
16
+ * import { setupRecipeFetch } from '@kaskad/core/testing';
17
+ * import * as path from 'node:path';
18
+ *
19
+ * setupRecipeFetch(path.resolve(__dirname, '../..'));
20
+ * ```
21
+ */
22
+ declare function setupRecipeFetch(recipesBaseDir: string): void;
23
+ declare function setCurrent(selector: string): void;
24
+ declare function get<T = unknown>(selector: string): T;
25
+ declare function set<T = unknown>(selector: string, value: T): void;
26
+ declare function run(selector: string, ...args: unknown[]): Promise<unknown>;
27
+ declare function select(selector: string): TComponent;
28
+ declare function selectAll(selector: string): TComponent[];
29
+ declare function evaluating(selector: string): boolean;
30
+ declare function running(selector: string): boolean;
31
+ declare function getComponentType(selector: string): string;
32
+ declare function getId(selector: string): ComponentId;
33
+
34
+ export { createView, createViewFromFile, evaluating, get, getComponentType, getId, loadYamlSchema, loadYamlSchemaFrom, run, running, select, selectAll, set, setCurrent, setupRecipeFetch };