From 97b98993c42d15cfed14e368a197e8a0833a4179 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 19 Mar 2025 07:29:14 +0900 Subject: [PATCH 1/3] remove postinstall script --- cli/rescript_postinstall.js | 42 ------------------------------------- package.json | 1 - 2 files changed, 43 deletions(-) delete mode 100644 cli/rescript_postinstall.js diff --git a/cli/rescript_postinstall.js b/cli/rescript_postinstall.js deleted file mode 100644 index 482d3b7962..0000000000 --- a/cli/rescript_postinstall.js +++ /dev/null @@ -1,42 +0,0 @@ -//@ts-check -const child_process = require("child_process"); -const fs = require("fs"); - -const { bsc_exe, ninja_exe } = require("./bin_path"); - -function checkNinja() { - if (!fs.existsSync(ninja_exe)) { - throw new Error( - `No ninja binary found for this platform. ${ninja_exe} does not exist.`, - ); - } - - try { - return String(child_process.execFileSync(ninja_exe, ["--version"])).trim(); - } catch (e) { - throw new Error( - `Error getting ninja version. The ninja binary at ${ninja_exe} may not be compatible with this platform: ${e}`, - ); - } -} - -function checkCompiler() { - if (!fs.existsSync(bsc_exe)) { - throw new Error( - `No ReScript compiler binary found for this platform. ${bsc_exe} does not exist.`, - ); - } - - try { - return String(child_process.execFileSync(bsc_exe, ["-v"])).trim(); - } catch (e) { - throw new Error( - `Error getting ReScript compiler version. The compiler binary at ${bsc_exe} may not be compatible with this platform: ${e}`, - ); - } -} - -var ninjaVersion = checkNinja(); -var compilerVersion = checkCompiler(); - -console.log(`${compilerVersion} (ninja ${ninjaVersion})`); diff --git a/package.json b/package.json index d0b730608b..479a16879e 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "rewatch": "cli/rewatch" }, "scripts": { - "postinstall": "node cli/rescript_postinstall.js", "test": "node scripts/test.js -all", "test-bsb": "node scripts/test.js -bsb", "test-ocaml": "node scripts/test.js -ounit", From 6241e4a6732a5b704a2a43e7bd7e4de23ffb3b8e Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 19 Mar 2025 07:58:38 +0900 Subject: [PATCH 2/3] update artifact list --- packages/artifacts.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/artifacts.txt b/packages/artifacts.txt index 8406f800dc..0b9c84e111 100644 --- a/packages/artifacts.txt +++ b/packages/artifacts.txt @@ -12,7 +12,6 @@ cli/rescript_arg.js cli/rescript_bsb.js cli/rescript_dump.js cli/rescript_format.js -cli/rescript_postinstall.js cli/rewatch darwin/bsb_helper.exe darwin/bsc.exe From 8f2eadcf57166b078ea125ff424851c0647f1953 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 19 Mar 2025 08:00:07 +0900 Subject: [PATCH 3/3] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a70aff209..b39594723f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - Hide stdlib modules in output. https://github.com/rescript-lang/rescript/pull/7305 - Deprecate unsafe host-specific bindings from stdlib. https://github.com/rescript-lang/rescript/pull/7334 - Make unsafe function names consistent in Stdlib.String. https://github.com/rescript-lang/rescript/pull/7337 +- `rescript` package does not trigger `postinstall` script anymore. https://github.com/rescript-lang/rescript/pull/7350 #### :bug: Bug fix