Skip to content

Commit fcdf7a9

Browse files
authored
refactor: split dir for CLI and dev scripts (#6782)
* refactor: split dir for CLI and dev scripts * make it official entrypoint that can be referenced by outside * update artifact list * can it be referenced from actions script too? * fix format * fix postinstall script but do we really need to keep this? The `postinstall` hooks is avoided by default in other PMs * artifacts * switch back bin_path resolution to use imports * remove unnecessary npmignore
1 parent 70e25f7 commit fcdf7a9

File tree

60 files changed

+83
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+83
-98
lines changed

.github/workflows/get_artifact_dir_name.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require("fs");
22
const os = require("os");
33

4-
const artifactDirName = require("../../scripts/bin_path").dirName;
4+
const { dirName: artifactDirName } = require("../../cli/bin_path.js");
55

66
// Pass artifactDirName to subsequent GitHub actions
77
fs.appendFileSync(

.github/workflows/prepare_package_upload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require("fs");
22
const os = require("os");
33

4-
const packageSpec = JSON.parse(fs.readFileSync("./package.json", "utf8"));
4+
const packageSpec = require("rescript/package.json");
55
const { version } = packageSpec;
66

77
const commitHash = process.argv[2] || process.env.GITHUB_SHA;

bsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"use strict";
33

44
var child_process = require("child_process");
5-
var bsc_exe = require("./scripts/bin_path").bsc_exe;
5+
var { bsc_exe } = require("./cli/bin_path");
66

77
var delegate_args = process.argv.slice(2);
88

File renamed without changes.
File renamed without changes.

scripts/rescript_bsb.js renamed to cli/rescript_bsb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require("fs");
44
const path = require("path");
55
var os = require("os");
66
const child_process = require("child_process");
7-
const rescript_exe = require("./bin_path").rescript_exe;
7+
const { rescript_exe } = require("./bin_path");
88

99
const cwd = process.cwd();
1010
const lockFileName = path.join(cwd, ".bsb.lock");
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/rescript_postinstall.js renamed to cli/rescript_postinstall.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
const child_process = require("child_process");
33
const fs = require("fs");
44

5-
const bsc_exe = require("./bin_path").bsc_exe;
6-
const ninja_exe = require("./bin_path").ninja_exe;
5+
const { bsc_exe, ninja_exe } = require("./bin_path");
76

87
function checkNinja() {
98
if (!fs.existsSync(ninja_exe)) {

0 commit comments

Comments
 (0)