@ankhorage/studio 0.0.20 → 0.1.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 +1 -2
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +81 -56
- package/dist/cli/index.js.map +1 -1
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +17 -6
- package/dist/core/constants.js.map +1 -1
- package/dist/hooks/useProjects.js +1 -1
- package/dist/hooks/useProjects.js.map +1 -1
- package/dist/host/createStudioHost.d.ts +13 -0
- package/dist/host/createStudioHost.d.ts.map +1 -0
- package/dist/host/createStudioHost.js +16 -0
- package/dist/host/createStudioHost.js.map +1 -0
- package/dist/host/http/security.d.ts +2 -0
- package/dist/host/http/security.d.ts.map +1 -0
- package/dist/host/http/security.js +55 -0
- package/dist/host/http/security.js.map +1 -0
- package/dist/host/http/server.d.ts +16 -0
- package/dist/host/http/server.d.ts.map +1 -0
- package/dist/host/http/server.js +549 -0
- package/dist/host/http/server.js.map +1 -0
- package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts +38 -0
- package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts.map +1 -0
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js +262 -0
- package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -0
- package/dist/host/layout/layoutGenerator.d.ts +19 -0
- package/dist/host/layout/layoutGenerator.d.ts.map +1 -0
- package/dist/host/layout/layoutGenerator.js +418 -0
- package/dist/host/layout/layoutGenerator.js.map +1 -0
- package/dist/host/layout/templates/auth/adapter.d.ts +6 -0
- package/dist/host/layout/templates/auth/adapter.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/adapter.js +94 -0
- package/dist/host/layout/templates/auth/adapter.js.map +1 -0
- package/dist/host/layout/templates/auth/screen.d.ts +12 -0
- package/dist/host/layout/templates/auth/screen.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/screen.js +648 -0
- package/dist/host/layout/templates/auth/screen.js.map +1 -0
- package/dist/host/layout/templates/auth/session.d.ts +2 -0
- package/dist/host/layout/templates/auth/session.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/session.js +326 -0
- package/dist/host/layout/templates/auth/session.js.map +1 -0
- package/dist/host/layout/templates/auth/signOut.d.ts +2 -0
- package/dist/host/layout/templates/auth/signOut.d.ts.map +1 -0
- package/dist/host/layout/templates/auth/signOut.js +43 -0
- package/dist/host/layout/templates/auth/signOut.js.map +1 -0
- package/dist/host/layout/templates/index.d.ts +11 -0
- package/dist/host/layout/templates/index.d.ts.map +1 -0
- package/dist/host/layout/templates/index.js +10 -0
- package/dist/host/layout/templates/index.js.map +1 -0
- package/dist/host/layout/templates/navigation.d.ts +16 -0
- package/dist/host/layout/templates/navigation.d.ts.map +1 -0
- package/dist/host/layout/templates/navigation.js +332 -0
- package/dist/host/layout/templates/navigation.js.map +1 -0
- package/dist/host/layout/templates/nestedLayout.d.ts +7 -0
- package/dist/host/layout/templates/nestedLayout.d.ts.map +1 -0
- package/dist/host/layout/templates/nestedLayout.js +56 -0
- package/dist/host/layout/templates/nestedLayout.js.map +1 -0
- package/dist/host/layout/templates/redirect.d.ts +2 -0
- package/dist/host/layout/templates/redirect.d.ts.map +1 -0
- package/dist/host/layout/templates/redirect.js +10 -0
- package/dist/host/layout/templates/redirect.js.map +1 -0
- package/dist/host/layout/templates/rootLayout.d.ts +28 -0
- package/dist/host/layout/templates/rootLayout.d.ts.map +1 -0
- package/dist/host/layout/templates/rootLayout.js +507 -0
- package/dist/host/layout/templates/rootLayout.js.map +1 -0
- package/dist/host/layout/templates/screen.d.ts +6 -0
- package/dist/host/layout/templates/screen.d.ts.map +1 -0
- package/dist/host/layout/templates/screen.js +94 -0
- package/dist/host/layout/templates/screen.js.map +1 -0
- package/dist/host/layout/templates/utils/routes.d.ts +3 -0
- package/dist/host/layout/templates/utils/routes.d.ts.map +1 -0
- package/dist/host/layout/templates/utils/routes.js +15 -0
- package/dist/host/layout/templates/utils/routes.js.map +1 -0
- package/dist/host/layout/templates/utils/strings.d.ts +3 -0
- package/dist/host/layout/templates/utils/strings.d.ts.map +1 -0
- package/dist/host/layout/templates/utils/strings.js +7 -0
- package/dist/host/layout/templates/utils/strings.js.map +1 -0
- package/dist/host/layout/utils/escapeStringLiteral.d.ts +2 -0
- package/dist/host/layout/utils/escapeStringLiteral.d.ts.map +1 -0
- package/dist/host/layout/utils/escapeStringLiteral.js +8 -0
- package/dist/host/layout/utils/escapeStringLiteral.js.map +1 -0
- package/dist/host/manifestSystem/auth/index.d.ts +2 -0
- package/dist/host/manifestSystem/auth/index.d.ts.map +1 -0
- package/dist/host/manifestSystem/auth/index.js +2 -0
- package/dist/host/manifestSystem/auth/index.js.map +1 -0
- package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts +4 -0
- package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts.map +1 -0
- package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js +7 -0
- package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js.map +1 -0
- package/dist/host/manifestSystem/auth/shared/index.d.ts +3 -0
- package/dist/host/manifestSystem/auth/shared/index.d.ts.map +1 -0
- package/dist/host/manifestSystem/auth/shared/index.js +8 -0
- package/dist/host/manifestSystem/auth/shared/index.js.map +1 -0
- package/dist/host/manifestSystem/index.d.ts +5 -0
- package/dist/host/manifestSystem/index.d.ts.map +1 -0
- package/dist/host/manifestSystem/index.js +23 -0
- package/dist/host/manifestSystem/index.js.map +1 -0
- package/dist/host/manifestSystem/types.d.ts +8 -0
- package/dist/host/manifestSystem/types.d.ts.map +1 -0
- package/dist/host/manifestSystem/types.js +2 -0
- package/dist/host/manifestSystem/types.js.map +1 -0
- package/dist/host/modules/catalog.d.ts +40 -0
- package/dist/host/modules/catalog.d.ts.map +1 -0
- package/dist/host/modules/catalog.js +112 -0
- package/dist/host/modules/catalog.js.map +1 -0
- package/dist/host/modules/layout.d.ts +7 -0
- package/dist/host/modules/layout.d.ts.map +1 -0
- package/dist/host/modules/layout.js +2 -0
- package/dist/host/modules/layout.js.map +1 -0
- package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts +34 -0
- package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts.map +1 -0
- package/dist/host/modules/runtime/LocalFsTargetAdapter.js +85 -0
- package/dist/host/modules/runtime/LocalFsTargetAdapter.js.map +1 -0
- package/dist/host/orchestrator/generatedAppFiles.d.ts +8 -0
- package/dist/host/orchestrator/generatedAppFiles.d.ts.map +1 -0
- package/dist/host/orchestrator/generatedAppFiles.js +125 -0
- package/dist/host/orchestrator/generatedAppFiles.js.map +1 -0
- package/dist/host/orchestrator/generatedRouteCleanup.d.ts +5 -0
- package/dist/host/orchestrator/generatedRouteCleanup.d.ts.map +1 -0
- package/dist/host/orchestrator/generatedRouteCleanup.js +117 -0
- package/dist/host/orchestrator/generatedRouteCleanup.js.map +1 -0
- package/dist/host/orchestrator/infraGenerator.d.ts +35 -0
- package/dist/host/orchestrator/infraGenerator.d.ts.map +1 -0
- package/dist/host/orchestrator/infraGenerator.js +135 -0
- package/dist/host/orchestrator/infraGenerator.js.map +1 -0
- package/dist/host/orchestrator/infraRuntime.d.ts +38 -0
- package/dist/host/orchestrator/infraRuntime.d.ts.map +1 -0
- package/dist/host/orchestrator/infraRuntime.js +227 -0
- package/dist/host/orchestrator/infraRuntime.js.map +1 -0
- package/dist/host/orchestrator/infraValidation.d.ts +3 -0
- package/dist/host/orchestrator/infraValidation.d.ts.map +1 -0
- package/dist/host/orchestrator/infraValidation.js +59 -0
- package/dist/host/orchestrator/infraValidation.js.map +1 -0
- package/dist/host/orchestrator/moduleManager.d.ts +86 -0
- package/dist/host/orchestrator/moduleManager.d.ts.map +1 -0
- package/dist/host/orchestrator/moduleManager.js +312 -0
- package/dist/host/orchestrator/moduleManager.js.map +1 -0
- package/dist/host/orchestrator/projectDeletion.d.ts +27 -0
- package/dist/host/orchestrator/projectDeletion.d.ts.map +1 -0
- package/dist/host/orchestrator/projectDeletion.js +242 -0
- package/dist/host/orchestrator/projectDeletion.js.map +1 -0
- package/dist/host/orchestrator/projectManager.d.ts +87 -0
- package/dist/host/orchestrator/projectManager.d.ts.map +1 -0
- package/dist/host/orchestrator/projectManager.js +371 -0
- package/dist/host/orchestrator/projectManager.js.map +1 -0
- package/dist/host/orchestrator/projectPaths.d.ts +4 -0
- package/dist/host/orchestrator/projectPaths.d.ts.map +1 -0
- package/dist/host/orchestrator/projectPaths.js +25 -0
- package/dist/host/orchestrator/projectPaths.js.map +1 -0
- package/dist/host/orchestrator/projectStore.d.ts +24 -0
- package/dist/host/orchestrator/projectStore.d.ts.map +1 -0
- package/dist/host/orchestrator/projectStore.js +155 -0
- package/dist/host/orchestrator/projectStore.js.map +1 -0
- package/dist/host/orchestrator/resolveMutations.d.ts +3 -0
- package/dist/host/orchestrator/resolveMutations.d.ts.map +1 -0
- package/dist/host/orchestrator/resolveMutations.js +12 -0
- package/dist/host/orchestrator/resolveMutations.js.map +1 -0
- package/dist/host/orchestrator/scaffolder.d.ts +33 -0
- package/dist/host/orchestrator/scaffolder.d.ts.map +1 -0
- package/dist/host/orchestrator/scaffolder.js +246 -0
- package/dist/host/orchestrator/scaffolder.js.map +1 -0
- package/dist/host/orchestrator/templates.d.ts +83 -0
- package/dist/host/orchestrator/templates.d.ts.map +1 -0
- package/dist/host/orchestrator/templates.js +355 -0
- package/dist/host/orchestrator/templates.js.map +1 -0
- package/dist/host/orchestrator/workspaceRuntime.d.ts +2 -0
- package/dist/host/orchestrator/workspaceRuntime.d.ts.map +1 -0
- package/dist/host/orchestrator/workspaceRuntime.js +82 -0
- package/dist/host/orchestrator/workspaceRuntime.js.map +1 -0
- package/dist/host/templateRegistry/index.d.ts +16 -0
- package/dist/host/templateRegistry/index.d.ts.map +1 -0
- package/dist/host/templateRegistry/index.js +74 -0
- package/dist/host/templateRegistry/index.js.map +1 -0
- package/dist/host/utils/requirementsInference.d.ts +4 -0
- package/dist/host/utils/requirementsInference.d.ts.map +1 -0
- package/dist/host/utils/requirementsInference.js +49 -0
- package/dist/host/utils/requirementsInference.js.map +1 -0
- package/dist/host/utils/trimOutput.d.ts +7 -0
- package/dist/host/utils/trimOutput.d.ts.map +1 -0
- package/dist/host/utils/trimOutput.js +32 -0
- package/dist/host/utils/trimOutput.js.map +1 -0
- package/dist/host/utils/workspaceRoot.d.ts +2 -0
- package/dist/host/utils/workspaceRoot.d.ts.map +1 -0
- package/dist/host/utils/workspaceRoot.js +33 -0
- package/dist/host/utils/workspaceRoot.js.map +1 -0
- package/dist/host/zoraExtensions/index.d.ts +11 -0
- package/dist/host/zoraExtensions/index.d.ts.map +1 -0
- package/dist/host/zoraExtensions/index.js +54 -0
- package/dist/host/zoraExtensions/index.js.map +1 -0
- package/dist/runtime/appExtensionRegistry.d.ts +3 -0
- package/dist/runtime/appExtensionRegistry.d.ts.map +1 -0
- package/dist/runtime/appExtensionRegistry.js +8 -0
- package/dist/runtime/appExtensionRegistry.js.map +1 -0
- package/dist/runtime/index.d.ts +8 -4
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +8 -4
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/registry.d.ts +7 -0
- package/dist/runtime/registry.d.ts.map +1 -0
- package/dist/runtime/registry.js +7 -0
- package/dist/runtime/registry.js.map +1 -0
- package/dist/runtime/runtimeActions.d.ts +19 -0
- package/dist/runtime/runtimeActions.d.ts.map +1 -0
- package/dist/runtime/runtimeActions.js +5 -0
- package/dist/runtime/runtimeActions.js.map +1 -0
- package/dist/runtime/useRuntimeAction.d.ts +10 -0
- package/dist/runtime/useRuntimeAction.d.ts.map +1 -0
- package/dist/runtime/useRuntimeAction.js +30 -0
- package/dist/runtime/useRuntimeAction.js.map +1 -0
- package/package.json +35 -3
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
const APP_ROOT_REL = 'src/app';
|
|
3
|
+
const AUTH_ADAPTER_FILE_PATH = 'src/auth/adapter.ts';
|
|
4
|
+
const AUTH_SESSION_FILE_PATH = 'src/auth/session.ts';
|
|
5
|
+
const AUTH_SIGN_OUT_FILE_PATH = 'src/app/(app)/sign-out.tsx';
|
|
6
|
+
const DEFAULT_SIGN_IN_SCREEN_ID = 'screen-auth-sign-in';
|
|
7
|
+
const DEFAULT_SIGN_IN_LABEL = 'Sign in';
|
|
8
|
+
const DEFAULT_SIGN_UP_SCREEN_ID = 'screen-auth-sign-up';
|
|
9
|
+
const DEFAULT_SIGN_UP_LABEL = 'Sign up';
|
|
10
|
+
const PUBLIC_GUARD = 'public';
|
|
11
|
+
export function resolveAuthLayoutPlan(input) {
|
|
12
|
+
const { manifest } = input;
|
|
13
|
+
const { auth } = manifest.infra;
|
|
14
|
+
if (auth?.scope !== 'global' || auth.provider !== 'supabase') {
|
|
15
|
+
return createDisabledPlan();
|
|
16
|
+
}
|
|
17
|
+
const signInRoute = manifest.settings.authFlow.signInRoute.trim();
|
|
18
|
+
const signUpRoute = manifest.settings.authFlow.signUpRoute?.trim() ?? '';
|
|
19
|
+
const signOutRoute = manifest.settings.authFlow.signOutRoute?.trim() ?? '';
|
|
20
|
+
const postSignInRoute = manifest.settings.authFlow.postSignInRoute.trim();
|
|
21
|
+
if (!signInRoute || !signUpRoute || !signOutRoute || !postSignInRoute) {
|
|
22
|
+
return createDisabledPlan();
|
|
23
|
+
}
|
|
24
|
+
const signInRouteName = authFlowPathToRouteName(signInRoute);
|
|
25
|
+
const signUpRouteName = authFlowPathToRouteName(signUpRoute);
|
|
26
|
+
const signOutRouteName = authFlowPathToRouteName(signOutRoute);
|
|
27
|
+
const postSignInRouteName = authFlowPathToRouteName(postSignInRoute);
|
|
28
|
+
if (!signInRouteName || !signUpRouteName || !signOutRouteName || !postSignInRouteName) {
|
|
29
|
+
return createDisabledPlan();
|
|
30
|
+
}
|
|
31
|
+
const publicRoutes = collectPublicRoutes(manifest, signInRouteName, signUpRouteName);
|
|
32
|
+
const groupedNavigators = getGroupedAuthNavigators(manifest);
|
|
33
|
+
const hasSignOutRoute = groupedNavigators
|
|
34
|
+
? groupedNavigators.appNavigator.routes.some((route) => route.name === signOutRouteName)
|
|
35
|
+
: manifest.navigator.routes.some((route) => route.name === signOutRouteName);
|
|
36
|
+
const includeSignOutRoute = !hasSignOutRoute;
|
|
37
|
+
const partitionedNavigators = groupedNavigators
|
|
38
|
+
? {
|
|
39
|
+
appNavigator: ensureAuthSignOutRoute(groupedNavigators.appNavigator, includeSignOutRoute, signOutRouteName),
|
|
40
|
+
authNavigator: ensureGlobalAuthEntryRoutes(groupedNavigators.authNavigator, {
|
|
41
|
+
signInRouteName,
|
|
42
|
+
signUpRouteName,
|
|
43
|
+
}),
|
|
44
|
+
}
|
|
45
|
+
: partitionRootNavigatorForAuth(manifest, signInRouteName, publicRoutes, includeSignOutRoute, signOutRouteName);
|
|
46
|
+
const authNavigator = groupedNavigators
|
|
47
|
+
? partitionedNavigators.authNavigator
|
|
48
|
+
: ensureGlobalAuthEntryRoutes(partitionedNavigators.authNavigator, {
|
|
49
|
+
signInRouteName,
|
|
50
|
+
signUpRouteName,
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
enabled: true,
|
|
54
|
+
provider: 'supabase',
|
|
55
|
+
signInRoute,
|
|
56
|
+
signInRouteName,
|
|
57
|
+
signUpRoute,
|
|
58
|
+
signUpRouteName,
|
|
59
|
+
signOutRoute,
|
|
60
|
+
signOutRouteName,
|
|
61
|
+
postSignInRoute,
|
|
62
|
+
postSignInRouteName,
|
|
63
|
+
publicRoutes,
|
|
64
|
+
appNavigator: partitionedNavigators.appNavigator,
|
|
65
|
+
authNavigator,
|
|
66
|
+
generatedFiles: buildGeneratedFilePlans(includeSignOutRoute, signOutRouteName),
|
|
67
|
+
authScreenFiles: [
|
|
68
|
+
...collectAuthScreenFiles(partitionedNavigators.appNavigator, '(app)', {
|
|
69
|
+
signInRouteName,
|
|
70
|
+
signUpRouteName,
|
|
71
|
+
}),
|
|
72
|
+
...collectAuthScreenFiles(authNavigator, '(auth)', {
|
|
73
|
+
signInRouteName,
|
|
74
|
+
signUpRouteName,
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function createDisabledPlan() {
|
|
80
|
+
return {
|
|
81
|
+
enabled: false,
|
|
82
|
+
publicRoutes: [],
|
|
83
|
+
generatedFiles: [],
|
|
84
|
+
authScreenFiles: [],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function buildGeneratedFilePlans(includeSignOutRoute, signOutRouteName) {
|
|
88
|
+
const generatedFiles = [
|
|
89
|
+
{
|
|
90
|
+
path: AUTH_ADAPTER_FILE_PATH,
|
|
91
|
+
kind: 'adapter',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
path: AUTH_SESSION_FILE_PATH,
|
|
95
|
+
kind: 'session',
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
if (includeSignOutRoute) {
|
|
99
|
+
generatedFiles.push({
|
|
100
|
+
path: AUTH_SIGN_OUT_FILE_PATH,
|
|
101
|
+
kind: 'sign-out',
|
|
102
|
+
routeName: signOutRouteName,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return generatedFiles;
|
|
106
|
+
}
|
|
107
|
+
function collectAuthScreenFiles(navigator, currentRel, authRouteNames) {
|
|
108
|
+
const { signInRouteName, signUpRouteName } = authRouteNames;
|
|
109
|
+
const files = [];
|
|
110
|
+
const visit = (node, parentRel) => {
|
|
111
|
+
for (const route of node.routes) {
|
|
112
|
+
const nextRel = parentRel ? path.join(parentRel, route.name) : route.name;
|
|
113
|
+
if (route.navigator) {
|
|
114
|
+
visit(route.navigator, nextRel);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (!route.screenId || (route.name !== signInRouteName && route.name !== signUpRouteName)) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
files.push({
|
|
121
|
+
path: resolveRouteScreenFilePath(nextRel),
|
|
122
|
+
kind: 'auth-screen',
|
|
123
|
+
routeName: route.name,
|
|
124
|
+
screenId: route.screenId,
|
|
125
|
+
authMode: route.name === signUpRouteName ? 'signUp' : 'signIn',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
visit(navigator, currentRel);
|
|
130
|
+
return files;
|
|
131
|
+
}
|
|
132
|
+
function resolveRouteScreenFilePath(routeRel) {
|
|
133
|
+
const fileName = `${path.basename(routeRel)}.tsx`;
|
|
134
|
+
const dirRel = path.dirname(routeRel);
|
|
135
|
+
const targetDirRel = dirRel === '.' ? '' : dirRel;
|
|
136
|
+
return normalizeRel(path.join(APP_ROOT_REL, targetDirRel, fileName));
|
|
137
|
+
}
|
|
138
|
+
function getGroupedAuthNavigators(manifest) {
|
|
139
|
+
if (manifest.navigator.type !== 'stack') {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const appGroup = manifest.navigator.routes.find((route) => route.name === '(app)');
|
|
143
|
+
const authGroup = manifest.navigator.routes.find((route) => route.name === '(auth)');
|
|
144
|
+
if (!appGroup?.navigator || !authGroup?.navigator) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
appNavigator: appGroup.navigator,
|
|
149
|
+
authNavigator: authGroup.navigator,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function ensureAuthSignOutRoute(navigator, includeAuthSignOutRoute, signOutRouteName) {
|
|
153
|
+
if (!includeAuthSignOutRoute ||
|
|
154
|
+
navigator.routes.some((route) => route.name === signOutRouteName)) {
|
|
155
|
+
return navigator;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
...navigator,
|
|
159
|
+
routes: [
|
|
160
|
+
...navigator.routes,
|
|
161
|
+
{
|
|
162
|
+
name: signOutRouteName,
|
|
163
|
+
...(navigator.type === 'stack' ? {} : { hideInTabBar: true }),
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function ensureGlobalAuthEntryRoutes(navigator, authRouteNames) {
|
|
169
|
+
const withSignIn = ensureGlobalAuthEntryRoute(navigator, {
|
|
170
|
+
routeName: authRouteNames.signInRouteName,
|
|
171
|
+
routeLabel: DEFAULT_SIGN_IN_LABEL,
|
|
172
|
+
defaultScreenId: DEFAULT_SIGN_IN_SCREEN_ID,
|
|
173
|
+
});
|
|
174
|
+
return ensureGlobalAuthEntryRoute(withSignIn, {
|
|
175
|
+
routeName: authRouteNames.signUpRouteName,
|
|
176
|
+
routeLabel: DEFAULT_SIGN_UP_LABEL,
|
|
177
|
+
defaultScreenId: DEFAULT_SIGN_UP_SCREEN_ID,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function ensureGlobalAuthEntryRoute(navigator, args) {
|
|
181
|
+
const { routeName, routeLabel, defaultScreenId } = args;
|
|
182
|
+
if (hasRouteName(navigator.routes, routeName)) {
|
|
183
|
+
return navigator;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
...navigator,
|
|
187
|
+
routes: [
|
|
188
|
+
...navigator.routes,
|
|
189
|
+
buildGeneratedAuthRoute({
|
|
190
|
+
routeName,
|
|
191
|
+
routeLabel,
|
|
192
|
+
screenId: defaultScreenId,
|
|
193
|
+
navigatorType: navigator.type,
|
|
194
|
+
}),
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function partitionRootNavigatorForAuth(manifest, signInRoute, publicRoutes, includeAuthSignOutRoute, signOutRouteName) {
|
|
199
|
+
const publicRouteSet = new Set(publicRoutes);
|
|
200
|
+
const appRoutes = manifest.navigator.routes.filter((route) => !publicRouteSet.has(route.name));
|
|
201
|
+
const authRoutes = manifest.navigator.routes.filter((route) => publicRouteSet.has(route.name));
|
|
202
|
+
const appNavigator = ensureAuthSignOutRoute({
|
|
203
|
+
...manifest.navigator,
|
|
204
|
+
routes: [...appRoutes],
|
|
205
|
+
}, includeAuthSignOutRoute, signOutRouteName);
|
|
206
|
+
const authNavigator = {
|
|
207
|
+
type: 'stack',
|
|
208
|
+
initialRouteName: signInRoute,
|
|
209
|
+
routes: [...authRoutes],
|
|
210
|
+
};
|
|
211
|
+
return { appNavigator, authNavigator };
|
|
212
|
+
}
|
|
213
|
+
function buildGeneratedAuthRoute(args) {
|
|
214
|
+
const { routeName, routeLabel, screenId, navigatorType } = args;
|
|
215
|
+
return {
|
|
216
|
+
name: routeName,
|
|
217
|
+
label: routeLabel,
|
|
218
|
+
screenId,
|
|
219
|
+
guards: [PUBLIC_GUARD],
|
|
220
|
+
...(navigatorType === 'tabs' ? { hideInTabBar: true } : {}),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function collectPublicRoutes(manifest, signInRouteName, signUpRouteName) {
|
|
224
|
+
const unauthorizedRouteName = authFlowPathToRouteName(manifest.settings.authFlow.unauthorizedRoute?.trim() ?? signInRouteName);
|
|
225
|
+
const publicRoutes = new Set([
|
|
226
|
+
signInRouteName,
|
|
227
|
+
signUpRouteName,
|
|
228
|
+
unauthorizedRouteName || signInRouteName,
|
|
229
|
+
]);
|
|
230
|
+
const visit = (routes) => {
|
|
231
|
+
for (const route of routes) {
|
|
232
|
+
const normalizedGuards = (route.guards ?? []).map((guard) => guard.trim().toLowerCase());
|
|
233
|
+
if (normalizedGuards.some((guard) => guard === 'public' || guard === 'guest')) {
|
|
234
|
+
publicRoutes.add(route.name);
|
|
235
|
+
}
|
|
236
|
+
if (route.navigator?.routes) {
|
|
237
|
+
visit(route.navigator.routes);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
visit(manifest.navigator.routes);
|
|
242
|
+
return [...publicRoutes];
|
|
243
|
+
}
|
|
244
|
+
function hasRouteName(routes, routeName) {
|
|
245
|
+
for (const route of routes) {
|
|
246
|
+
if (route.name === routeName) {
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
if (route.navigator?.routes && hasRouteName(route.navigator.routes, routeName)) {
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
function normalizeRel(filePath) {
|
|
256
|
+
return filePath.replace(/\\/g, '/');
|
|
257
|
+
}
|
|
258
|
+
function authFlowPathToRouteName(routePath) {
|
|
259
|
+
const normalized = routePath.trim().replace(/^\/+/, '').replace(/\/+$/, '');
|
|
260
|
+
return normalized === '' ? 'index' : normalized;
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=resolveAuthLayoutPlan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAuthLayoutPlan.js","sourceRoot":"","sources":["../../../../src/host/layout/auth/resolveAuthLayoutPlan.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AACrD,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AACrD,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AAC7D,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;AACxD,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;AACxD,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,YAAY,GAAG,QAAQ,CAAC;AA2C9B,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC;IAChC,IAAI,IAAI,EAAE,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC7D,OAAO,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAED,MAAM,WAAW,GAAG,QAA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C,SAAS,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,CAAC,GAAG,YAAY,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,YAAY,CAAC,MAAyB,EAAE,SAAiB;IAChE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,KAAK,CAAC,SAAS,EAAE,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC;YAC/E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,QAAgB;IACpC,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAiB;IAChD,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5E,OAAO,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AppManifest } from '@ankhorage/contracts';
|
|
2
|
+
import { type ExpoRuntimePlan } from '@ankhorage/expo-runtime/planning';
|
|
3
|
+
import type { LayoutMutation } from '../modules/layout';
|
|
4
|
+
export interface GeneratedFile {
|
|
5
|
+
path: string;
|
|
6
|
+
content: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LayoutGenerationOptions {
|
|
9
|
+
includeStudio?: boolean;
|
|
10
|
+
runtimePlan?: ExpoRuntimePlan;
|
|
11
|
+
}
|
|
12
|
+
export declare class LayoutGenerator {
|
|
13
|
+
generateAll(_projectRoot: string, manifest: AppManifest, mutations: LayoutMutation[], options?: LayoutGenerationOptions): GeneratedFile[];
|
|
14
|
+
private getAuthShellLayoutContent;
|
|
15
|
+
private getRootLayoutContent;
|
|
16
|
+
private getGeneratedAuthFileContent;
|
|
17
|
+
private getLayoutTemplate;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=layoutGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layoutGenerator.d.ts","sourceRoot":"","sources":["../../../src/host/layout/layoutGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAkC,MAAM,sBAAsB,CAAC;AACxF,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAmBxD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAyCD,qBAAa,eAAe;IAC1B,WAAW,CACT,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,cAAc,EAAE,EAC3B,OAAO,GAAE,uBAA4B,GACpC,aAAa,EAAE;IA6IlB,OAAO,CAAC,yBAAyB;IAkFjC,OAAO,CAAC,oBAAoB;IA+E5B,OAAO,CAAC,2BAA2B;IAmBnC,OAAO,CAAC,iBAAiB;CAO1B"}
|