diff --git a/package.json b/package.json index bdb8cd2afa1..8d0eb790d11 100644 --- a/package.json +++ b/package.json @@ -171,7 +171,7 @@ "react-dom": "^18.2.0", "react-frame-component": "^5.0.0", "react-test-renderer": "^16.9.0", - "recast": "^0.20", + "recast": "^0.23", "recursive-readdir": "^2.2.2", "regenerator-runtime": "0.13.3", "rimraf": "^2.6.3", @@ -185,7 +185,7 @@ "tailwindcss": "^3.4.0", "tailwindcss-animate": "^1.0.7", "tempy": "^0.5.0", - "typescript": "^5.3.3", + "typescript": "^5.5.0", "typescript-strict-plugin": "^2.0.0", "verdaccio": "^5.13.0", "walk-object": "^4.0.0", diff --git a/packages/@react-aria/numberfield/src/useNumberField.ts b/packages/@react-aria/numberfield/src/useNumberField.ts index 18ed8a8be01..9411cfb9570 100644 --- a/packages/@react-aria/numberfield/src/useNumberField.ts +++ b/packages/@react-aria/numberfield/src/useNumberField.ts @@ -153,7 +153,7 @@ export function useNumberField(props: AriaNumberFieldProps, state: NumberFieldSt // Browsers and operating systems are quite inconsistent about what keys are available, however. // We choose between numeric and decimal based on whether we allow negative and fractional numbers, // and based on testing on various devices to determine what keys are available in each inputMode. - let hasDecimals = intlOptions.maximumFractionDigits > 0; + let hasDecimals = (intlOptions.maximumFractionDigits ?? 0) > 0; let hasNegative = (state.minValue === undefined || isNaN(state.minValue)) || state.minValue < 0; let inputMode: TextInputDOMProps['inputMode'] = 'numeric'; if (isIPhone()) { diff --git a/packages/@react-spectrum/color/src/ColorEditor.tsx b/packages/@react-spectrum/color/src/ColorEditor.tsx index e4b8789ac2d..416f90f67d4 100644 --- a/packages/@react-spectrum/color/src/ColorEditor.tsx +++ b/packages/@react-spectrum/color/src/ColorEditor.tsx @@ -32,7 +32,7 @@ function ColorEditor(props: SpectrumColorEditorProps, ref: DOMRef
- : getColorChannels(format).map(channel => ( - + ))} {!props.hideAlphaChannel && } diff --git a/packages/@react-spectrum/meter/stories/Meter.stories.tsx b/packages/@react-spectrum/meter/stories/Meter.stories.tsx index b230fb46e09..c54d848c6b6 100644 --- a/packages/@react-spectrum/meter/stories/Meter.stories.tsx +++ b/packages/@react-spectrum/meter/stories/Meter.stories.tsx @@ -12,6 +12,7 @@ import {ComponentMeta, ComponentStoryObj} from '@storybook/react'; import {Meter} from '../'; +import {NumberFormatOptions} from '@internationalized/number'; import React from 'react'; type MeterStory = ComponentStoryObj; @@ -19,7 +20,7 @@ type MeterStory = ComponentStoryObj; const formatOptions = { style: 'currency', currency: 'JPY' -}; +} satisfies NumberFormatOptions; export default { title: 'Meter', diff --git a/packages/react-aria-components/stories/ColorPicker.stories.tsx b/packages/react-aria-components/stories/ColorPicker.stories.tsx index 4d28bda2b43..ba747b73dd4 100644 --- a/packages/react-aria-components/stories/ColorPicker.stories.tsx +++ b/packages/react-aria-components/stories/ColorPicker.stories.tsx @@ -42,14 +42,14 @@ export const ColorPickerExample = (args) => {
- {format === 'hex' + {format === 'hex' ? ( ) : getColorChannels(format).map(channel => ( - + diff --git a/patches/ast-types+0.16.1.patch b/patches/ast-types+0.16.1.patch new file mode 100644 index 00000000000..e88de790a90 --- /dev/null +++ b/patches/ast-types+0.16.1.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/ast-types/lib/main.d.ts b/node_modules/ast-types/lib/main.d.ts +index 9b54fef..5c38539 100644 +--- a/node_modules/ast-types/lib/main.d.ts ++++ b/node_modules/ast-types/lib/main.d.ts +@@ -1,7 +1,7 @@ +-import { ASTNode, Type, AnyType, Field } from "./types"; +-import { NodePath } from "./node-path"; ++import { ASTNode, type Type, AnyType, Field } from "./types"; ++import { type NodePath } from "./node-path"; + import { namedTypes } from "./gen/namedTypes"; +-import { builders } from "./gen/builders"; ++import { type builders } from "./gen/builders"; + import { Visitor } from "./gen/visitor"; + declare const astNodesAreEquivalent: { + (a: any, b: any, problemPath?: any): boolean; diff --git a/scripts/extractExamples.mjs b/scripts/extractExamples.mjs index 42a306202c0..476d10a9911 100644 --- a/scripts/extractExamples.mjs +++ b/scripts/extractExamples.mjs @@ -108,7 +108,7 @@ import ReactDOM from 'react-dom/client'; fs.writeFileSync(`${distDir}/tsconfig.json`, `{ "compilerOptions": { - "target": "es6", + "target": "es2018", "lib": [ "dom", "dom.iterable", diff --git a/tsconfig.json b/tsconfig.json index 3efe232a1c5..07e8c0d4471 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ // we can explicitly declare `any`, but we don't want to infer `any` "noImplicitAny": false, // maybe bump to 'esNext'? - "target": "es6", + "target": "es2018", // allows react jsx in tsx files "jsx": "react", // Eventually turn off, one we have no more assumed default exports. diff --git a/yarn.lock b/yarn.lock index bd7ac077179..d1a2f43d12b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6797,13 +6797,6 @@ ast-types-flow@^0.0.7: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= -ast-types@0.14.2: - version "0.14.2" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd" - integrity sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA== - dependencies: - tslib "^2.0.1" - ast-types@^0.16.1: version "0.16.1" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.16.1.tgz#7a9da1617c9081bc121faafe91711b4c8bb81da2" @@ -19769,14 +19762,15 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -recast@^0.20: - version "0.20.5" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.20.5.tgz#8e2c6c96827a1b339c634dd232957d230553ceae" - integrity sha512-E5qICoPoNL4yU0H0NoBDntNB0Q5oMSNh9usFctYniLBluTthi3RsQVBXIJNbApOlvSwW/RGxIuokPcAc59J5fQ== +recast@^0.23: + version "0.23.9" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.23.9.tgz#587c5d3a77c2cfcb0c18ccce6da4361528c2587b" + integrity sha512-Hx/BGIbwj+Des3+xy5uAtAbdCyqK9y9wbBcDFDYanLS9JnMqf7OeF87HQwUimE87OEc72mr6tkKUKMBBL+hF9Q== dependencies: - ast-types "0.14.2" + ast-types "^0.16.1" esprima "~4.0.0" source-map "~0.6.1" + tiny-invariant "^1.3.3" tslib "^2.0.1" recast@^0.23.1, recast@^0.23.3: @@ -22382,10 +22376,10 @@ typescript-strict-plugin@^2.0.0: ora "^5.4.1" yargs "^16.2.0" -typescript@^5.3.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" - integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== +typescript@^5.5.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507" + integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew== ua-parser-js@0.7.17: version "0.7.17"