]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Upgrade typescript
authorJeremy Davis <jeremy.davis@sonarsource.com>
Tue, 18 Oct 2022 09:04:08 +0000 (11:04 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 19 Oct 2022 20:03:07 +0000 (20:03 +0000)
server/sonar-docs/package.json
server/sonar-docs/yarn.lock
server/sonar-web/package.json
server/sonar-web/src/main/js/components/controls/Select.tsx
server/sonar-web/src/main/js/components/controls/__tests__/Select-test.tsx
server/sonar-web/src/main/js/helpers/mocks/react-select.ts
server/sonar-web/src/main/js/helpers/query.ts
server/sonar-web/yarn.lock

index 4482e180a8364dbb627372e7f65a0bafb6a2af56..6932214ca0c2c93083a254945a40d3401c6bb55a 100644 (file)
@@ -57,7 +57,7 @@
     "prettier": "1.19.1",
     "react-test-renderer": "16.8.5",
     "remark": "11.0.2",
-    "typescript": "4.6.3",
+    "typescript": "4.8.4",
     "unist-util-visit": "2.0.2"
   },
   "scripts": {
index 2763c65e1c338b7e2574981f9241eee088789291..302c6da08c66549cd23bd0b026b6cbd35878973e 100644 (file)
@@ -663,6 +663,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@babel/helper-string-parser@npm:^7.19.4":
+  version: 7.19.4
+  resolution: "@babel/helper-string-parser@npm:7.19.4"
+  checksum: b2f8a3920b30dfac81ec282ac4ad9598ea170648f8254b10f475abe6d944808fb006aab325d3eb5a8ad3bea8dfa888cfa6ef471050dae5748497c110ec060943
+  languageName: node
+  linkType: hard
+
 "@babel/helper-validator-identifier@npm:^7.10.4":
   version: 7.10.4
   resolution: "@babel/helper-validator-identifier@npm:7.10.4"
@@ -677,6 +684,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@babel/helper-validator-identifier@npm:^7.19.1":
+  version: 7.19.1
+  resolution: "@babel/helper-validator-identifier@npm:7.19.1"
+  checksum: 0eca5e86a729162af569b46c6c41a63e18b43dbe09fda1d2a3c8924f7d617116af39cac5e4cd5d431bb760b4dca3c0970e0c444789b1db42bcf1fa41fbad0a3a
+  languageName: node
+  linkType: hard
+
 "@babel/helper-validator-option@npm:^7.16.7":
   version: 7.16.7
   resolution: "@babel/helper-validator-option@npm:7.16.7"
@@ -2031,6 +2045,17 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@babel/types@npm:^7.15.4":
+  version: 7.19.4
+  resolution: "@babel/types@npm:7.19.4"
+  dependencies:
+    "@babel/helper-string-parser": ^7.19.4
+    "@babel/helper-validator-identifier": ^7.19.1
+    to-fast-properties: ^2.0.0
+  checksum: 4032f6407093f80dd4f4764be676f7527d2a5c0381586967cd79683cf8af01cdc16745a381b9cef045f702f0c9b0dffd880d84ee55dad59ba01bd23d5d52a8e0
+  languageName: node
+  linkType: hard
+
 "@babel/types@npm:^7.16.7, @babel/types@npm:^7.17.0, @babel/types@npm:^7.3.3":
   version: 7.17.0
   resolution: "@babel/types@npm:7.17.0"
@@ -9349,6 +9374,17 @@ __metadata:
   languageName: node
   linkType: hard
 
+"fs-extra@npm:^10.1.0":
+  version: 10.1.0
+  resolution: "fs-extra@npm:10.1.0"
+  dependencies:
+    graceful-fs: ^4.2.0
+    jsonfile: ^6.0.1
+    universalify: ^2.0.0
+  checksum: dc94ab37096f813cc3ca12f0f1b5ad6744dfed9ed21e953d72530d103cea193c2f81584a39e9dee1bea36de5ee66805678c0dddc048e8af1427ac19c00fffc50
+  languageName: node
+  linkType: hard
+
 "fs-extra@npm:^8.1.0":
   version: 8.1.0
   resolution: "fs-extra@npm:8.1.0"
@@ -19025,7 +19061,7 @@ fsevents@~2.1.2:
     react-typography: 0.16.20
     rehype-react: 6.1.0
     remark: 11.0.2
-    typescript: 4.6.3
+    typescript: 4.8.4
     typography: 0.16.21
     unist-util-visit: 2.0.2
   languageName: unknown
@@ -20334,23 +20370,23 @@ fsevents@~2.1.2:
   languageName: node
   linkType: hard
 
-"typescript@npm:4.6.3":
-  version: 4.6.3
-  resolution: "typescript@npm:4.6.3"
+"typescript@npm:4.8.4":
+  version: 4.8.4
+  resolution: "typescript@npm:4.8.4"
   bin:
     tsc: bin/tsc
     tsserver: bin/tsserver
-  checksum: 255bb26c8cb846ca689dd1c3a56587af4f69055907aa2c154796ea28ee0dea871535b1c78f85a6212c77f2657843a269c3a742d09d81495b97b914bf7920415b
+  checksum: 3e4f061658e0c8f36c820802fa809e0fd812b85687a9a2f5430bc3d0368e37d1c9605c3ce9b39df9a05af2ece67b1d844f9f6ea8ff42819f13bcb80f85629af0
   languageName: node
   linkType: hard
 
-"typescript@patch:typescript@4.6.3#~builtin<compat/typescript>":
-  version: 4.6.3
-  resolution: "typescript@patch:typescript@npm%3A4.6.3#~builtin<compat/typescript>::version=4.6.3&hash=bda367"
+"typescript@patch:typescript@4.8.4#~builtin<compat/typescript>":
+  version: 4.8.4
+  resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=701156"
   bin:
     tsc: bin/tsc
     tsserver: bin/tsserver
-  checksum: 6bf45caf847062420592e711bc9c28bf5f9a9a7fa8245343b81493e4ededae33f1774009d1234d911422d1646a2c839f44e1a23ecb111b40a60ac2ea4c1482a8
+  checksum: 301459fc3eb3b1a38fe91bf96d98eb55da88a9cb17b4ef80b4d105d620f4d547ba776cc27b44cc2ef58b66eda23fe0a74142feb5e79a6fb99f54fc018a696afa
   languageName: node
   linkType: hard
 
index 9a20370065fdc0a86f7ee233ca14efc3c497e73f..f8ea8460bb2ae85b0f5bae35bb68ae1393b44934 100644 (file)
     "prettier": "1.19.1",
     "react-select-event": "5.5.1",
     "testing-library-selector": "0.2.1",
-    "typescript": "4.6.3",
+    "typescript": "4.8.4",
     "whatwg-fetch": "3.6.2"
   },
   "resolutions": {
index af43b811421222ca14f91cdd2e0ed681de79cfa3..55a994fdd59e346dc235299dac3bbffc64bf18b3 100644 (file)
@@ -96,12 +96,15 @@ export function multiValueRemove<
   return <div {...props.innerProps}>×</div>;
 }
 
