11// @ts -check
22
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" ;
1011
1112const cwd = process . cwd ( ) ;
1213const lockFileName = path . join ( cwd , ".bsb.lock" ) ;
@@ -27,7 +28,7 @@ const lockFileName = path.join(cwd, ".bsb.lock");
2728 * @type {child_process.ChildProcess | null }
2829 */
2930let ownerProcess = null ;
30- function releaseBuild ( ) {
31+ export function releaseBuild ( ) {
3132 if ( ownerProcess ) {
3233 ownerProcess . kill ( "SIGHUP" ) ;
3334 try {
@@ -100,14 +101,14 @@ function delegate(args, maybeOnClose) {
100101/**
101102 * @param {Array<string> } args
102103 */
103- function info ( args ) {
104+ export function info ( args ) {
104105 delegate ( [ "info" , ...args ] ) ;
105106}
106107
107108/**
108109 * @param {Array<string> } args
109110 */
110- function clean ( args ) {
111+ export function clean ( args ) {
111112 delegate ( [ "clean" , ...args ] ) ;
112113}
113114
@@ -475,7 +476,7 @@ Please pick a different one using the \`-ws [host:]port\` flag from bsb.`);
475476/**
476477 * @param {Array<string> } args
477478 */
478- function build ( args ) {
479+ export function build ( args ) {
479480 // We want to show the compile time for build
480481 // But bsb might show a help message when --help or invalid arguments are passed
481482 // We don't want to show the compile time in that case
@@ -499,8 +500,3 @@ function build(args) {
499500 }
500501 delegate ( [ "build" , ...args ] ) ;
501502}
502-
503- exports . releaseBuild = releaseBuild ;
504- exports . info = info ;
505- exports . clean = clean ;
506- exports . build = build ;
0 commit comments