Skip to content

Commit 729f803

Browse files
committed
rescript_exe -> rescript_legacy_exe
1 parent d6fc76a commit 729f803

File tree

16 files changed

+65
-61
lines changed

16 files changed

+65
-61
lines changed

cli/common/bins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const {
2222
ninja_exe,
2323
rescript_editor_analysis_exe,
2424
rescript_tools_exe,
25-
rescript_exe,
25+
rescript_legacy_exe,
2626
rewatch_exe,
2727
},
2828
} = mod;

cli/common/bsb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as os from "node:os";
77
import * as path from "node:path";
88
import { WebSocket } from "#lib/minisocket";
99

10-
import { rescript_exe } from "./bins.js";
10+
import { rescript_legacy_exe } from "./bins.js";
1111

1212
const cwd = process.cwd();
1313
const lockFileName = path.join(cwd, ".bsb.lock");
@@ -50,7 +50,7 @@ function acquireBuild(args, options) {
5050
return null;
5151
}
5252
try {
53-
ownerProcess = child_process.spawn(rescript_exe, args, {
53+
ownerProcess = child_process.spawn(rescript_legacy_exe, args, {
5454
stdio: "inherit",
5555
...options,
5656
});

cli/rescript.js renamed to cli/rescript-legacy.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// It matters since we need read .sourcedirs(location)
77
// and its content are file/directories with regard to project root
88

9-
import * as tty from "node:tty";
109
import * as fs from "node:fs";
10+
import * as tty from "node:tty";
1111

12-
import { bsc_exe, rescript_exe } from "./common/bins.js";
12+
import { bsc_exe, rescript_legacy_exe } from "./common/bins.js";
1313
import * as bsb from "./common/bsb.js";
1414

1515
const cwd = process.cwd();
@@ -94,7 +94,7 @@ if (
9494
console.log(helpMessage);
9595
} else if (argPatterns.version.includes(args[0])) {
9696
const packageSpec = JSON.parse(
97-
fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8")
97+
fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8"),
9898
);
9999

100100
console.log(packageSpec.version);
@@ -116,13 +116,13 @@ if (
116116
break;
117117
}
118118
case "format": {
119-
const mod = await import("./rescript/format.js");
120-
await mod.main(subcmdArgs, rescript_exe, bsc_exe);
119+
const mod = await import("./rescript-legacy/format.js");
120+
await mod.main(subcmdArgs, rescript_legacy_exe, bsc_exe);
121121
break;
122122
}
123123
case "dump": {
124-
const mod = await import("./rescript/dump.js");
125-
mod.main(subcmdArgs, rescript_exe, bsc_exe);
124+
const mod = await import("./rescript-legacy/dump.js");
125+
mod.main(subcmdArgs, rescript_legacy_exe, bsc_exe);
126126
break;
127127
}
128128
default: {

cli/rescript/dump.js renamed to cli/rescript-legacy/dump.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ const specs = [];
1616

1717
/**
1818
* @param {string[]} argv
19-
* @param {string} rescript_exe
19+
* @param {string} rescript_legacy_exe
2020
* @param {string} bsc_exe
2121
*/
22-
export function main(argv, rescript_exe, bsc_exe) {
22+
export function main(argv, rescript_legacy_exe, bsc_exe) {
2323
let target;
2424
arg.parse_exn(dump_usage, argv, specs, xs => {
2525
if (xs.length !== 1) {
@@ -34,9 +34,13 @@ export function main(argv, rescript_exe, bsc_exe) {
3434
process.exit(2);
3535
}
3636

37-
let output = child_process.spawnSync(rescript_exe, ["build", "--", target], {
38-
encoding: "utf-8",
39-
});
37+
let output = child_process.spawnSync(
38+
rescript_legacy_exe,
39+
["build", "--", target],
40+
{
41+
encoding: "utf-8",
42+
},
43+
);
4044
if (output.status !== 0) {
4145
console.log(output.stdout);
4246
console.error(output.stderr);

cli/rescript/format.js renamed to cli/rescript-legacy/format.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ async function formatFiles(files, bsc_exe, isSupportedFile, checkFormatting) {
143143

144144
/**
145145
* @param {string[]} argv
146-
* @param {string} rescript_exe
146+
* @param {string} rescript_legacy_exe
147147
* @param {string} bsc_exe
148148
*/
149-
export async function main(argv, rescript_exe, bsc_exe) {
149+
export async function main(argv, rescript_legacy_exe, bsc_exe) {
150150
const isSupportedFile = hasExtension(formattedFileExtensions);
151151
const isSupportedStd = hasExtension(formattedStdExtensions);
152152

@@ -179,7 +179,7 @@ export async function main(argv, rescript_exe, bsc_exe) {
179179
// -all
180180
// TODO: check the rest arguments
181181
const output = child_process.spawnSync(
182-
rescript_exe,
182+
rescript_legacy_exe,
183183
["info", "-list-files"],
184184
{
185185
encoding: "utf-8",

lib_dev/process.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as child_process from "node:child_process";
22
import * as fs from "node:fs/promises";
33
import * as path from "node:path";
4-
import { bsc_exe, rescript_exe } from "#cli/bins";
4+
import { bsc_exe, rescript_legacy_exe } from "#cli/bins";
55

66
/**
77
* @typedef {{
@@ -181,7 +181,7 @@ export function setup(cwd = process.cwd()) {
181181
* @return {Promise<ExecResult>}
182182
*/
183183
execBuild(args = [], options = {}) {
184-
return exec(rescript_exe, ["build", ...args], options);
184+
return exec(rescript_legacy_exe, ["build", ...args], options);
185185
},
186186

187187
/**
@@ -192,7 +192,7 @@ export function setup(cwd = process.cwd()) {
192192
* @return {Promise<ExecResult>}
193193
*/
194194
execClean(args = [], options = {}) {
195-
return exec(rescript_exe, ["clean", ...args], options);
195+
return exec(rescript_legacy_exe, ["clean", ...args], options);
196196
},
197197

198198
/**

packages/@rescript/darwin-arm64/bin.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ export const binDir: string;
33
export const binPaths: BinaryPaths;
44

55
export type BinaryPaths = {
6-
bsb_helper_exe: string,
7-
bsc_exe: string,
8-
ninja_exe: string,
9-
rescript_exe: string,
10-
rescript_tools_exe: string,
11-
rescript_editor_analysis_exe: string,
12-
rewatch_exe: string,
6+
bsb_helper_exe: string;
7+
bsc_exe: string;
8+
ninja_exe: string;
9+
rescript_legacy_exe: string;
10+
rescript_tools_exe: string;
11+
rescript_editor_analysis_exe: string;
12+
rewatch_exe: string;
1313
};

packages/@rescript/darwin-arm64/bin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const binPaths = {
88
bsb_helper_exe: path.join(binDir, "bsb_helper.exe"),
99
bsc_exe: path.join(binDir, "bsc.exe"),
1010
ninja_exe: path.join(binDir, "ninja.exe"),
11-
rescript_exe: path.join(binDir, "rescript.exe"),
11+
rescript_legacy_exe: path.join(binDir, "rescript.exe"),
1212
rescript_tools_exe: path.join(binDir, "rescript-tools.exe"),
1313
rescript_editor_analysis_exe: path.join(
1414
binDir,

packages/@rescript/darwin-x64/bin.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ export const binDir: string;
33
export const binPaths: BinaryPaths;
44

55
export type BinaryPaths = {
6-
bsb_helper_exe: string,
7-
bsc_exe: string,
8-
ninja_exe: string,
9-
rescript_exe: string,
10-
rescript_tools_exe: string,
11-
rescript_editor_analysis_exe: string,
12-
rewatch_exe: string,
6+
bsb_helper_exe: string;
7+
bsc_exe: string;
8+
ninja_exe: string;
9+
rescript_legacy_exe: string;
10+
rescript_tools_exe: string;
11+
rescript_editor_analysis_exe: string;
12+
rewatch_exe: string;
1313
};

packages/@rescript/darwin-x64/bin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const binPaths = {
88
bsb_helper_exe: path.join(binDir, "bsb_helper.exe"),
99
bsc_exe: path.join(binDir, "bsc.exe"),
1010
ninja_exe: path.join(binDir, "ninja.exe"),
11-
rescript_exe: path.join(binDir, "rescript.exe"),
11+
rescript_legacy_exe: path.join(binDir, "rescript.exe"),
1212
rescript_tools_exe: path.join(binDir, "rescript-tools.exe"),
1313
rescript_editor_analysis_exe: path.join(
1414
binDir,

0 commit comments

Comments
 (0)