Skip to content

Migrate dashboard backend modules from ESM .mjs to strict TypeScript#42321

Merged
pelikhan merged 5 commits into
mainfrom
copilot/update-dashboard-mjs-to-typescript
Jun 29, 2026
Merged

Migrate dashboard backend modules from ESM .mjs to strict TypeScript#42321
pelikhan merged 5 commits into
mainfrom
copilot/update-dashboard-mjs-to-typescript

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

This updates the Copilot dashboard extension backend modules under .github/extensions/agentic-workflows-dashboard from .mjs sources to TypeScript and resolves strict-mode typing gaps introduced by the migration. Runtime module wiring is preserved by updating imports and emitting .js artifacts consumed by extension.mjs.

  • Module migration

    • Converted:
      • dashboard-cli.mjsdashboard-cli.ts
      • dashboard-config.mjsdashboard-config.ts
      • dashboard-data.mjsdashboard-data.ts
      • dashboard-logs.mjsdashboard-logs.ts
      • usage-forecast.mjsusage-forecast.ts
    • Removed original .mjs source files for these modules.
  • Type system hardening

    • Added explicit interfaces/types for:
      • logs options + continuations
      • CLI runner status and exec error shape
      • forecast payloads and usage summaries
      • cache entries and command result contracts
    • Resolved strict-mode issues (noImplicitAny, exact optional property handling, nullable parse paths, index safety).
  • Runtime import and artifact alignment

    • Updated extension.mjs to import compiled .js modules.
    • Added generated runtime artifacts:
      • dashboard-cli.js
      • dashboard-config.js
      • dashboard-data.js
      • dashboard-logs.js
      • usage-forecast.js
  • Config/dependency updates

    • Extended extension TS config to include migrated root-level TS modules.
    • Added @types/node for Node builtin module typing.
// extension.mjs now consumes emitted JS modules from TS sources
import { createGhAwRunnerWithStatus } from "./dashboard-cli.js";
import { DEFAULT_LOG_TIMEOUT_MINUTES, DEFAULT_RUN_COUNT } from "./dashboard-config.js";
import { createDashboardDataAccess } from "./dashboard-data.js";

Copilot AI and others added 2 commits June 29, 2026 18:48
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Migrate dashboard .mjs modules to TypeScript Migrate dashboard backend modules from ESM .mjs to strict TypeScript Jun 29, 2026
Copilot AI requested a review from pelikhan June 29, 2026 18:53
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update gitattributes to mark .js files as lang generated, favor local on merge

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Triage — §28395315609

Field Value
Category refactor
Risk medium
Score 41 / 100
Action batch_review
Batch

Score breakdown: impact 20 + urgency 8 + quality 13

Dashboard backend ESM → TypeScript migration. 19 files (+1096/-142). Draft with no CI yet. Well-described with type interfaces, strict-mode fixes, and artifact alignment. Medium risk — no behavior change but broad TS migration. Batch review when CI available.

Generated by 🔧 PR Triage Agent · 99.1 AIC · ⌖ 11.6 AIC · ⊞ 5.4K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update gitattributes to mark .js files as lang generated, favor local on merge. Move all typescript sources to the src folder.

Copilot stopped work on behalf of pelikhan due to an error June 29, 2026 19:12
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update gitattributes to mark .js files as lang generated, favor local on merge. Move all typescript sources to the src folder.

@pelikhan pelikhan marked this pull request as ready for review June 29, 2026 19:46
Copilot AI review requested due to automatic review settings June 29, 2026 19:46
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update gitattributes to mark .js files as lang generated, favor local on merge. Move all typescript sources to the src folder.

Updated in 48e02ff: .gitattributes now marks .github/extensions/agentic-workflows-dashboard/*.js as generated with merge=ours, and the migrated dashboard TypeScript backend sources were moved into src/ with corresponding import/tsconfig/test updates.

@pelikhan pelikhan merged commit 77306c1 into main Jun 29, 2026
@pelikhan pelikhan deleted the copilot/update-dashboard-mjs-to-typescript branch June 29, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the Copilot “agentic workflows dashboard” extension backend modules from ESM .mjs sources to strict TypeScript, updates runtime imports to consume emitted .js modules, and hardens typing/contracts across logs, usage summaries, and CLI execution.

Changes:

  • Converted dashboard backend helper modules to TypeScript with explicit interfaces and stricter parsing/normalization.
  • Updated the extension runtime (extension.mjs) and vitest tests to import the generated .js backend modules.
  • Extended the extension TypeScript configuration and dependencies to support strict Node typings.
Show a summary per file
File Description
.github/extensions/agentic-workflows-dashboard/usage-forecast.ts Adds strict TS types and typed helpers for forecast/usage calculations.
.github/extensions/agentic-workflows-dashboard/usage-forecast.js Adds the generated runtime JS module consumed by the extension/tests.
.github/extensions/agentic-workflows-dashboard/tsconfig.json Expands TS typechecking scope to include root-level backend TS modules and Node types.
.github/extensions/agentic-workflows-dashboard/test/usage-forecast.test.ts Updates tests to import the new runtime .js module.
.github/extensions/agentic-workflows-dashboard/test/dashboard-logs.test.ts Updates tests to import the new runtime .js modules.
.github/extensions/agentic-workflows-dashboard/test/dashboard-data.test.ts Updates tests to import the new runtime .js module.
.github/extensions/agentic-workflows-dashboard/test/dashboard-cli.test.ts Updates tests to import the new runtime .js module.
.github/extensions/agentic-workflows-dashboard/package.json Adds @types/node to support Node builtin typing in strict TS.
.github/extensions/agentic-workflows-dashboard/package-lock.json Locks @types/node (and transitive undici-types).
.github/extensions/agentic-workflows-dashboard/extension.mjs Switches backend imports from .mjs to compiled .js modules.
.github/extensions/agentic-workflows-dashboard/dashboard-logs.ts Adds typed logs option parsing/normalization helpers in TS.
.github/extensions/agentic-workflows-dashboard/dashboard-logs.js Adds the generated runtime JS module consumed by the extension/tests.
.github/extensions/agentic-workflows-dashboard/dashboard-data.ts Adds typed data-access layer in TS, including cache/result contracts and parsing errors.
.github/extensions/agentic-workflows-dashboard/dashboard-data.js Adds the generated runtime JS module consumed by the extension/tests.
.github/extensions/agentic-workflows-dashboard/dashboard-config.ts Reintroduces shared config in TS (report windows, defaults) with stricter typing.
.github/extensions/agentic-workflows-dashboard/dashboard-config.js Adds the generated runtime JS module consumed by the extension/tests.
.github/extensions/agentic-workflows-dashboard/dashboard-config.mjs Removes the legacy .mjs config module.
.github/extensions/agentic-workflows-dashboard/dashboard-cli.ts Migrates CLI runner to TS with typed error shape and runner status contract.
.github/extensions/agentic-workflows-dashboard/dashboard-cli.js Adds the generated runtime JS module consumed by the extension/tests.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Files not reviewed (1)
  • .github/extensions/agentic-workflows-dashboard/package-lock.json: Generated file
  • Files reviewed: 19/20 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment on lines 10 to 14
"devDependencies": {
"@types/node": "^26.0.1",
"esbuild": "^0.28.1",
"typescript": "6.0.3",
"vitest": "4.1.9"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants