Skip to content

Conversation

@ismailsunni
Copy link
Contributor

@ismailsunni ismailsunni commented Oct 17, 2025

Copy link
Contributor

Copilot AI left a comment

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 JavaScript files to TypeScript to improve type safety across the codebase. The changes convert a pnpm workspace update script and an external layers provider checking script from JavaScript to TypeScript, along with adding proper type annotations and updating import statements.

  • Migrated update-pnpm-workspace.js to TypeScript with comprehensive interface definitions
  • Converted check-external-layers-providers script to TypeScript with proper type annotations
  • Updated package dependencies and script references to support TypeScript execution

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/update-pnpm-workspace.ts Converted from JS to TS with interface definitions and type annotations
packages/viewer/src/modules/menu/components/advancedTools/ImportCatalogue/utils.js Added new utility functions for WMS/WMTS URL detection and processing
packages/viewer/scripts/check-external-layers-providers.ts Migrated from JS to TS with type annotations and updated API imports
packages/viewer/package.json Updated script reference to use .ts extension
package.json Updated workspace script to use tsx and added TypeScript dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

/**
* Checks if the URL is a WMTS url
*
* @param {string} urlreturn SetWmsUrlParameters(new URL(provider), language)
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The JSDoc comment contains malformed text. It appears to include code (urlreturn SetWmsUrlParameters(new URL(provider), language)) that should be just the parameter description.

Suggested change
* @param {string} urlreturn SetWmsUrlParameters(new URL(provider), language)
* @param {string} url URL to check

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +27
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import yargs from 'yargs'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

Using @ts-ignore comments to suppress TypeScript errors for yargs imports suggests missing type definitions. Consider installing @types/yargs or using proper TypeScript-compatible alternatives instead of suppressing type checking.

Suggested change
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import yargs from 'yargs'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import yargs from 'yargs'

Copilot uses AI. Check for mistakes.
.alias('h', 'help').argv

function setupAxiosRetry() {
/* eslint-disable @typescript-eslint/no-explicit-any */
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

Disabling the no-explicit-any rule globally for the entire file reduces type safety benefits of TypeScript. Consider defining proper interfaces for the objects being used instead of relying on 'any' types.

Copilot uses AI. Check for mistakes.
redirectHeaders,
checkProviderResponseContentGetMap
)
if (getTileUrl) {
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

[nitpick] The conditional check for getTileUrl wraps the entire fetch and response handling logic, but the corresponding closing brace is at line 206. This creates deeply nested code that could be refactored for better readability by using early returns or separate functions.

Copilot uses AI. Check for mistakes.
@ismailsunni ismailsunni force-pushed the feat-pb-1383-migrate-script branch from 7831fee to 32fcb27 Compare October 17, 2025 16:52
@ismailsunni ismailsunni marked this pull request as draft October 17, 2025 16:53
- Migrated the translation script
- Also started reworking the external provider script by scrapping as many 'any' as possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants