diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 58abad9c..cb18dd64 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,7 +16,7 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [18, 20] + node: [20, 22, 24] runs-on: ubuntu-latest steps: - name: 🛑 Cancel Previous Runs @@ -68,7 +68,7 @@ jobs: - name: ⎔ Setup node uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 24 - name: 📥 Download deps uses: bahmutov/npm-install@v1 diff --git a/package.json b/package.json index 3d3d431c..25a97948 100644 --- a/package.json +++ b/package.json @@ -80,59 +80,60 @@ "react": ">=16.12.0" }, "dependencies": { - "@babel/runtime": "^7.24.5", - "compute-scroll-into-view": "^3.1.0", + "@babel/runtime": "^7.28.4", + "compute-scroll-into-view": "^3.1.1", "prop-types": "^15.8.1", - "react-is": "18.2.0", - "tslib": "^2.6.2" + "react-is": "19.2.1", + "tslib": "^2.8.1" }, "devDependencies": { - "@babel/helpers": "^7.24.5", + "@babel/helpers": "^7.28.4", "@babel/plugin-proposal-private-methods": "^7.18.6", "@babel/plugin-proposal-private-property-in-object": "^7.21.11", - "@cypress/webpack-preprocessor": "^6.0.1", - "@docusaurus/core": "3.3.2", - "@docusaurus/module-type-aliases": "3.3.2", - "@docusaurus/preset-classic": "3.3.2", - "@mdx-js/react": "^3.0.1", - "@rollup/plugin-babel": "^6.0.4", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-typescript": "^11.1.6", - "@testing-library/cypress": "^10.0.1", - "@testing-library/dom": "^10.1.0", - "@testing-library/jest-dom": "^6.4.5", - "@testing-library/preact": "^2.0.1", - "@testing-library/react": "^15.0.7", - "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.12", - "@types/react": "^18.3.2", - "@typescript-eslint/eslint-plugin": "^7.9.0", - "@typescript-eslint/parser": "^7.9.0", + "@cypress/webpack-preprocessor": "^7.0.2", + "@docusaurus/core": "3.9.2", + "@docusaurus/module-type-aliases": "3.9.2", + "@docusaurus/preset-classic": "3.9.2", + "@mdx-js/react": "^3.1.1", + "@rollup/plugin-babel": "^6.1.0", + "@rollup/plugin-commonjs": "^29.0.0", + "@rollup/plugin-typescript": "^12.3.0", + "@testing-library/cypress": "^10.1.0", + "@testing-library/dom": "^10.4.1", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/preact": "^3.2.4", + "@testing-library/react": "^16.3.0", + "@testing-library/user-event": "^14.6.1", + "@types/jest": "^30.0.0", + "@types/prop-types": "^15.7.15", + "@types/react": "^19.2.7", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", "babel-plugin-macros": "^3.1.0", "babel-plugin-no-side-effect-class-properties": "0.0.7", "babel-preset-react-native": "^4.0.1", "buble": "^0.20.0", - "cpy-cli": "^5.0.0", - "cross-env": "^7.0.3", - "cypress": "13.9.0", - "eslint": "^8.56.0", - "eslint-plugin-cypress": "^3.2.0", - "eslint-plugin-react": "7.34.1", - "flow-bin": "^0.236.0", + "cpy-cli": "^6.0.0", + "cross-env": "^10.1.0", + "cypress": "15.7.1", + "eslint": "^8.57.0", + "eslint-plugin-cypress": "^3.6.0", + "eslint-plugin-react": "7.37.5", + "flow-bin": "^0.293.0", "flow-coverage-report": "^0.8.0", "get-pkg-repo": "5.0.0", - "kcd-scripts": "^15.0.1", - "node-polyfill-webpack-plugin": "^3.0.0", + "kcd-scripts": "^16.0.0", + "node-polyfill-webpack-plugin": "^4.1.0", "npm-run-all": "^4.1.5", - "preact": "^10.22.0", - "prism-react-renderer": "^2.3.1", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-native": "^0.74.1", - "react-test-renderer": "18.2.0", - "serve": "^14.2.3", - "start-server-and-test": "^2.0.3", - "typescript": "^5.4.5" + "preact": "^10.28.0", + "prism-react-renderer": "^2.4.1", + "react": "19.2.1", + "react-dom": "19.2.1", + "react-native": "^0.82.1", + "react-test-renderer": "19.2.1", + "serve": "^14.2.5", + "start-server-and-test": "^2.1.3", + "typescript": "^5.9.3" }, "eslintConfig": { "parserOptions": { diff --git a/rollup.config.js b/rollup.config.js index e7c82b01..d3f971a0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,6 +3,9 @@ const {babel} = require('@rollup/plugin-babel') const typescript = require('@rollup/plugin-typescript') const config = require('kcd-scripts/dist/config/rollup.config') +const isPreact = process.env.BUILD_PREACT === 'true' +const tsconfig = isPreact ? 'tsconfig.preact.json' : 'tsconfig.json' + const babelPluginIndex = config.plugins.findIndex( plugin => plugin.name === 'babel', ) @@ -21,10 +24,10 @@ config.plugins[cjsPluginIndex] = commonjs({ }) if (typescriptPluginIndex === -1) { - config.plugins.push(typescript({tsconfig: 'tsconfig.json'})) + config.plugins.push(typescript({tsconfig})) } else { config.plugins[typescriptPluginIndex] = typescript({ - tsconfig: 'tsconfig.json', + tsconfig, }) } diff --git a/src/__tests__/__snapshots__/downshift.get-menu-props.js.snap b/src/__tests__/__snapshots__/downshift.get-menu-props.js.snap index f1485423..4c172f2d 100644 --- a/src/__tests__/__snapshots__/downshift.get-menu-props.js.snap +++ b/src/__tests__/__snapshots__/downshift.get-menu-props.js.snap @@ -1,5 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`not applying the ref prop results in an error 1`] = `downshift: The ref prop "ref" from getMenuProps was not applied correctly on your menu element.`; - -exports[`using a composite component and calling getMenuProps without a refKey results in an error 1`] = `downshift: The ref prop "ref" from getMenuProps was not applied correctly on your menu element.`; diff --git a/src/__tests__/downshift.get-button-props.js b/src/__tests__/downshift.get-button-props.js index b01fd7cb..2bdabf84 100644 --- a/src/__tests__/downshift.get-button-props.js +++ b/src/__tests__/downshift.get-button-props.js @@ -74,11 +74,7 @@ test('getToggleButtonProps returns all given props', () => { const Button = jest.fn(props => ) setup({buttonProps, Button}) expect(Button).toHaveBeenCalledTimes(1) - const context = expect.any(Object) - expect(Button).toHaveBeenCalledWith( - expect.objectContaining(buttonProps), - context, - ) + expect(Button).toHaveBeenCalledWith(expect.objectContaining(buttonProps), undefined) }) // normally this test would be like the others where we render and then simulate a click on the diff --git a/src/__tests__/downshift.get-menu-props.js b/src/__tests__/downshift.get-menu-props.js index a3d0569e..af42c2ab 100644 --- a/src/__tests__/downshift.get-menu-props.js +++ b/src/__tests__/downshift.get-menu-props.js @@ -8,7 +8,7 @@ afterEach(() => console.error.mockRestore()) const Menu = ({innerRef, ...rest}) =>
const RefMenu = React.forwardRef((props, ref) => ) -test('using a composite component and calling getMenuProps without a refKey results in an error', () => { +test('using a composite component and calling getMenuProps without a refKey does not result in error anymore', () => { const MyComponent = () => (