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 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", 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