Commit Graph

532 Commits

Author SHA1 Message Date
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
giancarlo
940e704069 Refactor SQL tests, add function for single account per owner, enhance generator configuration
Enhanced the Supabase SQL tests by refining the code indentation. Added a new function that ensures users can only own a single account. Revised the interactive generator to use boolean checks rather than string inputs which simplifies the setup process and prevents potential user errors.
2024-06-08 00:31:10 +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
6ec939469b Merge remote-tracking branch 'origin/main' 2024-06-06 15:36:36 +07:00
Giancarlo Buomprisco
c9f0ec5d89 Turbo v2 (#32)
Updated to Turbo v2, and updated dependencies.
2024-06-06 15:36:16 +07:00
giancarlo
d057359ceb Added package.json scripts for env 2024-06-05 20:12:09 +07:00
giancarlo
aba9076805 Use existing environment variables as defaults for the generator command. 2024-06-05 20:02:29 +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
d3a4fbdeb1 Refactor env file generation and validation
This commit replaces the previous use of execSync to generate .env.local files with the use of writeFileSync. It also updates the corresponding path and default value in the validation process. This change provides a more efficient and safer way to create these files and correctly update the related prompts.
2024-06-05 15:45:47 +07:00
giancarlo
83a4f29be4 Add environment variables generators and validators
Added a new generator for creating environment variables and a validator to check the validity of the created variables. Also updated the config file to include these new generators in the list of registered generators.
2024-06-05 14:59:10 +07:00
giancarlo
4b4feeec99 Added tests for storage 2024-06-05 13:12:35 +07:00
mk3ext
521cba7dd3 fix(web): update schema.sql for supabase, fixes file upload (#31)
The RLS policy restricted non-uuid file names from being uploaded to ANY bucket.
This was caused by the "or" condition in the policy. This fixes that by wrapping both "or" conditions in a single set of parentheses.
2024-06-05 12:43:04 +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
d203c9782d Remove redundant loaders and update styling
Deleted the previously redundant loaders from blog and docs sections. Updated the loading.tsx files in home to utilize the GlobalLoader component with improved styling. Additionally, styling in global-loader.tsx from the ui package has been modified to ensure better visibility.
2024-06-04 17:46:40 +07:00
giancarlo
5f872f26cd Remove unused tooling/license from pnpm-lock.yaml
In the pnpm-lock.yaml file, the tooling/license dependency was unused and has been removed.
2024-06-04 17:20:14 +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
3261f2b582 Add more efficient authentication check function to server components.
Added request logging to Next.js config.

This commit introduces a new function 'requireUserInServerComponent' which checks for user authentication and is used in multiple server components. The aim is to enhance efficiency by caching the function so that data is only fetched once per request, preventing unnecessary database hits. Existing components were modified accordingly to incorporate this new method.
2024-06-04 11:54:04 +07:00
giancarlo
16c0f07e59 Update collection type for content retrieval
Changed the collection type from 'pages' to 'documentation' when getting content by slug in the marketing docs page. This change is intended to target the correct content segment in the CMS client function.
2024-06-04 02:12:39 +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
ae162f7471 Merge branch 'main' of github.com:makerkit/next-supabase-saas-kit-turbo 2024-05-28 15:18:24 +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