Skip to content

Commit

Permalink
simplify dmno type instance options, skip resolution if override pres…
Browse files Browse the repository at this point in the history
…ent, add allowMissing to ctx.get, add git vendor types autopopulate (#175)
  • Loading branch information
theoephraim authored Dec 16, 2024
1 parent ada2518 commit 1b70c75
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 137 deletions.
6 changes: 6 additions & 0 deletions .changeset/twenty-ladybugs-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@dmno/configraph": patch
"dmno": patch
---

simplify dmno type instance options, skip resolution if override present, add allowMissing to ctx.get, add git vendor types autopopulate
11 changes: 6 additions & 5 deletions packages/configraph/src/config-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const debug = Debug('configraph:node');
//! this might be in the wrong place?
export type ConfigValueOverride = {
sourceType: string;
icon: string;
icon?: string;
sourceLabel?: string;

/** the value of the override */
Expand Down Expand Up @@ -297,12 +297,13 @@ export class ConfigraphNode<NodeMetadata = any> {
// now deal with resolution
// TODO: need to track dependencies used in coerce/validate/etc

// TODO: probably want to _skip_ resolution if we have overrides present?
const itemResolverCtx = new ResolverContext(this.valueResolver || this);
const itemResolverCtx = new ResolverContext((!this.overrides.length && this.valueResolver) || this);
resolverCtxAls.enterWith(itemResolverCtx);


if (this.valueResolver) {
if (this.overrides.length) {
this.debug('using override - marking as resolved');
this.isResolved = true;
} else if (this.valueResolver) {
if (!this.valueResolver.isFullyResolved) {
this.debug('running node resolver');
await this.valueResolver.resolve(itemResolverCtx);
Expand Down
Loading

0 comments on commit 1b70c75

Please # to comment.