@terraforge/core 0.0.7 → 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.
package/dist/index.d.ts CHANGED
@@ -42,8 +42,8 @@ declare const interpolate: (literals: TemplateStringsArray, ...placeholders: Inp
42
42
  type URN = `urn:${string}`;
43
43
 
44
44
  declare const nodeMetaSymbol: unique symbol;
45
- type Node<T extends Tag = Tag, I extends State = State, O extends State = State, C extends Config = Config> = {
46
- readonly [nodeMetaSymbol]: Meta<T, I, O, C>;
45
+ type Node<T extends Tag = Tag, O extends State = State> = {
46
+ readonly [nodeMetaSymbol]: Meta<T>;
47
47
  readonly urn: URN;
48
48
  } & O;
49
49
  declare const isNode: (obj: object) => obj is {
@@ -66,14 +66,14 @@ type ResourceConfig = Config & {
66
66
  /** If true, create the replacement before deleting the existing resource. */
67
67
  createBeforeReplace?: boolean;
68
68
  };
69
- type ResourceMeta<I extends State = State, O extends State = State> = Meta<'resource', I, O, ResourceConfig>;
70
- type Resource<I extends State = State, O extends State = State> = O & {
71
- readonly [nodeMetaSymbol]: ResourceMeta<I, O>;
69
+ type ResourceMeta = Meta<'resource', ResourceConfig>;
70
+ type Resource<O extends State = State> = O & {
71
+ readonly [nodeMetaSymbol]: ResourceMeta;
72
72
  readonly urn: URN;
73
73
  };
74
74
  type ResourceClass<I extends State = State, O extends State = State> = {
75
- new (parent: Group, id: string, props: I, config?: ResourceConfig): Resource<I, O>;
76
- get(parent: Group, id: string, physicalId: string): DataSource<I, O>;
75
+ new (parent: Group, id: string, props: I, config?: ResourceConfig): Resource<O>;
76
+ get(parent: Group, id: string, physicalId: string): DataSource<O>;
77
77
  };
78
78
 
79
79
  declare class Stack extends Group {
@@ -87,31 +87,31 @@ type Tag = 'resource' | 'data';
87
87
  type State = Record<string, unknown>;
88
88
  type Config = {
89
89
  /** Specify additional explicit dependencies in addition to the ones in the dependency graph. */
90
- dependsOn?: Resource<any, any>[];
90
+ dependsOn?: Resource[];
91
91
  /** Pass an ID of an explicitly configured provider, instead of using the default provider. */
92
92
  provider?: string;
93
93
  };
94
- type Meta<T extends Tag = Tag, I extends State = State, O extends State = State, C extends Config = Config> = {
94
+ type Meta<T extends Tag = Tag, C extends Config = Config> = {
95
95
  readonly tag: T;
96
96
  readonly urn: URN;
97
97
  readonly logicalId: string;
98
98
  readonly type: string;
99
99
  readonly stack: Stack;
100
100
  readonly provider: string;
101
- readonly input: I;
101
+ readonly input: State;
102
102
  readonly config?: C;
103
103
  readonly dependencies: Set<URN>;
104
- readonly resolve: (data: O) => void;
105
- readonly output: <O>(cb: (data: State) => O) => Output<O>;
104
+ readonly resolve: (data: State) => void;
105
+ readonly output: <V>(cb: (data: State) => V) => Output<V>;
106
106
  };
107
- declare const createMeta: <T extends Tag = Tag, I extends State = State, O extends State = State, C extends Config = Config>(tag: T, provider: string, parent: Group, type: string, logicalId: string, input: I, config?: C) => Meta<T, I, O, C>;
107
+ declare const createMeta: <T extends Tag = Tag, C extends Config = Config>(tag: T, provider: string, parent: Group, type: string, logicalId: string, input: State, config?: C) => Meta<T, C>;
108
108
 
109
- type DataSourceMeta<I extends State = State, O extends State = State> = Meta<'data', I, O>;
110
- type DataSource<I extends State = State, O extends State = State> = {
111
- readonly [nodeMetaSymbol]: DataSourceMeta<I, O>;
109
+ type DataSourceMeta = Meta<'data'>;
110
+ type DataSource<O extends State = State> = {
111
+ readonly [nodeMetaSymbol]: DataSourceMeta;
112
112
  readonly urn: URN;
113
113
  } & O;
114
- type DataSourceFunction<I extends State = State, O extends State = State> = (parent: Group, id: string, input: I, config?: Config) => DataSource<I, O>;
114
+ type DataSourceFunction<I extends State = State, O extends State = State> = (parent: Group, id: string, input: I, config?: Config) => DataSource<O>;
115
115
 
116
116
  declare class Group {
117
117
  readonly parent: Group | undefined;
package/dist/index.js CHANGED
@@ -307,7 +307,7 @@ var createMeta = (tag, provider, parent, type, logicalId, input, config) => {
307
307
  linkMetaDep(dep);
308
308
  }
309
309
  for (const dep of config?.dependsOn ?? []) {
310
- linkMetaDep(dep.$);
310
+ linkMetaDep(getMeta(dep));
311
311
  }
312
312
  return dependencies;
313
313
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraforge/core",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",