Skip to content

Remove rescript convert subcommand #6860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- Some global names and old keywords are no longer prefixed. https://github.com/rescript-lang/rescript-compiler/pull/6831
- Remove ml parsing tests and conversion from `.ml` to `.res` via format. https://github.com/rescript-lang/rescript-compiler/pull/6848
- Remove support for compiling `.ml` files, and general cleanup. https://github.com/rescript-lang/rescript-compiler/pull/6852
- Remove `rescript convert` subcommand. https://github.com/rescript-lang/rescript-compiler/pull/6860

#### :bug: Bug Fix

Expand Down
5 changes: 1 addition & 4 deletions cli/rescript_bsb.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,7 @@ Please pick a different one using the \`-ws [host:]port\` flag from bsb.`);
if (!fileName) return true;

return (
((fileName.endsWith(".res") ||
fileName.endsWith(".resi") ||
fileName.endsWith(".ml") ||
fileName.endsWith(".mli")) &&
((fileName.endsWith(".res") || fileName.endsWith(".resi")) &&
!watchGenerated.includes(fileName)) ||
fileName === resConfig
);
Expand Down
128 changes: 0 additions & 128 deletions cli/rescript_convert.js

This file was deleted.

32 changes: 0 additions & 32 deletions jscomp/build_tests/cli_help/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const cliHelp =
" build\n" +
" clean\n" +
" format\n" +
" convert\n" +
" dump\n" +
" help\n" +
"\n" +
Expand Down Expand Up @@ -58,17 +57,6 @@ const formatHelp =
" -all Format the whole project \n" +
" -check Check formatting for file or the whole project. Use `-all` to check the whole project\n";

const convertHelp =
"Usage: rescript convert <options> [files]\n" +
"\n" +
"`rescript convert` converts the current directory\n" +
"\n" +
"**This command removes old OCaml files and creates new ReScript \n" +
"files. Make sure your work is saved first!**\n" +
"\n" +
"Options:\n" +
" -all Convert the whole project\n";

const dumpHelp =
"Usage: rescript dump <options> [target]\n" +
"`rescript dump` dumps the information for the target\n";
Expand Down Expand Up @@ -232,26 +220,6 @@ async function test() {
assert.equal(out.status, 0);
}

{
// Shows convert help with --help arg
const out = await exec(`../../../rescript`, ["convert", "--help"], {
cwd: __dirname,
});
assert.equal(out.stdout, convertHelp);
assert.equal(out.stderr, "");
assert.equal(out.status, 0);
}

{
// Shows convert help with -h arg
const out = await exec(`../../../rescript`, ["convert", "-h"], {
cwd: __dirname,
});
assert.equal(out.stdout, convertHelp);
assert.equal(out.stderr, "");
assert.equal(out.status, 0);
}

{
// Shows dump help with --help arg
const out = await exec(`../../../rescript`, ["dump", "--help"], {
Expand Down
1 change: 0 additions & 1 deletion packages/artifacts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bsc
cli/bin_path.js
cli/rescript_arg.js
cli/rescript_bsb.js
cli/rescript_convert.js
cli/rescript_dump.js
cli/rescript_format.js
cli/rescript_postinstall.js
Expand Down
9 changes: 0 additions & 9 deletions rescript
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Subcommands:
build
clean
format
convert
dump
help

Expand Down Expand Up @@ -119,14 +118,6 @@ if (helpArgIndex !== -1 && (firstPositionalArgIndex === -1 || helpArgIndex <= fi
);
break;
}
case "convert": {
require("./cli/rescript_convert.js").main(
subcmdArgs,
rescript_exe,
bsc_exe
);
break;
}
default: {
console.error(
`Error: Unknown command "${subcmd}".\n${helpMessage}`
Expand Down