@kaskad/core 0.0.8 → 0.0.9

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.
@@ -130,6 +130,20 @@ function evaluating(selector) {
130
130
  const node = ComponentTreeApi.findNode(currentComponentId, selector);
131
131
  return node?.evaluating ?? false;
132
132
  }
133
+ function settled(selector) {
134
+ const node = ComponentTreeApi.findNode(currentComponentId, selector);
135
+ return node?.settled ?? false;
136
+ }
137
+ function ready(selector) {
138
+ const node = ComponentTreeApi.findNode(currentComponentId, selector);
139
+ if (!node)
140
+ return false;
141
+ return node.settled && !node.evaluating && !node.failed;
142
+ }
143
+ function error(selector) {
144
+ const node = ComponentTreeApi.findNode(currentComponentId, selector);
145
+ return node?.error ?? null;
146
+ }
133
147
  function running(selector) {
134
148
  return ComponentTreeApi.isCommandRunning(currentComponentId, selector);
135
149
  }
@@ -152,5 +166,5 @@ function getId(selector) {
152
166
  * Generated bundle index. Do not edit.
153
167
  */
154
168
 
155
- export { createView, createViewFromFile, evaluating, get, getComponentType, getId, loadYamlSchema, loadYamlSchemaFrom, run, running, select, selectAll, set, setCurrent, setupRecipeFetch };
169
+ export { createView, createViewFromFile, error, evaluating, get, getComponentType, getId, loadYamlSchema, loadYamlSchemaFrom, ready, run, running, select, selectAll, set, setCurrent, settled, setupRecipeFetch };
156
170
  //# sourceMappingURL=kaskad-core-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"kaskad-core-testing.mjs","sources":["../../../../libs/core/testing/src/index.ts","../../../../libs/core/testing/src/kaskad-core-testing.ts"],"sourcesContent":["/// <reference types=\"node\" />\nimport { promises as fs, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport {\n activateNode,\n activateStructure,\n browser,\n common,\n ComponentId,\n ComponentRecipe,\n ComponentTreeApi,\n createRootNode,\n DefinitionStore,\n forms,\n initRuntime,\n loadTemplates,\n registerPlugins,\n sys,\n TComponent,\n templateRegistry,\n unfoldNodeSchema,\n} from '@kaskad/core';\nimport { vi } from 'vitest';\nimport { parse } from 'yaml';\n\nlet currentComponentId: ComponentId;\n\nexport async function createView(rawSchema: ComponentRecipe): Promise<void> {\n vi.useFakeTimers();\n\n const defStore = DefinitionStore.getInstance();\n\n // Register common definitions if not already registered (for YAML schema tests)\n // Core tests register these in beforeEach\n if (Object.keys(defStore.components).length === 0) {\n registerPlugins(sys, common, browser, forms);\n initRuntime();\n }\n\n const url = 'my-schema';\n const componentTypes = new Set<string>();\n const dependencies = new Set<string>();\n templateRegistry.set(url, rawSchema, componentTypes, dependencies);\n\n await loadTemplates(rawSchema);\n\n const schema = unfoldNodeSchema(rawSchema, { type: 'component' });\n const root = createRootNode(url, schema, null, null, url);\n\n activateNode(root);\n await vi.runAllTimersAsync();\n\n currentComponentId = root.extractedValue as ComponentId;\n}\n\nexport function loadYamlSchema(absolutePath: string): ComponentRecipe {\n try {\n const content = readFileSync(absolutePath, 'utf-8');\n return parse(content);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n throw new Error(`YAML schema not found: ${absolutePath}`);\n }\n throw new Error(`Failed to load YAML schema ${absolutePath}: ${error}`);\n }\n}\n\nexport function loadYamlSchemaFrom(baseDir: string, relativePath: string): ComponentRecipe {\n const fullPath = join(baseDir, relativePath);\n return loadYamlSchema(fullPath);\n}\n\nexport async function createViewFromFile(baseDir: string, relativePath: string): Promise<void> {\n const schema = loadYamlSchemaFrom(baseDir, relativePath);\n await createView(schema);\n}\n\n/**\n * Sets up a fetch mock that resolves `/recipes/{path}.yml` URLs to actual files.\n * Use this when testing recipes that use `templateUrl` to load external templates.\n *\n * @param recipesBaseDir - The base directory where recipe files are located\n *\n * @example\n * ```typescript\n * // In your test file\n * import { setupRecipeFetch } from '@kaskad/core/testing';\n * import * as path from 'node:path';\n *\n * setupRecipeFetch(path.resolve(__dirname, '../..'));\n * ```\n */\nexport function setupRecipeFetch(recipesBaseDir: string): void {\n vi.stubGlobal(\n 'fetch',\n vi.fn(async (url: string) => {\n // Handle /recipes/{path}.yml URLs\n if (url.startsWith('/recipes/')) {\n const recipePath = url.replace('/recipes/', '');\n const filePath = join(recipesBaseDir, recipePath);\n\n try {\n const raw = await fs.readFile(filePath);\n return new Response(raw, {\n status: 200,\n headers: { 'Content-Type': 'text/yaml' },\n });\n } catch (err: unknown) {\n if (err && typeof err === 'object' && 'code' in err && err.code === 'ENOENT') {\n return new Response(`File not found: ${url}`, {\n status: 404,\n statusText: 'Not Found',\n });\n }\n throw err;\n }\n }\n\n return new Response('Not found', { status: 404 });\n }),\n );\n}\n\nexport function setCurrent(selector: string): void {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n currentComponentId = component.id;\n}\n\nexport function get<T = unknown>(selector: string): T {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n return (node?.extractedValue ?? null) as T;\n}\n\nexport function set<T = unknown>(selector: string, value: T): void {\n ComponentTreeApi.setNodeRawSchema(currentComponentId, selector, value);\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n if (node) {\n activateStructure(node);\n }\n}\n\nexport async function run(selector: string, ...args: unknown[]): Promise<unknown> {\n const commandPromise = ComponentTreeApi.runCommandNode(currentComponentId, selector, ...args) as Promise<unknown>;\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n commandPromise.catch(() => {});\n await vi.runAllTimersAsync();\n return commandPromise;\n}\n\nexport function select(selector: string): TComponent {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n return component;\n}\n\nexport function selectAll(selector: string): TComponent[] {\n const components = selector.split(',').flatMap((s) => ComponentTreeApi.findComponents(currentComponentId, s.trim()));\n if (!components.length) {\n throw new Error(`Components not found: ${selector}`);\n }\n return components;\n}\n\nexport function evaluating(selector: string): boolean {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n return node?.evaluating ?? false;\n}\n\nexport function running(selector: string): boolean {\n return ComponentTreeApi.isCommandRunning(currentComponentId, selector);\n}\n\nexport function getComponentType(selector: string): string {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n return component.componentType;\n}\n\nexport function getId(selector: string): ComponentId {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n return component.id;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["fs"],"mappings":";;;;;;AAAA;AAyBA,IAAI,kBAA+B;AAE5B,eAAe,UAAU,CAAC,SAA0B,EAAA;IACzD,EAAE,CAAC,aAAa,EAAE;AAElB,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,EAAE;;;AAI9C,IAAA,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACjD,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;AAC5C,QAAA,WAAW,EAAE;;IAGf,MAAM,GAAG,GAAG,WAAW;AACvB,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU;AACxC,IAAA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU;IACtC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,CAAC;AAElE,IAAA,MAAM,aAAa,CAAC,SAAS,CAAC;AAE9B,IAAA,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;AACjE,IAAA,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;IAEzD,YAAY,CAAC,IAAI,CAAC;AAClB,IAAA,MAAM,EAAE,CAAC,iBAAiB,EAAE;AAE5B,IAAA,kBAAkB,GAAG,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E;AAEM,SAAU,gBAAgB,CAAC,QAAgB,EAAA;IAC/C,MAAM,SAAS,GAAG,gBAAgB,CAAC,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC9E,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAA,CAAE,CAAC;;IAErD,OAAO,SAAS,CAAC,aAAa;AAChC;AAEM,SAAU,KAAK,CAAC,QAAgB,EAAA;IACpC,MAAM,SAAS,GAAG,gBAAgB,CAAC,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC9E,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAA,CAAE,CAAC;;IAErD,OAAO,SAAS,CAAC,EAAE;AACrB;;AC/LA;;AAEG;;;;"}
1
+ {"version":3,"file":"kaskad-core-testing.mjs","sources":["../../../../libs/core/testing/src/index.ts","../../../../libs/core/testing/src/kaskad-core-testing.ts"],"sourcesContent":["/// <reference types=\"node\" />\nimport { promises as fs, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport {\n activateNode,\n activateStructure,\n browser,\n common,\n ComponentId,\n ComponentRecipe,\n ComponentTreeApi,\n createRootNode,\n DefinitionStore,\n forms,\n initRuntime,\n loadTemplates,\n registerPlugins,\n sys,\n TComponent,\n templateRegistry,\n unfoldNodeSchema,\n} from '@kaskad/core';\nimport { vi } from 'vitest';\nimport { parse } from 'yaml';\n\nlet currentComponentId: ComponentId;\n\nexport async function createView(rawSchema: ComponentRecipe): Promise<void> {\n vi.useFakeTimers();\n\n const defStore = DefinitionStore.getInstance();\n\n // Register common definitions if not already registered (for YAML schema tests)\n // Core tests register these in beforeEach\n if (Object.keys(defStore.components).length === 0) {\n registerPlugins(sys, common, browser, forms);\n initRuntime();\n }\n\n const url = 'my-schema';\n const componentTypes = new Set<string>();\n const dependencies = new Set<string>();\n templateRegistry.set(url, rawSchema, componentTypes, dependencies);\n\n await loadTemplates(rawSchema);\n\n const schema = unfoldNodeSchema(rawSchema, { type: 'component' });\n const root = createRootNode(url, schema, null, null, url);\n\n activateNode(root);\n await vi.runAllTimersAsync();\n\n currentComponentId = root.extractedValue as ComponentId;\n}\n\nexport function loadYamlSchema(absolutePath: string): ComponentRecipe {\n try {\n const content = readFileSync(absolutePath, 'utf-8');\n return parse(content);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n throw new Error(`YAML schema not found: ${absolutePath}`);\n }\n throw new Error(`Failed to load YAML schema ${absolutePath}: ${error}`);\n }\n}\n\nexport function loadYamlSchemaFrom(baseDir: string, relativePath: string): ComponentRecipe {\n const fullPath = join(baseDir, relativePath);\n return loadYamlSchema(fullPath);\n}\n\nexport async function createViewFromFile(baseDir: string, relativePath: string): Promise<void> {\n const schema = loadYamlSchemaFrom(baseDir, relativePath);\n await createView(schema);\n}\n\n/**\n * Sets up a fetch mock that resolves `/recipes/{path}.yml` URLs to actual files.\n * Use this when testing recipes that use `templateUrl` to load external templates.\n *\n * @param recipesBaseDir - The base directory where recipe files are located\n *\n * @example\n * ```typescript\n * // In your test file\n * import { setupRecipeFetch } from '@kaskad/core/testing';\n * import * as path from 'node:path';\n *\n * setupRecipeFetch(path.resolve(__dirname, '../..'));\n * ```\n */\nexport function setupRecipeFetch(recipesBaseDir: string): void {\n vi.stubGlobal(\n 'fetch',\n vi.fn(async (url: string) => {\n // Handle /recipes/{path}.yml URLs\n if (url.startsWith('/recipes/')) {\n const recipePath = url.replace('/recipes/', '');\n const filePath = join(recipesBaseDir, recipePath);\n\n try {\n const raw = await fs.readFile(filePath);\n return new Response(raw, {\n status: 200,\n headers: { 'Content-Type': 'text/yaml' },\n });\n } catch (err: unknown) {\n if (err && typeof err === 'object' && 'code' in err && err.code === 'ENOENT') {\n return new Response(`File not found: ${url}`, {\n status: 404,\n statusText: 'Not Found',\n });\n }\n throw err;\n }\n }\n\n return new Response('Not found', { status: 404 });\n }),\n );\n}\n\nexport function setCurrent(selector: string): void {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n currentComponentId = component.id;\n}\n\nexport function get<T = unknown>(selector: string): T {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n return (node?.extractedValue ?? null) as T;\n}\n\nexport function set<T = unknown>(selector: string, value: T): void {\n ComponentTreeApi.setNodeRawSchema(currentComponentId, selector, value);\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n if (node) {\n activateStructure(node);\n }\n}\n\nexport async function run(selector: string, ...args: unknown[]): Promise<unknown> {\n const commandPromise = ComponentTreeApi.runCommandNode(currentComponentId, selector, ...args) as Promise<unknown>;\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n commandPromise.catch(() => {});\n await vi.runAllTimersAsync();\n return commandPromise;\n}\n\nexport function select(selector: string): TComponent {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n return component;\n}\n\nexport function selectAll(selector: string): TComponent[] {\n const components = selector.split(',').flatMap((s) => ComponentTreeApi.findComponents(currentComponentId, s.trim()));\n if (!components.length) {\n throw new Error(`Components not found: ${selector}`);\n }\n return components;\n}\n\nexport function evaluating(selector: string): boolean {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n return node?.evaluating ?? false;\n}\n\nexport function settled(selector: string): boolean {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n return node?.settled ?? false;\n}\n\nexport function ready(selector: string): boolean {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n if (!node) return false;\n return node.settled && !node.evaluating && !node.failed;\n}\n\nexport function error(selector: string): unknown {\n const node = ComponentTreeApi.findNode(currentComponentId, selector);\n return node?.error ?? null;\n}\n\nexport function running(selector: string): boolean {\n return ComponentTreeApi.isCommandRunning(currentComponentId, selector);\n}\n\nexport function getComponentType(selector: string): string {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n return component.componentType;\n}\n\nexport function getId(selector: string): ComponentId {\n const component = ComponentTreeApi.findComponent(currentComponentId, selector);\n if (!component) {\n throw new Error(`Component not found: ${selector}`);\n }\n return component.id;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["fs"],"mappings":";;;;;;AAAA;AAyBA,IAAI,kBAA+B;AAE5B,eAAe,UAAU,CAAC,SAA0B,EAAA;IACzD,EAAE,CAAC,aAAa,EAAE;AAElB,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,EAAE;;;AAI9C,IAAA,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACjD,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;AAC5C,QAAA,WAAW,EAAE;;IAGf,MAAM,GAAG,GAAG,WAAW;AACvB,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU;AACxC,IAAA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU;IACtC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,CAAC;AAElE,IAAA,MAAM,aAAa,CAAC,SAAS,CAAC;AAE9B,IAAA,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;AACjE,IAAA,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;IAEzD,YAAY,CAAC,IAAI,CAAC;AAClB,IAAA,MAAM,EAAE,CAAC,iBAAiB,EAAE;AAE5B,IAAA,kBAAkB,GAAG,IAAI,CAAC,cAA6B;AACzD;AAEM,SAAU,cAAc,CAAC,YAAoB,EAAA;AACjD,IAAA,IAAI;QACF,MAAM,OAAO,GAA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