Skip to content

Commit 2e1305d

Browse files
committed
Drop support for bs-platform.
1 parent 8adf920 commit 2e1305d

File tree

4 files changed

+5
-26
lines changed

4 files changed

+5
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Sync with latest parser/printer.
1515
- Support paths to rescript executables in arm64 architectures.
1616
- Fix issue where `@inline` was not suported by the command to generate an interface file.
17+
- `*` Drop support for `bs-patform`. Only `rescript` supported.
1718

1819
## 1.3.0
1920

analysis/src/BuildSystem.ml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ let getBsPlatformDir rootPath =
99
let result =
1010
ModuleResolution.resolveNodeModulePath ~startPath:rootPath "rescript"
1111
in
12-
let result =
13-
if result = None then
14-
ModuleResolution.resolveNodeModulePath ~startPath:rootPath "bs-platform"
15-
else result
16-
in
1712
match result with
1813
| Some path -> Some path
1914
| None ->
20-
let message = "bs-platform could not be found" in
15+
let message = "rescript could not be found" in
2116
Log.log message;
2217
None
2318

server/src/constants.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ export let bscNativeReScriptPartialPath = path.join(
1212
platformDir,
1313
"bsc.exe"
1414
);
15-
export let bscNativePartialPath = path.join(
16-
"node_modules",
17-
"bs-platform",
18-
platformDir,
19-
"bsc.exe"
20-
);
2115

2216
export let analysisDevPath = path.join(
2317
path.dirname(__dirname),

server/src/utils.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ export let findProjectRootOfFile = (
3838
}
3939
};
4040

41-
// TODO: races here?
42-
// TODO: this doesn't handle file:/// scheme
43-
44-
// We need to recursively search for bs-platform/{platform}/bsc.exe upward from
45-
// the project's root, because in some setups, such as yarn workspace/monorepo,
46-
// the node_modules/bs-platform package might be hoisted up instead of alongside
47-
// the project root.
48-
// Also, if someone's ever formatting a regular project setup's dependency
49-
// (which is weird but whatever), they'll at least find an upward bs-platform
50-
// from the dependent.
5141
export let findBscBinaryFromProjectRoot = (
5242
source: p.DocumentUri
5343
): null | p.DocumentUri => {
@@ -56,12 +46,9 @@ export let findBscBinaryFromProjectRoot = (
5646
// also invokes another JS wrapper. _That_ JS wrapper ultimately calls the
5747
// (unexposed) bsc -format anyway.
5848
let bscNativeReScriptPath = path.join(dir, c.bscNativeReScriptPartialPath);
59-
let bscNativePath = path.join(dir, c.bscNativePartialPath);
6049

6150
if (fs.existsSync(bscNativeReScriptPath)) {
6251
return bscNativeReScriptPath;
63-
} else if (fs.existsSync(bscNativePath)) {
64-
return bscNativePath;
6552
} else if (dir === source) {
6653
// reached the top
6754
return null;
@@ -98,7 +85,9 @@ let findBuildBinaryBase = ({
9885
return null;
9986
};
10087

101-
export let findBuildBinaryFromConfig = (pathToBinaryDirFromConfig: p.DocumentUri) =>
88+
export let findBuildBinaryFromConfig = (
89+
pathToBinaryDirFromConfig: p.DocumentUri
90+
) =>
10291
findBuildBinaryBase({
10392
rescriptPath: path.join(pathToBinaryDirFromConfig, c.rescriptBinName),
10493
bsbPath: path.join(pathToBinaryDirFromConfig, c.bsbBinName),

0 commit comments

Comments
 (0)