From a047c10edf591728f14927fedf66c2ca3ad5da91 Mon Sep 17 00:00:00 2001 From: Miroslav Petrik Date: Thu, 14 Mar 2024 07:55:12 +0100 Subject: [PATCH] fix(build): peer dependencies, exclude story-form --- .github/workflows/release.yml | 2 +- .github/workflows/storybook.yml | 4 ++-- package.json | 13 +++++++------ .../checkbox-field/CheckboxField.stories.tsx | 2 +- .../CheckboxGroupField.stories.tsx | 2 +- .../file-field/FilesField.stories.tsx | 2 +- .../list-field/NestedListField.stories.tsx | 2 +- src/components/list-field/Phones.stories.tsx | 2 +- .../number-field/NumberField.stories.tsx | 2 +- .../radio-field/RadioField.stories.tsx | 2 +- .../rating-field/RatingField.stories.tsx | 2 +- .../select-field/SelectField.stories.tsx | 2 +- .../slider-field/SliderField.stories.tsx | 2 +- src/components/text-field/TextField.stories.tsx | 2 +- .../textarea-field/TextareaField.stories.tsx | 2 +- .../AddressListField.stories.tsx | 0 .../address-list-field/AddressListField.tsx | 0 .../advanced-search/AdvancedSearch.stories.tsx | 2 +- .../advanced-search/AdvancedSearch.tsx | 0 .../advanced-search/ColorPicker.tsx | 0 .../advanced-search/Docs.mdx | 0 .../advanced-search/PriceRange.tsx | 0 .../advanced-search/ProductBrand.tsx | 0 .../advanced-search/Rating.tsx | 0 .../advanced-search/UsageCondition.tsx | 0 .../review-list/ReviewList.stories.tsx | 2 +- .../review-list/ReviewList.tsx | 0 .../story-form/StoryForm.tsx | 0 src/{components => stories}/story-form/index.ts | 0 tsconfig.build.json | 2 +- yarn.lock | 17 ++++------------- 31 files changed, 29 insertions(+), 37 deletions(-) rename src/{showcase => stories}/address-list-field/AddressListField.stories.tsx (100%) rename src/{showcase => stories}/address-list-field/AddressListField.tsx (100%) rename src/{showcase => stories}/advanced-search/AdvancedSearch.stories.tsx (89%) rename src/{showcase => stories}/advanced-search/AdvancedSearch.tsx (100%) rename src/{showcase => stories}/advanced-search/ColorPicker.tsx (100%) rename src/{showcase => stories}/advanced-search/Docs.mdx (100%) rename src/{showcase => stories}/advanced-search/PriceRange.tsx (100%) rename src/{showcase => stories}/advanced-search/ProductBrand.tsx (100%) rename src/{showcase => stories}/advanced-search/Rating.tsx (100%) rename src/{showcase => stories}/advanced-search/UsageCondition.tsx (100%) rename src/{showcase => stories}/review-list/ReviewList.stories.tsx (89%) rename src/{showcase => stories}/review-list/ReviewList.tsx (100%) rename src/{components => stories}/story-form/StoryForm.tsx (100%) rename src/{components => stories}/story-form/index.ts (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 667fca5..bc95d87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: 🚀 Release on: push: diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index d8093aa..7805109 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -1,4 +1,4 @@ -name: storybook +name: 🎨 Storybook Docs 📄 on: push: @@ -42,7 +42,7 @@ jobs: - name: Build storybook uses: borales/actions-yarn@v4 with: - cmd: build:storybook + cmd: sb:build - name: Upload storybook uses: actions/upload-pages-artifact@v2 diff --git a/package.json b/package.json index fe78cd0..c9abf6f 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "publish": "yarn npm publish --access public", "build": "tsc --build ./tsconfig.build.json", "sb": "yarn storybook", - "build:storybook": "storybook build", - "storybook": "storybook dev -p 6006", + "sb:build": "storybook build", + "storybook": "storybook dev", "semantic-release": "semantic-release", "lint": "eslint --ext .tsx,.ts ./src", "lint:fix": "yarn run lint --fix", @@ -80,7 +80,6 @@ "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.0", "eslint-plugin-prettier": "5.0.1", - "flowbite": "^2.3.0", "flowbite-react": "^0.7.3", "form-atoms": "3.2.4", "happy-dom": "12.10.3", @@ -133,9 +132,11 @@ ] }, "peerDependencies": { - "@form-atoms/field": "^4", - "flowbite": "^1.8.1", - "flowbite-react": "^0.7.0" + "@form-atoms/field": "^5", + "flowbite-react": "^0.7.0", + "form-atoms": "^3", + "jotai": "^2", + "react": ">=16.8" }, "packageManager": "yarn@4.0.2" } diff --git a/src/components/checkbox-field/CheckboxField.stories.tsx b/src/components/checkbox-field/CheckboxField.stories.tsx index d2d5211..dcab764 100644 --- a/src/components/checkbox-field/CheckboxField.stories.tsx +++ b/src/components/checkbox-field/CheckboxField.stories.tsx @@ -1,7 +1,7 @@ import { checkboxField } from "@form-atoms/field"; import { CheckboxField } from "./CheckboxField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "CheckboxField", diff --git a/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx b/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx index 913e5af..92bf49b 100644 --- a/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx +++ b/src/components/checkbox-group-field/CheckboxGroupField.stories.tsx @@ -2,7 +2,7 @@ import { stringArrayField } from "@form-atoms/field"; import { CheckboxGroupField } from "./CheckboxGroupField"; import { getLabel, getValue, options } from "./languages"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "CheckboxGroupField", diff --git a/src/components/file-field/FilesField.stories.tsx b/src/components/file-field/FilesField.stories.tsx index 5f73f12..8e774ca 100644 --- a/src/components/file-field/FilesField.stories.tsx +++ b/src/components/file-field/FilesField.stories.tsx @@ -1,7 +1,7 @@ import { filesField } from "@form-atoms/field"; import { FilesField } from "./FilesField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "FilesField", diff --git a/src/components/list-field/NestedListField.stories.tsx b/src/components/list-field/NestedListField.stories.tsx index 9b1fe58..73aee3b 100644 --- a/src/components/list-field/NestedListField.stories.tsx +++ b/src/components/list-field/NestedListField.stories.tsx @@ -1,8 +1,8 @@ import { List, listField, numberField, textField } from "@form-atoms/field"; import { Button, Card } from "flowbite-react"; +import { formStory, meta } from "../../stories/story-form"; import { NumberField } from "../number-field"; -import { formStory, meta } from "../story-form"; import { TextField } from "../text-field"; export default { diff --git a/src/components/list-field/Phones.stories.tsx b/src/components/list-field/Phones.stories.tsx index b05b911..8fc793d 100644 --- a/src/components/list-field/Phones.stories.tsx +++ b/src/components/list-field/Phones.stories.tsx @@ -8,8 +8,8 @@ import { } from "@form-atoms/field"; import { Card } from "flowbite-react"; +import { formStory, meta } from "../../stories/story-form"; import { RadioOption } from "../radio-option"; -import { formStory, meta } from "../story-form"; import { TextField } from "../text-field"; export default { diff --git a/src/components/number-field/NumberField.stories.tsx b/src/components/number-field/NumberField.stories.tsx index bd46e86..7a8a8be 100644 --- a/src/components/number-field/NumberField.stories.tsx +++ b/src/components/number-field/NumberField.stories.tsx @@ -2,7 +2,7 @@ import { numberField } from "@form-atoms/field"; import { userEvent, within } from "@storybook/testing-library"; import { NumberField } from "./NumberField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "NumberField", diff --git a/src/components/radio-field/RadioField.stories.tsx b/src/components/radio-field/RadioField.stories.tsx index 944a526..8b827f6 100644 --- a/src/components/radio-field/RadioField.stories.tsx +++ b/src/components/radio-field/RadioField.stories.tsx @@ -1,8 +1,8 @@ import { stringField } from "@form-atoms/field"; import { RadioField } from "./RadioField"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; import { country, getLabel, getValue, options } from "../select-field/country"; -import { FormStory, meta, optionalField } from "../story-form"; export default { title: "RadioField", diff --git a/src/components/rating-field/RatingField.stories.tsx b/src/components/rating-field/RatingField.stories.tsx index 41b4d7b..b0b2264 100644 --- a/src/components/rating-field/RatingField.stories.tsx +++ b/src/components/rating-field/RatingField.stories.tsx @@ -1,7 +1,7 @@ import { numberField } from "@form-atoms/field"; import { RatingField } from "./RatingField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "RatingField", diff --git a/src/components/select-field/SelectField.stories.tsx b/src/components/select-field/SelectField.stories.tsx index 3853398..b459470 100644 --- a/src/components/select-field/SelectField.stories.tsx +++ b/src/components/select-field/SelectField.stories.tsx @@ -2,7 +2,7 @@ import { stringField } from "@form-atoms/field"; import { country, getLabel, getValue, options } from "./country"; import { SelectField } from "./SelectField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "SelectField", diff --git a/src/components/slider-field/SliderField.stories.tsx b/src/components/slider-field/SliderField.stories.tsx index eeadadb..3f2d452 100644 --- a/src/components/slider-field/SliderField.stories.tsx +++ b/src/components/slider-field/SliderField.stories.tsx @@ -2,7 +2,7 @@ import { numberField } from "@form-atoms/field"; import { z } from "zod"; import { SliderField } from "./SliderField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "SliderField", diff --git a/src/components/text-field/TextField.stories.tsx b/src/components/text-field/TextField.stories.tsx index c875c6d..09844fb 100644 --- a/src/components/text-field/TextField.stories.tsx +++ b/src/components/text-field/TextField.stories.tsx @@ -1,7 +1,7 @@ import { textField } from "@form-atoms/field"; import { TextField } from "./TextField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "TextField", diff --git a/src/components/textarea-field/TextareaField.stories.tsx b/src/components/textarea-field/TextareaField.stories.tsx index 60d6a8c..88dc3ae 100644 --- a/src/components/textarea-field/TextareaField.stories.tsx +++ b/src/components/textarea-field/TextareaField.stories.tsx @@ -1,7 +1,7 @@ import { textField } from "@form-atoms/field"; import { TextareaField } from "./TextareaField"; -import { FormStory, meta, optionalField } from "../story-form"; +import { FormStory, meta, optionalField } from "../../stories/story-form"; export default { title: "TextareaField", diff --git a/src/showcase/address-list-field/AddressListField.stories.tsx b/src/stories/address-list-field/AddressListField.stories.tsx similarity index 100% rename from src/showcase/address-list-field/AddressListField.stories.tsx rename to src/stories/address-list-field/AddressListField.stories.tsx diff --git a/src/showcase/address-list-field/AddressListField.tsx b/src/stories/address-list-field/AddressListField.tsx similarity index 100% rename from src/showcase/address-list-field/AddressListField.tsx rename to src/stories/address-list-field/AddressListField.tsx diff --git a/src/showcase/advanced-search/AdvancedSearch.stories.tsx b/src/stories/advanced-search/AdvancedSearch.stories.tsx similarity index 89% rename from src/showcase/advanced-search/AdvancedSearch.stories.tsx rename to src/stories/advanced-search/AdvancedSearch.stories.tsx index c135a0c..651629a 100644 --- a/src/showcase/advanced-search/AdvancedSearch.stories.tsx +++ b/src/stories/advanced-search/AdvancedSearch.stories.tsx @@ -4,7 +4,7 @@ import { priceMax, priceMin } from "./PriceRange"; import { productBrand } from "./ProductBrand"; import { rating } from "./Rating"; import { usageCondition } from "./UsageCondition"; -import { FormStory, meta } from "../../components/story-form"; +import { FormStory, meta } from "../story-form"; export default { title: "showcase/AdvancedSearch", diff --git a/src/showcase/advanced-search/AdvancedSearch.tsx b/src/stories/advanced-search/AdvancedSearch.tsx similarity index 100% rename from src/showcase/advanced-search/AdvancedSearch.tsx rename to src/stories/advanced-search/AdvancedSearch.tsx diff --git a/src/showcase/advanced-search/ColorPicker.tsx b/src/stories/advanced-search/ColorPicker.tsx similarity index 100% rename from src/showcase/advanced-search/ColorPicker.tsx rename to src/stories/advanced-search/ColorPicker.tsx diff --git a/src/showcase/advanced-search/Docs.mdx b/src/stories/advanced-search/Docs.mdx similarity index 100% rename from src/showcase/advanced-search/Docs.mdx rename to src/stories/advanced-search/Docs.mdx diff --git a/src/showcase/advanced-search/PriceRange.tsx b/src/stories/advanced-search/PriceRange.tsx similarity index 100% rename from src/showcase/advanced-search/PriceRange.tsx rename to src/stories/advanced-search/PriceRange.tsx diff --git a/src/showcase/advanced-search/ProductBrand.tsx b/src/stories/advanced-search/ProductBrand.tsx similarity index 100% rename from src/showcase/advanced-search/ProductBrand.tsx rename to src/stories/advanced-search/ProductBrand.tsx diff --git a/src/showcase/advanced-search/Rating.tsx b/src/stories/advanced-search/Rating.tsx similarity index 100% rename from src/showcase/advanced-search/Rating.tsx rename to src/stories/advanced-search/Rating.tsx diff --git a/src/showcase/advanced-search/UsageCondition.tsx b/src/stories/advanced-search/UsageCondition.tsx similarity index 100% rename from src/showcase/advanced-search/UsageCondition.tsx rename to src/stories/advanced-search/UsageCondition.tsx diff --git a/src/showcase/review-list/ReviewList.stories.tsx b/src/stories/review-list/ReviewList.stories.tsx similarity index 89% rename from src/showcase/review-list/ReviewList.stories.tsx rename to src/stories/review-list/ReviewList.stories.tsx index fc2e153..95f42e6 100644 --- a/src/showcase/review-list/ReviewList.stories.tsx +++ b/src/stories/review-list/ReviewList.stories.tsx @@ -1,7 +1,7 @@ import { listField, textField } from "@form-atoms/field"; import { ReviewList } from "./ReviewList"; -import { formStory, meta } from "../../components/story-form"; +import { formStory, meta } from "../story-form"; export default { title: "showcase/ReviewList", diff --git a/src/showcase/review-list/ReviewList.tsx b/src/stories/review-list/ReviewList.tsx similarity index 100% rename from src/showcase/review-list/ReviewList.tsx rename to src/stories/review-list/ReviewList.tsx diff --git a/src/components/story-form/StoryForm.tsx b/src/stories/story-form/StoryForm.tsx similarity index 100% rename from src/components/story-form/StoryForm.tsx rename to src/stories/story-form/StoryForm.tsx diff --git a/src/components/story-form/index.ts b/src/stories/story-form/index.ts similarity index 100% rename from src/components/story-form/index.ts rename to src/stories/story-form/index.ts diff --git a/tsconfig.build.json b/tsconfig.build.json index 62f921c..42593ec 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -10,7 +10,7 @@ }, "include": ["src"], "exclude": [ - "src/showcase/*", + "src/stories/*", "src/**/*.stories.tsx", "src/**/*.test.tsx", "src/**/*.skip.tsx" diff --git a/yarn.lock b/yarn.lock index 20b9ac6..507e491 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2707,7 +2707,6 @@ __metadata: eslint-import-resolver-typescript: "npm:^3.6.1" eslint-plugin-import: "npm:^2.29.0" eslint-plugin-prettier: "npm:5.0.1" - flowbite: "npm:^2.3.0" flowbite-react: "npm:^0.7.3" form-atoms: "npm:3.2.4" happy-dom: "npm:12.10.3" @@ -2729,9 +2728,11 @@ __metadata: vitest: "npm:1.1.3" zod: "npm:^3.22.4" peerDependencies: - "@form-atoms/field": ^4 - flowbite: ^1.8.1 + "@form-atoms/field": ^5 flowbite-react: ^0.7.0 + form-atoms: ^3 + jotai: ^2 + react: ">=16.8" languageName: unknown linkType: soft @@ -9382,16 +9383,6 @@ __metadata: languageName: node linkType: hard -"flowbite@npm:^2.3.0": - version: 2.3.0 - resolution: "flowbite@npm:2.3.0" - dependencies: - "@popperjs/core": "npm:^2.9.3" - mini-svg-data-uri: "npm:^1.4.3" - checksum: a72bc4c68fd6cc832e2df2fbf329eca5d96d8297da6f0578addca68fccc8e33fcc12c00403b2b8cf550a345e46831d86a35e69b2fd4e79b7087f01b7712310a3 - languageName: node - linkType: hard - "for-each@npm:^0.3.3": version: 0.3.3 resolution: "for-each@npm:0.3.3"