Skip to content

Commit

Permalink
docs(changeset): feat(cli): update killer
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Nov 7, 2024
1 parent bd93ad7 commit 755335c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-zebras-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nailyjs/cli": patch
---

feat(cli): update killer
1 change: 0 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"dependencies": {
"@nailyjs/config": "workspace:*",
"@nailyjs/ioc": "workspace:*",
"@nailyjs/winston": "workspace:*",
"chokidar": "^4.0.1",
"commander": "^12.1.0",
"defu": "^6.1.4",
Expand Down
14 changes: 7 additions & 7 deletions packages/cli/src/development-runner.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { Service } from '@nailyjs/ioc'

@Service()
export class DevelopmentRunnerService {
createProcess(filePath: string): () => void {
createProcess(filePath: string): () => boolean {
const resolvedFilePath = path.resolve(filePath)
const forked = child_process.spawn('node', [resolvedFilePath])

const dout = forked.stdout?.pipe(stdout)
const derr = forked.stderr?.pipe(stderr)
const forkStdout = forked.stdout?.pipe(stdout)
const forkStderr = forked.stderr?.pipe(stderr)

function killer(signal: NodeJS.Signals | number = 0): void {
dout?.unpipe(stdout)
derr?.unpipe(stderr)
forked.kill(signal)
function killer(signal: NodeJS.Signals | number = 0): boolean {
forkStdout?.unpipe(stdout)
forkStderr?.unpipe(stderr)
return forked.kill(signal)
}

return killer
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/development.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class DevelopmentStarter implements Setupable {
this.logoWriter.write()
}

private killer: () => void = () => true
private killer: () => boolean = () => true
private async run(): Promise<void> {
await this.tsupService.setup()
this.refreshScreen()
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 755335c

Please sign in to comment.