fix: Migrate plugin to TypeScript 6.0.2 compatibility - #1427
Conversation
Remove conflicting dependencies from package.json that clash with the core OpenSearch-Dashboards TypeScript 6.0.2 upgrade (PR #11687). Delete yarn.lock so the root lockfile is the source of truth. Verified: bootstrap, build, and unit tests all pass. Signed-off-by: Justin Kim <jungkm@amazon.com>
| version "22.14.0" | ||
| resolved "https://registry.yarnpkg.com/@types/node/-/node-22.14.0.tgz#d3bfa3936fef0dbacd79ea3eb17d521c628bb47e" | ||
| integrity sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA== | ||
| version "25.6.0" |
There was a problem hiding this comment.
guess we should not bump types of node.js version to 25
There was a problem hiding this comment.
I have reverted it. but upon fresh yarn lock updates, the issue will happen again. we are currently on node v22.22.0: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/.nvmrc and so the correct @types/node verison should be 22.19.17.
My first instinct to solve this problem holistiically was to have core OSD dictate what @types/node we use, and upon looking at the code i see that core OSD is using the wrong version: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/package.json#L14014 . This is wrong, so I have opened a PR to update this:
opensearch-project/OpenSearch-Dashboards#11872
But this change will not "update" the external plugin's yarn.lock resolution, because when "yarn osd bootstrap" runs it, it runs it independently on each plugin. So the correct fix would be for each plugin to declare in the dev dependency the "@types/node" version to match my pull request to OSD above (and only include the yarn resolution if it needs it)
I won't make that change as part of this PR, but that is something we can discuss w/ all plugins on adopting. One ramification of this though is that whenever we do decide to update node in the future, all plugins must also update the @types/node independently as well
Per review feedback, keep @types/node at 22.14.0 (undici-types ~6.21.0) instead of bumping to 25.6.0 (undici-types ~7.19.0). Signed-off-by: Justin Kim <jungkm@amazon.com>
Description
Migrate plugin to be compatible with the TypeScript 6.0.2 upgrade in the core OpenSearch-Dashboards repo (PR #11687).
Changes
**/typescriptresolution (was pinned to 4.6.4, conflicts with core 6.0.2)yarn.lockVerification
All three success criteria pass:
yarn osd bootstrap --single-version=loose✅yarn build✅Migration tool: osd-ts6-migration-prompt
Tracker: opensearch-project/OpenSearch-Dashboards#11730
Closes #1424