Files
MananTank 92896ddf3f Create shared UI library - @workspace/ui (#7855)
created a @workspace/ui package - shared by dashboard and playground. for now it only has button component for testing

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the `postcss` and `tailwind` configurations across multiple applications to centralize styles in the `@workspace/ui` package, along with various updates to components and layouts.

### Detailed summary
- Deleted `postcss.config.js` files and replaced them with `postcss.config.mjs` referencing `@workspace/ui`.
- Updated CSS imports to use `@workspace/ui/global.css`.
- Added `tailwindcss` configuration in `@workspace/ui` and updated references.
- Introduced new utility functions in `packages/ui/src/lib/utils.ts`.
- Modified component imports to utilize centralized components from `@workspace/ui`.
- Updated `package.json` files to include `@workspace/ui` as a dependency.
- Refactored button components to use a centralized button definition in `@workspace/ui`.
- Adjusted TypeScript configurations to align with the new structure.
- Enhanced global styles and configurations across multiple applications to ensure consistency.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- New Features
  - Added a shared UI package and unified Button component used across apps.

- Style
  - Apps now load shared global styles and animations from the UI package; global CSS and theme tokens consolidated.

- Bug Fixes
  - AI chat header uses a safe fallback when the client ID is missing.

- Refactor
  - Replaced local UI implementations with shared re-exports and composed Tailwind configs.

- Chores
  - Added UI package dependencies, PostCSS delegation, and enabled Next.js transpilation for the UI package; lint/scan ignore lists updated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-08-16 12:58:24 +00:00

171 lines
4.1 KiB
JavaScript

const ContentSecurityPolicy = `
default-src 'self';
img-src * data: blob:;
media-src * data: blob:;
object-src 'none';
style-src 'self' 'unsafe-inline';
font-src 'self';
frame-src * data:;
script-src 'self' 'unsafe-eval' 'unsafe-inline' 'wasm-unsafe-eval' 'inline-speculation-rules' *.thirdweb.com thirdweb.com *.thirdweb-dev.com vercel.live js.stripe.com;
connect-src * data: blob:;
worker-src 'self' blob:;
block-all-mixed-content;
`;
const securityHeaders = [
{
key: "X-DNS-Prefetch-Control",
value: "on",
},
{
key: "X-XSS-Protection",
value: "1; mode=block",
},
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "Referrer-Policy",
value: "origin-when-cross-origin",
},
{
key: "Content-Security-Policy",
value: ContentSecurityPolicy.replace(/\s{2,}/g, " ").trim(),
},
];
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@workspace/ui"],
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
serverSourceMaps: false,
webpackBuildWorker: true,
webpackMemoryOptimizations: true,
},
async headers() {
return [
{
headers: securityHeaders,
source: "/(.*)",
},
];
},
productionBrowserSourceMaps: false,
async redirects() {
return [
{
source: "/connect/pay",
destination: "/payments/ui-components",
permanent: false,
},
{
source: "/connect/pay/:path*",
destination: "/payments/:path*",
permanent: false,
},
{
source: "/connect/ui",
destination: "/wallets/headless/account-components",
permanent: false,
},
{
source: "/connect/ui/nft",
destination: "/wallets/headless/nft-components",
permanent: false,
},
{
source: "/connect/ui/token",
destination: "/wallets/headless/token-components",
permanent: false,
},
{
source: "/connect/ui/chain",
destination: "/wallets/headless/chain-components",
permanent: false,
},
{
source: "/connect/ui/wallet",
destination: "/wallets/headless/wallet-components",
permanent: false,
},
{
source: "/connect/:path*",
destination: "/wallets/:path*",
permanent: false,
},
{
source: "/engine/airdrop",
destination: "/transactions/airdrop-tokens",
permanent: false,
},
{
source: "/engine/minting",
destination: "/transactions/mint-tokens",
permanent: false,
},
{
source: "/engine/webhooks",
destination: "/transactions/webhooks",
permanent: false,
},
{
source: "/wallets/account-abstraction/sponsor",
destination: "/account-abstraction/eip-4337",
permanent: false,
},
{
source: "/wallets/account-abstraction/7702",
destination: "/account-abstraction/eip-7702",
permanent: false,
},
{
source: "/wallets/account-abstraction/5792",
destination: "/account-abstraction/eip-5792",
permanent: false,
},
{
source: "/wallets/account-abstraction/native-aa",
destination: "/account-abstraction/native-aa",
permanent: false,
},
{
source: "/wallets/headless/token-components",
destination: "/tokens/token-components",
permanent: false,
},
{
source: "/wallets/headless/nft-components",
destination: "/tokens/nft-components",
permanent: false,
},
{
source: "/wallets/in-app-wallet/ecosystem",
destination: "/wallets/ecosystem-wallet",
permanent: false,
},
];
},
async rewrites() {
return [
{
destination: "https://us-assets.i.posthog.com/static/:path*",
source: "/_ph/static/:path*",
},
{
destination: "https://us.i.posthog.com/:path*",
source: "/_ph/:path*",
},
{
destination: "https://us.i.posthog.com/decide",
source: "/_ph/decide",
},
];
},
};
export default nextConfig;