@ui-manifest-json/core 0.1.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,8 @@
1
+ export * from './types/dom.js';
2
+ export * from './types/component.js';
3
+ export * from './types/route.js';
4
+ export * from './types/dependency-graph.js';
5
+ export * from './types/manifest.js';
6
+ export { resolveRouteDependencyTree } from './resolve-tree.js';
7
+ export type { MatchFn } from './resolve-tree.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from './types/dom.js';
2
+ export * from './types/component.js';
3
+ export * from './types/route.js';
4
+ export * from './types/dependency-graph.js';
5
+ export * from './types/manifest.js';
6
+ export { resolveRouteDependencyTree } from './resolve-tree.js';
@@ -0,0 +1,29 @@
1
+ import type { ComponentNode } from './types/component.js';
2
+ import type { RouteDependencyTree } from './types/dependency-graph.js';
3
+ /**
4
+ * Given an element's tag (e.g. "app-app-flow-tab" or a JSX identifier like "UserCard") and the
5
+ * `ComponentNode` whose OWN template is currently being walked (i.e. the file-context that tag
6
+ * appeared in), return the `ComponentNode` it refers to, or undefined if the tag is a plain
7
+ * element / not a known component.
8
+ *
9
+ * The second argument matters: as resolution descends into a spliced child's own template, tags
10
+ * found there must be resolved against THAT child's file, not the route's root file. Angular can
11
+ * ignore it (a selector is a global namespace across the whole app, not file-relative) — React
12
+ * cannot: import bindings are inherently per-file, so a `matchFn` that only ever saw the route
13
+ * root's file would silently fail to resolve anything more than one splice deep. Framework-
14
+ * specific either way; core only calls it.
15
+ */
16
+ export type MatchFn = (tag: string, currentComponent: ComponentNode) => ComponentNode | undefined;
17
+ /**
18
+ * Resolve one route's dependency tree: starting from its root component's own template, replace
19
+ * every element whose tag matches a known component (via `matchFn`) with an annotated splice of
20
+ * that component's own (recursively resolved) template, in place.
21
+ *
22
+ * Cycle detection is path-scoped: a `Set` of component classNames currently on the active
23
+ * resolution stack, pushed on entering a splice and popped on leaving. The same component
24
+ * legitimately appears in multiple unrelated branches of a tree and must be expanded fresh each
25
+ * time — only a component reappearing in its own ancestor chain (direct or indirect
26
+ * self-inclusion) is a cycle, at which point a CycleMarkerNode is emitted instead of recursing.
27
+ */
28
+ export declare function resolveRouteDependencyTree(routePath: string, rootComponent: ComponentNode, matchFn: MatchFn): RouteDependencyTree;
29
+ //# sourceMappingURL=resolve-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-tree.d.ts","sourceRoot":"","sources":["../src/resolve-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAwD,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAE7H;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,KAAK,aAAa,GAAG,SAAS,CAAC;AAElG;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,GACf,mBAAmB,CAIrB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Resolve one route's dependency tree: starting from its root component's own template, replace
3
+ * every element whose tag matches a known component (via `matchFn`) with an annotated splice of
4
+ * that component's own (recursively resolved) template, in place.
5
+ *
6
+ * Cycle detection is path-scoped: a `Set` of component classNames currently on the active
7
+ * resolution stack, pushed on entering a splice and popped on leaving. The same component
8
+ * legitimately appears in multiple unrelated branches of a tree and must be expanded fresh each
9
+ * time — only a component reappearing in its own ancestor chain (direct or indirect
10
+ * self-inclusion) is a cycle, at which point a CycleMarkerNode is emitted instead of recursing.
11
+ */
12
+ export function resolveRouteDependencyTree(routePath, rootComponent, matchFn) {
13
+ const path = [rootComponent.className];
14
+ const tree = (rootComponent.dom ?? []).map(node => resolveNode(node, matchFn, path, rootComponent));
15
+ return { routePath, rootComponent: rootComponent.className, tree };
16
+ }
17
+ function resolveNode(node, matchFn, path, currentComponent) {
18
+ switch (node.type) {
19
+ case 'element': {
20
+ const matched = matchFn(node.el, currentComponent);
21
+ if (!matched) {
22
+ // Plain element (or an unresolvable tag) — keep as-is, but still recurse into children
23
+ // so descendant components further down get spliced. Still within currentComponent's own
24
+ // template, so the context doesn't change.
25
+ return {
26
+ ...node,
27
+ children: node.children.map(child => resolveNode(child, matchFn, path, currentComponent)),
28
+ };
29
+ }
30
+ if (path.includes(matched.className)) {
31
+ const marker = {
32
+ type: 'cycle-detected',
33
+ extraction: 'compiler',
34
+ tag: node.el,
35
+ componentClassName: matched.className,
36
+ cyclePath: [...path],
37
+ };
38
+ return marker;
39
+ }
40
+ path.push(matched.className);
41
+ // Descending into the matched component's OWN template: it becomes the new context, so
42
+ // any tag found within it resolves against ITS file, not the caller's.
43
+ const children = (matched.dom ?? []).map(child => resolveNode(child, matchFn, path, matched));
44
+ path.pop();
45
+ const boundary = {
46
+ type: 'component-boundary',
47
+ extraction: node.extraction,
48
+ tag: node.el,
49
+ componentClassName: matched.className,
50
+ children,
51
+ };
52
+ return boundary;
53
+ }
54
+ case 'template': {
55
+ // Still the same component's own template (an @if/@for/ternary/etc. block doesn't cross a
56
+ // component boundary) — context is unchanged.
57
+ const children = node.children.map(child => resolveNode(child, matchFn, path, currentComponent));
58
+ const branches = node.branches?.map(branch => ({
59
+ ...branch,
60
+ children: branch.children.map(child => resolveNode(child, matchFn, path, currentComponent)),
61
+ }));
62
+ return { ...node, children, ...(branches ? { branches } : {}) };
63
+ }
64
+ case 'text':
65
+ case 'interpolation':
66
+ // Leaf nodes — nothing to splice into.
67
+ return node;
68
+ }
69
+ }
@@ -0,0 +1,40 @@
1
+ import type { DomNode } from './dom.js';
2
+ export type PropertyBindingKind = 'decorator' | 'signal';
3
+ /** An Angular @Input()/@Output() or input()/output() signal. */
4
+ export interface PropertyBinding {
5
+ name: string;
6
+ type?: string;
7
+ required?: boolean;
8
+ kind: PropertyBindingKind;
9
+ alias?: string;
10
+ }
11
+ export type PropSource = 'ts-type' | 'prop-types' | 'unknown';
12
+ /** A React component prop. */
13
+ export interface PropDefinition {
14
+ name: string;
15
+ type?: string;
16
+ required: boolean;
17
+ source: PropSource;
18
+ isEventHandler?: boolean;
19
+ }
20
+ export interface ComponentNode {
21
+ className: string;
22
+ /** Repo-relative path to the file the component is defined in. */
23
+ filePath: string;
24
+ /** Angular only. */
25
+ selector?: string;
26
+ /** Angular only. */
27
+ standalone?: boolean;
28
+ templateUrl?: string;
29
+ inlineTemplate?: boolean;
30
+ styleUrls?: string[];
31
+ /** Angular only; always [] for React components. */
32
+ inputs: PropertyBinding[];
33
+ /** Angular only; always [] for React components. */
34
+ outputs: PropertyBinding[];
35
+ /** React only; undefined for Angular components. */
36
+ props?: PropDefinition[];
37
+ /** Present only when the extractor was run with template/JSX parsing enabled. */
38
+ dom?: DomNode[];
39
+ }
40
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9D,8BAA8B;AAC9B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,oDAAoD;IACpD,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,oDAAoD;IACpD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,oDAAoD;IACpD,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,iFAAiF;IACjF,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;CACjB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ import type { BaseNode, DomNode, ElementNode, InterpolationNode, TemplateNode, TextNode } from './dom.js';
2
+ /**
3
+ * An annotated splice point: the subtree of a descendant component, spliced in where its
4
+ * custom-element tag appeared in the parent's template, wrapped with provenance so consumers
5
+ * (including a future diff engine) can tell a component boundary was crossed without
6
+ * re-running resolution. Deliberately NOT a silently-flattened inline — see docs/schema.md.
7
+ *
8
+ * `children` is `ResolvedNode[]`, not `DomNode[]`: the spliced-in subtree is itself recursively
9
+ * resolved, so it can contain further component-boundary splices and cycle markers, not just
10
+ * raw template nodes.
11
+ */
12
+ export interface ComponentBoundaryNode extends BaseNode {
13
+ type: 'component-boundary';
14
+ /** The tag that was matched, e.g. "app-app-flow-tab" or a React component identifier. */
15
+ tag: string;
16
+ componentClassName: string;
17
+ children: ResolvedNode[];
18
+ }
19
+ /**
20
+ * Emitted instead of recursing when a component reappears in its own ancestor chain
21
+ * (direct or indirect self-inclusion). Never a global "already seen anywhere" cutoff —
22
+ * the same component legitimately appears in multiple unrelated branches and must be
23
+ * expanded each time; only a cycle back to an ancestor is cut off.
24
+ */
25
+ export interface CycleMarkerNode extends BaseNode {
26
+ type: 'cycle-detected';
27
+ tag: string;
28
+ componentClassName: string;
29
+ /** The ancestor className chain (root-first) that produced the cycle. */
30
+ cyclePath: string[];
31
+ }
32
+ /**
33
+ * The resolved-tree counterpart to DomNode: every DomNode variant, but element/template nodes
34
+ * are parameterized so their `children` can also hold component-boundary splices and cycle
35
+ * markers, plus the two new leaf kinds themselves.
36
+ */
37
+ export type ResolvedNode = ElementNode<ResolvedNode> | TextNode | InterpolationNode | TemplateNode<ResolvedNode> | ComponentBoundaryNode | CycleMarkerNode;
38
+ export interface RouteDependencyTree {
39
+ /** Matches RouteNode.path of the route this tree was resolved for. */
40
+ routePath: string;
41
+ rootComponent: string;
42
+ tree: ResolvedNode[];
43
+ }
44
+ export type { DomNode };
45
+ //# sourceMappingURL=dependency-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-graph.d.ts","sourceRoot":"","sources":["../../src/types/dependency-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE1G;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IACrD,IAAI,EAAE,oBAAoB,CAAC;IAC3B,yFAAyF;IACzF,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,gBAAgB,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,yEAAyE;IACzE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,YAAY,CAAC,GACzB,QAAQ,GACR,iBAAiB,GACjB,YAAY,CAAC,YAAY,CAAC,GAC1B,qBAAqB,GACrB,eAAe,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAID,YAAY,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The template/JSX element tree shape both extractors emit.
3
+ *
4
+ * `extraction` is a per-node honesty marker, not a single blended confidence score:
5
+ * - "compiler": produced by a real parser (Angular's Ivy `parseTemplate()`, or TypeScript's
6
+ * JSX AST) that either understands the construct completely or fails loudly. Unconditionally
7
+ * trustworthy.
8
+ * - "heuristic": produced by pattern-matching arbitrary code (React's ternary/`&&`/`.map()`
9
+ * control-flow detection) rather than a grammar built for the purpose. Best-effort — the
10
+ * underlying JS could always route around the pattern in a way that isn't detected.
11
+ */
12
+ export type Extraction = 'compiler' | 'heuristic';
13
+ export interface BaseNode {
14
+ extraction: Extraction;
15
+ }
16
+ /** A bound property/event: e.g. {name: "class.active", expr: "isActive"} or {name: "click", expr: "onClick()"}. */
17
+ export interface BoundExpr {
18
+ name: string;
19
+ expr: string;
20
+ }
21
+ /**
22
+ * `Child` is generic so the resolved dependency-graph tree (packages/core/src/types/
23
+ * dependency-graph.ts) can reuse this exact shape with a wider child type (one that also
24
+ * allows ComponentBoundaryNode/CycleMarkerNode) instead of duplicating every field.
25
+ */
26
+ export interface ElementNode<Child = DomNode> extends BaseNode {
27
+ type: 'element';
28
+ /** Tag name, e.g. "div" or a custom element/component tag like "app-app-flow-tab". */
29
+ el: string;
30
+ /** Static attributes (string-literal values only). */
31
+ attrs: Record<string, string>;
32
+ /** Bound properties, e.g. [value], [class.active], JSX {expr} props. */
33
+ props: BoundExpr[];
34
+ /** Bound events, e.g. (click), JSX onClick={...}. */
35
+ events: BoundExpr[];
36
+ /** Template reference variables (#ref). Angular only. */
37
+ refs?: string[];
38
+ children: Child[];
39
+ }
40
+ export interface TextNode extends BaseNode {
41
+ type: 'text';
42
+ value: string;
43
+ }
44
+ export interface InterpolationNode extends BaseNode {
45
+ type: 'interpolation';
46
+ /** Raw source of the interpolation, e.g. "Hello {{ name }}" or the JSX {expr} source text. */
47
+ interpolation: string;
48
+ }
49
+ export type StructuralKind = '*ngIf' | '*ngFor' | '@if' | '@for' | '@switch' | '@defer' | 'ternary' | '&&' | '.map()';
50
+ export interface TemplateBranch<Child = DomNode> {
51
+ label: string;
52
+ condition?: string;
53
+ children: Child[];
54
+ }
55
+ export interface TemplateNode<Child = DomNode> extends BaseNode {
56
+ type: 'template';
57
+ structural: StructuralKind;
58
+ /** The raw guiding expression: @if condition, ternary test, && LHS, .map() source array, etc. */
59
+ condition?: string;
60
+ /** Present for multi-branch constructs (@if/@else chains, @switch cases, ternaries). */
61
+ branches?: TemplateBranch<Child>[];
62
+ /** The primary/consequent branch's children, kept so every DomNode has a `children` array. */
63
+ children: Child[];
64
+ }
65
+ export type DomNode = ElementNode | TextNode | InterpolationNode | TemplateNode;
66
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/types/dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAElD,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,mHAAmH;AACnH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,QAAQ;IAC5D,IAAI,EAAE,SAAS,CAAC;IAChB,sFAAsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,wEAAwE;IACxE,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,qDAAqD;IACrD,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,IAAI,EAAE,eAAe,CAAC;IACtB,8FAA8F;IAC9F,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,QAAQ,GACR,KAAK,GACL,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,GACT,IAAI,GACJ,QAAQ,CAAC;AAEb,MAAM,WAAW,cAAc,CAAC,KAAK,GAAG,OAAO;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,QAAQ;IAC7D,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;IAC3B,iGAAiG;IACjG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IACnC,8FAA8F;IAC9F,QAAQ,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,QAAQ,GAAG,iBAAiB,GAAG,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { ComponentNode } from './component.js';
2
+ import type { RouteNode } from './route.js';
3
+ import type { RouteDependencyTree } from './dependency-graph.js';
4
+ export declare const SCHEMA_VERSION = "1.0";
5
+ export type Framework = 'angular' | 'react';
6
+ export interface UiManifest {
7
+ schemaVersion: typeof SCHEMA_VERSION;
8
+ framework: Framework;
9
+ /** ISO timestamp of generation. Not diff-relevant on its own — consumers diffing two
10
+ * manifests should ignore this field, since it changes on every run even with no UI change. */
11
+ generatedAt: string;
12
+ routes: RouteNode[];
13
+ components: ComponentNode[];
14
+ /** Present only when the extractor was run with dependency-graph resolution enabled. */
15
+ dependencyGraph?: RouteDependencyTree[];
16
+ /** Soft-failure notices, e.g. "routing pattern unresolved for src/App.tsx". Never used in
17
+ * place of throwing for a hard failure — this is for partial, recoverable extraction gaps. */
18
+ diagnostics?: string[];
19
+ }
20
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,OAAO,cAAc,CAAC;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB;oGACgG;IAChG,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,wFAAwF;IACxF,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACxC;mGAC+F;IAC/F,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB"}
@@ -0,0 +1 @@
1
+ export const SCHEMA_VERSION = '1.0';
@@ -0,0 +1,20 @@
1
+ export interface RouteGuards {
2
+ canActivate?: string[];
3
+ canDeactivate?: string[];
4
+ }
5
+ export type ReactRoutingPattern = 'jsx-routes' | 'router-config' | 'file-based';
6
+ export interface RouteNode {
7
+ path: string;
8
+ /** The resolved lazy-loaded target, e.g. Angular's loadComponent or a React <Route element>. */
9
+ component?: {
10
+ module: string;
11
+ export: string;
12
+ };
13
+ redirectTo?: string;
14
+ pathMatch?: string;
15
+ guards?: RouteGuards;
16
+ children?: RouteNode[];
17
+ /** React only, set at the tree root: which detection strategy produced this tree. */
18
+ routingPattern?: ReactRoutingPattern;
19
+ }
20
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/types/route.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,eAAe,GAAG,YAAY,CAAC;AAEhF,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,qFAAqF;IACrF,cAAc,CAAC,EAAE,mBAAmB,CAAC;CACtC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@ui-manifest-json/core",
3
+ "version": "0.1.0",
4
+ "description": "Shared JSON schema types and dependency-tree resolver for ui-manifest extractors.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "engines": {
8
+ "node": ">=20.6.0"
9
+ },
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc -b",
23
+ "test": "vitest run"
24
+ }
25
+ }