create-nextblock 0.2.12 → 0.2.13
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 +11 -9
- package/package.json +1 -1
package/bin/create-nextblock.js
CHANGED
|
@@ -189,23 +189,25 @@ async function runSetupWizard(projectDir, projectName) {
|
|
|
189
189
|
clack.note('I will now open your browser to log into Supabase.');
|
|
190
190
|
await execa('npx', ['supabase', 'login'], { stdio: 'inherit', cwd: projectPath });
|
|
191
191
|
|
|
192
|
-
clack.note('Now, please select your NextBlock project
|
|
193
|
-
|
|
192
|
+
clack.note('Now, please select your NextBlock project when prompted.');
|
|
193
|
+
await execa('npx', ['supabase', 'link'], {
|
|
194
194
|
cwd: projectPath,
|
|
195
|
+
stdio: 'inherit',
|
|
195
196
|
});
|
|
196
|
-
const linkOutput = `${linkStdout || ''}${linkStderr || ''}`;
|
|
197
|
-
if (linkStdout) process.stdout.write(linkStdout);
|
|
198
|
-
if (linkStderr) process.stderr.write(linkStderr);
|
|
199
197
|
|
|
200
198
|
// Ensure supabase assets exist (config + migrations) after link in case the CLI created/overrode files
|
|
201
199
|
await ensureSupabaseAssets(projectPath);
|
|
202
200
|
|
|
203
201
|
const configTomlPath = resolve(projectPath, 'supabase', 'config.toml');
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
if (!(await fs.pathExists(configTomlPath))) {
|
|
203
|
+
throw new Error('supabase/config.toml not found. Please rerun `npx supabase link`.');
|
|
204
|
+
}
|
|
205
|
+
const configToml = await fs.readFile(configTomlPath, 'utf8');
|
|
206
|
+
const projectMatch = configToml.match(/project_id\s*=\s*"([^"]+)"/);
|
|
207
|
+
if (!projectMatch?.[1] || projectMatch[1].includes('env(')) {
|
|
208
|
+
throw new Error('Could not read a concrete project_id from supabase/config.toml. Please rerun `npx supabase link`.');
|
|
207
209
|
}
|
|
208
|
-
const projectId =
|
|
210
|
+
const projectId = projectMatch[1];
|
|
209
211
|
|
|
210
212
|
if (!(await fs.pathExists(configTomlPath))) {
|
|
211
213
|
const configToml = `project_id = "env(SUPABASE_PROJECT_ID)"\n`;
|