-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tools): add graph and graph search #614
Conversation
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
Signed-off-by: Matt Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome.
(() => { | ||
testClass.getSuperType(); | ||
}).should.throw('Scalars do not have super types.'); | ||
should.equal(testClass.getSuperType(), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why return null here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I'm adding a test to increase coverage which reflects the current implementation.
This is one of the now deprecated functions. It should go away in the next major release, IMO
Signed-off-by: Matt Roberts <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Note that markdown-transform uses the https://www.npmjs.com/package/dijkstrajs library. Perhaps we can refactor this (or that)?
Adds utilities to allow navigation of the dependency tree of a model as a graph. This allows for more advanced operations like "tree-shaking" (see
findConnectedGraph
), and finding unused imports (not implemented in this PR).Changes
filter
functions toBaseModelManager
andModelFile
to allow filtering declarations based on the graph.ConcertoGraphVisitor
andDirectedGraph
toconcerto-tools
, and testsDeclaration
type toconcerto-core
. This is a new Class betweenClassDeclaration
/ScalarDeclaration
andDecorated
. This allows us to refactor common functions in the base class. This better matches the metamodel, will allow for better docs, better usage in TypeScript clients, and better extensibility to aggregate types in the future. We use this new type in the definition of the filter function.Flags
ClassDeclaration
/ScalarDeclaration
, I noticed thatScalarDeclaration
has several functions that should only appear onClassDeclaration
. I've marked them as@deprecated
.Author Checklist
--signoff
option of git commit.main
fromfork:branchname