((_props, ref) => {
return (
({
arrowContainer: null,
period: { start: null, end: null },
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars
- changePeriod: period => {},
+ changePeriod: _period => {},
// eslint-disable-next-line @typescript-eslint/no-empty-function
hideDatepicker: () => {},
dayHover: null,
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars
- changeDayHover: (day: string | null) => {},
+ changeDayHover: (_day: string | null) => {},
inputText: "",
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars
- changeInputText: text => {},
+ changeInputText: _text => {},
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars
- updateFirstDate: date => {},
+ updateFirstDate: _date => {},
// eslint-disable-next-line @typescript-eslint/no-empty-function,@typescript-eslint/no-unused-vars
- changeDatepickerValue: (value: DateValueType, e: HTMLInputElement | null | undefined) => {},
+ changeDatepickerValue: (_value: DateValueType, _e: HTMLInputElement | null | undefined) => {},
showFooter: false,
value: null,
i18n: LANGUAGE,
From 808a90ca4b7eb1fb9854aabf2a203afcbdae7857 Mon Sep 17 00:00:00 2001
From: sri
Date: Fri, 20 Sep 2024 18:39:14 +0200
Subject: [PATCH 21/38] test(jest.config): ignore paths
dist and rollup cache to be ignored by jest to avoid having test be run multiple times
---
jest.config.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/jest.config.js b/jest.config.js
index f56dfa44..6dd60374 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -4,5 +4,6 @@ module.exports = {
testEnvironment: "node",
transform: {
"^.+.tsx?$": ["ts-jest", {}]
- }
+ },
+ testPathIgnorePatterns: [".rollup.cache", "dist"]
};
From c3eab32777b89312357b882e3c062ae6afebb02c Mon Sep 17 00:00:00 2001
From: sri
Date: Fri, 20 Sep 2024 18:42:27 +0200
Subject: [PATCH 22/38] 1.7.2
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 5a3a903e..233f8cda 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.7.1",
+ "version": "1.7.2",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
From a3d7ab687b1e151e6091a8a899a8a310ab5b8905 Mon Sep 17 00:00:00 2001
From: sri
Date: Mon, 14 Oct 2024 10:50:13 +0200
Subject: [PATCH 23/38] fix(package): replace rollup with tsup; add changesets
fix bundling error; upgrade deps
---
.changeset/README.md | 9 +++++++++
.changeset/config.json | 11 +++++++++++
.changeset/sweet-tips-mate.md | 5 +++++
CONTRIBUTING.md | 29 +++++++++++++++++++++++++++++
package.json | 22 +++++++++++-----------
pages/index.js | 5 +++--
rollup.config.js | 23 -----------------------
src/index.tsx | 1 -
tsconfig.json | 6 +++---
9 files changed, 71 insertions(+), 40 deletions(-)
create mode 100644 .changeset/README.md
create mode 100644 .changeset/config.json
create mode 100644 .changeset/sweet-tips-mate.md
delete mode 100644 rollup.config.js
diff --git a/.changeset/README.md b/.changeset/README.md
new file mode 100644
index 00000000..84fd1276
--- /dev/null
+++ b/.changeset/README.md
@@ -0,0 +1,9 @@
+# Changesets
+
+Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool
+that works with multi-package repos, or single-package repos to help you version and publish your
+code. You can find the full documentation for it
+[in our repository](https://github.com/changesets/changesets)
+
+We have a quick list of common questions to get you started engaging with this project in
+[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
diff --git a/.changeset/config.json b/.changeset/config.json
new file mode 100644
index 00000000..96cdec90
--- /dev/null
+++ b/.changeset/config.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
+ "changelog": "@changesets/cli/changelog",
+ "commit": false,
+ "fixed": [],
+ "linked": [],
+ "access": "restricted",
+ "baseBranch": "main",
+ "updateInternalDependencies": "patch",
+ "ignore": []
+}
diff --git a/.changeset/sweet-tips-mate.md b/.changeset/sweet-tips-mate.md
new file mode 100644
index 00000000..cdfb734f
--- /dev/null
+++ b/.changeset/sweet-tips-mate.md
@@ -0,0 +1,5 @@
+---
+"@sciendis/react-tailwindcss-datepicker": patch
+---
+
+replace bundler
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 66cd2969..a58adbaf 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -80,3 +80,32 @@ yarn pret:fix
yarn build
```
+
+**Add a changeset**
+
+Everytime you make a change you should add a changeset. Changesets hold two key bits of information:
+a version type (following semver), and change information to be added to a changelog. For details,
+check out the
+[documentation](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md)
+
+```sh
+npx changeset
+```
+
+Follow the prompts to document your changes.
+
+To release a new version use
+
+```sh
+npx changeset
+```
+
+This consumes all changesets, and updates to the most appropriate semver version based on those
+changesets. It also writes changelog entries for each consumed changeset.
+
+Make sure to review all changes. Once you are confident that these are correct, and have made any
+necessary tweaks to changelogs, you can publish your packages:
+
+```sh
+npx changeset publish
+```
diff --git a/package.json b/package.json
index 233f8cda..1a64714e 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,8 @@
"name": "@sciendis/react-tailwindcss-datepicker",
"version": "1.7.2",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
- "main": "dist/index.cjs.js",
- "module": "dist/index.esm.js",
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
"types": "dist/index.d.ts",
"author": "sciendis",
"license": "MIT",
@@ -16,7 +16,7 @@
"pret:fix": "prettier --ignore-path .gitignore --config ./.prettierrc --write './**/*.{js,jsx,ts,tsx,css,md,json}'",
"code-style": "npm run pret && npm run lint",
"code-style:fix": "npm run pret:fix && npm run pret:fix",
- "build": "npm run code-style && npm run clean && rollup -c rollup.config.js --bundleConfigAsCjs",
+ "build": "npm run code-style && npm run clean && tsup src/index.tsx --format cjs,esm --dts",
"pub": "npm run build && npm publish",
"dev": "next dev -p 8888",
"test": "jest",
@@ -44,12 +44,9 @@
},
"devDependencies": {
"@jest/globals": "^29.7.0",
- "@rollup/plugin-commonjs": "^26.0.1",
- "@rollup/plugin-node-resolve": "^15.2.3",
- "@rollup/plugin-typescript": "^11.1.6",
"@tailwindcss/forms": "^0.5.3",
- "@types/node": "18.14.5",
- "@types/react": "^18.0.21",
+ "@types/node": "^22.7.5",
+ "@types/react": "^18.3.11",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"autoprefixer": "^10.4.13",
@@ -69,11 +66,11 @@
"prettier": "^2.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
- "rollup": "^4.22.0",
"tailwindcss": "^3.2.4",
"ts-jest": "^29.2.5",
"tslib": "^2.7.0",
- "typescript": "^4.8.4"
+ "tsup": "^8.3.0",
+ "typescript": "^5.6.2"
},
"lint-staged": {
"*.{ts,tsx}": [
@@ -86,5 +83,8 @@
"bugs": {
"url": "https://github.com/sciendis/react-tailwindcss-datepicker/issues"
},
- "homepage": "https://github.com/sciendis/react-tailwindcss-datepicker#readme"
+ "homepage": "https://github.com/sciendis/react-tailwindcss-datepicker#readme",
+ "dependencies": {
+ "@changesets/cli": "^2.27.8"
+ }
}
diff --git a/pages/index.js b/pages/index.js
index 90299a33..eb23daeb 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -1,16 +1,17 @@
import dayjs from "dayjs";
import Head from "next/head";
-import { useState } from "react";
+import React, { useState } from "react";
import Datepicker from "../src";
import { COLORS, DATE_LOOKING_OPTIONS } from "../src/constants";
+import { ColorKeys } from "../src/types";
export default function Playground() {
const [value, setValue] = useState({
startDate: null,
endDate: null
});
- const [primaryColor, setPrimaryColor] = useState("blue");
+ const [primaryColor, setPrimaryColor] = useState < ColorKeys > "blue";
const [useRange, setUseRange] = useState(true);
const [showFooter, setShowFooter] = useState(false);
const [showShortcuts, setShowShortcuts] = useState(false);
diff --git a/rollup.config.js b/rollup.config.js
deleted file mode 100644
index b1e3033f..00000000
--- a/rollup.config.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import commonjs from "@rollup/plugin-commonjs";
-import resolve from "@rollup/plugin-node-resolve";
-import typescript from "@rollup/plugin-typescript";
-
-module.exports = {
- input: "src/index.tsx",
- output: [
- {
- file: "dist/index.cjs.js",
- format: "cjs",
- sourcemap: true,
- inlineDynamicImports: true
- },
- {
- file: "dist/index.esm.js",
- format: "esm",
- sourcemap: true,
- inlineDynamicImports: true
- }
- ],
- external: ["react", "dayjs"],
- plugins: [resolve(), commonjs(), typescript({ tsconfig: "./tsconfig.json" })]
-};
diff --git a/src/index.tsx b/src/index.tsx
index 1a4ded83..15f0ed45 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,4 +1,3 @@
import Datepicker from "./components/Datepicker";
-export * from "./types";
export default Datepicker;
diff --git a/tsconfig.json b/tsconfig.json
index 2ca11a41..64afaa8c 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -3,7 +3,7 @@
"target": "esnext",
"lib": ["dom", "esnext"],
"module": "esnext",
- "jsx": "preserve",
+ "jsx": "react-jsx",
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
@@ -23,8 +23,8 @@
"skipLibCheck": true,
"noEmit": true,
"resolveJsonModule": true,
- "isolatedModules": true,
- "incremental": true
+ "isolatedModules": true
+ // "noUncheckedIndexedAccess": true // should be enabled
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
From 1715a0acd31832927cbbfad1a459e329ad7c2930 Mon Sep 17 00:00:00 2001
From: sri
Date: Mon, 14 Oct 2024 12:14:39 +0200
Subject: [PATCH 24/38] fix(tsup): export types
---
.changeset/fast-berries-rest.md | 5 +++++
package.json | 5 ++---
src/{index.tsx => index.ts} | 1 +
tsup.config.ts | 10 ++++++++++
4 files changed, 18 insertions(+), 3 deletions(-)
create mode 100644 .changeset/fast-berries-rest.md
rename src/{index.tsx => index.ts} (75%)
create mode 100644 tsup.config.ts
diff --git a/.changeset/fast-berries-rest.md b/.changeset/fast-berries-rest.md
new file mode 100644
index 00000000..dba8f822
--- /dev/null
+++ b/.changeset/fast-berries-rest.md
@@ -0,0 +1,5 @@
+---
+"@sciendis/react-tailwindcss-datepicker": patch
+---
+
+explicitly export types
diff --git a/package.json b/package.json
index 1a64714e..dcc54dd5 100644
--- a/package.json
+++ b/package.json
@@ -8,15 +8,14 @@
"author": "sciendis",
"license": "MIT",
"scripts": {
- "watch": "rollup -c -w",
- "clean": "rm -rf dist .rollup.cache tsconfig.tsbuildinfo",
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
"lint": "eslint --ignore-path .gitignore .",
"lint:fix": "eslint --ignore-path .gitignore --fix .",
"pret": "prettier -c .",
"pret:fix": "prettier --ignore-path .gitignore --config ./.prettierrc --write './**/*.{js,jsx,ts,tsx,css,md,json}'",
"code-style": "npm run pret && npm run lint",
"code-style:fix": "npm run pret:fix && npm run pret:fix",
- "build": "npm run code-style && npm run clean && tsup src/index.tsx --format cjs,esm --dts",
+ "build": "npm run code-style && npm run clean && tsup",
"pub": "npm run build && npm publish",
"dev": "next dev -p 8888",
"test": "jest",
diff --git a/src/index.tsx b/src/index.ts
similarity index 75%
rename from src/index.tsx
rename to src/index.ts
index 15f0ed45..f8d8aea5 100644
--- a/src/index.tsx
+++ b/src/index.ts
@@ -1,3 +1,4 @@
import Datepicker from "./components/Datepicker";
export default Datepicker;
+export * from "./types";
diff --git a/tsup.config.ts b/tsup.config.ts
new file mode 100644
index 00000000..fce01b89
--- /dev/null
+++ b/tsup.config.ts
@@ -0,0 +1,10 @@
+import { defineConfig } from "tsup";
+
+export default defineConfig({
+ entry: ["./src/index.ts"],
+ splitting: false,
+ sourcemap: true,
+ format: ["cjs", "esm"],
+ dts: true,
+ clean: true
+});
From 8c0a8e299de37208f3e31fc03a9a713ae694e4cc Mon Sep 17 00:00:00 2001
From: sri
Date: Mon, 14 Oct 2024 12:21:02 +0200
Subject: [PATCH 25/38] build(v1.7.3): nnew release
bump version, add changelog
---
.changeset/fast-berries-rest.md | 5 -----
.changeset/sweet-tips-mate.md | 5 -----
CHANGELOG.md | 7 +++++++
package.json | 2 +-
4 files changed, 8 insertions(+), 11 deletions(-)
delete mode 100644 .changeset/fast-berries-rest.md
delete mode 100644 .changeset/sweet-tips-mate.md
create mode 100644 CHANGELOG.md
diff --git a/.changeset/fast-berries-rest.md b/.changeset/fast-berries-rest.md
deleted file mode 100644
index dba8f822..00000000
--- a/.changeset/fast-berries-rest.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@sciendis/react-tailwindcss-datepicker": patch
----
-
-explicitly export types
diff --git a/.changeset/sweet-tips-mate.md b/.changeset/sweet-tips-mate.md
deleted file mode 100644
index cdfb734f..00000000
--- a/.changeset/sweet-tips-mate.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@sciendis/react-tailwindcss-datepicker": patch
----
-
-replace bundler
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..7fd33633
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# @sciendis/react-tailwindcss-datepicker
+
+## 1.7.3
+
+### Patch Changes
+
+- 1715a0a: explicitly export types
diff --git a/package.json b/package.json
index dcc54dd5..60da0ed6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.7.2",
+ "version": "1.7.3",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.js",
"module": "dist/index.mjs",
From 3425909936c4b7300bf42868064240ec6938ebe5 Mon Sep 17 00:00:00 2001
From: sri
Date: Tue, 22 Oct 2024 12:23:43 +0200
Subject: [PATCH 26/38] fix(tsup): fix config
---
CONTRIBUTING.md | 2 +-
pages/index.js | 3 +--
src/index.ts | 1 -
tsup.config.ts | 7 +++++--
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a58adbaf..63c7c7ad 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -97,7 +97,7 @@ Follow the prompts to document your changes.
To release a new version use
```sh
-npx changeset
+npx changeset version
```
This consumes all changesets, and updates to the most appropriate semver version based on those
diff --git a/pages/index.js b/pages/index.js
index eb23daeb..df6ba7f0 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -4,14 +4,13 @@ import React, { useState } from "react";
import Datepicker from "../src";
import { COLORS, DATE_LOOKING_OPTIONS } from "../src/constants";
-import { ColorKeys } from "../src/types";
export default function Playground() {
const [value, setValue] = useState({
startDate: null,
endDate: null
});
- const [primaryColor, setPrimaryColor] = useState < ColorKeys > "blue";
+ const [primaryColor, setPrimaryColor] = useState("blue");
const [useRange, setUseRange] = useState(true);
const [showFooter, setShowFooter] = useState(false);
const [showShortcuts, setShowShortcuts] = useState(false);
diff --git a/src/index.ts b/src/index.ts
index f8d8aea5..15f0ed45 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,4 +1,3 @@
import Datepicker from "./components/Datepicker";
export default Datepicker;
-export * from "./types";
diff --git a/tsup.config.ts b/tsup.config.ts
index fce01b89..125f75ee 100644
--- a/tsup.config.ts
+++ b/tsup.config.ts
@@ -4,7 +4,10 @@ export default defineConfig({
entry: ["./src/index.ts"],
splitting: false,
sourcemap: true,
- format: ["cjs", "esm"],
+ format: ["esm"],
dts: true,
- clean: true
+ clean: true,
+ treeshake: true,
+ outDir: "dist",
+ noExternal: [/.*/]
});
From cd3253da139ca67f2d766479947f893b847b8fa5 Mon Sep 17 00:00:00 2001
From: Priska
Date: Fri, 15 Nov 2024 15:32:35 +0100
Subject: [PATCH 27/38] fix(web): fix dependency array
---
src/components/Datepicker.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/Datepicker.tsx b/src/components/Datepicker.tsx
index 5ea73562..d6bff169 100644
--- a/src/components/Datepicker.tsx
+++ b/src/components/Datepicker.tsx
@@ -236,7 +236,7 @@ const Datepicker: React.FC = ({
setSecondDate(nextMonth(dayjs(startFrom)));
}
}
- }, [asSingle, startFrom, value]);
+ }, [asSingle, startFrom.getDate(), value]);
// Variables
const safePrimaryColor = useMemo(() => {
From d7b091187e69bd40bbbe6de85aed39e092e8e540 Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 12:45:27 +0100
Subject: [PATCH 28/38] docs(docs): updated version and changelog
---
CHANGELOG.md | 6 ++++++
package.json | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fd33633..df061ddf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# @sciendis/react-tailwindcss-datepicker
+## 1.8.1
+
+### Patch Changes
+
+- e97181d: fix maximum update depth bug
+
## 1.7.3
### Patch Changes
diff --git a/package.json b/package.json
index 60da0ed6..18c25359 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.7.3",
+ "version": "1.8.1",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.js",
"module": "dist/index.mjs",
From ab17142ed297a3bab2955eb0f57c893ce566651b Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 13:24:28 +0100
Subject: [PATCH 29/38] fix(datepicker): fix some eslint and ts error
---
src/components/Calendar/Years.tsx | 3 +--
src/components/Calendar/index.tsx | 3 +--
src/components/Datepicker.tsx | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/components/Calendar/Years.tsx b/src/components/Calendar/Years.tsx
index 0bbef7b5..0431689d 100644
--- a/src/components/Calendar/Years.tsx
+++ b/src/components/Calendar/Years.tsx
@@ -1,10 +1,9 @@
import React, { useContext } from "react";
+import DatepickerContext from "../../contexts/DatepickerContext";
import { generateArrayNumber } from "../../helpers";
import { RoundedButton } from "../utils";
-import DatepickerContext from "contexts/DatepickerContext";
-
interface Props {
year: number;
currentYear: number;
diff --git a/src/components/Calendar/index.tsx b/src/components/Calendar/index.tsx
index 4a374375..f5ca794c 100644
--- a/src/components/Calendar/index.tsx
+++ b/src/components/Calendar/index.tsx
@@ -14,6 +14,7 @@ import {
nextMonth,
previousMonth
} from "../../helpers";
+import { DateType } from "../../types";
import {
ChevronLeftIcon,
ChevronRightIcon,
@@ -27,8 +28,6 @@ import Months from "./Months";
import Week from "./Week";
import Years from "./Years";
-import { DateType } from "types";
-
interface Props {
date: dayjs.Dayjs;
minDate?: DateType | null;
diff --git a/src/components/Datepicker.tsx b/src/components/Datepicker.tsx
index d6bff169..dd8ad400 100644
--- a/src/components/Datepicker.tsx
+++ b/src/components/Datepicker.tsx
@@ -236,7 +236,7 @@ const Datepicker: React.FC = ({
setSecondDate(nextMonth(dayjs(startFrom)));
}
}
- }, [asSingle, startFrom.getDate(), value]);
+ }, [asSingle, startFrom?.getDate(), value]);
// Variables
const safePrimaryColor = useMemo(() => {
From 836df22bc3dfdc56f68222da3c0a47f61c5416c6 Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 14:39:13 +0100
Subject: [PATCH 30/38] fix(datepicker): export types
---
src/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.ts b/src/index.ts
index 15f0ed45..d0b0828b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,3 @@
import Datepicker from "./components/Datepicker";
-
+export * from "./types";
export default Datepicker;
From 098a408a36f8514006ef9fcd85b77eb364231942 Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 14:45:17 +0100
Subject: [PATCH 31/38] docs(docs): update version
---
CHANGELOG.md | 6 ++++++
package.json | 3 +--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index df061ddf..f3ac4cf3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# @sciendis/react-tailwindcss-datepicker
+## 1.8.2
+
+### Patch Changes
+
+- 836df22: fix export types
+
## 1.8.1
### Patch Changes
diff --git a/package.json b/package.json
index 18c25359..043bf5de 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.8.1",
+ "version": "1.8.2",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.js",
"module": "dist/index.mjs",
@@ -51,7 +51,6 @@
"autoprefixer": "^10.4.13",
"dayjs": "^1.11.7",
"eslint": "^8.29.0",
- "eslint-config-next": "^13.1.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
From 82c206959495b5c9b147ca268e7a53005f8686b7 Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 14:47:08 +0100
Subject: [PATCH 32/38] docs(docs): added package again
---
package.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/package.json b/package.json
index 043bf5de..d9a554b2 100644
--- a/package.json
+++ b/package.json
@@ -51,6 +51,7 @@
"autoprefixer": "^10.4.13",
"dayjs": "^1.11.7",
"eslint": "^8.29.0",
+ "eslint-config-next": "^13.1.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
From f689819e746fb5f179ef98435f605b44df4d73a4 Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 15:09:40 +0100
Subject: [PATCH 33/38] docs(docs): update types declaration in package json
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index d9a554b2..dcde08dd 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,10 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.8.2",
+ "version": "1.8.3",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.js",
"module": "dist/index.mjs",
- "types": "dist/index.d.ts",
+ "types": "dist/index.d.mts",
"author": "sciendis",
"license": "MIT",
"scripts": {
From 49b8f0300b7f7b8a446017786b46161aecd3b9f9 Mon Sep 17 00:00:00 2001
From: Priska
Date: Mon, 18 Nov 2024 15:10:21 +0100
Subject: [PATCH 34/38] docs(docs): updated changelog
---
CHANGELOG.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f3ac4cf3..3eb67f05 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# @sciendis/react-tailwindcss-datepicker
+## 1.8.3
+
+### Patch Changes
+
+- f689819: fix export types
+
## 1.8.2
### Patch Changes
From 78f1bd47ad432270ee4580d127937f6102e83ce2 Mon Sep 17 00:00:00 2001
From: Priska
Date: Tue, 19 Nov 2024 08:12:39 +0100
Subject: [PATCH 35/38] fix(docs): reverted version back to 1.7.3 and
unpublished versions back to 1.7.3
---
CHANGELOG.md | 18 ------------------
package.json | 4 ++--
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3eb67f05..7fd33633 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,23 +1,5 @@
# @sciendis/react-tailwindcss-datepicker
-## 1.8.3
-
-### Patch Changes
-
-- f689819: fix export types
-
-## 1.8.2
-
-### Patch Changes
-
-- 836df22: fix export types
-
-## 1.8.1
-
-### Patch Changes
-
-- e97181d: fix maximum update depth bug
-
## 1.7.3
### Patch Changes
diff --git a/package.json b/package.json
index dcde08dd..60da0ed6 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,10 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.8.3",
+ "version": "1.7.3",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.js",
"module": "dist/index.mjs",
- "types": "dist/index.d.mts",
+ "types": "dist/index.d.ts",
"author": "sciendis",
"license": "MIT",
"scripts": {
From 8f89252a3efc8647747cb4ae83e09d2ebd1e9b99 Mon Sep 17 00:00:00 2001
From: sri
Date: Tue, 19 Nov 2024 11:09:08 +0100
Subject: [PATCH 36/38] build(config): switch back to rollup
BREAKING CHANGE: tsup did not work; revert to prior bundle setup
---
.npmignore | 4 +++-
CHANGELOG.md | 14 ++++++++++++++
next.config.js | 6 ++----
package.json | 25 +++++++++++++++----------
rollup.config.js | 23 +++++++++++++++++++++++
src/{index.ts => index.tsx} | 0
tsconfig.json | 10 ++++++++--
tsup.config.ts | 13 -------------
8 files changed, 65 insertions(+), 30 deletions(-)
create mode 100644 rollup.config.js
rename src/{index.ts => index.tsx} (100%)
delete mode 100644 tsup.config.ts
diff --git a/.npmignore b/.npmignore
index 943f8cd7..f9f9d267 100644
--- a/.npmignore
+++ b/.npmignore
@@ -5,7 +5,9 @@ node_modules
.idea
assets
.git
-pages
+.github
+.changeset
+app
styles
.next
.rollup.cache
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fd33633..49242a9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
# @sciendis/react-tailwindcss-datepicker
+## 1.8.0
+
+### Minor Changes
+
+- switch back to rollup
+- bring back explicit types
+
+## 1.7.4 (reverted)
+
+### Patch Changes
+
+- fix (hopefully) tsup config
+- remove type folder from dist
+
## 1.7.3
### Patch Changes
diff --git a/next.config.js b/next.config.js
index eda88d1a..4678774e 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,6 +1,4 @@
/** @type {import('next').NextConfig} */
-const nextConfig = {
- reactStrictMode: true
-};
+const nextConfig = {};
-module.exports = nextConfig;
+export default nextConfig;
diff --git a/package.json b/package.json
index 60da0ed6..f192dfff 100644
--- a/package.json
+++ b/package.json
@@ -1,25 +1,26 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.7.3",
+ "version": "1.8.0",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
- "main": "dist/index.js",
- "module": "dist/index.mjs",
+ "main": "dist/index.cjs.js",
+ "module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"author": "sciendis",
"license": "MIT",
"scripts": {
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
+ "clean": "rm -rf dist tsconfig.tsbuildinfo .rollup.cache",
"lint": "eslint --ignore-path .gitignore .",
"lint:fix": "eslint --ignore-path .gitignore --fix .",
"pret": "prettier -c .",
"pret:fix": "prettier --ignore-path .gitignore --config ./.prettierrc --write './**/*.{js,jsx,ts,tsx,css,md,json}'",
"code-style": "npm run pret && npm run lint",
"code-style:fix": "npm run pret:fix && npm run pret:fix",
- "build": "npm run code-style && npm run clean && tsup",
+ "build": "npm run code-style && npm run clean && rollup -c rollup.config.js --bundleConfigAsCjs",
"pub": "npm run build && npm publish",
"dev": "next dev -p 8888",
"test": "jest",
- "prepare": "husky install"
+ "prepare": "husky install",
+ "ci": "pnpm run lint && pnpm run test && pnpm run build"
},
"repository": {
"type": "git",
@@ -42,7 +43,11 @@
"react": "^17.0.2 || ^18.2.0"
},
"devDependencies": {
+ "@changesets/cli": "^2.27.9",
"@jest/globals": "^29.7.0",
+ "@rollup/plugin-commonjs": "^28.0.1",
+ "@rollup/plugin-node-resolve": "^15.3.0",
+ "@rollup/plugin-typescript": "^12.1.1",
"@tailwindcss/forms": "^0.5.3",
"@types/node": "^22.7.5",
"@types/react": "^18.3.11",
@@ -65,10 +70,10 @@
"prettier": "^2.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
+ "rollup": "^4.24.0",
"tailwindcss": "^3.2.4",
"ts-jest": "^29.2.5",
"tslib": "^2.7.0",
- "tsup": "^8.3.0",
"typescript": "^5.6.2"
},
"lint-staged": {
@@ -83,7 +88,7 @@
"url": "https://github.com/sciendis/react-tailwindcss-datepicker/issues"
},
"homepage": "https://github.com/sciendis/react-tailwindcss-datepicker#readme",
- "dependencies": {
- "@changesets/cli": "^2.27.8"
- }
+ "files": [
+ "dist"
+ ]
}
diff --git a/rollup.config.js b/rollup.config.js
new file mode 100644
index 00000000..b1e3033f
--- /dev/null
+++ b/rollup.config.js
@@ -0,0 +1,23 @@
+import commonjs from "@rollup/plugin-commonjs";
+import resolve from "@rollup/plugin-node-resolve";
+import typescript from "@rollup/plugin-typescript";
+
+module.exports = {
+ input: "src/index.tsx",
+ output: [
+ {
+ file: "dist/index.cjs.js",
+ format: "cjs",
+ sourcemap: true,
+ inlineDynamicImports: true
+ },
+ {
+ file: "dist/index.esm.js",
+ format: "esm",
+ sourcemap: true,
+ inlineDynamicImports: true
+ }
+ ],
+ external: ["react", "dayjs"],
+ plugins: [resolve(), commonjs(), typescript({ tsconfig: "./tsconfig.json" })]
+};
diff --git a/src/index.ts b/src/index.tsx
similarity index 100%
rename from src/index.ts
rename to src/index.tsx
diff --git a/tsconfig.json b/tsconfig.json
index 64afaa8c..fc9fbef9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -20,12 +20,18 @@
"sourceMap": true,
"rootDir": "src",
"allowJs": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
"skipLibCheck": true,
"noEmit": true,
"resolveJsonModule": true,
- "isolatedModules": true
+ "isolatedModules": true,
// "noUncheckedIndexedAccess": true // should be enabled
+ "incremental": true
},
"include": ["src/**/*"],
- "exclude": ["node_modules"]
+ "exclude": ["node_modules", "dist", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/__tests__"]
}
diff --git a/tsup.config.ts b/tsup.config.ts
deleted file mode 100644
index 125f75ee..00000000
--- a/tsup.config.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { defineConfig } from "tsup";
-
-export default defineConfig({
- entry: ["./src/index.ts"],
- splitting: false,
- sourcemap: true,
- format: ["esm"],
- dts: true,
- clean: true,
- treeshake: true,
- outDir: "dist",
- noExternal: [/.*/]
-});
From 6f746057e41910474b7c26008f20b0239e5ee72e Mon Sep 17 00:00:00 2001
From: Priska
Date: Tue, 19 Nov 2024 13:27:15 +0100
Subject: [PATCH 37/38] docs(docs): updated changelog and version in package
json
---
CHANGELOG.md | 6 ++++++
package.json | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 49242a9c..3dbd1595 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# @sciendis/react-tailwindcss-datepicker
+## 1.8.1
+
+### Patch Changes
+
+- fix dependency array in datepicker to prevent rerenders and fix max update depth bug
+
## 1.8.0
### Minor Changes
diff --git a/package.json b/package.json
index f192dfff..de3f9df3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@sciendis/react-tailwindcss-datepicker",
- "version": "1.8.0",
+ "version": "1.8.1",
"description": " Modern date range picker component for React using Tailwind and dayjs.",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
From d7f6b2af72c850ef2f7d6a4ae095670895313718 Mon Sep 17 00:00:00 2001
From: sri
Date: Tue, 19 Nov 2024 15:20:52 +0100
Subject: [PATCH 38/38] docs(Contributing): update instructions
---
CONTRIBUTING.md | 74 +++++++++++++++++++++++++++++--------------------
1 file changed, 44 insertions(+), 30 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 63c7c7ad..fdbacfd7 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,27 +3,18 @@
Thanks for your interest in contributing to `react-tailwindcss-datepicker`! Please take a moment to
review this document **before submitting a pull request**.
-- [Pull requests](#pull-requests)
- [Installation](#installation)
- [Coding standards](#coding-standards)
- [Running playground](#running-playgrounds)
- [Before you make a Pull Request](#before-you-make-a-pull-request)
-
-## Pull requests
-
-**Please ask first before starting work on any significant new features.**
-
-It's never a fun experience to have your pull request declined after investing a lot of time and
-effort into a new feature. To avoid this from happening, we request that contributors create
-[an issue](https://github.com/sciendis/react-tailwindcss-datepicker/issues) to first discuss any
-significant new features.
+- [Publish the updated Datepicker](#publish-the-updated-datepicker)
## Installation
-You only require a `yarn install` in the root directory to install everything you need.
+You only require a `npm install` in the root directory to install everything you need.
```sh
-yarn install
+npm install
```
## Coding standards
@@ -31,14 +22,6 @@ yarn install
We use `prettier` for making sure that the codebase is formatted consistently. To automatically fix
any style violations in your code, you can run:
-**Using yarn**
-
-```sh
-yarn pret:fix
-```
-
-**Using npm**
-
```sh
npm pret:fix
```
@@ -51,14 +34,6 @@ You can run the `dev` script and open your browser to `http://localhost:8888`.
See complete `props` usage in `pages/index.js` file.
-**Using yarn**
-
-```sh
-yarn dev
-```
-
-**Using npm**
-
```sh
npm dev
```
@@ -71,13 +46,13 @@ Request
**Let's clean the code first**
```sh
-yarn pret:fix
+npm pret:fix
```
**Test a build of your changes**
```sh
-yarn build
+npm build
```
@@ -94,6 +69,21 @@ npx changeset
Follow the prompts to document your changes.
+**Commit your changes**
+
+It is generally advised to create a feature branch for your changes and open a merge request.
+
+Create a commit, preferrably using [Commitizen](https://commitizen-tools.github.io/commitizen/).
+
+```sh
+git cz commit
+git push
+```
+
+# Publish the updated Datepicker
+
+**Update npm package**
+
To release a new version use
```sh
@@ -109,3 +99,27 @@ necessary tweaks to changelogs, you can publish your packages:
```sh
npx changeset publish
```
+
+**Update github repo**
+
+Make sure to also commit und push the updated package and changelogs to github.
+
+```sh
+git commit -m
+git push
+```
+
+Add a tag with the latest version number to mark a new release. The tag name should reflect the
+updated version property in the `package.json` file.
+
+```sh
+git tag
+
+```
+
+Note that tags are not automatically pushed. You will have to explicitly push tags to a shared
+server after you have created them.
+
+```sh
+git push origin
+```