Skip to content

Commit 473f993

Browse files
committedAug 31, 2021
tweak build scripts
1 parent 50d0e5a commit 473f993

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed
 

‎scripts/repl.js

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env node
2+
23
//@ts-check
3-
var p = require("child_process");
4+
var child_process = require("child_process");
45
var fs = require("fs");
56
var path = require("path");
67

78
var ocamlVersion = "4.06.1";
89
var jscompDir = path.join(__dirname, "..", "jscomp");
9-
var jsRefmtCompDir = path.join(
10+
var sourceDir = path.join(
1011
__dirname,
1112
"..",
1213
"lib",
@@ -26,34 +27,32 @@ var config = {
2627
*/
2728
function e(cmd) {
2829
console.log(`>>>>>> running command: ${cmd}`);
29-
p.execSync(cmd, config);
30+
child_process.execSync(cmd, config);
3031
console.log(`<<<<<<`);
3132
}
3233

33-
if (!process.env.BS_PLAYGROUND) {
34-
var defaultPlayground = `../../bucklescript-playground`;
34+
if (!process.env.PLAYGROUND) {
35+
var defaultPlayground = `../../playground`;
3536
console.warn(
36-
`BS_PLAYGROUND env var unset, defaulting to ${defaultPlayground}`
37+
`PLAYGROUND env var unset, defaulting to ${defaultPlayground}`
3738
);
38-
process.env.BS_PLAYGROUND = defaultPlayground;
39+
process.env.PLAYGROUND = defaultPlayground;
3940
}
4041

41-
var playground = process.env.BS_PLAYGROUND;
42+
var playground = process.env.PLAYGROUND;
43+
var OCAMLC = `ocamlc.opt`
4244

43-
var nativePath = path.join(__dirname, "..", "native", "4.06.1", "bin");
44-
var OCAMLC = path.join(nativePath, "ocamlc.opt");
45-
var OCAMLRUN = path.join(nativePath, "ocamlrun");
46-
var JSOO = path.join(__dirname, "..", "vendor", "js_of_ocaml.bc");
45+
var JSOO = `js_of_ocaml`;
4746
function prepare(isDev) {
4847
var [env, ocamlFlag, jsooFlag] = isDev
4948
? ["development", "-g ", "--pretty "]
5049
: ["production", "", ""];
5150
console.log(`building byte code version of the compiler [${env}]`);
5251
e(
53-
`${OCAMLC} ${ocamlFlag}-w -30-40 -no-check-prims -I ${jsRefmtCompDir} ${jsRefmtCompDir}/js_refmt_compiler.mli ${jsRefmtCompDir}/js_refmt_compiler.ml -o jsc.byte `
52+
`${OCAMLC} ${ocamlFlag}-w -30-40 -no-check-prims -I ${sourceDir} ${sourceDir}/js_compiler.mli ${sourceDir}/js_compiler.ml -o jsc.byte `
5453
);
5554
console.log("building js version");
56-
e(`${OCAMLRUN} ${JSOO} compile jsc.byte ${jsooFlag}-o exports.js`);
55+
e(`${JSOO} compile jsc.byte ${jsooFlag}-o exports.js`);
5756
console.log("copy js artifacts");
5857
e(`cp ../lib/js/*.js ${playground}/stdlib`);
5958
e(`mv ./exports.js ${playground}`);
@@ -65,7 +64,7 @@ function prepublish() {
6564
);
6665
var packageJson = JSON.stringify(
6766
{
68-
name: "reason-js-compiler",
67+
name: "rescript-compiler",
6968
version: mainPackageJson.version,
7069
license: mainPackageJson.license,
7170
description: mainPackageJson.description,

0 commit comments

Comments
 (0)