sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Consider moving dependsOn property to metadata in index file

Open philidem opened this issue 5 years ago • 4 comments

It would be nice to see all of the dependsOn in a a single index.ts file instead of having to open each step file to get that information. I the metadata of the steps should be in index.ts and the step function code should be in separate files.

philidem avatar May 04 '20 22:05 philidem

I also like the approach of having a single index.ts file that pulls together everything and is the one place to find the step meta data. 👍

@charlieduong94 has mentioned creating a j1-integration dependencies kind of command that would show the dependency tree in a visual way, which would be useful in a large integration where even having the metadata in a single file wouldn't help.

This seems to depend on #124. No pun intended.

aiwilliams avatar May 05 '20 00:05 aiwilliams

Thoughts on maybe defining dependencies as a something like Record<string, string[]> where the property name is the step id and the array is the list of dependencies?

ctdio avatar May 05 '20 13:05 ctdio

Thoughts on maybe defining dependencies as a something like Record<string, string[]> where the property name is the step id and the array is the list of dependencies?

Do you mean, instead of having an index.ts file that includes all step metadata, or even were there an index.ts with step metadata, the step's dependencies would be pulled out and moved to this Record?

Supposing the goal has these requirements:

  • See all dependencies in one place
  • See all dependencies right next to each other
  • See all the dependencies in source code (no need for a visualization command)

Then I suppose a Record like that, at the top of an index.ts file, would meet those goals best.

aiwilliams avatar May 05 '20 15:05 aiwilliams

Do you mean, instead of having an index.ts file that includes all step metadata, or even were there an index.ts with step metadata, the step's dependencies would be pulled out and moved to this Record?

Yeah, I was thinking the Record would be in the index.ts file as part of the InvocationConfig. Perhaps under something like integrationStepDependencies to match the integrationSteps property name we have on the config.

ctdio avatar May 05 '20 16:05 ctdio