Skip to content

Commit

Permalink
fix: fix dev stopping flow
Browse files Browse the repository at this point in the history
  • Loading branch information
crnsh committed Mar 7, 2024
1 parent 1c3bb15 commit fae5be8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "million-lint-check",
"version": "1.0.3",
"version": "1.0.4",
"description": "A command-line tool to verify if Million Lint is active in a project.",
"main": "index.js",
"files": [
Expand All @@ -15,7 +15,10 @@
"test": "echo \"Error: no test specified\" && exit 0"
},
"keywords": [
""
"million",
"cli",
"testing",
"frontend"
],
"author": "Karan Handa",
"license": "ISC",
Expand Down
15 changes: 11 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const pjson = require('./package.json');

import { Command } from 'commander';
import { execSync } from 'child_process';
import { execSync, spawn } from 'child_process';
import puppeteer from 'puppeteer';
import { fuzzPage } from './fuzzer';

Expand Down Expand Up @@ -42,12 +42,19 @@ program.command('setup')
execSync('ni', { stdio: 'inherit' });
try {
execSync('npx @million/lint@latest', { stdio: 'inherit' });
} catch {

} catch(error) {
console.error('Error running Million Lint:', error);
}

console.log('Running development server...');
execSync('nr dev', { stdio: 'inherit' });
// Start the development server in the background
const devServer = spawn('nr', ['dev'], {
stdio: 'inherit',
shell: true,
detached: true,
});
console.log('Development server started in the background.');
devServer.unref();

console.log('Opening browser and interacting with components...');
await checkWhetherMillionWorks(options.port)
Expand Down

0 comments on commit fae5be8

Please sign in to comment.