NuxtJS has Auto Imports. I added a new directory named "workflows" which has code like this:
test_tasks.ts
export const task1 = {
name: "Task 1",
description: "This task does something important.",
dependencies: []
};
export const task2 = {
name: "Task 2",
description: "This task depends on Task 1.",
dependencies: [task1]
};
And my file named "anotherWorkflow.ts":
import { task1, task2 } from './test_tasks';
export const anotherWorkflow = {
name: "Another Workflow",
description: "This workflow does something else.",
author: "Jane Doe",
jobs: [task1, task2]
};
My goal here is that I want to make a system where I can access the auto imported workflows and then build out a front end UI which displays this data in a dependency graph.
For example, I want to have a dropdown which displays a list of workflows which would be tghe "name" property that we see in "anotherWorkflow.ts" I then want it to basically be able to dynamically parse that data and find out which "jobs" there are, and then check those jobs in the test_tasks.ts file to find the dependencies.
I can do this in python using iter_modules() to iterate over all of the imported modules in my python interpreter. However, I'm quite new to nuxt and node and I have not been able to find anything that works. I also cannot import .ts files.
What can I do to achieve the effect I'm looking for?