From 3a101ddc7f2eceac02841a7d2ee4d4df6ed285a5 Mon Sep 17 00:00:00 2001 From: FleetAdmiralJakob Date: Mon, 8 Jan 2024 19:18:44 +0100 Subject: [PATCH] fix: Fixed bug that was preventing to build and restructured the old ui package --- apps/web/package.json | 2 +- apps/web/src/components/Layout.tsx | 2 +- .../home => components}/moon-phase-info.tsx | 0 apps/web/src/pages/_app.tsx | 2 +- apps/web/src/pages/home/index.tsx | 14 +- packages/{ui => components}/package.json | 18 +-- packages/{ui => components}/src/index.ts | 0 packages/{ui => components}/src/map.tsx | 0 .../{ui/src => components/src/ui}/button.tsx | 2 +- .../src => components/src/ui}/collapsible.tsx | 0 .../src => components/src/ui}/hover-card.tsx | 2 +- .../src => components/src/ui}/scroll-area.tsx | 2 +- .../src => components/src/ui}/skeleton.tsx | 2 +- .../{ui/src => components/src/ui}/sonner.tsx | 0 .../{ui => components}/tailwind.config.ts | 0 packages/{ui => components}/tsconfig.json | 0 pnpm-lock.yaml | 135 +++++++++++++----- 17 files changed, 119 insertions(+), 62 deletions(-) rename apps/web/src/{pages/home => components}/moon-phase-info.tsx (100%) rename packages/{ui => components}/package.json (80%) rename packages/{ui => components}/src/index.ts (100%) rename packages/{ui => components}/src/map.tsx (100%) rename packages/{ui/src => components/src/ui}/button.tsx (98%) rename packages/{ui/src => components/src/ui}/collapsible.tsx (100%) rename packages/{ui/src => components/src/ui}/hover-card.tsx (97%) rename packages/{ui/src => components/src/ui}/scroll-area.tsx (98%) rename packages/{ui/src => components/src/ui}/skeleton.tsx (88%) rename packages/{ui/src => components/src/ui}/sonner.tsx (100%) rename packages/{ui => components}/tailwind.config.ts (100%) rename packages/{ui => components}/tsconfig.json (100%) diff --git a/apps/web/package.json b/apps/web/package.json index f9c39c88..37849150 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -28,7 +28,7 @@ "@vercel/speed-insights": "^1.0.2", "@weatherio/api": "workspace:^0.1.0", "@weatherio/types": "workspace:^0.1.0", - "@weatherio/ui": "workspace:^0.1.0", + "@weatherio/components": "workspace:^0.1.0", "classnames": "^2.5.1", "dayjs": "^1.11.10", "next": "^14.0.4", diff --git a/apps/web/src/components/Layout.tsx b/apps/web/src/components/Layout.tsx index 37ce0db5..4bbcb47e 100644 --- a/apps/web/src/components/Layout.tsx +++ b/apps/web/src/components/Layout.tsx @@ -7,7 +7,7 @@ import { FaMapMarkedAlt, FaShare } from "react-icons/fa"; import { IoIosSettings, IoMdContact } from "react-icons/io"; import { LuMenu, LuX } from "react-icons/lu"; -import { cn } from "@weatherio/ui"; +import { cn } from "@weatherio/components"; interface LayoutProps { title?: string; diff --git a/apps/web/src/pages/home/moon-phase-info.tsx b/apps/web/src/components/moon-phase-info.tsx similarity index 100% rename from apps/web/src/pages/home/moon-phase-info.tsx rename to apps/web/src/components/moon-phase-info.tsx diff --git a/apps/web/src/pages/_app.tsx b/apps/web/src/pages/_app.tsx index 12294e3a..bda38f95 100644 --- a/apps/web/src/pages/_app.tsx +++ b/apps/web/src/pages/_app.tsx @@ -11,7 +11,7 @@ import { SpeedInsights } from "@vercel/speed-insights/next"; import { AxiomWebVitals } from "next-axiom"; import { appWithTranslation } from "next-i18next"; -import { Toaster } from "@weatherio/ui/sonner"; +import { Toaster } from "@weatherio/components/ui/sonner"; import { PWALifeCycle } from "~/components/PWALifecycle"; import { api } from "~/lib/utils/api"; diff --git a/apps/web/src/pages/home/index.tsx b/apps/web/src/pages/home/index.tsx index 3ecf5e39..df9bfdd8 100644 --- a/apps/web/src/pages/home/index.tsx +++ b/apps/web/src/pages/home/index.tsx @@ -27,27 +27,27 @@ import { PiSunglasses } from "react-icons/pi"; import { WiRaindrop } from "react-icons/wi"; import type { IDailyForecast, IHourlyForecast } from "@weatherio/types"; -import { Button } from "@weatherio/ui/button"; +import { Button } from "@weatherio/components/ui/button"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, -} from "@weatherio/ui/collapsible"; +} from "@weatherio/components/ui/collapsible"; import { HoverCard, HoverCardContent, HoverCardTrigger, -} from "@weatherio/ui/hover-card"; -import { ScrollArea, ScrollBar } from "@weatherio/ui/scroll-area"; -import { Skeleton } from "@weatherio/ui/skeleton"; +} from "@weatherio/components/ui/hover-card"; +import { ScrollArea, ScrollBar } from "@weatherio/components/ui/scroll-area"; +import { Skeleton } from "@weatherio/components/ui/skeleton"; import type { WindSpeedUnitType } from "~/states"; import Layout from "~/components/Layout"; +import { MoonPhaseInfo } from "~/components/moon-phase-info"; import { api } from "~/lib/utils/api"; -import { MoonPhaseInfo } from "~/pages/home/moon-phase-info"; import { activeCity$, temperatureUnit$, windSpeedUnit$ } from "~/states"; -const Map = dynamic(() => import("@weatherio/ui/map"), { ssr: false }); +const Map = dynamic(() => import("@weatherio/components/map"), { ssr: false }); dayjs.extend(utc); dayjs.extend(timezone); diff --git a/packages/ui/package.json b/packages/components/package.json similarity index 80% rename from packages/ui/package.json rename to packages/components/package.json index ca1e1b02..63f321e3 100644 --- a/packages/ui/package.json +++ b/packages/components/package.json @@ -1,17 +1,17 @@ { - "name": "@weatherio/ui", + "name": "@weatherio/components", "private": true, "version": "0.1.0", "type": "module", "exports": { ".": "./src/index.ts", - "./button": "./src/button.tsx", - "./collapsible": "./src/collapsible.tsx", - "./hover-card": "./src/hover-card.tsx", - "./map": "./src/map.tsx", - "./scroll-area": "./src/scroll-area.tsx", - "./skeleton": "./src/skeleton.tsx", - "./sonner": "./src/sonner.tsx" + "./ui/button": "./src/ui/button.tsx", + "./ui/collapsible": "./src/ui/collapsible.tsx", + "./ui/hover-card": "./src/ui/hover-card.tsx", + "./ui/scroll-area": "./src/ui/scroll-area.tsx", + "./ui/skeleton": "./src/ui/skeleton.tsx", + "./ui/sonner": "./src/ui/sonner.tsx", + "./map": "./src/map.tsx" }, "license": "MIT", "scripts": { @@ -37,9 +37,9 @@ "tailwindcss-animate": "^1.0.7" }, "devDependencies": { + "@types/leaflet": "^1.9.8", "@types/node": "^20.10.6", "@types/react": "^18.2.46", - "@types/leaflet": "^1.9.8", "@weatherio/eslint-config": "workspace:^0.2.0", "@weatherio/prettier-config": "workspace:^0.1.0", "@weatherio/tailwind-config": "workspace:^0.1.0", diff --git a/packages/ui/src/index.ts b/packages/components/src/index.ts similarity index 100% rename from packages/ui/src/index.ts rename to packages/components/src/index.ts diff --git a/packages/ui/src/map.tsx b/packages/components/src/map.tsx similarity index 100% rename from packages/ui/src/map.tsx rename to packages/components/src/map.tsx diff --git a/packages/ui/src/button.tsx b/packages/components/src/ui/button.tsx similarity index 98% rename from packages/ui/src/button.tsx rename to packages/components/src/ui/button.tsx index 3554a3c7..2170ca77 100644 --- a/packages/ui/src/button.tsx +++ b/packages/components/src/ui/button.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { cva } from "class-variance-authority"; -import { cn } from "."; +import { cn } from "../index"; const buttonVariants = cva( "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", diff --git a/packages/ui/src/collapsible.tsx b/packages/components/src/ui/collapsible.tsx similarity index 100% rename from packages/ui/src/collapsible.tsx rename to packages/components/src/ui/collapsible.tsx diff --git a/packages/ui/src/hover-card.tsx b/packages/components/src/ui/hover-card.tsx similarity index 97% rename from packages/ui/src/hover-card.tsx rename to packages/components/src/ui/hover-card.tsx index b434f360..1e9840b8 100644 --- a/packages/ui/src/hover-card.tsx +++ b/packages/components/src/ui/hover-card.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import * as HoverCardPrimitive from "@radix-ui/react-hover-card"; -import { cn } from "."; +import { cn } from "../index"; const HoverCard = HoverCardPrimitive.Root; diff --git a/packages/ui/src/scroll-area.tsx b/packages/components/src/ui/scroll-area.tsx similarity index 98% rename from packages/ui/src/scroll-area.tsx rename to packages/components/src/ui/scroll-area.tsx index bd6b4346..2350e9c2 100644 --- a/packages/ui/src/scroll-area.tsx +++ b/packages/components/src/ui/scroll-area.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; -import { cn } from "."; +import { cn } from "../index"; const ScrollArea = React.forwardRef< React.ElementRef, diff --git a/packages/ui/src/skeleton.tsx b/packages/components/src/ui/skeleton.tsx similarity index 88% rename from packages/ui/src/skeleton.tsx rename to packages/components/src/ui/skeleton.tsx index e1ca576b..0a688f2a 100644 --- a/packages/ui/src/skeleton.tsx +++ b/packages/components/src/ui/skeleton.tsx @@ -1,4 +1,4 @@ -import { cn } from "."; +import { cn } from "../index"; function Skeleton({ className, diff --git a/packages/ui/src/sonner.tsx b/packages/components/src/ui/sonner.tsx similarity index 100% rename from packages/ui/src/sonner.tsx rename to packages/components/src/ui/sonner.tsx diff --git a/packages/ui/tailwind.config.ts b/packages/components/tailwind.config.ts similarity index 100% rename from packages/ui/tailwind.config.ts rename to packages/components/tailwind.config.ts diff --git a/packages/ui/tsconfig.json b/packages/components/tsconfig.json similarity index 100% rename from packages/ui/tsconfig.json rename to packages/components/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ceed1466..d8fee3af 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,12 +74,12 @@ importers: '@weatherio/api': specifier: workspace:^0.1.0 version: link:../../packages/api + '@weatherio/components': + specifier: workspace:^0.1.0 + version: link:../../packages/components '@weatherio/types': specifier: workspace:^0.1.0 version: link:../../packages/types - '@weatherio/ui': - specifier: workspace:^0.1.0 - version: link:../../packages/ui classnames: specifier: ^2.5.1 version: 2.5.1 @@ -258,41 +258,7 @@ importers: specifier: workspace:^0.1.0 version: link:../../tooling/typescript - packages/e2e-web-tests: - dependencies: - '@weatherio/web': - specifier: workspace:* - version: link:../../apps/web - start-server-and-test: - specifier: ^2.0.3 - version: 2.0.3 - devDependencies: - '@types/node': - specifier: ^20.10.6 - version: 20.10.6 - '@weatherio/eslint-config': - specifier: workspace:^0.2.0 - version: link:../../tooling/eslint - '@weatherio/prettier-config': - specifier: workspace:^0.1.0 - version: link:../../tooling/prettier - '@weatherio/tsconfig': - specifier: workspace:^0.1.0 - version: link:../../tooling/typescript - - packages/types: - devDependencies: - '@weatherio/eslint-config': - specifier: workspace:^0.2.0 - version: link:../../tooling/eslint - '@weatherio/prettier-config': - specifier: workspace:^0.1.0 - version: link:../../tooling/prettier - '@weatherio/tsconfig': - specifier: workspace:^0.1.0 - version: link:../../tooling/typescript - - packages/ui: + packages/components: dependencies: '@radix-ui/react-collapsible': specifier: ^1.0.3 @@ -368,6 +334,40 @@ importers: specifier: ^5.3.3 version: 5.3.3 + packages/e2e-web-tests: + dependencies: + '@weatherio/web': + specifier: workspace:* + version: link:../../apps/web + start-server-and-test: + specifier: ^2.0.3 + version: 2.0.3 + devDependencies: + '@types/node': + specifier: ^20.10.6 + version: 20.10.6 + '@weatherio/eslint-config': + specifier: workspace:^0.2.0 + version: link:../../tooling/eslint + '@weatherio/prettier-config': + specifier: workspace:^0.1.0 + version: link:../../tooling/prettier + '@weatherio/tsconfig': + specifier: workspace:^0.1.0 + version: link:../../tooling/typescript + + packages/types: + devDependencies: + '@weatherio/eslint-config': + specifier: workspace:^0.2.0 + version: link:../../tooling/eslint + '@weatherio/prettier-config': + specifier: workspace:^0.1.0 + version: link:../../tooling/prettier + '@weatherio/tsconfig': + specifier: workspace:^0.1.0 + version: link:../../tooling/typescript + tooling/eslint: dependencies: '@next/eslint-plugin-next': @@ -6248,7 +6248,7 @@ packages: react: '*' react-dom: '*' dependencies: - next: 14.0.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0) + next: 14.0.4(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -6293,6 +6293,46 @@ packages: - babel-plugin-macros dev: false + /next@14.0.4(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==} + engines: {node: '>=18.17.0'} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + react: ^18.2.0 + react-dom: ^18.2.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + sass: + optional: true + dependencies: + '@next/env': 14.0.4 + '@swc/helpers': 0.5.2 + busboy: 1.6.0 + caniuse-lite: 1.0.30001572 + graceful-fs: 4.2.11 + postcss: 8.4.31 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + styled-jsx: 5.1.1(react@18.2.0) + watchpack: 2.4.0 + optionalDependencies: + '@next/swc-darwin-arm64': 14.0.4 + '@next/swc-darwin-x64': 14.0.4 + '@next/swc-linux-arm64-gnu': 14.0.4 + '@next/swc-linux-arm64-musl': 14.0.4 + '@next/swc-linux-x64-gnu': 14.0.4 + '@next/swc-linux-x64-musl': 14.0.4 + '@next/swc-win32-arm64-msvc': 14.0.4 + '@next/swc-win32-ia32-msvc': 14.0.4 + '@next/swc-win32-x64-msvc': 14.0.4 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + /no-case@2.3.2: resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==} dependencies: @@ -7591,6 +7631,23 @@ packages: react: 18.2.0 dev: false + /styled-jsx@5.1.1(react@18.2.0): + resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + client-only: 0.0.1 + react: 18.2.0 + dev: false + /sucrase@3.32.0: resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} engines: {node: '>=8'}