-export type SelectOptionProps<T, IsMulti extends boolean> = OptionProps<T, IsMulti>;
+export type SelectOptionProps<T extends OptionTypeBase, IsMulti extends boolean> = OptionProps<
+  T,
+  IsMulti
+>;
 export const SelectOption = components.Option;
 
 /* Keeping it as a class to simplify a dozen tests */
 export default class Select<
-  Option,
+  Option extends OptionTypeBase,
   IsMulti extends boolean = false,
   Group extends GroupTypeBase<Option> = GroupTypeBase<Option>
 > extends React.Component<NamedProps<Option, IsMulti, Group> & StyleExtensionProps> {
@@ -124,7 +127,7 @@ export default class Select<
 }
 
 export function CreatableSelect<
-  Option,
+  Option extends OptionTypeBase,
   isMulti extends boolean,
   Group extends GroupTypeBase<Option> = GroupTypeBase<Option>
 >(props: AsyncCreatableProps<Option, isMulti, Group>) {
@@ -144,7 +147,7 @@ export function CreatableSelect<
 }
 
 export function SearchSelect<
-  Option,
+  Option extends OptionTypeBase,
   IsMulti extends boolean,
   Group extends GroupTypeBase<Option> = GroupTypeBase<Option>
 >(props: NamedProps<Option, IsMulti, Group> & AsyncProps<Option, Group> & StyleExtensionProps) {
@@ -165,7 +168,11 @@ export function SearchSelect<
   );
 }
 
