From 8808a2a3f0490894a072f8fe1f3e4bd8bf94ed6f Mon Sep 17 00:00:00 2001 From: Arno V Date: Tue, 17 Sep 2024 15:45:37 -0400 Subject: [PATCH] feat(Footer): extracting Footer as a standalone package (#655) --- .release-please-manifest.json | 3 +- packages/ui-components/package.json | 9 ++-- .../ui-components/src/components/index.ts | 2 +- packages/ui-footer/README.md | 3 ++ packages/ui-footer/package.json | 47 +++++++++++++++++++ packages/ui-footer/postcss.config.cjs | 6 +++ packages/ui-footer/src/common/constants.ts | 1 + .../src/components/Footer/Footer.tsx | 0 .../src/components/Footer/FooterTypes.d.ts | 0 .../Footer/__tests__/Footer.test.tsx | 0 packages/ui-footer/src/components/index.ts | 2 + packages/ui-footer/src/index.css | 3 ++ packages/ui-footer/src/style.ts | 1 + packages/ui-footer/src/vite-env.d.ts | 1 + packages/ui-footer/tailwind.config.js | 2 + packages/ui-footer/tsconfig.json | 4 ++ packages/ui-footer/tsup.config.ts | 2 + packages/ui-footer/vite.config.ts | 2 + packages/ui-footer/vitest.config.js | 4 ++ pnpm-lock.yaml | 25 ++++++++++ release-please-config.json | 3 +- 21 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 packages/ui-footer/README.md create mode 100644 packages/ui-footer/package.json create mode 100644 packages/ui-footer/postcss.config.cjs create mode 100644 packages/ui-footer/src/common/constants.ts rename packages/{ui-components => ui-footer}/src/components/Footer/Footer.tsx (100%) rename packages/{ui-components => ui-footer}/src/components/Footer/FooterTypes.d.ts (100%) rename packages/{ui-components => ui-footer}/src/components/Footer/__tests__/Footer.test.tsx (100%) create mode 100644 packages/ui-footer/src/components/index.ts create mode 100644 packages/ui-footer/src/index.css create mode 100644 packages/ui-footer/src/style.ts create mode 100644 packages/ui-footer/src/vite-env.d.ts create mode 100644 packages/ui-footer/tailwind.config.js create mode 100644 packages/ui-footer/tsconfig.json create mode 100644 packages/ui-footer/tsup.config.ts create mode 100644 packages/ui-footer/vite.config.ts create mode 100644 packages/ui-footer/vitest.config.js diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7cf2a867..741676c1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -10,5 +10,6 @@ "packages/ui-button": "1.1.0", "packages/ui-anchor": "1.1.0", "packages/ui-bubble": "1.0.0", - "packages/ui-card": "1.0.0" + "packages/ui-card": "1.0.0", + "packages/ui-footer": "0.0.0" } diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 095bb49f..95781f16 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -14,9 +14,7 @@ "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build:check": "tsc", "build:js": "vite build", @@ -51,13 +49,12 @@ "@versini/ui-button": "workspace:../ui-button", "@versini/ui-bubble": "workspace:../ui-bubble", "@versini/ui-card": "workspace:../ui-card", + "@versini/ui-footer": "workspace:../ui-footer", "@versini/ui-hooks": "workspace:../ui-hooks", "@versini/ui-icons": "workspace:../ui-icons", "@versini/ui-private": "workspace:../ui-private", "clsx": "2.1.1", "tailwindcss": "3.4.11" }, - "sideEffects": [ - "**/*.css" - ] + "sideEffects": ["**/*.css"] } diff --git a/packages/ui-components/src/components/index.ts b/packages/ui-components/src/components/index.ts index 803ed4ed..1a76809c 100644 --- a/packages/ui-components/src/components/index.ts +++ b/packages/ui-components/src/components/index.ts @@ -2,8 +2,8 @@ import { Anchor } from "@versini/ui-anchor"; import { Bubble } from "@versini/ui-bubble"; import { Button, ButtonIcon } from "@versini/ui-button"; import { Card } from "@versini/ui-card"; +import { Footer } from "@versini/ui-footer"; -import { Footer } from "./Footer/Footer"; import { Header } from "./Header/Header"; import { Main } from "./Main/Main"; import { Menu } from "./Menu/Menu"; diff --git a/packages/ui-footer/README.md b/packages/ui-footer/README.md new file mode 100644 index 00000000..50d82bb1 --- /dev/null +++ b/packages/ui-footer/README.md @@ -0,0 +1,3 @@ +# @versini/ui-footer + +A simple footer component for React. diff --git a/packages/ui-footer/package.json b/packages/ui-footer/package.json new file mode 100644 index 00000000..d7d4feed --- /dev/null +++ b/packages/ui-footer/package.json @@ -0,0 +1,47 @@ +{ + "name": "@versini/ui-footer", + "version": "0.0.0", + "license": "MIT", + "author": "Arno Versini", + "publishConfig": { + "access": "public" + }, + "homepage": "https://github.com/aversini/ui-components", + "repository": { + "type": "git", + "url": "git@github.com:aversini/ui-components.git" + }, + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": ["dist"], + "scripts": { + "build:check": "tsc", + "build:js": "vite build", + "build:types": "tsup", + "build": "npm-run-all --serial clean build:check build:js build:types", + "clean": "rimraf dist tmp", + "dev:js": "vite build --watch --mode development", + "dev:types": "tsup --watch src", + "dev": "npm-run-all clean --parallel dev:js dev:types", + "lint": "biome lint src", + "start": "static-server dist --port 5173", + "test:coverage:ui": "vitest --coverage --ui", + "test:coverage": "vitest run --coverage", + "test:watch": "vitest", + "test": "vitest run" + }, + "peerDependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@versini/ui-styles": "workspace:../ui-styles" + }, + "dependencies": { + "@tailwindcss/typography": "0.5.15", + "@versini/ui-private": "workspace:../ui-private", + "tailwindcss": "3.4.11" + }, + "sideEffects": ["**/*.css"] +} diff --git a/packages/ui-footer/postcss.config.cjs b/packages/ui-footer/postcss.config.cjs new file mode 100644 index 00000000..e873f1a4 --- /dev/null +++ b/packages/ui-footer/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/packages/ui-footer/src/common/constants.ts b/packages/ui-footer/src/common/constants.ts new file mode 100644 index 00000000..c9ef4cfe --- /dev/null +++ b/packages/ui-footer/src/common/constants.ts @@ -0,0 +1 @@ +export const FOOTER_CLASSNAME = "av-footer"; diff --git a/packages/ui-components/src/components/Footer/Footer.tsx b/packages/ui-footer/src/components/Footer/Footer.tsx similarity index 100% rename from packages/ui-components/src/components/Footer/Footer.tsx rename to packages/ui-footer/src/components/Footer/Footer.tsx diff --git a/packages/ui-components/src/components/Footer/FooterTypes.d.ts b/packages/ui-footer/src/components/Footer/FooterTypes.d.ts similarity index 100% rename from packages/ui-components/src/components/Footer/FooterTypes.d.ts rename to packages/ui-footer/src/components/Footer/FooterTypes.d.ts diff --git a/packages/ui-components/src/components/Footer/__tests__/Footer.test.tsx b/packages/ui-footer/src/components/Footer/__tests__/Footer.test.tsx similarity index 100% rename from packages/ui-components/src/components/Footer/__tests__/Footer.test.tsx rename to packages/ui-footer/src/components/Footer/__tests__/Footer.test.tsx diff --git a/packages/ui-footer/src/components/index.ts b/packages/ui-footer/src/components/index.ts new file mode 100644 index 00000000..f3760928 --- /dev/null +++ b/packages/ui-footer/src/components/index.ts @@ -0,0 +1,2 @@ +export * from "../common/constants"; +export * from "./Footer/Footer"; diff --git a/packages/ui-footer/src/index.css b/packages/ui-footer/src/index.css new file mode 100644 index 00000000..b5c61c95 --- /dev/null +++ b/packages/ui-footer/src/index.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/packages/ui-footer/src/style.ts b/packages/ui-footer/src/style.ts new file mode 100644 index 00000000..3a29aed1 --- /dev/null +++ b/packages/ui-footer/src/style.ts @@ -0,0 +1 @@ +import "./index.css"; diff --git a/packages/ui-footer/src/vite-env.d.ts b/packages/ui-footer/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/packages/ui-footer/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/ui-footer/tailwind.config.js b/packages/ui-footer/tailwind.config.js new file mode 100644 index 00000000..42ba260d --- /dev/null +++ b/packages/ui-footer/tailwind.config.js @@ -0,0 +1,2 @@ +import { commonTailwindConfigForComponent } from "../../configuration/tailwind.common"; +export default commonTailwindConfigForComponent(); diff --git a/packages/ui-footer/tsconfig.json b/packages/ui-footer/tsconfig.json new file mode 100644 index 00000000..652d144c --- /dev/null +++ b/packages/ui-footer/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../configuration/tsconfig.common.json", + "include": ["src"] +} diff --git a/packages/ui-footer/tsup.config.ts b/packages/ui-footer/tsup.config.ts new file mode 100644 index 00000000..7490cbb5 --- /dev/null +++ b/packages/ui-footer/tsup.config.ts @@ -0,0 +1,2 @@ +import { commonTsupConfig } from "../../configuration/tsup.common"; +export default commonTsupConfig; diff --git a/packages/ui-footer/vite.config.ts b/packages/ui-footer/vite.config.ts new file mode 100644 index 00000000..f23a2b78 --- /dev/null +++ b/packages/ui-footer/vite.config.ts @@ -0,0 +1,2 @@ +import { commonViteConfigForComponent } from "../../configuration/vite.common"; +export default commonViteConfigForComponent(); diff --git a/packages/ui-footer/vitest.config.js b/packages/ui-footer/vitest.config.js new file mode 100644 index 00000000..028e7ef7 --- /dev/null +++ b/packages/ui-footer/vitest.config.js @@ -0,0 +1,4 @@ +import { commonVitestConfig } from "../../configuration/vitestconfig.common"; +import viteConfig from "./vite.config"; + +export default commonVitestConfig(viteConfig); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b47fdf8..8e480c68 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -315,6 +315,9 @@ importers: '@versini/ui-card': specifier: workspace:../ui-card version: link:../ui-card + '@versini/ui-footer': + specifier: workspace:../ui-footer + version: link:../ui-footer '@versini/ui-hooks': specifier: workspace:../ui-hooks version: link:../ui-hooks @@ -343,6 +346,28 @@ importers: packages/ui-fingerprint: {} + packages/ui-footer: + dependencies: + '@tailwindcss/typography': + specifier: 0.5.15 + version: 0.5.15(tailwindcss@3.4.11) + '@versini/ui-private': + specifier: workspace:../ui-private + version: link:../ui-private + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + tailwindcss: + specifier: 3.4.11 + version: 3.4.11 + devDependencies: + '@versini/ui-styles': + specifier: workspace:../ui-styles + version: link:../ui-styles + packages/ui-form: dependencies: '@versini/ui-hooks': diff --git a/release-please-config.json b/release-please-config.json index aabf200e..d8113735 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -11,7 +11,8 @@ "packages/ui-button": {}, "packages/ui-anchor": {}, "packages/ui-bubble": {}, - "packages/ui-card": {} + "packages/ui-card": {}, + "packages/ui-footer": {} }, "plugins": ["node-workspace"], "pull-request-header": ":rocket: Automated Release"