[PR #779] Update index.d.ts to use Types namespace instead of Types export #784

Open
opened 2025-10-31 15:21:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/moghtech/komodo/pull/779
Author: @chrishoage
Created: 8/28/2025
Status: 🔄 Open

Base: mainHead: komodo_action_sidecar


📝 Commits (1)

  • 51472c1 Update index.d.ts to use Types namespace instead of Types export

📊 Changes

7 files changed (+18102 additions, -4 deletions)

View changed files

📝 bin/core/src/ts_client.rs (+2 -0)
📝 client/core/ts/generate_types.mjs (+5 -0)
client/core/ts/src/types_namespace.ts (+9033 -0)
frontend/public/client/types_namespace.d.ts (+9052 -0)
frontend/public/client/types_namespace.js (+1 -0)
📝 frontend/public/index.d.ts (+2 -3)
📝 frontend/src/monaco/init.ts (+7 -1)

📄 Description

Description

Relates to https://github.com/moghtech/komodo/issues/778

This PR updates the index.d.ts file which defines the global variables and available types to use a namespace instead of an export of the types.

This better allows Deno to pick up the types for use (observe the deno.d.ts file uses a namespace for Deno in the same way

While having both types.ts and types_namespace.ts is a bit unfortunate, these files are automatically generated so they will always stay up to date.

This change unlocks the future for Action resource syncs since they can now be type checked outside of Komodo Core.

This PR was largely to demonstrate the steps shown in the linked GitHub issue. Feel free to either push to this branch directly, or wait as long as you want until time can be made to do the rust half of the ticket (my rust skills are not sharp enough to make the change

Steps to Test

  1. Build Komodo and start server
  2. Create file in a Deno enabled workspace with the following contents
/// <reference types="http://localhost:9120/index.d.ts" />

// Run actions using the pre initialized 'komodo' client.
const version: Types.GetVersionResponse = await komodo.read("GetVersion", {});
console.log("🦎 Komodo version:", version.version, "🦎\n");

// Access arguments using the 'ARGS' object.
console.log(ARGS);

Trigger deno to cache the imports (right click menu / action menu in VS Code)

Observe types work in editor

  1. Do the same for an action in the Komodo UI
  2. Ensure types correctly display

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/779 **Author:** [@chrishoage](https://github.com/chrishoage) **Created:** 8/28/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `komodo_action_sidecar` --- ### 📝 Commits (1) - [`51472c1`](https://github.com/moghtech/komodo/commit/51472c1be78ee505f2b2c083ee070b5081271f34) Update index.d.ts to use Types namespace instead of Types export ### 📊 Changes **7 files changed** (+18102 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `bin/core/src/ts_client.rs` (+2 -0) 📝 `client/core/ts/generate_types.mjs` (+5 -0) ➕ `client/core/ts/src/types_namespace.ts` (+9033 -0) ➕ `frontend/public/client/types_namespace.d.ts` (+9052 -0) ➕ `frontend/public/client/types_namespace.js` (+1 -0) 📝 `frontend/public/index.d.ts` (+2 -3) 📝 `frontend/src/monaco/init.ts` (+7 -1) </details> ### 📄 Description ## Description Relates to https://github.com/moghtech/komodo/issues/778 This PR updates the index.d.ts file which defines the global variables and available types to use a namespace instead of an export of the types. This better allows Deno to pick up the types for use (observe the deno.d.ts file uses a namespace for Deno in the same way While having both `types.ts` and `types_namespace.ts` is a bit unfortunate, these files are automatically generated so they will always stay up to date. This change[ unlocks the future for Action resource syncs](https://github.com/moghtech/komodo/issues/778) since they can now be type checked outside of Komodo Core. This PR was largely to demonstrate the steps shown in the linked GitHub issue. Feel free to either push to this branch directly, or wait as long as you want until time can be made to do the rust half of the ticket (my rust skills are not sharp enough to make the change ## Steps to Test 1. Build Komodo and start server 2. Create file in a Deno enabled workspace with the following contents ```ts /// <reference types="http://localhost:9120/index.d.ts" /> // Run actions using the pre initialized 'komodo' client. const version: Types.GetVersionResponse = await komodo.read("GetVersion", {}); console.log("🦎 Komodo version:", version.version, "🦎\n"); // Access arguments using the 'ARGS' object. console.log(ARGS); ``` Trigger deno to cache the imports (right click menu / action menu in VS Code) Observe types work in editor 3. Do the same for an action in the Komodo UI 4. Ensure types correctly display --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the
pull-request
label 2025-10-31 15:21:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#784
No description provided.