Skip to content

Commit 1de5e7c

Browse files
authored
Move rescript and bsc wrapper scripts into cli folder (#7083)
1 parent 4be5ea0 commit 1de5e7c

File tree

12 files changed

+21
-23
lines changed

12 files changed

+21
-23
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ clean-rewatch:
8585
cargo clean --manifest-path rewatch/Cargo.toml && rm -f rewatch/rewatch
8686

8787
clean:
88-
(cd runtime && ../rescript clean)
88+
(cd runtime && ../cli/rescript clean)
8989
dune clean
9090

9191
clean-all: clean clean-gentype clean-rewatch

bsc cli/bsc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"use strict";
33

44
var child_process = require("child_process");
5-
var { bsc_exe } = require("./cli/bin_path");
5+
var { bsc_exe } = require("./bin_path");
66

77
var delegate_args = process.argv.slice(2);
88

rescript cli/rescript

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* and its content are file/directories with regard to project root
99
*/
1010

11-
var { bsc_exe, rescript_exe } = require("./cli/bin_path.js");
12-
var bsb = require("./cli/rescript_bsb.js");
11+
var { bsc_exe, rescript_exe } = require("./bin_path.js");
12+
var bsb = require("./rescript_bsb.js");
1313

1414
var cwd = process.cwd();
1515
process.env.BSB_PROJECT_ROOT = cwd;
@@ -87,7 +87,7 @@ if (helpArgIndex !== -1 && (firstPositionalArgIndex === -1 || helpArgIndex <= fi
8787
console.log(helpMessage);
8888

8989
} else if (argPatterns.version.includes(args[0])) {
90-
console.log(require("./package.json").version);
90+
console.log(require("../package.json").version);
9191

9292
} else if (firstPositionalArgIndex !== -1) {
9393
const subcmd = args[firstPositionalArgIndex];
@@ -107,15 +107,15 @@ if (helpArgIndex !== -1 && (firstPositionalArgIndex === -1 || helpArgIndex <= fi
107107
break;
108108
}
109109
case "format": {
110-
require("./cli/rescript_format.js").main(
110+
require("./rescript_format.js").main(
111111
subcmdArgs,
112112
rescript_exe,
113113
bsc_exe
114114
);
115115
break;
116116
}
117117
case "dump": {
118-
require("./cli/rescript_dump.js").main(
118+
require("./rescript_dump.js").main(
119119
subcmdArgs,
120120
rescript_exe,
121121
bsc_exe

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
"node": ">=18"
3737
},
3838
"bin": {
39-
"bsc": "bsc",
39+
"bsc": "cli/bsc",
4040
"bstracing": "lib/bstracing",
41-
"rescript": "rescript",
41+
"rescript": "cli/rescript",
4242
"rewatch": "cli/rewatch"
4343
},
4444
"scripts": {
@@ -56,8 +56,6 @@
5656
"CHANGELOG.md",
5757
"CREDITS.md",
5858
"ninja.COPYING",
59-
"bsc",
60-
"rescript",
6159
"darwin",
6260
"darwinarm64",
6361
"linux",

packages/artifacts.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ COPYING.LESSER
44
CREDITS.md
55
LICENSE
66
README.md
7-
bsc
87
cli/bin_path.js
8+
cli/bsc
9+
cli/rescript
910
cli/rescript_arg.js
1011
cli/rescript_bsb.js
1112
cli/rescript_dump.js
@@ -863,7 +864,6 @@ linuxarm64/rescript.exe
863864
linuxarm64/rewatch.exe
864865
ninja.COPYING
865866
package.json
866-
rescript
867867
win32/bsb_helper.exe
868868
win32/bsc.exe
869869
win32/ninja.exe

scripts/buildRuntime.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rm -f lib/es6/*.js lib/js/*.js lib/ocaml/*
66
mkdir -p lib/es6 lib/js lib/ocaml
77
mkdir -p runtime/lib/es6 runtime/lib/js
88

9-
(cd runtime && ../rescript build)
9+
(cd runtime && ../cli/rescript build)
1010

1111
cp runtime/lib/es6/*.js lib/es6
1212
cp runtime/lib/js/*.js lib/js

scripts/format.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ shopt -s extglob
55
dune build @fmt --auto-promote
66

77
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*")
8-
./rescript format $files
8+
./cli/rescript format $files

scripts/format_check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ case "$(uname -s)" in
1717
fi
1818

1919
echo "Checking ReScript code formatting..."
20-
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*")
21-
if ./rescript format -check $files; then
20+
files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -path "tests/gentype_tests/typescript-react-example/node_modules/*")
21+
if ./cli/rescript format -check $files; then
2222
printf "${successGreen}✅ ReScript code formatting ok.${reset}\n"
2323
else
2424
printf "${warningYellow}⚠️ ReScript code formatting issues found.${reset}\n"

tests/build_tests/cli_compile_status/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require("path");
55
const child_process = require("child_process");
66
const { normalizeNewlines } = require("../utils.js");
77

8-
const rescriptPath = path.join(__dirname, "..", "..", "..", "rescript")
8+
const rescriptPath = path.join(__dirname, "..", "..", "..", "cli", "rescript")
99

1010
// Shows compile time for `rescript build` command
1111
let out = child_process.spawnSync("node", [rescriptPath, "build"], {

tests/build_tests/cli_help/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require("assert");
44
const path = require("path");
55
const { exec, normalizeNewlines } = require("../utils.js");
66

7-
const rescriptPath = path.join(__dirname, "..", "..", "..", "rescript")
7+
const rescriptPath = path.join(__dirname, "..", "..", "..", "cli", "rescript")
88

99
const cliHelp =
1010
"Usage: rescript <options> <subcommand>\n" +

tests/gentype_tests/typescript-react-example/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)