create-nextblock 0.2.4 → 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/bin/create-nextblock.js
CHANGED
|
@@ -202,7 +202,7 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
202
202
|
cwd: projectPath,
|
|
203
203
|
stdin: 'inherit',
|
|
204
204
|
stdout: 'pipe',
|
|
205
|
-
stderr: '
|
|
205
|
+
stderr: 'pipe',
|
|
206
206
|
});
|
|
207
207
|
if (linkProcess.stdout) {
|
|
208
208
|
linkProcess.stdout.on('data', (chunk) => {
|
|
@@ -211,7 +211,25 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
211
211
|
process.stdout.write(text);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
+
if (linkProcess.stderr) {
|
|
215
|
+
linkProcess.stderr.on('data', (chunk) => {
|
|
216
|
+
const text = chunk.toString();
|
|
217
|
+
linkOutput += text;
|
|
218
|
+
process.stderr.write(text);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
214
221
|
await linkProcess;
|
|
222
|
+
if (process.stdin.isTTY) {
|
|
223
|
+
try {
|
|
224
|
+
process.stdin.setRawMode(false);
|
|
225
|
+
} catch (_) {
|
|
226
|
+
// ignore if not supported
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
process.stdin.resume();
|
|
230
|
+
|
|
231
|
+
// Ensure supabase assets exist (config + migrations) after link in case the CLI created/overrode files
|
|
232
|
+
await ensureSupabaseAssets(projectPath);
|
|
215
233
|
|
|
216
234
|
const configTomlPath = resolve(projectPath, 'supabase', 'config.toml');
|
|
217
235
|
let configToml = '';
|
|
@@ -318,8 +336,16 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
318
336
|
dbPushSpinner.start('Pushing database schema... (This may take a minute)');
|
|
319
337
|
try {
|
|
320
338
|
process.env.POSTGRES_URL = postgresUrl;
|
|
321
|
-
|
|
322
|
-
|
|
339
|
+
const migrationsDir = resolve(projectPath, 'supabase', 'migrations');
|
|
340
|
+
const hasMigrations =
|
|
341
|
+
(await fs.pathExists(migrationsDir)) &&
|
|
342
|
+
(await fs.readdir(migrationsDir)).some((name) => name.endsWith('.sql'));
|
|
343
|
+
if (!hasMigrations) {
|
|
344
|
+
dbPushSpinner.stop('No migrations found in supabase/migrations; skipping db push.');
|
|
345
|
+
} else {
|
|
346
|
+
await execa('npx', ['supabase', 'db', 'push'], { stdio: 'inherit', cwd: projectPath });
|
|
347
|
+
dbPushSpinner.stop('Database schema pushed successfully!');
|
|
348
|
+
}
|
|
323
349
|
} catch (error) {
|
|
324
350
|
dbPushSpinner.stop('Database push failed. Please run `npx supabase db push` manually.');
|
|
325
351
|
if (error instanceof Error) {
|
package/package.json
CHANGED