create-100x-mobile 0.6.6 → 0.6.7
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/steps.js +14 -0
- package/dist/commands/new.js +11 -0
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ exports.writeInstantEnvironment = writeInstantEnvironment;
|
|
|
18
18
|
exports.initializeConvex = initializeConvex;
|
|
19
19
|
exports.ensureExpoPublicConvexUrl = ensureExpoPublicConvexUrl;
|
|
20
20
|
exports.setConvexClerkEnv = setConvexClerkEnv;
|
|
21
|
+
exports.pushInstantSchema = pushInstantSchema;
|
|
21
22
|
exports.setupCloudflare = setupCloudflare;
|
|
22
23
|
exports.initializeGit = initializeGit;
|
|
23
24
|
exports.runHealthChecks = runHealthChecks;
|
|
@@ -546,6 +547,19 @@ async function setConvexClerkEnv(projectDir, clerkDomain) {
|
|
|
546
547
|
return false;
|
|
547
548
|
}
|
|
548
549
|
}
|
|
550
|
+
async function pushInstantSchema(projectDir) {
|
|
551
|
+
try {
|
|
552
|
+
prompts_1.log.info("");
|
|
553
|
+
prompts_1.log.info(picocolors_1.default.bold("Pushing InstantDB schema to register entities..."));
|
|
554
|
+
await (0, run_1.run)("npx", ["instant-cli@latest", "push-schema", "--yes"], { cwd: projectDir });
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
557
|
+
catch (error) {
|
|
558
|
+
prompts_1.log.warn(`InstantDB schema push failed: ${toErrorMessage(error)}`);
|
|
559
|
+
prompts_1.log.info(picocolors_1.default.dim("Run manually: npx instant-cli push-schema"));
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
549
563
|
async function setupCloudflare(projectDir) {
|
|
550
564
|
const result = {
|
|
551
565
|
configured: false,
|
package/dist/commands/new.js
CHANGED
|
@@ -279,9 +279,11 @@ async function cmdNew(rawArgs) {
|
|
|
279
279
|
prompts_1.log.info(picocolors_1.default.dim(`Clerk publishable key: ${instant.clerkPublishableKey}`));
|
|
280
280
|
}
|
|
281
281
|
const isCloudflareMode = backend === "instantdb" && (0, scaffold_1.isCloudflareInstantAuthMode)(instantAuthMode);
|
|
282
|
+
const hasInstantAppId = instant && "appId" in instant && instant.appId;
|
|
282
283
|
const totalSteps = 1 + // project generation
|
|
283
284
|
(options.installDependencies ? 2 : 0) +
|
|
284
285
|
(backend === "convex" ? 2 + (clerk.domain ? 1 : 0) : 1) +
|
|
286
|
+
(isCloudflareMode && options.installDependencies && hasInstantAppId ? 1 : 0) + // push schema
|
|
285
287
|
(isCloudflareMode && options.installDependencies ? 1 : 0) + // cloudflare setup
|
|
286
288
|
(options.initializeGit ? 1 : 0) +
|
|
287
289
|
1; // health check
|
|
@@ -373,6 +375,15 @@ async function cmdNew(rawArgs) {
|
|
|
373
375
|
}
|
|
374
376
|
}
|
|
375
377
|
if (isCloudflareMode && options.installDependencies) {
|
|
378
|
+
// Push InstantDB schema before Cloudflare deploy so the Worker can write to it
|
|
379
|
+
if (hasInstantAppId) {
|
|
380
|
+
currentStep++;
|
|
381
|
+
prompts_1.log.step(`Pushing InstantDB schema ${stepLabel()}`);
|
|
382
|
+
const schemaPushed = await (0, steps_1.pushInstantSchema)(projectDir);
|
|
383
|
+
if (schemaPushed) {
|
|
384
|
+
prompts_1.log.success("InstantDB schema pushed.");
|
|
385
|
+
}
|
|
386
|
+
}
|
|
376
387
|
currentStep++;
|
|
377
388
|
prompts_1.log.step(`Setting up Cloudflare storage ${stepLabel()}`);
|
|
378
389
|
cloudflareSetup = await (0, steps_1.setupCloudflare)(projectDir);
|