fabrica-e-commerce 0.2.5 → 0.2.6
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/package.json +1 -1
- package/src/cli.js +32 -1
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -78,7 +78,38 @@ async function build() {
|
|
|
78
78
|
endSections();
|
|
79
79
|
|
|
80
80
|
await ensureVercelLogin();
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
let githubRepo = null;
|
|
83
|
+
try {
|
|
84
|
+
githubRepo = await createGithubRepoFromClone(project);
|
|
85
|
+
} catch (ghErr) {
|
|
86
|
+
// GitHub repo creation failed (fork/template unavailable, gh not authed, etc.)
|
|
87
|
+
// Offer to fall back to a direct code deploy — Vercel CLI uploads local files.
|
|
88
|
+
section('GitHub repo creation failed');
|
|
89
|
+
logWarn('Could not create a GitHub repository for this project.');
|
|
90
|
+
log(dim(`Reason: ${ghErr.message}`));
|
|
91
|
+
divider();
|
|
92
|
+
logInfo('Fabrica can still deploy directly from the cloned code on this machine.');
|
|
93
|
+
log(dim('Vercel will upload the local files instead of connecting to a GitHub repo.'));
|
|
94
|
+
log(dim('Auto-deploy on git push will not be available — you can connect a repo later.'));
|
|
95
|
+
endSections();
|
|
96
|
+
|
|
97
|
+
const proceed = await choose('Deploy directly from local code (no GitHub repo)?', [
|
|
98
|
+
{ name: '✓ Yes — deploy from local code now', value: 'yes' },
|
|
99
|
+
{ name: '✗ No — cancel and fix GitHub first', value: 'no' },
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
if (proceed === 'no') {
|
|
103
|
+
section('Deployment cancelled');
|
|
104
|
+
log(dim('Fix the GitHub issue and run "fabrica build" again.'));
|
|
105
|
+
endSections();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// githubRepo stays null — deployToVercel skips connectGithubRepo and
|
|
110
|
+
// runs "vercel --prod --yes" which uploads local files directly.
|
|
111
|
+
}
|
|
112
|
+
|
|
82
113
|
const record = await deployToVercel(project, env, githubRepo);
|
|
83
114
|
|
|
84
115
|
section('✓ Deployment complete');
|