From 4bf64fd73a3792aacb1fe1a16ea3820ac030367f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qing=20Wang=20=E2=9A=9B?= Date: Tue, 15 Aug 2023 11:13:24 +0800 Subject: [PATCH 1/5] feat: improve onboarding experience --- apps/main/package.json | 6 +- apps/main/src/pages/create.tsx | 1 + package.json | 2 +- packages/analytics/package.json | 4 +- packages/eslint-config/package.json | 2 +- packages/trpc/package.json | 4 +- packages/trpc/src/router/project.ts | 17 ++ packages/types/package.json | 2 +- packages/ui/package.json | 6 +- packages/ui/src/blocks/layout/site-layout.tsx | 6 +- .../src/components/text-field/text-field.tsx | 2 +- packages/ui/src/pages/create.tsx | 124 ++++++++++ .../dashboard/settings/page-identifier.tsx | 2 +- packages/ui/src/pages/index.ts | 1 + pnpm-lock.yaml | 231 +++++++++--------- 15 files changed, 281 insertions(+), 129 deletions(-) create mode 100644 apps/main/src/pages/create.tsx create mode 100644 packages/ui/src/pages/create.tsx diff --git a/apps/main/package.json b/apps/main/package.json index 5e727db1d..e96ae49a9 100644 --- a/apps/main/package.json +++ b/apps/main/package.json @@ -34,7 +34,7 @@ "html-loader": "4.2.0", "lodash": "4.17.21", "micro": "10.0.1", - "next": "13.4.13", + "next": "13.4.16", "next-axiom": "0.17.0", "next-connect": "0.12.2", "next-mdx-remote": "3.0.8", @@ -52,7 +52,7 @@ "superjson": "1.13.1", "type-fest": "4.2.0", "web-push": "3.6.4", - "zod": "3.21.4" + "zod": "3.22.0" }, "devDependencies": { "@chirpy-dev/bootstrapper": "workspace:*", @@ -61,7 +61,7 @@ "@chirpy-dev/eslint-config": "workspace:*", "@chirpy-dev/service-worker": "workspace:*", "@chirpy-dev/tsconfigs": "workspace:*", - "@next/bundle-analyzer": "13.4.13", + "@next/bundle-analyzer": "13.4.16", "@relative-ci/agent": "4.1.6", "@types/cors": "2.8.13", "@types/jest": "29.5.3", diff --git a/apps/main/src/pages/create.tsx b/apps/main/src/pages/create.tsx new file mode 100644 index 000000000..ddde9eaa6 --- /dev/null +++ b/apps/main/src/pages/create.tsx @@ -0,0 +1 @@ +export { Create as default } from '@chirpy-dev/ui'; diff --git a/package.json b/package.json index 7acccc8d0..501540939 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "eslint": "8.47.0", "husky": "8.0.3", "lint-staged": "13.2.3", - "next": "13.4.13", + "next": "13.4.16", "prettier": "2.8.8", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 3df50789d..0724b6c13 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -17,8 +17,8 @@ "@headlessui/react": "1.7.16", "@tremor/react": "3.6.1", "clsx": "2.0.0", - "framer-motion": "10.15.1", - "next": "13.4.13", + "framer-motion": "10.15.2", + "next": "13.4.16", "prop-types": "15.8.1", "react": "18.2.0", "react-dom": "18.2.0" diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 6802b7aec..d2c4a5e3e 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -13,7 +13,7 @@ "eslint-plugin-prettier": "4.2.1", "eslint-plugin-storybook": "0.6.7", "eslint-plugin-unicorn": "48.0.1", - "next": "13.4.13", + "next": "13.4.16", "prettier": "2.8.8", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/trpc/package.json b/packages/trpc/package.json index 21b08d4c3..460a248d5 100644 --- a/packages/trpc/package.json +++ b/packages/trpc/package.json @@ -26,7 +26,7 @@ "@trpc/server": "10.37.1", "@types/web-push": "3.3.2", "dayjs": "1.11.9", - "next": "13.4.13", + "next": "13.4.16", "next-auth": "4.23.0", "next-axiom": "0.17.0", "react": "18.2.0", @@ -34,7 +34,7 @@ "stripe": "12.18.0", "superjson": "1.13.1", "web-push": "3.6.4", - "zod": "3.21.4" + "zod": "3.22.0" }, "devDependencies": { "@types/jest": "29.5.3", diff --git a/packages/trpc/src/router/project.ts b/packages/trpc/src/router/project.ts index 27f5ef39c..d74a5ef34 100644 --- a/packages/trpc/src/router/project.ts +++ b/packages/trpc/src/router/project.ts @@ -123,6 +123,23 @@ export const projectRouter = router({ } return project; }), + validate: publicProcedure + .input( + z.object({ + domain: z.string(), + }), + ) + // Use mutation to let client query on-demand + .mutation(async ({ input }) => { + const proj = await prisma.project.findUnique({ + where: { + domain: input.domain, + }, + }); + if (proj?.id) { + return 'DOMAIN_UNIQUE_CONSTRAINT'; + } + }), }); async function getAllProjects({ username }: { username: string }) { diff --git a/packages/types/package.json b/packages/types/package.json index 9492e4706..0d07a1f1c 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -14,7 +14,7 @@ "@types/react": "18.2.20", "@types/react-dom": "18.2.7", "csstype": "3.1.2", - "next": "13.4.13", + "next": "13.4.16", "next-auth": "4.23.0", "next-mdx-remote": "3.0.8", "react": "18.2.0", diff --git a/packages/ui/package.json b/packages/ui/package.json index 486d543e9..6c22e8810 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -25,7 +25,7 @@ "@radix-ui/react-dropdown-menu": "2.0.5", "@radix-ui/react-popover": "1.0.6", "@radix-ui/react-tooltip": "1.0.6", - "@stripe/stripe-js": "2.0.0", + "@stripe/stripe-js": "2.1.0", "@tanstack/react-query": "4.32.6", "@tiptap/core": "2.0.4", "@tiptap/extension-image": "2.0.4", @@ -42,9 +42,9 @@ "crisp-sdk-web": "1.0.21", "dayjs": "1.11.9", "debounce-promise": "3.1.2", - "framer-motion": "10.15.1", + "framer-motion": "10.15.2", "lucide-react": "0.265.0", - "next": "13.4.13", + "next": "13.4.16", "next-auth": "4.23.0", "next-axiom": "0.17.0", "next-mdx-remote": "3.0.8", diff --git a/packages/ui/src/blocks/layout/site-layout.tsx b/packages/ui/src/blocks/layout/site-layout.tsx index 8cfebb976..12b1ff4bc 100644 --- a/packages/ui/src/blocks/layout/site-layout.tsx +++ b/packages/ui/src/blocks/layout/site-layout.tsx @@ -40,13 +40,15 @@ export function SiteLayout({ {!hideHeader &&
}
- {children} + {/* This div is necessary to make fill viewport work */} +
{children}
{!hideFooter &&