Skip to content

Commit 97eb93d

Browse files
committed
fix format
1 parent 031e3f0 commit 97eb93d

File tree

3 files changed

+18
-25
lines changed

3 files changed

+18
-25
lines changed

Diff for: .github/workflows/prepare_package_upload.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
22
import * as os from "node:os";
33

44
const packageSpec = JSON.parse(
5-
fs.readFileSync(new URL("../../package.json", import.meta.url), "utf-8")
5+
fs.readFileSync(new URL("../../package.json", import.meta.url), "utf-8"),
66
);
77

88
const { version } = packageSpec;
@@ -11,10 +11,7 @@ const commitHash = process.argv[2] || process.env.GITHUB_SHA;
1111
const commitHashShort = commitHash.substring(0, 7);
1212

1313
// rescript
14-
fs.renameSync(
15-
"package.tgz",
16-
`rescript-${version}-${commitHashShort}.tgz`,
17-
);
14+
fs.renameSync("package.tgz", `rescript-${version}-${commitHashShort}.tgz`);
1815

1916
// @rescript/std
2017
fs.renameSync(

Diff for: cli/bstracing.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// @ts-check
44

55
import * as fs from "node:fs";
6-
import * as readline from "node:readline";
76
import * as path from "node:path";
7+
import * as readline from "node:readline";
88

99
/**
1010
*
@@ -14,10 +14,10 @@ import * as path from "node:path";
1414
*/
1515
function processEntry(file, lineCb, finish) {
1616
const input = fs.createReadStream(file);
17-
input.on("error", (error) => {
17+
input.on("error", error => {
1818
console.error(error.message);
1919
console.error(
20-
"make sure you are running after bsb building and in the top directory"
20+
"make sure you are running after bsb building and in the top directory",
2121
);
2222
process.exit(2);
2323
});
@@ -156,7 +156,7 @@ function category(target, obj) {
156156
} else {
157157
getColorName(obj, "cmj");
158158
}
159-
obj.name = target.targets.map((x) => path.parse(x).base).join(",");
159+
obj.name = target.targets.map(x => path.parse(x).base).join(",");
160160
return obj;
161161
}
162162
/**
@@ -173,7 +173,7 @@ function readIntervals(file, showAll, outputFile) {
173173
let offset = 0;
174174
processEntry(
175175
file,
176-
(line) => {
176+
line => {
177177
const lineTrim = line.trim();
178178
if (lineTrim.startsWith("#")) {
179179
return;
@@ -195,7 +195,7 @@ function readIntervals(file, showAll, outputFile) {
195195
setDefault(
196196
targets,
197197
cmdHash,
198-
new Interval(Number(start) + offset, Number(end) + offset)
198+
new Interval(Number(start) + offset, Number(end) + offset),
199199
).targets.push(name);
200200
},
201201
() => {
@@ -213,12 +213,12 @@ function readIntervals(file, showAll, outputFile) {
213213
ts: target.start * 1000,
214214
tid: threads.alloc(target),
215215
args: {},
216-
})
216+
}),
217217
);
218218
}
219219
console.log(` ${outputFile} is produced, loade it via chrome://tracing/`);
220220
fs.writeFileSync(outputFile, JSON.stringify(jsonArray), "utf8");
221-
}
221+
},
222222
);
223223
}
224224
const logName = ".ninja_log";
@@ -240,7 +240,7 @@ function tryLocation(ps) {
240240
}
241241
}
242242
console.error(
243-
"no .ninja_log found in specified paths, make sure you set bstracing to the proper directory"
243+
"no .ninja_log found in specified paths, make sure you set bstracing to the proper directory",
244244
);
245245
process.exit(2);
246246
}

Diff for: scripts/npmPack.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
// In CI, the scripts is invoked without options. It then performs `yarn pack` for real,
1111
// recreates the artifact list and verifies that it has no changes compared to the committed state.
1212

13-
import { spawn, execSync } from "node:child_process";
13+
import { execSync, spawn } from "node:child_process";
1414
import fs from "node:fs";
1515
import { parseArgs } from "node:util";
1616
import { artifactListFile } from "#dev/paths";
1717

18-
/**
18+
/**
1919
* @typedef {(
2020
* | { "base": string }
2121
* | { "location": string }
@@ -33,9 +33,7 @@ const { values } = parseArgs({
3333
},
3434
});
3535

36-
const mode = values.updateArtifactList
37-
? "updateArtifactList"
38-
: "package";
36+
const mode = values.updateArtifactList ? "updateArtifactList" : "package";
3937

4038
const child = spawn(
4139
"yarn",
@@ -55,7 +53,9 @@ const exitCode = new Promise((resolve, reject) => {
5553
fs.unlinkSync(artifactListFile);
5654

5755
for await (const chunk of child.stdout.setEncoding("utf8")) {
58-
const lines = /** @type {string} */ (chunk).trim().split(/\s/);
56+
const lines = /** @type {string} */ (chunk)
57+
.trim()
58+
.split(/\s/);
5959
for (const line of lines) {
6060
/** @type {YarnPackOutputLine} */
6161
const json = JSON.parse(line);
@@ -65,11 +65,7 @@ for await (const chunk of child.stdout.setEncoding("utf8")) {
6565
if (json.location.startsWith("_build")) {
6666
continue;
6767
}
68-
fs.appendFileSync(
69-
artifactListFile,
70-
json.location + "\n",
71-
"utf8",
72-
);
68+
fs.appendFileSync(artifactListFile, json.location + "\n", "utf8");
7369
}
7470
}
7571
}

0 commit comments

Comments
 (0)