From 22b5754f3f8fa959985b1b1646802d72ea630608 Mon Sep 17 00:00:00 2001 From: Sujan Date: Sun, 31 Mar 2024 02:32:33 -0400 Subject: [PATCH] Add support for React 18 --- .package.json.un~ | Bin 0 -> 1468 bytes .rollup.config.demo.js.un~ | Bin 0 -> 557 bytes package.json | 4 +- package.json~ | 129 +++++++++++++++++++++++++++++++++++++ rollup.config.demo.js | 1 + rollup.config.demo.js~ | 56 ++++++++++++++++ 6 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 .package.json.un~ create mode 100644 .rollup.config.demo.js.un~ create mode 100644 package.json~ create mode 100644 rollup.config.demo.js~ diff --git a/.package.json.un~ b/.package.json.un~ new file mode 100644 index 0000000000000000000000000000000000000000..3b2b11c07484e5bb70d145b1e9f4ad4b760069ea GIT binary patch literal 1468 zcmWH`%$*;a=aT=FfoYN2o;B}vnRc()UA)$RE0fQo=syu2=4!=F|J!pCi)Gg_FfcR% zv9tmZC>5n9CYR`@Gyc07SzuLmDT;a~4LR z2qQ!M1&}NdfFwaeAOO;+1;nBt&VL|)%YXz%0hL1l7#$D6(ZRs*RRUV|L3?oLuWV5fFL*W+Mn$KtKxx!L9UImbg87#J*p zm_q>yfNUcWABY*D7)Zg{ATfqCPG$ubh-~}?kN_G0Ng2Y#{sRG6J4|4drg8`XqeC7V g9bYAYW`ly>7>Ggf3W^GN+@i=@0A(0V8=tQN08w`#t^fc4 literal 0 HcmV?d00001 diff --git a/package.json b/package.json index 79d2f7a..42f8fa0 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ }, "peerDependencies": { "prop-types": "^15.5.4", - "react": "15 - 17", - "react-dom": "15 - 17", + "react": "15 - 18", + "react-dom": "15 - 18", "styled-components": "^5.1.0" }, "devDependencies": { diff --git a/package.json~ b/package.json~ new file mode 100644 index 0000000..79d2f7a --- /dev/null +++ b/package.json~ @@ -0,0 +1,129 @@ +{ + "name": "react-elastic-carousel", + "version": "0.11.5", + "description": "A flexible and responsive carousel component for react", + "author": "sag1v (Sagiv Ben Giat)", + "license": "MIT", + "repository": "sag1v/react-elastic-carousel", + "main": "dist/index.js", + "module": "dist/index.es.js", + "types": "./dist/index.d.ts", + "jsnext:main": "dist/index.es.js", + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "engines": { + "node": ">=8", + "npm": ">=5" + }, + "scripts": { + "start": "concurrently -r -k -s all \"docz dev\" \"yarn run lint:watch\"", + "demo": "concurrently -r -k -s all \"rollup --config rollup.config.demo.js --watch\" \"yarn run lint:watch\"", + "lint:fix": "eslint src/* --fix", + "lint:watch": "esw --watch --fix src/*", + "test": "cross-env CI=1 react-scripts test --env=jsdom", + "test:watch": "react-scripts test --env=jsdom", + "prebuild": "yarn run lint:fix", + "build": "rollup -c", + "build-doc": "docz build", + "deploy-doc": "gh-pages -d demo" + }, + "lint-staged": { + "*.js": "eslint src/. --fix" + }, + "dependencies": { + "classnames": "^2.2.6", + "react-only-when": "^1.0.2", + "react-swipeable": "^5.5.1", + "resize-observer-polyfill": "1.5.0" + }, + "peerDependencies": { + "prop-types": "^15.5.4", + "react": "15 - 17", + "react-dom": "15 - 17", + "styled-components": "^5.1.0" + }, + "devDependencies": { + "@babel/core": "^7.3.4", + "@babel/plugin-external-helpers": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.3.4", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.3.4", + "@babel/preset-react": "^7.0.0", + "@rollup/plugin-replace": "^2.3.4", + "babel-eslint": "^9.0.0", + "concurrently": "^4.1.0", + "cross-env": "^5.1.4", + "docz": "^2.3.1", + "enzyme": "^3.6.0", + "enzyme-adapter-react-16": "^1.5.0", + "eslint": "5.12.0", + "eslint-config-prettier": "^3.0.1", + "eslint-config-standard": "^12.0.0", + "eslint-config-standard-react": "^7.0.0", + "eslint-plugin-import": "^2.13.0", + "eslint-plugin-node": "^7.0.1", + "eslint-plugin-prettier": "^2.6.2", + "eslint-plugin-promise": "^4.0.0", + "eslint-plugin-react": "^7.10.0", + "eslint-plugin-standard": "^3.1.0", + "eslint-watch": "^4.0.2", + "gatsby-plugin-google-analytics": "^2.1.34", + "gh-pages": "^2.2.0", + "husky": "^4.3.0", + "lint-staged": "^10.5.2", + "prettier": "1.14.2", + "prettier-eslint": "^8.8.2", + "react": "^16.12.0", + "react-dom": "^16.12.0", + "react-resizable": "^1.7.5", + "react-scripts": "^2.1.8", + "react-test-renderer": "^16.5.2", + "rollup": "^0.64.1", + "rollup-plugin-alias": "^1.4.0", + "rollup-plugin-auto-external": "^2.0.0", + "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-commonjs": "^9.1.3", + "rollup-plugin-copy": "^3.3.0", + "rollup-plugin-livereload": "^2.0.0", + "rollup-plugin-node-resolve": "^3.3.0", + "rollup-plugin-postcss": "^1.6.2", + "rollup-plugin-serve": "^1.1.0", + "rollup-plugin-url": "^1.4.0", + "styled-components": "^5.1.0" + }, + "files": [ + "dist" + ], + "keywords": [ + "react", + "react-carousel", + "carousel", + "responsive", + "reactjs", + "carrousel", + "slides", + "flexibale", + "rtl", + "right-to-left", + "resize", + "touch" + ], + "resolutions": { + "ansi-styles": "^3.2.0" + } +} diff --git a/rollup.config.demo.js b/rollup.config.demo.js index 5496226..1c81f1c 100644 --- a/rollup.config.demo.js +++ b/rollup.config.demo.js @@ -47,6 +47,7 @@ export default { serve({ open: true, contentBase: "demoApp/dist", + port: 5000, }), livereload(), replace({ diff --git a/rollup.config.demo.js~ b/rollup.config.demo.js~ new file mode 100644 index 0000000..5496226 --- /dev/null +++ b/rollup.config.demo.js~ @@ -0,0 +1,56 @@ +import babel from "rollup-plugin-babel"; +import commonjs from "rollup-plugin-commonjs"; +import postcss from "rollup-plugin-postcss"; +import resolve from "rollup-plugin-node-resolve"; +import url from "rollup-plugin-url"; +import alias from "rollup-plugin-alias"; +import serve from "rollup-plugin-serve"; +import replace from "@rollup/plugin-replace"; +import livereload from 'rollup-plugin-livereload' + +import libName from "./libName"; + +import * as ReactNamedExports from 'react'; +import * as ReactIsNamedExports from 'react-is'; + +export default { + input: `demoApp/src/index.js`, + output: [ + { + file: "demoApp/dist/bundle.js", + format: "cjs", + sourcemap: true, + exports: "named", + }, + ], + plugins: [ + alias({ + "react-elastic-carousel": `src/${libName}/index.js`, + }), + //external(), + postcss({ + modules: false, + }), + url(), + babel({ + exclude: "node_modules/**", + plugins: ["@babel/external-helpers"], + }), + resolve(), + commonjs({ + include: "node_modules/**", + namedExports: { + "node_modules/react-is/index.js": Object.keys(ReactIsNamedExports), + "node_modules/react/index.js": Object.keys(ReactNamedExports), + }, + }), + serve({ + open: true, + contentBase: "demoApp/dist", + }), + livereload(), + replace({ + "process.env.NODE_ENV": JSON.stringify("production"), + }), + ], +};