create-stackr 0.2.0 → 0.3.0
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/README.md +10 -0
- package/dist/prompts/features.d.ts +1 -1
- package/dist/prompts/features.d.ts.map +1 -1
- package/dist/prompts/features.js +34 -25
- package/dist/prompts/features.js.map +1 -1
- package/dist/prompts/index.js +33 -6
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/preset.d.ts.map +1 -1
- package/dist/prompts/preset.js +69 -34
- package/dist/prompts/preset.js.map +1 -1
- package/dist/utils/template.js +1 -1
- package/dist/utils/template.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +43 -1
- package/dist/utils/validation.js.map +1 -1
- package/package.json +1 -1
- package/templates/base/backend/controllers/rest-api/routes/auth.ts.ejs +33 -1
- package/templates/base/backend/controllers/rest-api/routes/oauth-web.ts.ejs +6 -0
- package/templates/base/backend/domain/user/repository.drizzle.ts +28 -1
- package/templates/base/backend/domain/user/repository.prisma.ts +25 -0
- package/templates/base/backend/drizzle/{schema.drizzle.ts → schema.drizzle.ts.ejs} +25 -0
- package/templates/base/backend/lib/auth.drizzle.ts.ejs +27 -18
- package/templates/base/backend/lib/auth.prisma.ts.ejs +24 -18
- package/templates/base/backend/package.json.ejs +29 -23
- package/templates/base/backend/prisma/schema.prisma.ejs +20 -0
- package/templates/base/mobile/app/+not-found.tsx +1 -1
- package/templates/base/mobile/app/_layout.tsx.ejs +95 -10
- package/templates/base/mobile/package.json.ejs +21 -13
- package/templates/base/mobile/src/components/ui/Button.tsx +5 -3
- package/templates/base/mobile/src/components/ui/Card.tsx +1 -1
- package/templates/base/mobile/src/components/ui/Input.tsx +1 -1
- package/templates/base/mobile/src/components/ui/Skeleton.tsx +1 -1
- package/templates/base/mobile/src/components/ui/Toast.tsx +106 -0
- package/templates/base/mobile/src/components/ui/{IconSymbol.tsx → icon-symbol.tsx} +7 -0
- package/templates/base/mobile/src/components/ui/{LoadingSpinner.tsx → loading-spinner.tsx} +1 -1
- package/templates/base/mobile/src/components/ui/{OnboardingLayout.tsx → onboarding-layout.tsx} +2 -2
- package/templates/base/mobile/src/components/ui/{PaywallLayout.tsx → paywall-layout.tsx} +3 -3
- package/templates/base/mobile/src/constants/Theme.ts +3 -3
- package/templates/base/mobile/src/context/{ThemeContext.tsx → theme-context.tsx} +2 -2
- package/templates/base/mobile/src/lib/auth-client.ts.ejs +18 -0
- package/templates/base/mobile/src/services/{sdkInitializer.ts.ejs → sdk-initializer.ts.ejs} +4 -4
- package/templates/base/web/.prettierignore +6 -0
- package/templates/base/web/.prettierrc +8 -0
- package/templates/base/web/eslint.config.mjs +31 -7
- package/templates/base/web/next.config.ts +50 -1
- package/templates/base/web/package.json.ejs +14 -2
- package/templates/base/web/src/app/globals.css +1 -1
- package/templates/base/web/src/app/layout.tsx.ejs +2 -0
- package/templates/base/web/src/components/auth/protected-route.tsx.ejs +32 -5
- package/templates/base/web/src/components/providers/device-session-setup.tsx.ejs +1 -1
- package/templates/base/web/src/hooks/use-device-session.ts.ejs +2 -2
- package/templates/base/web/src/lib/auth/actions.ts.ejs +438 -15
- package/templates/base/web/src/lib/auth/config.ts.ejs +13 -0
- package/templates/base/web/src/lib/auth/cookies.ts.ejs +61 -0
- package/templates/base/web/src/lib/device/actions.ts.ejs +2 -10
- package/templates/base/web/src/lib/device/types.ts +37 -0
- package/templates/base/web/src/proxy.ts.ejs +12 -2
- package/templates/base/web/src/store/{deviceSession.store.ts.ejs → device-session-store.ts.ejs} +1 -1
- package/templates/features/mobile/auth/app/(auth)/{_layout.tsx → _layout.tsx.ejs} +7 -0
- package/templates/features/mobile/auth/app/(auth)/{login.tsx → login.tsx.ejs} +9 -8
- package/templates/features/mobile/auth/app/(auth)/{register.tsx → register.tsx.ejs} +9 -8
- package/templates/features/mobile/auth/app/(auth)/two-factor-expired.tsx.ejs +88 -0
- package/templates/features/mobile/auth/app/(auth)/two-factor.tsx.ejs +259 -0
- package/templates/features/mobile/auth/app/(public)/_layout.tsx +9 -0
- package/templates/features/mobile/{tabs/app/(tabs)/index.tsx → auth/app/(public)/index.tsx.ejs} +76 -257
- package/templates/features/mobile/auth/app/(tabs)/settings/_layout.tsx.ejs +20 -0
- package/templates/features/mobile/auth/app/(tabs)/settings/index.tsx.ejs +137 -0
- package/templates/features/mobile/auth/app/(tabs)/settings/security/_layout.tsx.ejs +35 -0
- package/templates/features/mobile/auth/app/(tabs)/settings/security/index.tsx.ejs +147 -0
- package/templates/features/mobile/auth/app/(tabs)/settings/security/set-password.tsx.ejs +140 -0
- package/templates/features/mobile/auth/app/(tabs)/settings/security/two-factor-manage.tsx.ejs +366 -0
- package/templates/features/mobile/auth/app/(tabs)/settings/security/two-factor-setup.tsx.ejs +317 -0
- package/templates/features/mobile/auth/app/account.tsx.ejs +331 -0
- package/templates/features/mobile/auth/app/verify-email.tsx.ejs +315 -0
- package/templates/features/mobile/auth/components/auth/{LoginForm.tsx.ejs → login-form.tsx.ejs} +15 -3
- package/templates/features/mobile/auth/components/auth/protected-screen.tsx.ejs +56 -0
- package/templates/features/mobile/auth/components/auth/{RegisterForm.tsx.ejs → register-form.tsx.ejs} +5 -3
- package/templates/features/mobile/auth/hooks/{useAuth.ts.ejs → auth.ts.ejs} +255 -1
- package/templates/features/mobile/auth/hooks/two-factor-timeout.ts.ejs +56 -0
- package/templates/features/mobile/auth/services/{deviceSession.ts → device-session.ts} +2 -10
- package/templates/features/mobile/auth/store/{deviceSession.store.ts → device-session-store.ts} +14 -5
- package/templates/features/mobile/auth/types/device-session.ts +37 -0
- package/templates/features/mobile/onboarding/app/(onboarding)/page-1.tsx.ejs +3 -1
- package/templates/features/mobile/onboarding/app/(onboarding)/page-2.tsx.ejs +3 -1
- package/templates/features/mobile/onboarding/app/(onboarding)/page-3.tsx.ejs +6 -1
- package/templates/features/mobile/paywall/app/paywall.tsx +4 -4
- package/templates/features/mobile/tabs/app/(tabs)/_layout.tsx +0 -6
- package/templates/features/mobile/tabs/app/(tabs)/_layout.tsx.ejs +60 -0
- package/templates/features/mobile/tabs/app/(tabs)/index.tsx.ejs +264 -0
- package/templates/features/web/auth/app/(app)/layout.tsx.ejs +8 -22
- package/templates/features/web/auth/app/(auth)/login/page.tsx.ejs +19 -3
- package/templates/features/web/auth/app/(auth)/login/two-factor/page.tsx.ejs +24 -0
- package/templates/features/web/auth/app/(auth)/verify-email/page.tsx.ejs +117 -152
- package/templates/features/web/auth/app/{(app) → (protected)}/dashboard/dashboard-client.tsx.ejs +41 -1
- package/templates/features/web/auth/app/{(app) → (protected)}/dashboard/page.tsx.ejs +3 -1
- package/templates/features/web/auth/app/(protected)/layout.tsx.ejs +67 -0
- package/templates/features/web/auth/app/(protected)/settings/security/page.tsx.ejs +19 -0
- package/templates/features/web/auth/app/(protected)/settings/security/security-settings.tsx.ejs +73 -0
- package/templates/features/web/auth/app/{(app) → (protected)}/settings/sessions/page.tsx.ejs +2 -6
- package/templates/features/web/auth/app/auth/callback/route.ts.ejs +5 -1
- package/templates/features/web/auth/app/auth/session-expired/route.ts.ejs +39 -0
- package/templates/features/web/auth/app/auth/two-factor-expired/route.ts.ejs +22 -0
- package/templates/features/web/auth/components/auth/login-form.tsx.ejs +18 -0
- package/templates/features/web/auth/components/auth/two-factor-verify.tsx.ejs +173 -0
- package/templates/features/web/auth/components/settings/set-password-form.tsx.ejs +123 -0
- package/templates/features/web/auth/components/settings/two-factor-manage.tsx.ejs +253 -0
- package/templates/features/web/auth/components/settings/two-factor-setup.tsx.ejs +249 -0
- package/templates/features/web/auth/components/ui/checkbox.tsx +32 -0
- package/templates/features/web/auth/components/ui/dialog.tsx +143 -0
- package/templates/features/web/auth/components/ui/input-otp.tsx +71 -0
- package/templates/integrations/mobile/adjust/store/{adjust.store.ts → adjust-store.ts} +3 -3
- package/templates/integrations/mobile/att/store/{att.store.ts → att-store.ts} +2 -2
- package/templates/integrations/mobile/revenuecat/store/{revenuecat.store.ts → revenuecat-store.ts} +1 -1
- package/templates/integrations/mobile/scate/store/{scate.store.ts → scate-store.ts} +1 -1
- package/templates/base/mobile/src/components/ui/index.ts +0 -6
- package/templates/base/mobile/src/store/index.ts.ejs +0 -18
- package/templates/base/web/src/lib/auth/index.ts.ejs +0 -40
- package/templates/features/mobile/auth/components/auth/index.ts +0 -2
- package/templates/features/mobile/auth/hooks/index.ts.ejs +0 -1
- /package/templates/base/mobile/src/services/{errorService.ts → error-service.ts} +0 -0
- /package/templates/base/mobile/src/store/{ui.store.ts → ui-store.ts} +0 -0
- /package/templates/features/web/auth/app/{(app) → (protected)}/settings/sessions/sessions-client.tsx.ejs +0 -0
- /package/templates/integrations/mobile/adjust/services/{adjustService.ts.ejs → adjust-service.ts.ejs} +0 -0
- /package/templates/integrations/mobile/att/services/{attService.ts → att-service.ts} +0 -0
- /package/templates/integrations/mobile/att/services/{trackingPermissions.ts → tracking-permissions.ts} +0 -0
- /package/templates/integrations/mobile/revenuecat/services/{revenuecatService.ts.ejs → revenuecat-service.ts.ejs} +0 -0
- /package/templates/integrations/mobile/scate/services/{scateService.ts.ejs → scate-service.ts.ejs} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { OTPInput, OTPInputContext } from "input-otp"
|
|
5
|
+
import { Dot } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const InputOTP = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof OTPInput>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof OTPInput>
|
|
12
|
+
>(({ className, containerClassName, ...props }, ref) => (
|
|
13
|
+
<OTPInput
|
|
14
|
+
ref={ref}
|
|
15
|
+
containerClassName={cn(
|
|
16
|
+
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
17
|
+
containerClassName
|
|
18
|
+
)}
|
|
19
|
+
className={cn("disabled:cursor-not-allowed", className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
))
|
|
23
|
+
InputOTP.displayName = "InputOTP"
|
|
24
|
+
|
|
25
|
+
const InputOTPGroup = React.forwardRef<
|
|
26
|
+
React.ElementRef<"div">,
|
|
27
|
+
React.ComponentPropsWithoutRef<"div">
|
|
28
|
+
>(({ className, ...props }, ref) => (
|
|
29
|
+
<div ref={ref} className={cn("flex items-center", className)} {...props} />
|
|
30
|
+
))
|
|
31
|
+
InputOTPGroup.displayName = "InputOTPGroup"
|
|
32
|
+
|
|
33
|
+
const InputOTPSlot = React.forwardRef<
|
|
34
|
+
React.ElementRef<"div">,
|
|
35
|
+
React.ComponentPropsWithoutRef<"div"> & { index: number }
|
|
36
|
+
>(({ index, className, ...props }, ref) => {
|
|
37
|
+
const inputOTPContext = React.useContext(OTPInputContext)
|
|
38
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(
|
|
44
|
+
"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
|
|
45
|
+
isActive && "z-10 ring-2 ring-ring ring-offset-background",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
{char}
|
|
51
|
+
{hasFakeCaret && (
|
|
52
|
+
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
|
|
53
|
+
<div className="h-4 w-px animate-caret-blink bg-foreground duration-1000" />
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
})
|
|
59
|
+
InputOTPSlot.displayName = "InputOTPSlot"
|
|
60
|
+
|
|
61
|
+
const InputOTPSeparator = React.forwardRef<
|
|
62
|
+
React.ElementRef<"div">,
|
|
63
|
+
React.ComponentPropsWithoutRef<"div">
|
|
64
|
+
>(({ ...props }, ref) => (
|
|
65
|
+
<div ref={ref} role="separator" {...props}>
|
|
66
|
+
<Dot />
|
|
67
|
+
</div>
|
|
68
|
+
))
|
|
69
|
+
InputOTPSeparator.displayName = "InputOTPSeparator"
|
|
70
|
+
|
|
71
|
+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
|
-
import { adjustService } from '../services/
|
|
3
|
-
import { useRevenueCatStore } from './revenuecat
|
|
4
|
-
import { useScateStore } from './scate
|
|
2
|
+
import { adjustService } from '../services/adjust-service';
|
|
3
|
+
import { useRevenueCatStore } from './revenuecat-store';
|
|
4
|
+
import { useScateStore } from './scate-store';
|
|
5
5
|
import { logger } from '../utils/logger';
|
|
6
6
|
|
|
7
7
|
interface AdjustState {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
|
-
import { attService } from '../services/
|
|
3
|
-
import { TrackingStatus, TrackingPermissionResult } from '../services/
|
|
2
|
+
import { attService } from '../services/att-service';
|
|
3
|
+
import { TrackingStatus, TrackingPermissionResult } from '../services/tracking-permissions';
|
|
4
4
|
import { logger } from '../utils/logger';
|
|
5
5
|
|
|
6
6
|
interface ATTState {
|
package/templates/integrations/mobile/revenuecat/store/{revenuecat.store.ts → revenuecat-store.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
|
-
import { revenueCatService } from '../services/
|
|
2
|
+
import { revenueCatService } from '../services/revenuecat-service';
|
|
3
3
|
import { CustomerInfo, PurchasesPackage, PurchasesOfferings } from 'react-native-purchases';
|
|
4
4
|
import { logger } from '../utils/logger';
|
|
5
5
|
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// UI Store (always included)
|
|
2
|
-
export * from './ui.store';
|
|
3
|
-
|
|
4
|
-
<% if (features.sessionManagement) { %>// Device Session Store
|
|
5
|
-
export * from './deviceSession.store';
|
|
6
|
-
<% } %>
|
|
7
|
-
<% if (integrations.revenueCat.enabled) { %>// RevenueCat Store
|
|
8
|
-
export * from './revenuecat.store';
|
|
9
|
-
<% } %>
|
|
10
|
-
<% if (integrations.adjust.enabled) { %>// Adjust Store
|
|
11
|
-
export * from './adjust.store';
|
|
12
|
-
<% } %>
|
|
13
|
-
<% if (integrations.scate.enabled) { %>// Scate Store
|
|
14
|
-
export * from './scate.store';
|
|
15
|
-
<% } %>
|
|
16
|
-
<% if (integrations.att.enabled) { %>// ATT Store
|
|
17
|
-
export * from './att.store';
|
|
18
|
-
<% } %>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth module exports
|
|
3
|
-
*
|
|
4
|
-
* This barrel file provides a clean public API for the auth module.
|
|
5
|
-
* Import from '@/lib/auth' instead of individual files.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Configuration
|
|
9
|
-
export { AUTH_CONFIG, COOKIE_NAMES, BETTER_AUTH_COOKIE_NAME } from "./config";
|
|
10
|
-
|
|
11
|
-
// Server actions for authentication
|
|
12
|
-
export {
|
|
13
|
-
signIn,
|
|
14
|
-
signUp,
|
|
15
|
-
signOut,
|
|
16
|
-
getSession,
|
|
17
|
-
requestPasswordReset,
|
|
18
|
-
resetPassword,
|
|
19
|
-
buildAuthHeaders,
|
|
20
|
-
<% if (features.authentication.emailVerification) { %>
|
|
21
|
-
verifyEmail,
|
|
22
|
-
<% } %>
|
|
23
|
-
type User,
|
|
24
|
-
type Session,
|
|
25
|
-
type AuthSession,
|
|
26
|
-
} from "./actions";
|
|
27
|
-
|
|
28
|
-
// OAuth actions
|
|
29
|
-
export { initiateOAuth, getOAuthUrl } from "./oauth";
|
|
30
|
-
|
|
31
|
-
// Cookie utilities (server-side only)
|
|
32
|
-
export {
|
|
33
|
-
setSessionCookie,
|
|
34
|
-
getSessionToken,
|
|
35
|
-
clearSessionCookie,
|
|
36
|
-
clearAuthCookies,
|
|
37
|
-
} from "./cookies";
|
|
38
|
-
|
|
39
|
-
// PKCE utilities (server-side only)
|
|
40
|
-
export { generatePKCE, verifyPKCE } from "./pkce";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useAuth';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/integrations/mobile/scate/services/{scateService.ts.ejs → scate-service.ts.ejs}
RENAMED
|
File without changes
|