create-nextblock 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.
@@ -228,6 +228,9 @@ async function runSetupWizard(projectDir, projectName) {
228
228
  }
229
229
  process.stdin.resume();
230
230
 
231
+ // Ensure supabase assets exist (config + migrations) after link in case the CLI created/overrode files
232
+ await ensureSupabaseAssets(projectPath);
233
+
231
234
  const configTomlPath = resolve(projectPath, 'supabase', 'config.toml');
232
235
  let configToml = '';
233
236
  if (!(await fs.pathExists(configTomlPath))) {
@@ -333,8 +336,16 @@ async function runSetupWizard(projectDir, projectName) {
333
336
  dbPushSpinner.start('Pushing database schema... (This may take a minute)');
334
337
  try {
335
338
  process.env.POSTGRES_URL = postgresUrl;
336
- await execa('npx', ['supabase', 'db', 'push'], { stdio: 'inherit', cwd: projectPath });
337
- dbPushSpinner.stop('Database schema pushed successfully!');
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
+ }
338
349
  } catch (error) {
339
350
  dbPushSpinner.stop('Database push failed. Please run `npx supabase db push` manually.');
340
351
  if (error instanceof Error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nextblock",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {