1
1
// @ts -check
2
2
3
- const fs = require ( "node:fs" ) ;
4
- const path = require ( "node:path" ) ;
5
- const os = require ( "node:os" ) ;
6
- const child_process = require ( "node:child_process" ) ;
7
- const { createServer } = require ( "node:http" ) ;
8
- const { MiniWebSocket : WebSocket } = require ( "#lib/minisocket" ) ;
9
- const { rescript_exe } = require ( "#cli/bin_path" ) ;
3
+ import * as child_process from "node:child_process" ;
4
+ import * as fs from "node:fs" ;
5
+ import { createServer } from "node:http" ;
6
+ import * as os from "node:os" ;
7
+ import * as path from "node:path" ;
8
+ import { WebSocket } from "#lib/minisocket" ;
9
+
10
+ import { rescript_exe } from "./_paths.js" ;
10
11
11
12
const cwd = process . cwd ( ) ;
12
13
const lockFileName = path . join ( cwd , ".bsb.lock" ) ;
@@ -27,7 +28,7 @@ const lockFileName = path.join(cwd, ".bsb.lock");
27
28
* @type {child_process.ChildProcess | null }
28
29
*/
29
30
let ownerProcess = null ;
30
- function releaseBuild ( ) {
31
+ export function releaseBuild ( ) {
31
32
if ( ownerProcess ) {
32
33
ownerProcess . kill ( "SIGHUP" ) ;
33
34
try {
@@ -100,14 +101,14 @@ function delegate(args, maybeOnClose) {
100
101
/**
101
102
* @param {Array<string> } args
102
103
*/
103
- function info ( args ) {
104
+ export function info ( args ) {
104
105
delegate ( [ "info" , ...args ] ) ;
105
106
}
106
107
107
108
/**
108
109
* @param {Array<string> } args
109
110
*/
110
- function clean ( args ) {
111
+ export function clean ( args ) {
111
112
delegate ( [ "clean" , ...args ] ) ;
112
113
}
113
114
@@ -475,7 +476,7 @@ Please pick a different one using the \`-ws [host:]port\` flag from bsb.`);
475
476
/**
476
477
* @param {Array<string> } args
477
478
*/
478
- function build ( args ) {
479
+ export function build ( args ) {
479
480
// We want to show the compile time for build
480
481
// But bsb might show a help message when --help or invalid arguments are passed
481
482
// We don't want to show the compile time in that case
@@ -499,8 +500,3 @@ function build(args) {
499
500
}
500
501
delegate ( [ "build" , ...args ] ) ;
501
502
}
502
-
503
- exports . releaseBuild = releaseBuild ;
504
- exports . info = info ;
505
- exports . clean = clean ;
506
- exports . build = build ;
0 commit comments