Menu

1.2.1

Good to know

Please check the version field in the package.json file for the version number

Bug Fixes

Required update, version 1.2.0 code needs to be updated.

  1. Fix stripe existence check

In app/api/admin/stripe/coupons/route.ts, before calling stripe.xxx methods, you need to check if stripe exists

app/api/admin/stripe/coupons/route.ts
  if (!stripe) {
    return apiResponse.serverError('Stripe is not initialized. Please check your environment variables.');
  }
  1. Fix unencoded symbol error

In app/[locale]/(protected)/dashboard/credit-usage-example/page.tsx, one instance of feature's has been changed to feature's

Optimizations

These optimizations are preparations for future features, old version code does not need to be synchronized.

  1. Split custom styles
  • Custom styles in styles/globals.css have been split into styles/theme.css
  • Import theme.css in app/[locale]/layout.tsx

Future theme switching solution will be based on theme.css

  1. Use main for custom primary styles
  • Custom primary related CSS variables in styles/theme.css have been renamed to main
  • Add main color extension in tailwind.config.ts
  1. Support regular users uploading files through Cloudflare pre-signed URLs
  • generatePresignedUploadUrl in actions/r2-resources/index.ts has been extended to generateAdminPresignedUploadUrl and generateUserPresignedUploadUrl
  • Pages that previously used generatePresignedUploadUrl have been updated to use generateAdminPresignedUploadUrl

Other Updates

Non-essential updates, existing code does not need to be synchronized.

  • Text updates
  • Unified unauthorized default message
  • Added analyze command to package.json
  • Pricing page path now supports environment variable configuration (NEXT_PUBLIC_PRICING_PATH), defaults to /#pricing
  • Footer link object fields have been modified to sync with Header
  • Added website name configuration to config/site.ts, email templates and Footer locations that need to display the website name now use configuration instead of hardcoding
  • Renamed uploadFile method in @/lib/cloudflare/r2 to serverUploadFile, and updated all function names calling this method
  • Optimized BLOGS_IMAGE_PATH path by removing the suffix
  • Unified the method for server-side file upload to Cloudflare R2 file naming and path configuration
  • Changed the path of AI model list file models.ts