-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add support for partial graphs
- Loading branch information
1 parent
a61bcd3
commit a064e6d
Showing
11 changed files
with
112 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3166,5 +3166,6 @@ | |
"nodeId": "-2007711503" | ||
} | ||
] | ||
} | ||
}, | ||
"status": "complete" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2624,5 +2624,6 @@ | |
"nodeId": "-2007711503" | ||
} | ||
] | ||
} | ||
}, | ||
"status": "complete" | ||
} |
11 changes: 6 additions & 5 deletions
11
packages/core/errors/exceptions/unknown-dependencies.exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { InjectorDependencyContext } from '../../injector/injector'; | ||
import { Module } from '../../injector/module'; | ||
import { UNKNOWN_DEPENDENCIES_MESSAGE } from '../messages'; | ||
import { RuntimeException } from './runtime.exception'; | ||
import { Module } from '../../injector/module'; | ||
|
||
export class UnknownDependenciesException extends RuntimeException { | ||
constructor( | ||
type: string | symbol, | ||
unknownDependencyContext: InjectorDependencyContext, | ||
module?: Module, | ||
public readonly type: string | symbol, | ||
public readonly context: InjectorDependencyContext, | ||
public readonly moduleRef?: Module, | ||
public readonly metadata?: { id: string }, | ||
) { | ||
super(UNKNOWN_DEPENDENCIES_MESSAGE(type, unknownDependencyContext, module)); | ||
super(UNKNOWN_DEPENDENCIES_MESSAGE(type, context, moduleRef)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './graph-inspector'; | ||
export * from './initialize-on-preview.allowlist'; | ||
export * from './partial-graph.host'; | ||
export * from './serialized-graph'; |
15 changes: 15 additions & 0 deletions
15
packages/core/inspector/interfaces/serialized-graph-json.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { SerializedGraphStatus } from '../serialized-graph'; | ||
import { Edge } from './edge.interface'; | ||
import { Entrypoint } from './entrypoint.interface'; | ||
import { Extras } from './extras.interface'; | ||
import { Node } from './node.interface'; | ||
import { SerializedGraphMetadata } from './serialized-graph-metadata.interface'; | ||
|
||
export interface SerializedGraphJson { | ||
nodes: Record<string, Node>; | ||
edges: Record<string, Edge>; | ||
entrypoints: Record<string, Entrypoint<unknown>[]>; | ||
extras: Extras; | ||
status?: SerializedGraphStatus; | ||
metadata?: SerializedGraphMetadata; | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/core/inspector/interfaces/serialized-graph-metadata.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { InjectorDependencyContext } from '../../injector/injector'; | ||
|
||
export interface SerializedGraphMetadata { | ||
cause: { | ||
type: 'unknown-dependencies' | 'unknown'; | ||
context?: InjectorDependencyContext; | ||
moduleId?: string; | ||
nodeId?: string; | ||
error?: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { SerializedGraph } from './serialized-graph'; | ||
|
||
export class PartialGraphHost { | ||
private static partialGraph: SerializedGraph; | ||
|
||
static toJSON() { | ||
return this.partialGraph?.toJSON(); | ||
} | ||
|
||
static toString() { | ||
return this.partialGraph?.toString(); | ||
} | ||
|
||
static register(partialGraph: SerializedGraph) { | ||
this.partialGraph = partialGraph; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters