Migrate dashboard backend modules from ESM .mjs to strict TypeScript#42321
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
.mjs to strict TypeScript
|
@copilot update gitattributes to mark .js files as lang generated, favor local on merge |
🔍 PR Triage — §28395315609
Score breakdown: impact 20 + urgency 8 + quality 13
|
|
@copilot update gitattributes to mark .js files as lang generated, favor local on merge. Move all typescript sources to the src folder. |
|
@copilot update gitattributes to mark .js files as lang generated, favor local on merge. Move all typescript sources to the src folder. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in |
There was a problem hiding this comment.
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.jsbackend 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
| "devDependencies": { | ||
| "@types/node": "^26.0.1", | ||
| "esbuild": "^0.28.1", | ||
| "typescript": "6.0.3", | ||
| "vitest": "4.1.9" |
This updates the Copilot dashboard extension backend modules under
.github/extensions/agentic-workflows-dashboardfrom.mjssources to TypeScript and resolves strict-mode typing gaps introduced by the migration. Runtime module wiring is preserved by updating imports and emitting.jsartifacts consumed byextension.mjs.Module migration
dashboard-cli.mjs→dashboard-cli.tsdashboard-config.mjs→dashboard-config.tsdashboard-data.mjs→dashboard-data.tsdashboard-logs.mjs→dashboard-logs.tsusage-forecast.mjs→usage-forecast.ts.mjssource files for these modules.Type system hardening
noImplicitAny, exact optional property handling, nullable parse paths, index safety).Runtime import and artifact alignment
extension.mjsto import compiled.jsmodules.dashboard-cli.jsdashboard-config.jsdashboard-data.jsdashboard-logs.jsusage-forecast.jsConfig/dependency updates
@types/nodefor Node builtin module typing.