-export function selectStyle<Option, IsMulti extends boolean, Group extends GroupTypeBase<Option>>(
+export function selectStyle<
+  Option extends OptionTypeBase,
+  IsMulti extends boolean,
+  Group extends GroupTypeBase<Option>
+>(
   props?: NamedProps<Option, IsMulti, Group> & AsyncProps<Option, Group> & StyleExtensionProps
 ): StylesConfig<Option, IsMulti, Group> {
   return {
index 840cef0a826d7aedc34548482a825092a68d6c36..3360ccd64a1c8c885245659c44e56d01c95e2f93 100644 (file)
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
-import { components, GroupTypeBase, InputProps, Props as ReactSelectProps } from 'react-select';
+import {
+  components,
+  GroupTypeBase,
+  InputProps,
+  OptionTypeBase,
+  Props as ReactSelectProps
+} from 'react-select';
 import { LoadingIndicatorProps } from 'react-select/src/components/indicators';
 import { MultiValueRemoveProps } from 'react-select/src/components/MultiValue';
 import { mockReactSelectIndicatorProps } from '../../../helpers/mocks/react-select';
@@ -75,7 +81,7 @@ describe('Select', () => {
   });
 
   function shallowRender<
-    Option,
+    Option extends OptionTypeBase,
     IsMulti extends boolean = false,
     Group extends GroupTypeBase<Option> = GroupTypeBase<Option>
   >(props: Partial<ReactSelectProps<Option, IsMulti, Group>> = {}) {
index d25e6abf791b52623168faf0ad52d6cc2ca781f2..17f4562c4377eb8b788303ed522f8f98af5d94fd 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { ControlProps, GroupTypeBase, IndicatorProps, InputProps, OptionProps } from 'react-select';
+import {
+  ControlProps,
+  GroupTypeBase,
+  IndicatorProps,
+  InputProps,
+  OptionProps,
+  OptionTypeBase
+} from 'react-select';
 
 export function mockReactSelectOptionProps<
-  OptionType,
+  OptionType extends OptionTypeBase,
   IsMulti extends boolean,
   GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
 >(
@@ -38,7 +45,7 @@ export function mockReactSelectInputProps(): InputProps {
 }
 
 export function mockReactSelectControlProps<
-  OptionType,
+  OptionType extends OptionTypeBase,
   IsMulti extends boolean,
   GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
 >(): ControlProps<OptionType, IsMulti, GroupType> {
@@ -46,7 +53,7 @@ export function mockReactSelectControlProps<
 }
 
 export function mockReactSelectIndicatorProps<
-  OptionType,
+  OptionType extends OptionTypeBase,
   IsMulti extends boolean,
   GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
 >(_option: OptionType): IndicatorProps<OptionType, IsMulti, GroupType> {
index 19eaf60e319e66d832e26d37e010fb0915468bfb..2cadbc21282ffc7fc4a3cc3ac35bcf6aca18d70b 100644 (file)
@@ -85,7 +85,7 @@ export function parseAsOptionalArray<T>(
 }
 
 export function serializeDate(value?: Date, serializer = toNotSoISOString): string | undefined {
-  if (value != null && value.toISOString) {
+  if (value != null) {
     return serializer(value);
   }
   return undefined;
index 6d63d13f09339648fab4df619e5f9cb5c5d47ffc..542215bd8838bf65af0e30261d5e3bbef39f3895 100644 (file)
@@ -2409,7 +2409,7 @@ __metadata:
     remark-react: 7.0.1
     remark-rehype: 6.0.0
     testing-library-selector: 0.2.1
-    typescript: 4.6.3
+    typescript: 4.8.4
     unist-util-visit: 2.0.2
     valid-url: 1.0.9
     whatwg-fetch: 3.6.2
@@ -10766,23 +10766,23 @@ resolve@^1.3.2:
   languageName: node
   linkType: hard
 
-"typescript@npm:4.6.3":
-  version: 4.6.3
-  resolution: "typescript@npm:4.6.3"
+"typescript@npm:4.8.4":
+  version: 4.8.4
+  resolution: "typescript@npm:4.8.4"
   bin:
     tsc: bin/tsc
     tsserver: bin/tsserver
-  checksum: 255bb26c8cb846ca689dd1c3a56587af4f69055907aa2c154796ea28ee0dea871535b1c78f85a6212c77f2657843a269c3a742d09d81495b97b914bf7920415b
+  checksum: 3e4f061658e0c8f36c820802fa809e0fd812b85687a9a2f5430bc3d0368e37d1c9605c3ce9b39df9a05af2ece67b1d844f9f6ea8ff42819f13bcb80f85629af0
   languageName: node
   linkType: hard
 
-"typescript@patch:typescript@4.6.3#~builtin<compat/typescript>":
-  version: 4.6.3
-  resolution: "typescript@patch:typescript@npm%3A4.6.3#~builtin<compat/typescript>::version=4.6.3&hash=701156"
+"typescript@patch:typescript@4.8.4#~builtin<compat/typescript>":
+  version: 4.8.4
+  resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=701156"
   bin:
     tsc: bin/tsc
     tsserver: bin/tsserver
-  checksum: 6bf45caf847062420592e711bc9c28bf5f9a9a7fa8245343b81493e4ededae33f1774009d1234d911422d1646a2c839f44e1a23ecb111b40a60ac2ea4c1482a8
+  checksum: 301459fc3eb3b1a38fe91bf96d98eb55da88a9cb17b4ef80b4d105d620f4d547ba776cc27b44cc2ef58b66eda23fe0a74142feb5e79a6fb99f54fc018a696afa
   languageName: node
   linkType: hard