create-100x-mobile 0.4.7 → 0.4.9
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/dist/commands/new/scaffold.js +2 -0
- package/dist/commands/new.js +12 -0
- package/dist/templates/app/signIn.js +1 -1
- package/dist/templates/config/appJson.js +2 -2
- package/dist/templates/instant/authProvider.js +14 -1
- package/dist/templates/instant/settingsScreen.js +11 -2
- package/package.json +1 -1
|
@@ -28,6 +28,8 @@ async function writeScaffoldFiles(projectDir, files) {
|
|
|
28
28
|
}
|
|
29
29
|
async function writeDefaultAssetFiles(projectDir) {
|
|
30
30
|
const png = Buffer.from(TRANSPARENT_PNG_BASE64, "base64");
|
|
31
|
+
await (0, fs_1.writeBinaryFile)((0, node_path_1.join)(projectDir, "assets/icon.png"), png);
|
|
32
|
+
await (0, fs_1.writeBinaryFile)((0, node_path_1.join)(projectDir, "assets/favicon.png"), png);
|
|
31
33
|
await (0, fs_1.writeBinaryFile)((0, node_path_1.join)(projectDir, "assets/images/icon.png"), png);
|
|
32
34
|
await (0, fs_1.writeBinaryFile)((0, node_path_1.join)(projectDir, "assets/images/favicon.png"), png);
|
|
33
35
|
}
|
package/dist/commands/new.js
CHANGED
|
@@ -173,6 +173,13 @@ async function cmdNew(rawArgs) {
|
|
|
173
173
|
const instant = backend === "instantdb"
|
|
174
174
|
? await (0, steps_1.promptInstantSetup)(options)
|
|
175
175
|
: { appId: "", clerkPublishableKey: "", clerkClientName: "clerk" };
|
|
176
|
+
if (backend === "instantdb" && instant.appId && instant.clerkPublishableKey) {
|
|
177
|
+
prompts_1.log.info("");
|
|
178
|
+
prompts_1.log.info(picocolors_1.default.bold("Instant Auth setup required"));
|
|
179
|
+
prompts_1.log.info(picocolors_1.default.dim("In Instant Dashboard → Auth tab, add a Clerk auth client before running the app."));
|
|
180
|
+
prompts_1.log.info(picocolors_1.default.dim(`Client name: ${instant.clerkClientName}`));
|
|
181
|
+
prompts_1.log.info(picocolors_1.default.dim(`Clerk publishable key: ${instant.clerkPublishableKey}`));
|
|
182
|
+
}
|
|
176
183
|
const totalSteps = 1 + // project generation
|
|
177
184
|
(options.installDependencies ? 2 : 0) +
|
|
178
185
|
(backend === "convex" ? 2 + (clerk.domain ? 1 : 0) : 1) +
|
|
@@ -300,6 +307,11 @@ async function cmdNew(rawArgs) {
|
|
|
300
307
|
projectName));
|
|
301
308
|
prompts_1.log.info(picocolors_1.default.dim(" In Instant Auth tab, add your Clerk app and set EXPO_PUBLIC_INSTANT_CLERK_CLIENT_NAME."));
|
|
302
309
|
}
|
|
310
|
+
else {
|
|
311
|
+
prompts_1.log.info("");
|
|
312
|
+
prompts_1.log.info(picocolors_1.default.dim(" In Instant Dashboard → Auth tab, add a Clerk auth client using your publishable key."));
|
|
313
|
+
prompts_1.log.info(picocolors_1.default.dim(` Use client name "${instant.clerkClientName}" (EXPO_PUBLIC_INSTANT_CLERK_CLIENT_NAME).`));
|
|
314
|
+
}
|
|
303
315
|
}
|
|
304
316
|
else if (clerk.publishableKey && clerk.domain) {
|
|
305
317
|
prompts_1.log.success(picocolors_1.default.bold(picocolors_1.default.green("Your app is ready!")));
|
|
@@ -44,7 +44,7 @@ export default function SignInScreen() {
|
|
|
44
44
|
|
|
45
45
|
if (createdSessionId && setActive) {
|
|
46
46
|
await setActive({ session: createdSessionId });
|
|
47
|
-
router.replace("/
|
|
47
|
+
router.replace("/");
|
|
48
48
|
}
|
|
49
49
|
} catch (err: any) {
|
|
50
50
|
console.error(\`\${provider} OAuth error:\`, err);
|
|
@@ -11,7 +11,7 @@ function appJsonTemplate(appName, backend) {
|
|
|
11
11
|
slug: appName,
|
|
12
12
|
version: "1.0.0",
|
|
13
13
|
orientation: "portrait",
|
|
14
|
-
icon: "./assets/
|
|
14
|
+
icon: "./assets/icon.png",
|
|
15
15
|
scheme: appName,
|
|
16
16
|
userInterfaceStyle: "automatic",
|
|
17
17
|
newArchEnabled: true,
|
|
@@ -21,7 +21,7 @@ function appJsonTemplate(appName, backend) {
|
|
|
21
21
|
web: {
|
|
22
22
|
bundler: "metro",
|
|
23
23
|
output: "single",
|
|
24
|
-
favicon: "./assets/
|
|
24
|
+
favicon: "./assets/favicon.png",
|
|
25
25
|
},
|
|
26
26
|
plugins,
|
|
27
27
|
experiments: {
|
|
@@ -12,6 +12,11 @@ const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY;
|
|
|
12
12
|
const clerkClientName =
|
|
13
13
|
process.env.EXPO_PUBLIC_INSTANT_CLERK_CLIENT_NAME || "clerk";
|
|
14
14
|
|
|
15
|
+
function isSignedOutError(error: unknown): boolean {
|
|
16
|
+
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
17
|
+
return message.toLowerCase().includes("signed out");
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
const tokenCache = {
|
|
16
21
|
async getToken(key: string) {
|
|
17
22
|
try {
|
|
@@ -74,7 +79,9 @@ function InstantSessionBridge({ children }: { children: React.ReactNode }) {
|
|
|
74
79
|
try {
|
|
75
80
|
await instantDb.auth.signOut();
|
|
76
81
|
} catch (error) {
|
|
77
|
-
|
|
82
|
+
if (!isSignedOutError(error)) {
|
|
83
|
+
console.warn("Instant signOut warning:", error);
|
|
84
|
+
}
|
|
78
85
|
}
|
|
79
86
|
return;
|
|
80
87
|
}
|
|
@@ -95,6 +102,12 @@ function InstantSessionBridge({ children }: { children: React.ReactNode }) {
|
|
|
95
102
|
setSyncError(null);
|
|
96
103
|
}
|
|
97
104
|
} catch (error) {
|
|
105
|
+
if (isSignedOutError(error)) {
|
|
106
|
+
if (active) {
|
|
107
|
+
setSyncError(null);
|
|
108
|
+
}
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
98
111
|
console.error("Instant Clerk auth error:", error);
|
|
99
112
|
if (active) {
|
|
100
113
|
setSyncError(
|
|
@@ -20,6 +20,11 @@ import * as SecureStore from "expo-secure-store";
|
|
|
20
20
|
import { useAuth, useUser } from "@clerk/clerk-expo";
|
|
21
21
|
import { instantDb } from "@/lib/instant";
|
|
22
22
|
|
|
23
|
+
function isSignedOutError(error: unknown): boolean {
|
|
24
|
+
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
25
|
+
return message.toLowerCase().includes("signed out");
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
export default function SettingsScreen() {
|
|
24
29
|
const { signOut } = useAuth();
|
|
25
30
|
const { user, isLoaded } = useUser();
|
|
@@ -37,7 +42,9 @@ export default function SettingsScreen() {
|
|
|
37
42
|
try {
|
|
38
43
|
await instantDb?.auth.signOut();
|
|
39
44
|
} catch (error) {
|
|
40
|
-
|
|
45
|
+
if (!isSignedOutError(error)) {
|
|
46
|
+
console.warn("Instant signOut warning:", error);
|
|
47
|
+
}
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
try {
|
|
@@ -52,7 +59,9 @@ export default function SettingsScreen() {
|
|
|
52
59
|
|
|
53
60
|
await signOut();
|
|
54
61
|
} catch (error) {
|
|
55
|
-
|
|
62
|
+
if (!isSignedOutError(error)) {
|
|
63
|
+
console.warn("Sign out flow warning:", error);
|
|
64
|
+
}
|
|
56
65
|
} finally {
|
|
57
66
|
setIsSigningOut(false);
|
|
58
67
|
}
|