Commit Graph

374 Commits

Author SHA1 Message Date
gbuomprisco
cbd8941c37 Upgrade 'next' package and several dependencies to newer versions
The 'next' package and its dependencies in several packages have been upgraded. The 'lemonsqueezy.js' and 'pino' libraries also received updates. This commit ensures that the project uses the latest features, performance improvements, and security patches from these dependencies.
2024-06-12 12:49:08 +08:00
gbuomprisco
236185933d Update package dependencies and remove unused import
Updated several package dependencies including 'react-hook-form' and '@types/node' in various package.json files, and '@typescript-eslint/eslint-plugin' and '@typescript-eslint/parser' in the ESLint configuration. Additionally, an unused import related to "prettier-plugin-tailwindcss" has been removed from the prettier tool configuration.
2024-06-12 00:04:08 +08:00
gbuomprisco
5e115ca600 Update several package dependencies
This commit updates the versions of several dependencies across various packages, with the primary updates being to `@tanstack/react-query`, `prettier`, and `lucide-react`. This helps to keep the project dependencies up-to-date and may also include minor bug fixes or improvements from the updated packages.
2024-06-11 23:36:11 +08:00
gbuomprisco
bb6f26f240 Update and refactor billing services and types
Several updates and refactorings have been made to the billing services and types. The "onInvoicePaid" method and some types related to line items have been removed. The comments and arguments for the "verifyWebhookSignature" and "handleWebhookEvent" methods in service classes have been updated for clarity. The "onEvent" method's arguments have also been adjusted in multiple places to improve consistency.
2024-06-11 23:35:32 +08:00
gbuomprisco
ce18a342ba Removed wrong parameter and fix build 2024-06-09 15:47:06 +08:00
gbuomprisco
83bb1521f7 Update host setting in auth-callback and add className prop to UI page
Included a conditional to check and update host settings in the 'auth-callback.service.ts' file to avoid incorrect host setting outside of Vercel. Additionally, added a className prop to the Page component in the UI package to enhance customization capabilities.
2024-06-09 15:42:49 +08:00
giancarlo
f8347c603c Update versions of multiple dependencies
This commit updates the minor and patch versions of several dependencies across multiple packages including eslint-config-turbo, lucide-react, stripe, turboo and others. It also updates the lockfile version. Additionally, styling for CheckCircle in 'packages/billing/gateway/src/components/pricing-table.tsx' has been adjusted.
2024-06-07 11:21:49 +07:00
giancarlo
390e01535b Remove 'invoice.paid' event handler in Stripe webhook service
The 'invoice.paid' event has been removed from the Stripe webhook handler service. The corresponding method handleInvoicePaid and the case in the switch statement have been deleted.
2024-06-07 01:46:36 +07:00
giancarlo
a965ca9d39 Add shouldCreateUser property to MagicLinkAuthContainer
The update integrates a new property, shouldCreateUser, in MagicLinkAuthContainer component. This property defines the behavior for both the sign-in and sign-up methods. It is assigned false for sign-in and true for sign-up methods.
2024-06-07 01:39:27 +07:00
giancarlo
2e7e289495 Fixed sign in with an invite token when user is signed out 2024-06-07 01:23:16 +07:00
Giancarlo Buomprisco
c9f0ec5d89 Turbo v2 (#32)
Updated to Turbo v2, and updated dependencies.
2024-06-06 15:36:16 +07:00
giancarlo
a3f339aaf6 Fix issues with Lemon Squeezy and i18n issue requiring a parameter we do not pass. 2024-06-05 19:15:21 +07:00
giancarlo
8808e37558 Refactor sign out and auth change listener hooks
In the use-sign-out.ts file, the use of query client has been removed and error handling has been improved during sign-out operations. Meanwhile, in the use-auth-change-listener.ts file, an unnecessary usage of query client and router has been removed. Event handling logic has also been simplified by using window.location.reload() instead of router.refresh() on user sign-out.
2024-06-04 19:38:51 +07:00
giancarlo
e2112eefee Update UI styling and Spinner component
Several updates have been made to UI components across various packages. Styling changes have been made in 'global-loader.tsx', 'docs-card.tsx', and 'pricing-table.tsx'. The Spinner component in 'spinner.tsx' has been updated to adjust size and animation properties. Addition of a new prop 'spinnerClassName' in 'loading-overlay.tsx' allows dynamic class assignment. The 'loading.tsx' now exports GlobalLoader directly instead of wrapping it in a function. 'pnpm-lock.yaml' has been updated with a new specifier.
2024-06-04 17:17:12 +07:00
giancarlo
ab1e09cbc1 Update packages and refactored code for improved performance
Updated versions of various packages including "@tanstack/react-query", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", and "@marsidev/react-turnstile".

 Additionally, refactored the code in several files including package.json, members-page.loader.ts, page.tsx to ensure proper import statements and optimal function execution order.
2024-06-04 16:03:31 +07:00
giancarlo
2696c08d7d Refactor BillingEventHandlerService and update SQL permissions
Changed BillingEventHandlerService from a class to a method. Also, the SQL permissions for service_role on public.order_items table have been updated to include insert, update and delete operations. Additionally, made adjustment to configuration values in the billing.sample.config.ts file.
2024-06-04 13:32:02 +07:00
giancarlo
cc4453ae4c Update loading bar and spinner animations
The loading bar's completion property on unmounting has been removed to make its behavior more consistent. The css classes have been updated for spinner animation: The 'zoom-in-80' class was changed to 'zoom-in-50' and 'slide-in-from-bottom-4' was added. Also, the react-top-loading-bar's continuous start time has been increased to 300.
2024-06-04 12:33:19 +07:00
giancarlo
86e4bdcc7a Update loading indicators with animation and unmount completion option
Updated the global loading and top loading bar indicators. For the global loading indicator, added zoom-in and fade-in animations. As for the top loading bar indicator, introduced an option to control whether to complete its progress once it's unmounted.
2024-06-04 02:00:23 +07:00
giancarlo
bf7e3185de Refactor cache functions to use explicit loaders
The commit refactors the previous implementation of using cache functions across several modules. They are now explicitly defined as loaders to improve readability and maintain a consistent style. This prevents the cache function calls from getting too nested and difficult to understand, especially in asynchronous cases. Additionally, the user session related hooks are deleted which were not used anymore.
2024-06-04 01:03:57 +07:00
giancarlo
b1c3f12721 Fixed React Query provider. Removed getSession and replaced with getUser to make Supabase happy. Fixed Stepper's responsiveness. 2024-06-03 16:13:55 +07:00
giancarlo
88cebc2126 Improved cache invalidation, and minor design fixes 2024-06-03 15:10:40 +07:00
giancarlo
d0c6981e78 New Tailwind CSS formatter run 2024-06-03 00:35:09 +07:00
giancarlo
08de59a43a Update dependencies and improve type safety in webhook handling
This commit updates various dependencies across the project, including a version bump for 'lucide-react' and 'prettier'. Additionally, it improves type safety in the 'database-webhook-handler.service.ts' by making the 'DatabaseChangePayload' and 'handleEvent' function more type-safe.
2024-06-03 00:33:49 +07:00
giancarlo
26b2eed60d Update pricing table to exclude flat line items
The pricing table component now filters out flat line items as they do not require further explanation. Consequently, changes have been made to the billing sample configuration file, turning a previously metered item into a flat one for clearer demonstration of usage.
2024-06-02 12:22:52 +07:00
giancarlo
ced1b4f7e3 Add refinement to ensure metered line items have zero cost
The billing schema has been updated to include a refinement that ensures metered line items have a cost of zero. To clarify, a different line item type should be added for a flat fee in Stripe. Additionally, unnecessary verifications and logic regarding item costs have been removed from the PlanPicker and LineItemDetails components.
2024-06-01 17:03:20 +07:00
giancarlo
2c52a06536 Update pricing table and billing configuration
Updated the pricing table component to display all line items for a plan, removed condition to exclude primary plan. Adjusted the type of a billing package in the sample configuration to be "metered" instead of "flat". Made related changes in line-item-details component to handle the changes in billing type and to fix the layout.
2024-06-01 15:59:39 +07:00
giancarlo
88ff32479a Update dependencies and refactor SentryProvider component
This update includes version bumps for several dependencies across multiple packages and applications including "@sentry/nextjs", "lucide-react", "@types/node", "pnpm", and others. It also includes a change to the SentryProvider component where the SentryMonitoringService is now instantiated outside the MonitoringProvider function instead of using useRef inside the function.
2024-05-31 19:38:56 +07:00
giancarlo
4be66cb3da Update logic for enabling monitoring instrumentation
The logic to enable the monitoring instrumentation was updated in both the Sentry and Baselime packages. This change ensures that the instrumentation is only enabled when the ENV variable 'ENABLE_MONITORING_INSTRUMENTATION' is specifically set to 'true' instead of simply checking for its existence.
2024-05-29 13:57:36 +07:00
giancarlo
789b06cc1b Update route handler to include route parameters
The changes include updating the route handler function to receive an additional argument containing the route parameters. The body type in the request parameters was also updated to define it as undefined instead of never when
2024-05-29 13:28:16 +07:00
Giancarlo Buomprisco
7f4bfb15e5 Replace createServerClient with createClient in multiple files (#30)
The `createServerClient` function has been replaced with the `createClient` function in the `server-actions.client.ts`, `route-handler.client.ts`, and `server-component.client.ts` files. This includes adding necessary import statements for `createClient` and adjusting the options passed to it, including `persistSession`, `detectSessionInUrl`, and `autoRefreshToken`.
2024-05-29 09:33:43 +07:00
giancarlo
cbf116c688 Add user id parameter to multi-factor authentication functions
The multi-factor authentication functions have been modified to accept a user id as a parameter. This provides more flexibility as it allows a more specific targeting of users. The `useFetchAuthFactors` function has been updated to export the function rather than default, and the `useFactorsMutationKey` function has been updated to take a user id.
2024-05-28 21:13:36 +07:00
Giancarlo Buomprisco
c495335fd5 Sentry + Turbopack fixes (#28)
* Updated packages

Updated all packages to the latest versions

* Refactor Sentry monitoring configuration and services

The Sentry monitoring configuration and services have been refactored to simplify the setup process. In addition, unnecessary files or exports have been removed from the Sentry package. These changes should make the process of initializing and using the Sentry monitoring services in both the client and server more straightforward and efficient.

* Refactor server-side Sentry instrumentation code

The conditional logic responsible for checking the runtime environment and the enabled status of the monitoring instrumentation has been adjusted. This refactoring simplifies the code, making it more readable, by clearly separating the conditions and nesting the environment-specific operations. A typo in the environment variable name "ENABLE_MONITORING_INSTRMENTATION" was also corrected to "ENABLE_MONITORING_INSTRUMENTATION".

* Rename environment variable for monitoring instrumentation

The environment variable controlling monitoring instrumentation has been renamed from 'MONITORING_INSTRUMENTATION_ENABLED' to 'ENABLE_MONITORING_INSTRUMENTATION'. It affects both the README and .env.production files within the monitoring/api and apps/web directories respectively.
2024-05-28 15:17:56 +07:00
giancarlo
1e047463c8 Upgrade dependencies and enhance UI components
This commit primarily focuses on updating various dependencies, including "@types/react", "@tanstack/react-query", "lucide-react", and others. In addition, several adjustments have been made to UI components, such as adding more properties
2024-05-27 16:12:29 +07:00
Giancarlo Buomprisco
127ad5a315 Force no cache in Supabase clients with Next.js (#27)
* Update navigation menu text color and disable caching in Supabase clients

Updated the active and hover text colors for the navigation menu in the UI package. Also, added prevention of any sort of caching in the Supabase clients (server-actions.client.ts, route-handler.client.ts, server-component.client.ts) to be eventually removed in Next v15. Automatic token refresh is also turned off in the server-component client.

* Increase content items limit in docs loader

The content items limit in the documentation loader has been increased to the maximum safe integer. This ensures that all documentation entries are retrieved from the CMS, avoiding any potential omissions due to arbitrary limits.
2024-05-26 14:44:43 +07:00
giancarlo
f164b24786 Updated packages 2024-05-25 11:31:42 +07:00
giancarlo
428805f791 Update logic for setting active subscription status
Broaden the conditions for active subscriptions in the lemon-squeezy-webhook-handler.service. Now, subscriptions that are cancelled but still within their valid period (cancelAtPeriodEnd) are considered active. This helps prevent users from losing access to services until their current subscription period strictly ends.
2024-05-22 00:49:26 +07:00
giancarlo
a115e37535 Update error handling and function calls in billing services
Minor modifications made to the billing service handlers to improve data interpretation and error processing. The 'getLineItemTypeById' function now uses 'item.variant' for more accurate line item type identification. Unnecessary 'Crypto' object instantiation has been removed in 'createHmac', while improved formatting applied to the error logging within the billing webhook.
2024-05-21 20:41:41 +07:00
giancarlo
70f5ff42df Update dependencies in pnpm-lock.yaml
This commit contains updates to several dependencies, including changes in versions and specifier details. Modifications were also made to the lockfile version. Furthermore, all updated dependencies had adjustments in their association with react, for example removing some dependencies from react and react-dom.
2024-05-21 20:18:02 +07:00
giancarlo
9107e31921 Rename 'subscription' path to 'return' in pricing components
The path referred to by "subscription" in the pricing table and pages has been updated to "return". This will redirect users back to the home page instead of the previously configured personalAccountBilling page after signing up or selecting a plan.
2024-05-21 13:50:30 +07:00
giancarlo
e4d4069aa8 Add check for document in useCsrfToken hook
This commit introduces a check for the existence of 'document' in 'useCsrfToken' hook. This is to protect against errors when using this hook in a non-browser environment where 'document' is not defined.
2024-05-20 12:12:07 +07:00
giancarlo
912995730b Update UI layout and update request handler types
The UI layout has been updated to fix full screen display issues and enable class names in Sidebar. Separately, request handler function types have been improved in next route handlers for better flexibility and type safety.
2024-05-20 12:11:28 +07:00
giancarlo
951356bfa6 Remove query parameters from the URL in auth-callback.service
The update on auth-callback.service now includes the deletion of 'token_hash', 'type', 'next', and 'callback' query parameters from the URL. This ensures a cleaner URL after the authentication callback process.
2024-05-20 02:03:16 +07:00
Giancarlo Buomprisco
048ab96cbc Add AuthCallbackService to handle auth callbacks in Supabase (#25)
* Add AuthCallbackService to handle auth callbacks in Supabase

Created a new service, AuthCallbackService, in the Supabase package to centralize the handling of authentication callbacks. This service handles two main tasks: verifying the token hash for user email verification and exchanging the authentication code for a session. Code in the web app routes were updated to utilize this new service, improving code organization and reusability.

* Remove CSRF Token Meta component and add Jaeger exporter

The CSRF Token Meta component was removed from the application. Instead, CSRF tokens are now included in the root metadata of the application. Additionally, the "@opentelemetry/exporter-jaeger" package was added as a dependency to the Sentry monitoring package. This enables the tracing of application requests via Jaeger.

* Refactor README.md and remove redundant content

Removed the excessive content and detailed instruction from the README.md file. The documentation has been moved to a more suitable and detailed location elsewhere.

* Update package dependencies in sentry/package.json

An ordering change has been made in the dependencies within the sentry/package.json file. The "@opentelemetry/exporter-jaeger" dependency was moved to its correct alphabetical order. No version changes were made.
2024-05-19 23:45:12 +07:00
giancarlo
3cf3c263bc Fixed issue with one-time payments; Updated packages 2024-05-18 22:56:57 +07:00
giancarlo
5c1e1d5cd0 Update package versions in pnpm-lock.yaml
Several package versions including '@types/node', '@supabase/supabase-js', '@tanstack/react-query' and others were updated in the pnpm-lock.yaml file. This commit ensures all references to these versions are properly updated across the project, contributing to the maintenance of dependency consistency.
2024-05-17 23:13:13 +07:00
giancarlo
e88ae7268a Update UI styles and behavior across various components
This commit updates a variety of user interface styles and interactivity across multiple components. Changes include altering color schemes and border styles, modifying button interactivity and behaviors, and updating font weights. An emphasis has been placed on enhancing visual appearance, improving user experience, and maintaining a more consistent look-and-feel across the application.
2024-05-16 15:56:25 +07:00
giancarlo
09c24346a6 Update logging and return statements in billing services
The commit modifies the logging level in the billing services from 'error' to 'info'. Moreover, the error statement has been modified to clarify that the subscription cancellation has possibly been done by the user. Also, it reduces redundant imports and beefs up the return structure in stripe-billing-strategy.service.
2024-05-15 11:28:37 +07:00
Giancarlo Buomprisco
4e50094808 Fix upsert billing (#24)
This commit updates the product_id and variant_id in both the subscription_items and order_items in the billing tests. Updates also include adding new checks to verify these changes. Changes are reflected in corresponding SQL files for personal and team billing subscriptions/orders tests.
2024-05-15 11:08:19 +07:00
giancarlo
9d30039ba8 Update package versions and optimize URL generation
Updated the versions of several packages including pino and pnpm. Also, the generation of URLs in the pricing-table.tsx file has been optimized by implementing URLSearchParams. A new global error page was also added.
2024-05-13 21:47:51 +07:00
giancarlo
a75009c0df Update route check and add PageBody wrapper
Updated the `isRouteActive` check in the sidebar component to ensure it doesn't falsely identify nested routes as active. Additionally, introduced a `PageBody` wrapper in the account page component for consistent styling and padding.
2024-05-13 19:51:33 +07:00