@digilogiclabs/create-saas-app 2.4.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +2 -11
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/mobile/base/template/App.tsx +8 -13
- package/dist/templates/mobile/base/template/app/(auth)/login.tsx +1 -2
- package/dist/templates/mobile/base/template/app/(auth)/signup.tsx +1 -2
- package/dist/templates/mobile/base/template/app/checkout.tsx +2 -2
- package/dist/templates/mobile/base/template/package.json +0 -2
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments/template/app/_layout.tsx +4 -14
- package/dist/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments/template/package.json +1 -3
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +4 -14
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +1 -1
- package/dist/templates/mobile/ui-auth-payments-ai/template/package.json +0 -2
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +5 -15
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -2
- package/dist/templates/web/ai-platform/template/package.json +0 -2
- package/dist/templates/web/base/template/package.json +0 -2
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +2 -2
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +1 -1
- package/dist/templates/web/base/template/src/app/login/page.tsx +1 -2
- package/dist/templates/web/base/template/src/app/page.tsx +1 -1
- package/dist/templates/web/base/template/src/app/signup/page.tsx +1 -2
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +14 -19
- package/dist/templates/web/base/template/src/components/shared/header.tsx +1 -1
- package/dist/templates/web/base/template/src/lib/platform.ts +0 -25
- package/dist/templates/web/base/template/src/test/setup.ts +3 -8
- package/dist/templates/web/iot-dashboard/template/package.json +0 -1
- package/dist/templates/web/marketplace/template/package.json +0 -2
- package/dist/templates/web/micro-saas/template/package.json +0 -1
- package/dist/templates/web/ui-auth/template/.claude +1 -1
- package/dist/templates/web/ui-auth/template/context.md +5 -5
- package/dist/templates/web/ui-auth/template/package.json +0 -1
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +3 -3
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +1 -1
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +1 -1
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +3 -3
- package/dist/templates/web/ui-auth/template/src/lib/platform.ts +0 -16
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +3 -8
- package/dist/templates/web/ui-auth-ai/template/package.json +0 -1
- package/dist/templates/web/ui-auth-payments/template/package.json +0 -2
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +3 -3
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +7 -10
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +1 -1
- package/dist/templates/web/ui-auth-payments/template/src/lib/platform.ts +0 -25
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +3 -8
- package/dist/templates/web/ui-auth-payments-ai/template/.claude +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/context.md +11 -11
- package/dist/templates/web/ui-auth-payments-ai/template/package.json +0 -2
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +3 -3
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +7 -10
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/platform.ts +0 -18
- package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +3 -8
- package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -2
- package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +0 -2
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +7 -10
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +3 -8
- package/dist/templates/web/ui-auth-payments-video/template/package.json +0 -2
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +2 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +7 -10
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +3 -8
- package/dist/templates/web/ui-only/template/src/test/setup.ts +3 -8
- package/package.json +2 -2
- package/src/templates/mobile/base/template/App.tsx +8 -13
- package/src/templates/mobile/base/template/app/(auth)/login.tsx +1 -2
- package/src/templates/mobile/base/template/app/(auth)/signup.tsx +1 -2
- package/src/templates/mobile/base/template/app/checkout.tsx +2 -2
- package/src/templates/mobile/base/template/package.json +0 -2
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments/template/app/_layout.tsx +4 -14
- package/src/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments/template/package.json +1 -3
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +4 -14
- package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +1 -1
- package/src/templates/mobile/ui-auth-payments-ai/template/package.json +0 -2
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +5 -15
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -2
- package/src/templates/web/ai-platform/template/package.json +0 -2
- package/src/templates/web/base/template/package.json +0 -2
- package/src/templates/web/base/template/src/app/checkout/page.tsx +2 -2
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +1 -1
- package/src/templates/web/base/template/src/app/login/page.tsx +1 -2
- package/src/templates/web/base/template/src/app/page.tsx +1 -1
- package/src/templates/web/base/template/src/app/signup/page.tsx +1 -2
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +14 -19
- package/src/templates/web/base/template/src/components/shared/header.tsx +1 -1
- package/src/templates/web/base/template/src/lib/platform.ts +0 -25
- package/src/templates/web/base/template/src/test/setup.ts +3 -8
- package/src/templates/web/iot-dashboard/template/package.json +0 -1
- package/src/templates/web/marketplace/template/package.json +0 -2
- package/src/templates/web/micro-saas/template/package.json +0 -1
- package/src/templates/web/ui-auth/template/.claude +1 -1
- package/src/templates/web/ui-auth/template/context.md +5 -5
- package/src/templates/web/ui-auth/template/package.json +0 -1
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +3 -3
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +1 -1
- package/src/templates/web/ui-auth/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +1 -1
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +3 -3
- package/src/templates/web/ui-auth/template/src/lib/platform.ts +0 -16
- package/src/templates/web/ui-auth/template/src/test/setup.ts +3 -8
- package/src/templates/web/ui-auth-ai/template/package.json +0 -1
- package/src/templates/web/ui-auth-payments/template/package.json +0 -2
- package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +3 -3
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +7 -10
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/lib/platform.ts +0 -25
- package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +3 -8
- package/src/templates/web/ui-auth-payments-ai/template/.claude +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/context.md +11 -11
- package/src/templates/web/ui-auth-payments-ai/template/package.json +0 -2
- package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +3 -3
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +7 -10
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/platform.ts +0 -18
- package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +3 -8
- package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -2
- package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-audio/template/package.json +0 -2
- package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +1 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +7 -10
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +1 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +3 -8
- package/src/templates/web/ui-auth-payments-video/template/package.json +0 -2
- package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +2 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +7 -10
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +1 -1
- package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +3 -8
- package/src/templates/web/ui-only/template/src/test/setup.ts +3 -8
- package/src/templates/web/base/template.backup/.env.example +0 -15
- package/src/templates/web/ui-auth/template.backup/.env.example +0 -15
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.backup +0 -391
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx.bak +0 -391
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.backup +0 -391
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx.bak +0 -391
- package/src/templates/web/ui-only/template.backup/.env.example +0 -15
|
@@ -15,8 +15,8 @@ vi.mock('next/navigation', () => ({
|
|
|
15
15
|
usePathname: () => '/',
|
|
16
16
|
}))
|
|
17
17
|
|
|
18
|
-
// Mock
|
|
19
|
-
vi.mock('@digilogiclabs/
|
|
18
|
+
// Mock App SDK (optional - only if testing auth/payment components)
|
|
19
|
+
vi.mock('@digilogiclabs/app-sdk', () => ({
|
|
20
20
|
useAuth: () => ({
|
|
21
21
|
user: null,
|
|
22
22
|
loading: false,
|
|
@@ -26,18 +26,13 @@ vi.mock('@digilogiclabs/saas-factory-auth', () => ({
|
|
|
26
26
|
signOut: vi.fn(),
|
|
27
27
|
signInWithOAuth: vi.fn(),
|
|
28
28
|
}),
|
|
29
|
-
AuthProvider: ({ children }: { children: React.ReactNode }) => children,
|
|
30
|
-
}))
|
|
31
|
-
|
|
32
|
-
// Mock SaaS Factory Payments (optional - only if testing payment components)
|
|
33
|
-
vi.mock('@digilogiclabs/saas-factory-payments', () => ({
|
|
34
29
|
usePayments: () => ({
|
|
35
30
|
createCheckoutSession: vi.fn(),
|
|
36
31
|
createPortalSession: vi.fn(),
|
|
37
32
|
subscription: null,
|
|
38
33
|
loading: false,
|
|
39
34
|
}),
|
|
40
|
-
|
|
35
|
+
DLLProvider: ({ children }: { children: React.ReactNode }) => children,
|
|
41
36
|
}))
|
|
42
37
|
|
|
43
38
|
// Global test utilities
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digilogiclabs/create-saas-app",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Create modern SaaS applications with DLL Platform - tier-aware scaffolding with platform-core and app-sdk",
|
|
5
5
|
"main": "dist/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"ora": "^5.4.1",
|
|
70
70
|
"semver": "^7.5.4",
|
|
71
71
|
"validate-npm-package-name": "^5.0.0",
|
|
72
|
-
"zod": "^
|
|
72
|
+
"zod": "^4.1.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@changesets/cli": "^2.26.2",
|
|
@@ -2,8 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { StatusBar } from 'expo-status-bar';
|
|
3
3
|
import { StyleSheet, Text, View, Button } from 'react-native';
|
|
4
4
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
-
import {
|
|
6
|
-
import { PaymentsProvider } from '@digilogiclabs/saas-factory-payments/native';
|
|
5
|
+
import { DLLProvider, useAuth } from '@digilogiclabs/app-sdk';
|
|
7
6
|
import { StripeProvider } from '@stripe/stripe-react-native';
|
|
8
7
|
import { Link, Slot } from 'expo-router';
|
|
9
8
|
import {
|
|
@@ -100,18 +99,14 @@ function AppContent() {
|
|
|
100
99
|
export default function App() {
|
|
101
100
|
return (
|
|
102
101
|
<SafeAreaProvider>
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
102
|
+
<DLLProvider>
|
|
103
|
+
<StripeProvider
|
|
104
|
+
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY!}
|
|
105
|
+
merchantIdentifier="merchant.com.{{packageName}}.app"
|
|
106
106
|
>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
>
|
|
111
|
-
<AppContent />
|
|
112
|
-
</StripeProvider>
|
|
113
|
-
</PaymentsProvider>
|
|
114
|
-
</AuthProvider>
|
|
107
|
+
<AppContent />
|
|
108
|
+
</StripeProvider>
|
|
109
|
+
</DLLProvider>
|
|
115
110
|
</SafeAreaProvider>
|
|
116
111
|
);
|
|
117
112
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LoginForm } from '@digilogiclabs/saas-factory-ui/native';
|
|
2
|
-
import { AuthProvider } from '@digilogiclabs/saas-factory-auth/native';
|
|
3
2
|
import { createBrowserClient } from '@supabase/ssr';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { View } from 'react-native';
|
|
@@ -37,7 +36,7 @@ export default function LoginPage() {
|
|
|
37
36
|
<LoginForm
|
|
38
37
|
onSubmit={handleLogin}
|
|
39
38
|
onGoogleSignIn={handleGoogleLogin}
|
|
40
|
-
authProvider=
|
|
39
|
+
authProvider="supabase"
|
|
41
40
|
/>
|
|
42
41
|
</View>
|
|
43
42
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SignupForm } from '@digilogiclabs/saas-factory-ui/native';
|
|
2
|
-
import { AuthProvider } from '@digilogiclabs/saas-factory-auth/native';
|
|
3
2
|
import { createBrowserClient } from '@supabase/ssr';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { View } from 'react-native';
|
|
@@ -36,7 +35,7 @@ export default function SignupPage() {
|
|
|
36
35
|
<SignupForm
|
|
37
36
|
onSubmit={handleSignup}
|
|
38
37
|
onGoogleSignIn={handleGoogleSignup}
|
|
39
|
-
authProvider=
|
|
38
|
+
authProvider="supabase"
|
|
40
39
|
/>
|
|
41
40
|
</View>
|
|
42
41
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Button } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { usePayments } from '@digilogiclabs/app-sdk';
|
|
4
4
|
|
|
5
5
|
export default function CheckoutScreen() {
|
|
6
|
-
const { handleCheckout } =
|
|
6
|
+
const { handleCheckout } = usePayments();
|
|
7
7
|
|
|
8
8
|
const onCheckout = async () => {
|
|
9
9
|
await handleCheckout({
|
|
@@ -23,8 +23,6 @@
|
|
|
23
23
|
"react-native-safe-area-context": "4.6.3",
|
|
24
24
|
"react-native-gesture-handler": "~2.12.0",
|
|
25
25
|
"@digilogiclabs/saas-factory-ui": "^1.4.0",
|
|
26
|
-
"@digilogiclabs/saas-factory-auth": "^1.0.5",
|
|
27
|
-
"@digilogiclabs/saas-factory-payments": "^1.2.7",
|
|
28
26
|
"firebase": "^10.0.0",
|
|
29
27
|
"@supabase/supabase-js": "^2.0.0",
|
|
30
28
|
"@react-native-community/netinfo": "^11.0.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { Tabs } from 'expo-router';
|
|
4
|
-
import { useAuth } from '@digilogiclabs/
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
5
5
|
import { Redirect } from 'expo-router';
|
|
6
6
|
|
|
7
7
|
// UI Components - Updated for v0.22.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, RefreshControl, Dimensions, Animated } from 'react-native';
|
|
3
|
-
import { useAuth } from '@digilogiclabs/
|
|
3
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
4
4
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
5
|
import { BlurView } from 'expo-blur';
|
|
6
6
|
import * as Haptics from 'expo-haptics';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Alert, RefreshControl, Animated } from 'react-native';
|
|
3
3
|
import { router } from 'expo-router';
|
|
4
|
-
import { useAuth } from '@digilogiclabs/
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
5
5
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
6
|
import { BlurView } from 'expo-blur';
|
|
7
7
|
import * as Haptics from 'expo-haptics';
|
|
@@ -16,11 +16,8 @@ import {
|
|
|
16
16
|
AppShell
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
// Payments Provider
|
|
23
|
-
import { PaymentsProvider } from '@digilogiclabs/saas-factory-payments/native';
|
|
19
|
+
// App SDK Provider
|
|
20
|
+
import { DLLProvider } from '@digilogiclabs/app-sdk';
|
|
24
21
|
|
|
25
22
|
// Prevent the splash screen from auto-hiding before asset loading is complete
|
|
26
23
|
SplashScreen.preventAutoHideAsync();
|
|
@@ -56,13 +53,7 @@ export default function RootLayout() {
|
|
|
56
53
|
backgroundSync={true}
|
|
57
54
|
>
|
|
58
55
|
<NetworkAwareContent>
|
|
59
|
-
<
|
|
60
|
-
supabaseUrl={process.env.EXPO_PUBLIC_SUPABASE_URL!}
|
|
61
|
-
supabaseAnonKey={process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY!}
|
|
62
|
-
>
|
|
63
|
-
<PaymentsProvider
|
|
64
|
-
apiUrl={process.env.EXPO_PUBLIC_API_URL || 'http://localhost:3000'}
|
|
65
|
-
>
|
|
56
|
+
<DLLProvider>
|
|
66
57
|
<StripeProvider
|
|
67
58
|
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY!}
|
|
68
59
|
merchantIdentifier="merchant.com.{{packageName}}.app"
|
|
@@ -122,8 +113,7 @@ export default function RootLayout() {
|
|
|
122
113
|
<Toast />
|
|
123
114
|
<StatusBar style="auto" />
|
|
124
115
|
</StripeProvider>
|
|
125
|
-
|
|
126
|
-
</AuthProvider>
|
|
116
|
+
</DLLProvider>
|
|
127
117
|
</NetworkAwareContent>
|
|
128
118
|
</OfflineWrapper>
|
|
129
119
|
</HapticsProvider>
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
19
|
// Auth Hook
|
|
20
|
-
import { useAuth } from '@digilogiclabs/
|
|
20
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
21
21
|
|
|
22
22
|
// Validation Schema
|
|
23
23
|
const loginSchema = z.object({
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
19
|
// Auth Hook
|
|
20
|
-
import { useAuth } from '@digilogiclabs/
|
|
20
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
21
21
|
|
|
22
22
|
// Validation Schema
|
|
23
23
|
const signupSchema = z.object({
|
|
@@ -36,9 +36,7 @@
|
|
|
36
36
|
"react-native-reanimated": "~3.6.2",
|
|
37
37
|
|
|
38
38
|
"@digilogiclabs/saas-factory-ui": "^1.4.0",
|
|
39
|
-
|
|
40
|
-
"@digilogiclabs/saas-factory-payments": "^1.2.7",
|
|
41
|
-
|
|
39
|
+
|
|
42
40
|
"@supabase/supabase-js": "^2.39.0",
|
|
43
41
|
"@react-native-async-storage/async-storage": "1.21.0",
|
|
44
42
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { Tabs } from 'expo-router';
|
|
4
|
-
import { useAuth } from '@digilogiclabs/
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
5
5
|
import { Redirect } from 'expo-router';
|
|
6
6
|
|
|
7
7
|
// UI Components - Updated for v0.22.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, RefreshControl, Dimensions, Animated } from 'react-native';
|
|
3
|
-
import { useAuth } from '@digilogiclabs/
|
|
3
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
4
4
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
5
|
import { BlurView } from 'expo-blur';
|
|
6
6
|
import * as Haptics from 'expo-haptics';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Alert, RefreshControl, Animated } from 'react-native';
|
|
3
3
|
import { router } from 'expo-router';
|
|
4
|
-
import { useAuth } from '@digilogiclabs/
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
5
5
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
6
|
import { BlurView } from 'expo-blur';
|
|
7
7
|
import * as Haptics from 'expo-haptics';
|
|
@@ -16,11 +16,8 @@ import {
|
|
|
16
16
|
AppShell
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
// Payments Provider
|
|
23
|
-
import { PaymentsProvider } from '@digilogiclabs/saas-factory-payments/native';
|
|
19
|
+
// App SDK Provider
|
|
20
|
+
import { DLLProvider } from '@digilogiclabs/app-sdk';
|
|
24
21
|
|
|
25
22
|
// Prevent the splash screen from auto-hiding before asset loading is complete
|
|
26
23
|
SplashScreen.preventAutoHideAsync();
|
|
@@ -56,13 +53,7 @@ export default function RootLayout() {
|
|
|
56
53
|
backgroundSync={true}
|
|
57
54
|
>
|
|
58
55
|
<NetworkAwareContent>
|
|
59
|
-
<
|
|
60
|
-
supabaseUrl={process.env.EXPO_PUBLIC_SUPABASE_URL!}
|
|
61
|
-
supabaseAnonKey={process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY!}
|
|
62
|
-
>
|
|
63
|
-
<PaymentsProvider
|
|
64
|
-
apiUrl={process.env.EXPO_PUBLIC_API_URL || 'http://localhost:3000'}
|
|
65
|
-
>
|
|
56
|
+
<DLLProvider>
|
|
66
57
|
<StripeProvider
|
|
67
58
|
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY!}
|
|
68
59
|
merchantIdentifier="merchant.com.{{packageName}}.app"
|
|
@@ -122,8 +113,7 @@ export default function RootLayout() {
|
|
|
122
113
|
<Toast />
|
|
123
114
|
<StatusBar style="auto" />
|
|
124
115
|
</StripeProvider>
|
|
125
|
-
|
|
126
|
-
</AuthProvider>
|
|
116
|
+
</DLLProvider>
|
|
127
117
|
</NetworkAwareContent>
|
|
128
118
|
</OfflineWrapper>
|
|
129
119
|
</HapticsProvider>
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
19
|
// Auth Hook
|
|
20
|
-
import { useAuth } from '@digilogiclabs/
|
|
20
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
21
21
|
|
|
22
22
|
// Validation Schema
|
|
23
23
|
const loginSchema = z.object({
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
19
|
// Auth Hook
|
|
20
|
-
import { useAuth } from '@digilogiclabs/
|
|
20
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
21
21
|
|
|
22
22
|
// Validation Schema
|
|
23
23
|
const signupSchema = z.object({
|
|
@@ -36,8 +36,6 @@
|
|
|
36
36
|
"react-native-reanimated": "~3.6.2",
|
|
37
37
|
|
|
38
38
|
"@digilogiclabs/saas-factory-ui": "^1.4.0",
|
|
39
|
-
"@digilogiclabs/saas-factory-auth": "^1.0.5",
|
|
40
|
-
"@digilogiclabs/saas-factory-payments": "^1.2.7",
|
|
41
39
|
"@digilogiclabs/saas-factory-ai": "^4.0.2",
|
|
42
40
|
"@digilogiclabs/saas-factory-ai-types": "^4.0.2",
|
|
43
41
|
|
|
@@ -16,11 +16,8 @@ import {
|
|
|
16
16
|
AppShell
|
|
17
17
|
} from '@digilogiclabs/saas-factory-ui/native';
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
// Payments Provider
|
|
23
|
-
import { PaymentsProvider } from '@digilogiclabs/saas-factory-payments/native';
|
|
19
|
+
// App SDK Provider
|
|
20
|
+
import { DLLProvider } from '@digilogiclabs/app-sdk';
|
|
24
21
|
|
|
25
22
|
// Prevent the splash screen from auto-hiding before asset loading is complete
|
|
26
23
|
SplashScreen.preventAutoHideAsync();
|
|
@@ -56,16 +53,10 @@ export default function RootLayout() {
|
|
|
56
53
|
backgroundSync={true}
|
|
57
54
|
>
|
|
58
55
|
<NetworkAwareContent>
|
|
59
|
-
<
|
|
60
|
-
supabaseUrl={process.env.EXPO_PUBLIC_SUPABASE_URL!}
|
|
61
|
-
supabaseAnonKey={process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY!}
|
|
62
|
-
>
|
|
63
|
-
<PaymentsProvider
|
|
64
|
-
apiUrl={process.env.EXPO_PUBLIC_API_URL || 'http://localhost:3000'}
|
|
65
|
-
>
|
|
56
|
+
<DLLProvider>
|
|
66
57
|
<StripeProvider
|
|
67
58
|
publishableKey={process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY!}
|
|
68
|
-
merchantIdentifier="merchant.com.{{packageName}}
|
|
59
|
+
merchantIdentifier="merchant.com.{{packageName}}-app"
|
|
69
60
|
>
|
|
70
61
|
<AppShell
|
|
71
62
|
navigationMode="tabs"
|
|
@@ -122,8 +113,7 @@ export default function RootLayout() {
|
|
|
122
113
|
<Toast />
|
|
123
114
|
<StatusBar style="auto" />
|
|
124
115
|
</StripeProvider>
|
|
125
|
-
|
|
126
|
-
</AuthProvider>
|
|
116
|
+
</DLLProvider>
|
|
127
117
|
</NetworkAwareContent>
|
|
128
118
|
</OfflineWrapper>
|
|
129
119
|
</HapticsProvider>
|
|
@@ -39,8 +39,6 @@
|
|
|
39
39
|
"react-native-reanimated": "~3.6.2",
|
|
40
40
|
|
|
41
41
|
"@digilogiclabs/saas-factory-ui": "^1.4.0",
|
|
42
|
-
"@digilogiclabs/saas-factory-auth": "^1.0.5",
|
|
43
|
-
"@digilogiclabs/saas-factory-payments": "^1.2.7",
|
|
44
42
|
"@digilogiclabs/saas-factory-ai": "^4.0.2",
|
|
45
43
|
"@digilogiclabs/saas-factory-ai-types": "^4.0.2",
|
|
46
44
|
|
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
"react-dom": "^19.0.0",
|
|
19
19
|
"@digilogiclabs/platform-core": "^1.13.0",
|
|
20
20
|
"@digilogiclabs/app-sdk": "^1.0.0",
|
|
21
|
-
"@digilogiclabs/saas-factory-auth": "^1.0.7",
|
|
22
|
-
"@digilogiclabs/saas-factory-payments": "^1.2.9",
|
|
23
21
|
"@digilogiclabs/saas-factory-ai": "^1.0.0",
|
|
24
22
|
"@digilogiclabs/saas-factory-ui": "^1.4.0",
|
|
25
23
|
"ai": "^3.4.0",
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
"react-dom": "^19.0.0",
|
|
20
20
|
"@digilogiclabs/platform-core": "^1.13.0",
|
|
21
21
|
"@digilogiclabs/saas-factory-ui": "^1.4.0",
|
|
22
|
-
"@digilogiclabs/saas-factory-auth": "^1.0.6",
|
|
23
|
-
"@digilogiclabs/saas-factory-payments": "^1.2.8",
|
|
24
22
|
"tailwindcss": "^3.3.0",
|
|
25
23
|
"autoprefixer": "^10.4.16",
|
|
26
24
|
"postcss": "^8.4.31",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { usePayments } from '@digilogiclabs/app-sdk';
|
|
5
5
|
import { Button } from '@/components/ui/button';
|
|
6
6
|
import {
|
|
7
7
|
PageTransition,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import { CreditCard, Zap } from 'lucide-react';
|
|
16
16
|
|
|
17
17
|
export default function CheckoutPage() {
|
|
18
|
-
const { handleCheckout } =
|
|
18
|
+
const { handleCheckout } = usePayments();
|
|
19
19
|
const networkInfo = useNetworkInfo();
|
|
20
20
|
|
|
21
21
|
const onCheckout = async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import { useAuth } from '@digilogiclabs/
|
|
4
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
5
5
|
import { Button } from '@/components/ui/button';
|
|
6
6
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
7
7
|
import {
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
NetworkAwareContent,
|
|
8
8
|
OfflineWrapper
|
|
9
9
|
} from '@digilogiclabs/saas-factory-ui';
|
|
10
|
-
import { AuthProvider } from '@digilogiclabs/saas-factory-auth';
|
|
11
10
|
import { createBrowserClient } from '@supabase/ssr';
|
|
12
11
|
import React from 'react';
|
|
13
12
|
|
|
@@ -54,7 +53,7 @@ export default function LoginPage() {
|
|
|
54
53
|
<LoginForm
|
|
55
54
|
onSubmit={handleLogin}
|
|
56
55
|
onGoogleSignIn={handleGoogleLogin}
|
|
57
|
-
authProvider=
|
|
56
|
+
authProvider="supabase"
|
|
58
57
|
mobileOptimized={true}
|
|
59
58
|
touchFriendly={true}
|
|
60
59
|
/>
|
|
@@ -4,7 +4,7 @@ import { Button } from '@/components/ui/button'
|
|
|
4
4
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
5
5
|
import { Badge } from '@/components/ui/badge'
|
|
6
6
|
import { ArrowRight, Zap, Shield, Rocket, LogOut } from 'lucide-react'
|
|
7
|
-
import { useAuth } from '@digilogiclabs/
|
|
7
|
+
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
8
8
|
import {
|
|
9
9
|
MobileHero,
|
|
10
10
|
LazyImage,
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
NetworkAwareContent,
|
|
8
8
|
OfflineWrapper
|
|
9
9
|
} from '@digilogiclabs/saas-factory-ui';
|
|
10
|
-
import { AuthProvider } from '@digilogiclabs/saas-factory-auth';
|
|
11
10
|
import { createBrowserClient } from '@supabase/ssr';
|
|
12
11
|
import React from 'react';
|
|
13
12
|
|
|
@@ -54,7 +53,7 @@ export default function SignupPage() {
|
|
|
54
53
|
<SignupForm
|
|
55
54
|
onSubmit={handleSignup}
|
|
56
55
|
onGoogleSignIn={handleGoogleSignup}
|
|
57
|
-
authProvider=
|
|
56
|
+
authProvider="supabase"
|
|
58
57
|
mobileOptimized={true}
|
|
59
58
|
touchFriendly={true}
|
|
60
59
|
/>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import {
|
|
4
|
+
import { DLLProvider } from '@digilogiclabs/app-sdk'
|
|
5
5
|
import { ThemeProvider } from 'next-themes'
|
|
6
|
-
import { StripeProvider } from '@digilogiclabs/saas-factory-payments'
|
|
7
6
|
import { Toaster } from '@digilogiclabs/saas-factory-ui'
|
|
8
7
|
import { AppThemeProvider } from './theme-provider'
|
|
9
8
|
|
|
@@ -13,23 +12,19 @@ interface AppProvidersProps {
|
|
|
13
12
|
|
|
14
13
|
export function AppProviders({ children }: AppProvidersProps) {
|
|
15
14
|
return (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
15
|
+
<DLLProvider>
|
|
16
|
+
<ThemeProvider
|
|
17
|
+
attribute="class"
|
|
18
|
+
defaultTheme="{{defaultTheme}}"
|
|
19
|
+
enableSystem
|
|
20
|
+
disableTransitionOnChange
|
|
21
|
+
storageKey="{{packageName}}-theme"
|
|
19
22
|
>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
>
|
|
27
|
-
<AppThemeProvider themeColor="{{themeColor}}">
|
|
28
|
-
{children}
|
|
29
|
-
<Toaster />
|
|
30
|
-
</AppThemeProvider>
|
|
31
|
-
</ThemeProvider>
|
|
32
|
-
</StripeProvider>
|
|
33
|
-
</AuthProvider>
|
|
23
|
+
<AppThemeProvider themeColor="{{themeColor}}">
|
|
24
|
+
{children}
|
|
25
|
+
<Toaster />
|
|
26
|
+
</AppThemeProvider>
|
|
27
|
+
</ThemeProvider>
|
|
28
|
+
</DLLProvider>
|
|
34
29
|
)
|
|
35
30
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Link from 'next/link';
|
|
5
|
-
import { useAuth } from '@digilogiclabs/
|
|
5
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
6
6
|
import { Button } from '@/components/ui/button';
|
|
7
7
|
import { ThemeToggle } from '@/components/ui/theme-toggle';
|
|
8
8
|
import { ResponsiveHeader, MobileNavigation } from '@digilogiclabs/saas-factory-ui';
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { createPlatform, createPlatformAsync, type IPlatform } from '@digilogiclabs/platform-core';
|
|
18
|
-
import { setPlatform as setAuthPlatform } from '@digilogiclabs/saas-factory-auth';
|
|
19
|
-
import { setPlatform as setPaymentsPlatform } from '@digilogiclabs/saas-factory-payments';
|
|
20
18
|
|
|
21
19
|
// Singleton platform instance
|
|
22
20
|
let platformInstance: IPlatform | null = null;
|
|
@@ -36,7 +34,6 @@ let platformInstance: IPlatform | null = null;
|
|
|
36
34
|
export function getPlatform(): IPlatform {
|
|
37
35
|
if (!platformInstance) {
|
|
38
36
|
platformInstance = createPlatform();
|
|
39
|
-
initializePackageIntegrations(platformInstance);
|
|
40
37
|
}
|
|
41
38
|
return platformInstance;
|
|
42
39
|
}
|
|
@@ -61,32 +58,10 @@ export async function initializePlatform(): Promise<IPlatform> {
|
|
|
61
58
|
// Use createPlatformAsync for production adapters
|
|
62
59
|
// Falls back to memory adapters if env vars are not set
|
|
63
60
|
platformInstance = await createPlatformAsync();
|
|
64
|
-
initializePackageIntegrations(platformInstance);
|
|
65
61
|
|
|
66
62
|
return platformInstance;
|
|
67
63
|
}
|
|
68
64
|
|
|
69
|
-
/**
|
|
70
|
-
* Initialize package integrations with platform services
|
|
71
|
-
*/
|
|
72
|
-
function initializePackageIntegrations(platform: IPlatform): void {
|
|
73
|
-
// Connect saas-factory-auth to platform-core
|
|
74
|
-
// Enables: logging, metrics, and email for auth events
|
|
75
|
-
setAuthPlatform({
|
|
76
|
-
email: platform.email,
|
|
77
|
-
logger: platform.logger,
|
|
78
|
-
metrics: platform.metrics,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// Connect saas-factory-payments to platform-core
|
|
82
|
-
// Enables: logging, metrics, and caching for payment events
|
|
83
|
-
setPaymentsPlatform({
|
|
84
|
-
logger: platform.logger,
|
|
85
|
-
metrics: platform.metrics,
|
|
86
|
-
cache: platform.cache,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
65
|
/**
|
|
91
66
|
* Reset platform instance (useful for testing)
|
|
92
67
|
*/
|