-
Notifications
You must be signed in to change notification settings - Fork 16
PB-1383: Migrate Script #1435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat-PB-1383-pinia-store
Are you sure you want to change the base?
PB-1383: Migrate Script #1435
Conversation
There was a problem hiding this 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.jsto TypeScript with comprehensive interface definitions - Converted
check-external-layers-providersscript 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) |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
| * @param {string} urlreturn SetWmsUrlParameters(new URL(provider), language) | |
| * @param {string} url URL to check |
| // 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 |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
| // 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' |
| .alias('h', 'help').argv | ||
|
|
||
| function setupAxiosRetry() { | ||
| /* eslint-disable @typescript-eslint/no-explicit-any */ |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
| redirectHeaders, | ||
| checkProviderResponseContentGetMap | ||
| ) | ||
| if (getTileUrl) { |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
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.
7831fee to
32fcb27
Compare
- Migrated the translation script - Also started reworking the external provider script by scrapping as many 'any' as possible.
Test link