Commit Graph

571 Commits

Author SHA1 Message Date
gbuomprisco
fa73cf103a Update multiple package versions across the project
This commit performs an update of the version numbers for several packages used across the project. Overall, this is part of a maintenance task to ensure the latest version of each package is used to gain performance improvements, bug fixes and new features where applicable.
2024-07-03 10:52:32 +08:00
gbuomprisco
d155940df2 Update interval values in lemon-squeezy-webhook-handler
Changed the 'monthly' interval value to 'month' and the 'yearly' interval to 'year'. This change improves code consistency and alignment with the expected format for interval values.
2024-07-03 10:49:05 +08:00
gbuomprisco
6cdb46ea44 Remove redundant 'next' parameter check in auth callback
Refactored the condition handling for the next path in auth-callback.service.ts to only rely on the callbackUrl instead of an additional 'next' parameter. This not only simplifies the code but also reduces potential errors linked to multiple sources of truth for the next path direction.
2024-07-02 11:46:19 +08:00
gbuomprisco
bb846f461e Enhance handling of 'next' path in auth callback
This update improves the logic for handling the 'next' path in the auth callback service. Now, it first checks the query parameters for the 'next' path. If it's not found there, it looks into the callback URL
2024-07-01 16:25:34 +08:00
Giancarlo Buomprisco
9583aeec9f Update webhook handler and tailwind paths, add first subscription ite… (#40)
* Update webhook handler and tailwind paths, add first subscription item to types

In the lemon-squeezy-webhook-handler, changed logger from error to warning and refactored the generation of lineItems to use firstSubscriptionItem details and obtain the priceAmount. In tailwind's index file, adjusted the path to include src directories in packages. Also, the first_subscription_item has been added to the subscription-webhook type for better data representation.

* Refactor subscription interval calculation

The subscription interval calculation was refactored to use the new 'getSubscriptionIntervalType' function. This new function provides a more accurate calculation, where it determines the interval type ('monthly' or 'yearly') by comparing the renewal date with the current date.

* Update dependencies across multiple packages

This commit includes updates to the version of "supabase-js", "lucide-react", "react-query", "react-table", "postcss", "stripe" among other dependencies in multiple package.json files. The "pnpm-lock.yaml" file is also updated to reflect these changes. This ensures the project dependencies stay up-to-date to include new features, improvements and bug fixes.
2024-06-30 23:29:06 +08:00
gbuomprisco
90c1e23821 Update dependency versions
Updated several dependency versions across multiple packages. This includes updating "@supabase/supabase-js" from "^2.43.5" to "^2.44.1", "lucide-react" from "^0.396.0" to "^0.397.0", and "@stripe/react-stripe-js" from "^2.7.1" to "^2.7.2". Also, some dependencies in the lock file were updated.
2024-06-28 00:23:56 +08:00
gbuomprisco
82dbf0128f Refactor Keystatic configuration and update turbo.json
The keystatic.config.ts has been again refactor with new field validations and a new dedicated function to get collections. The "turbo.json" file is also updated with a new "ui" field. The refactor aims to streamline the collection generation, and the "ui" field in "turbo.json" enhances its configuration capabilities.
2024-06-28 00:20:35 +08:00
gbuomprisco
221f59b668 Update '@tanstack/react-query' version and refactor 'database.types.ts'
The '@tanstack/react-query' dependency version has been upgraded across several packages. Alongside, syntax and unnecessary semicolons in 'database.types.ts' have been cleaned up to adhere with the formatting standards.
2024-06-25 23:37:41 +08:00
gbuomprisco
6e218dc47b Update multiple packages and fix warning logs indentation
This commit includes the upgrade of multiple packages to their latest versions, including "@supabase/ssr", "stripe", "@playwright/test", "@typescript-eslint/eslint-plugin" and "@typescript-eslint/parser". It also ensures consistent warning logs indentation in route.ts.
2024-06-25 09:43:17 +08:00
gbuomprisco
5e26e1256e Fix testing value 2024-06-24 13:03:44 +08:00
gbuomprisco
6ea75bf10a Update Keystatic version and refactor version updater
This commit updates the Keystatic version to 0.5.23 and changes the interval for version refetching. The environment variable used for the refetch interval has been modified to NEXT_PUBLIC_VERSION_UPDATER_REFETCH_INTERVAL_SECONDS. Additionally, the code for checking for new version has been refactored and a visual change has been implemented to include a RocketIcon in the dialog header.
2024-06-24 12:38:21 +08:00
gbuomprisco
a3e5f928c4 Add guard clauses in getHashFromProcess
Additional logic has been introduced to the getHashFromProcess function. It will now exit early if the runtime is not Node.js or if the environment is not a development environment to prevent calling a Node.js command. This is done to avoid potential issues in the edge runtime and non-development environments.
2024-06-23 21:09:00 +08:00
gbuomprisco
6b48778753 Add version updater feature
Added a version updater component that frequently checks for updates to the app and alerts the user if necessary. This requires a new route, config changes, and additional UI resources. A new feature flag 'enableVersionUpdater' has been added in the feature-flags.config.ts file to toggle this feature.
2024-06-22 20:21:08 +08:00
gbuomprisco
a6ff3af677 Update package versions in multiple json files
Updated the package versions of "typescript", "lucide-react", "@radix-ui/react-dialog" and several other dependencies across multiple json files. The pnpm-lock.yaml file was also updated to reflect these changes in dependencies. This ensures that we use the most up-to-date versions of these packages in our project.
2024-06-22 15:41:41 +08:00
gbuomprisco
9294e1c823 Refactor code for readability and order
Made several changes across different files primarily focusing on readability. Arranged CSS classes in a standardized order for easier reading and maintenance. Arranged and formatted import lines, function declarations, and component return statements for legibility. Removed unnecessary React imports in some files.
2024-06-21 17:58:20 +08:00
gbuomprisco
8c929e6685 Add new email components: Content and Header
Two new functionalities for email templates have been introduced. A 'content' component which provides a container complete with border and padding specifications, and a 'header' component which simply encapsulates its child items. Both use the '@react-email/components' container for layout.
2024-06-21 17:00:38 +08:00
gbuomprisco
e96651d19b Update CSS in email templates
Enhanced the design of the 'invite-user' and 'confirm-email' templates by adding new CSS code. This CSS code professionaly styles the email, improving readability and user experience.
2024-06-21 16:59:02 +08:00
gbuomprisco
ccf3b38b06 Refactor stripe subscription retrieval process
The process of retrieving stripe subscriptions has been updated in the 'stripe-webhook-handler.service.ts' file. Instead of expanding to 'line_items', the process now retrieves just the subscription and proceeds to build the payload. The refactor aims to improve the performance and simplicity of the subscription retrieval process.
2024-06-21 13:04:23 +08:00
gbuomprisco
b3d938144f Replace app name with title in root metadata
The root metadata in the application config now uses the title instead of the name both in the metadata base and openGraph sections. Adding title into OpenGraph can significantly improve SEO and make the app more discoverable on the internet.
2024-06-21 01:22:25 +08:00
gbuomprisco
b288bca6b8 Update documentation loader limit and optimize sitemap generation
The documentation loader has been updated to limit the number of items to 500 from the previous limit of 'Number.MAX_SAFE_INTEGER'. Additionally, the handling of URL generation and item retrieval in 'server-sitemap.xml/route.ts' has been refactored for more effective sitemap generation. A new 'robots.ts' file was created to set up default rules for web robots accessing the site.
2024-06-20 19:28:47 +08:00
gbuomprisco
b9acbffcae Remove yarn package from dependencies
The yarn package, previously a dependency, has been removed from both pnpm-lock.yaml and package.json files. The removal is consistent across the application and the lockfile, ensuring that yarn will not be installed or used in any part of the project.
2024-06-20 12:43:33 +08:00
gbuomprisco
a8322789de Updated packages 2024-06-20 12:42:09 +08:00
gbuomprisco
95fa8fb7c6 Add handling for paid invoices in billing services
In response to paid invoices, a new callback method has been introduced in the billing services. This feature includes changes in billing-webhook-handler.service.ts, lemon-squeezy-webhook-handler.service.ts, and other related files. The new method fetches and handles paid invoice information from Stripe and LemonSqueezy subscriptions.
2024-06-20 00:02:25 +08:00
gbuomprisco
73c721557f Merge remote-tracking branch 'origin/main' 2024-06-19 23:05:27 +08:00
Giancarlo Buomprisco
6a339a4b02 Billing get subscription enhancement (#36)
* Filter out metered line items from billing schema

This update refines the process of creating a billing schema by filtering out metered line items. The change is necessary as metered line items can be shared across different plans, potentially causing conflicts or duplicates in the schema.

* Update packages to newer versions

This update upgrades several packages across multiple project files to their latest version. These packages include "supabase-js", "react-query", "react-hook-form", and "pnpm". The commit ensures the project is up-to-date with recent package versions, potentially benefiting from bug fixes, new features, and performance improvements.

* Add subscription retrieval in billing services

Added a function to retrieve subscription info in both Stripe and LemonSqueezy billing services. To accomplish this, new methods were added to related services and types. This allows querying specific subscription data based on its id, and throws an error if it fails. Furthermore, PayloadBuilder classes were created to systematically build the subscription payload.

* Remove account ID retrieval from Lemon Squeezy billing service

The code that was querying the database to fetch the accountId has been removed from lemon-squeezy-billing-strategy.service.ts. It was unnecessary as the Lemon Squeezy API does not provide account ID and therefore it is always left empty. Also, adjustments have been made in billing-strategy-provider.service.ts to reflect that the target account ID can be optional.

* Extract 'next' parameter from callback URL

The update allows for the extraction of the 'next' parameter from the callback URL. If such a parameter is available, it is subsequently added to the search parameters. The enhancement improves URL parameter handling in the authentication callback service.

* Refactor URL redirection in auth-callback service

The update simplifies the redirection logic in the authentication callback service. This is achieved by setting the url pathname directly to the redirect path, instead of first setting it to the callback parameter. Moreover, the code handling the 'next' path has also been streamlined, setting the url pathname to the next path when available.
2024-06-19 23:00:00 +08:00
gbuomprisco
abd4b1d095 Update packages to newer versions
This update upgrades several packages across multiple project files to their latest version. These packages include "supabase-js", "react-query", "react-hook-form", and "pnpm". The commit ensures the project is up-to-date with recent package versions, potentially benefiting from bug fixes, new features, and performance improvements.
2024-06-18 01:07:22 +08:00
gbuomprisco
b48380eb69 Filter out metered line items from billing schema
This update refines the process of creating a billing schema by filtering out metered line items. The change is necessary as metered line items can be shared across different plans, potentially causing conflicts or duplicates in the schema.
2024-06-18 01:06:08 +08:00
Giancarlo Buomprisco
fbe7ca4c9e Refactor password validation and enhance localization (#35)
* Refactor password validation and enhance localization

A new PasswordSchema is introduced to handle the password validation in a centralized way and is used across all authentication schemas. The password requirements are also altered with additional special character, number, and uppercase letter checks. Error messages now utilize localization to provide dynamic error notifications.

* Sign out before impersonating a user

This update adds a call to sign out before impersonating a user. This is an additional measure to ensure the security of the system, accentuating the isolation of user sessions.

* Refactor password validation and refine password schemas

The password validation process has been restructured. The 'PasswordSchema' is now split into two separate schemas - 'PasswordSchema' and 'RefinedPasswordSchema'. The logic for validating repeating passwords has been moved into a separate function named 'refineRepeatPassword'. This streamlines the password validation process and ensures consistency across password checks.
2024-06-17 14:37:18 +08:00
gbuomprisco
298e70b738 Refactor multi-factor challenge verification logic
This update modifies the multi-factor challenge execution in the auth component. By moving the onSuccess callback directly into the useVerifyMFAChallenge useMutation hook, it simplifies the code and removes unnecessary useCallback use. Also, it reduces the dependency on useEffect to handle the success scenario which enhances readability and maintainability.
2024-06-17 13:12:40 +08:00
gbuomprisco
f15e92a306 Adjust MFA factor fetching and verification process
This commit refines the Multi-Factor Authentication (MFA) handling by removing 'requireUser' method, optimizing 'useFetchMfaFactors' hook to avoid fetching stale data, and improving error logging. The changes enhance the system's user session management and the MFA challenge response, ensuring smoother user experience and potential troubleshooting.
2024-06-17 12:30:20 +08:00
gbuomprisco
fc65293d98 Update localhost logic in auth-callback service
The logic handling localhost in the auth-callback service has been updated. The host is no longer automatically set to the request host; instead, it's only updated if it's currently set to localhost and the request host does not include localhost itself. This change improves handling of different host configurations.
2024-06-15 21:15:57 +08:00
gbuomprisco
6ee0dd345f Add auth email templates and update config
Expanded the Supabase configuration file to include new auth email templates and created corresponding HTML templates. These templates facilitate authentication emails such as invitations, confirmations, password resets, and magic link logins.
2024-06-15 20:47:16 +08:00
gbuomprisco
37c8be808d Update redirect behavior in auth success state
The commit introduces changes to the behavior of the "Update Password" page on a successful password update. Instead of redirecting the user back to the home page upon a successful update, the updated code now redirects the user to a specified URL passed in as a prop. The authentication configuration has also been updated to include a list of acceptable redirect URLs.
2024-06-15 17:37:56 +08:00
gbuomprisco
d3076dfebc Update sorting options in CMS client
The sorting options in the CMS client have been updated. Specifically, the 'slug' option has been removed from 'sortBy'. This change simplifies the options available for sorting operations.
2024-06-15 11:30:20 +08:00
gbuomprisco
f56e2b83b9 Update several package dependencies
Several dependencies across multiple packages have been updated to their later versions. This includes updates to 'lucide-react', '@lemonsqueezy/lemonsqueezy.js', 'supabase' and 'eslint-config-turbo'. The lock file has been updated to reflect these changes.
2024-06-15 11:23:09 +08:00
gbuomprisco
6e362a73af Update several package dependencies
Several dependencies across multiple packages have been updated to their later versions. This includes updates to 'lucide-react', '@lemonsqueezy/lemonsqueezy.js', 'supabase' and 'eslint-config-turbo'. The lock file has been updated to reflect these changes.
2024-06-15 11:07:43 +08:00
gbuomprisco
fb104e0b7f Simplify team account layout sidebar
The team account layout sidebar has been simplified by removing collapsible functionality and unneeded dependencies. The changes aim to improve clarity and reduce complexity in the codebase. With a lesser number of dependencies, future updates or improvements should be easier.
2024-06-13 22:28:15 +08:00
gbuomprisco
5af905256a Update multiple package versions across the project
Updated versions for "@tanstack/react-query" in several packages, "@lemonsqueezy/lemonsqueezy.js" in billing package and version references in "pnpm-lock.yaml". This commit aims for compatibility enhancement and potential bug fixes accompanying these updated versions.
2024-06-13 19:32:07 +08:00
gbuomprisco
10fc46af9c Add productName to subject in account-delete email
The change includes the productName as a prop in the subject of the account-delete email. This aims to give a more personalised message when sending emails related to account deletion, improving user experience.
2024-06-13 19:26:19 +08:00
gbuomprisco
9bf3f0ea4b Add documentation links to environment variable prompts
The environment variable prompts in the Turbo generator now include a link to the associated documentation. This addition helps guide end users in setting up their environment variables appropriately. The URL of the documentation page is declared as a constant, which is appended to each environment variable name to create the full documentation link.
2024-06-13 11:22:18 +08:00
Giancarlo Buomprisco
ca5e02f509 Add conditional checks for E2E and billing tests (#34)
* Add conditional checks for E2E and billing tests

Added a conditional check to only run the End-to-End (E2E) workflow if the environment variable ENABLE_E2E_JOB is set to true. Also added a similar check in the Playwright configuration for running billing tests only if the ENABLE_BILLING_TESTS environment variable is 'true'. This will allow more control over the tests run in different environments.
2024-06-12 16:51:28 +08:00
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
5e6ed5c6bd Re-generate lock file 2024-06-11 23:44:49 +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
gbuomprisco
134eeb2400 Fixed documentation navigation overflow 2024-06-09 00:10:00 +08:00
gbuomprisco
337c8043c8 Remove workspaces configuration from package.json
The configuration for the "workspaces" field in package.json file has been deleted. It should pick up the workspaces form pnpm-workspace.yaml instead.
2024-06-08 23:50:24 +08:00