mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-06 08:55:40 -05:00
[GH-ISSUE #778] [Feature] Allow resource actions be populated from sidecar file #3563
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @chrishoage on GitHub (Aug 28, 2025).
Original GitHub issue: https://github.com/moghtech/komodo/issues/778
Problem Statement
I have actions which have dependencies, which when viewed in Komodo look like this
From the TOML file itself, it's obviously worse to try to work on and edit the action.
Suggestion
I propose that actions allow defining them as a sidecar file to the resource
Solution
In order to get types to work in the same way that they work inside the Komodo editor, we need to make a few modifications to the client code
types_namespace.tswhich is output alongsidetypes.tsthat wraps the content of that file indeclare namespace Types {}export import Typesfrompublic/index.d.tsimport "./client/types_namespace.d.ts";to the imports ofpublic/index.d.tsThis works for both the Monaco editor using the built in typescript language sever
"Sidecar" action files would look like this
This works because deno (which we are assuming users will write their actions in if they use sidecar files) can load the types via the
/// <reference types="http://localhost:9120/index.d.ts" />. It then recognizes theTypesnamespace and the rest of the globals.Implementation notes
[[VARIABLE]]and secret references would still work just like they do for UI / TOML defined actions (I would anticipate a similar temporary file would be used to execute the action, and the original file would not be used)/// <reference types="http://localhost:9120/index.d.ts" />appears to be harmless to the Monaco editor. You'll get red squiggles under it, but the rest of the types still work