create-nextblock 0.2.8 → 0.2.9

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.
@@ -190,28 +190,10 @@ async function runSetupWizard(projectDir, projectName) {
190
190
  await execa('npx', ['supabase', 'login'], { stdio: 'inherit', cwd: projectPath });
191
191
 
192
192
  clack.note('Now, please select your NextBlock project in the browser.');
193
- let linkOutput = '';
194
- const linkProcess = execa('npx', ['supabase', 'link'], {
193
+ await execa('npx', ['supabase', 'link'], {
195
194
  cwd: projectPath,
196
- stdin: 'inherit',
197
- stdout: 'pipe',
198
- stderr: 'pipe',
195
+ stdio: 'inherit',
199
196
  });
200
- if (linkProcess.stdout) {
201
- linkProcess.stdout.on('data', (chunk) => {
202
- const text = chunk.toString();
203
- linkOutput += text;
204
- process.stdout.write(text);
205
- });
206
- }
207
- if (linkProcess.stderr) {
208
- linkProcess.stderr.on('data', (chunk) => {
209
- const text = chunk.toString();
210
- linkOutput += text;
211
- process.stderr.write(text);
212
- });
213
- }
214
- await linkProcess;
215
197
  if (process.stdin.isTTY) {
216
198
  try {
217
199
  process.stdin.setRawMode(false);
@@ -219,8 +201,8 @@ async function runSetupWizard(projectDir, projectName) {
219
201
  // ignore if not supported
220
202
  }
221
203
  process.stdin.setEncoding('utf8');
222
- process.stdin.removeAllListeners('data');
223
- process.stdin.removeAllListeners('keypress');
204
+ process.stdin.pause();
205
+ process.stdin.resume();
224
206
  }
225
207
  process.stdin.resume();
226
208
 
@@ -230,20 +212,15 @@ async function runSetupWizard(projectDir, projectName) {
230
212
  const configTomlPath = resolve(projectPath, 'supabase', 'config.toml');
231
213
  let configToml = '';
232
214
  if (!(await fs.pathExists(configTomlPath))) {
233
- const parsedRef = linkOutput.match(/Selected project:\s*([a-z0-9-]+)/i)?.[1];
234
- let projectRef = parsedRef;
235
-
236
- if (!projectRef) {
237
- const manualProjectId = await clack.text({
238
- message:
239
- 'supabase/config.toml was not created. Enter your Supabase project ref (from the link output, e.g., abcdefghijklmnopqrstu):',
240
- validate: (val) => (!val ? 'Project ref is required' : undefined),
241
- });
242
- if (clack.isCancel(manualProjectId)) {
243
- handleWizardCancel('Setup cancelled.');
244
- }
245
- projectRef = manualProjectId.trim();
215
+ const manualProjectId = await clack.text({
216
+ message:
217
+ 'supabase/config.toml was not created. Enter your Supabase project ref (from the link output, e.g., abcdefghijklmnopqrstu):',
218
+ validate: (val) => (!val ? 'Project ref is required' : undefined),
219
+ });
220
+ if (clack.isCancel(manualProjectId)) {
221
+ handleWizardCancel('Setup cancelled.');
246
222
  }
223
+ const projectRef = manualProjectId.trim();
247
224
 
248
225
  configToml = `project_id = "${projectRef}"\n`;
249
226
  await fs.writeFile(configTomlPath, configToml);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nextblock",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {