Skip to content

Commit 07eb068

Browse files
committed
format
1 parent 41343f2 commit 07eb068

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@
7676
"vite-plugin-devtools-json": "^1.0.0",
7777
"vite-plugin-env-compatible": "^2.0.1"
7878
}
79-
}
79+
}

react-router.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import * as fs from "node:fs";
22
import { init } from "react-router-mdx/server";
33

44
const mdx = init({
5-
paths: ["markdown-pages/blogposts", "markdown-pages/docs", "markdown-pages/community", "markdown-pages/syntax-lookup"],
5+
paths: [
6+
"markdown-pages/blogposts",
7+
"markdown-pages/docs",
8+
"markdown-pages/community",
9+
"markdown-pages/syntax-lookup",
10+
],
611
aliases: ["blog", "docs", "community", "syntax-lookup"],
712
});
813

scripts/test-examples.mjs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,26 @@ fs.writeFileSync(tempFileName, "");
9797

9898
let success = true;
9999

100-
glob.sync(__dirname + "/../markdown-pages/docs/{manual,react}/**/*.mdx").forEach((file) => {
101-
let content = fs.readFileSync(file, { encoding: "utf-8" });
102-
let parsedResult = parseFile(content);
103-
if (parsedResult != null) {
104-
fs.writeFileSync(tempFileName, parsedResult);
105-
try {
106-
console.log("testing examples in", file);
107-
// -109 for suppressing `Toplevel expression is expected to have unit type.`
108-
// Most doc snippets do e.g. `Belt.Array.length(["test"])`, which triggers this
109-
child_process.execSync("npm exec rescript build ./temp -- --quiet", {
110-
stdio: "inherit",
111-
});
112-
} catch (e) {
113-
// process.stdout.write(postprocessOutput(file, e));
114-
success = false;
100+
glob
101+
.sync(__dirname + "/../markdown-pages/docs/{manual,react}/**/*.mdx")
102+
.forEach((file) => {
103+
let content = fs.readFileSync(file, { encoding: "utf-8" });
104+
let parsedResult = parseFile(content);
105+
if (parsedResult != null) {
106+
fs.writeFileSync(tempFileName, parsedResult);
107+
try {
108+
console.log("testing examples in", file);
109+
// -109 for suppressing `Toplevel expression is expected to have unit type.`
110+
// Most doc snippets do e.g. `Belt.Array.length(["test"])`, which triggers this
111+
child_process.execSync("npm exec rescript build ./temp -- --quiet", {
112+
stdio: "inherit",
113+
});
114+
} catch (e) {
115+
// process.stdout.write(postprocessOutput(file, e));
116+
success = false;
117+
}
115118
}
116-
}
117-
});
119+
});
118120

119121
fs.unlinkSync(tempFileName);
120122
process.exit(success ? 0 : 1);

src/ApiDocs.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ module Data = {
404404

405405
let pathModule = Path.join([dir, `${moduleName}.json`])
406406

407-
let moduleContent = Fs.readFileSync(`markdown-pages/docs/api/${moduleName}.json`)->JSON.parseOrThrow
407+
let moduleContent =
408+
Fs.readFileSync(`markdown-pages/docs/api/${moduleName}.json`)->JSON.parseOrThrow
408409

409410
let content = switch moduleContent {
410411
| Object(dict) => dict->Some
@@ -428,7 +429,6 @@ let processStaticProps = (~slug: array<string>) => {
428429
->Option.map(data => data.mainModule)
429430
->Option.flatMap(Dict.get(_, modulePath))
430431

431-
432432
let _content = content
433433

434434
switch content {

vite.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { reactRouter } from "@react-router/dev/vite";
22
import tailwindcss from "@tailwindcss/vite";
33
import { defineConfig } from "vite";
44
import env from "vite-plugin-env-compatible";
5-
import devtoolsJson from 'vite-plugin-devtools-json';
5+
import devtoolsJson from "vite-plugin-devtools-json";
66

77
export default defineConfig({
88
plugins: [
99
tailwindcss(),
1010
reactRouter(),
1111
env({ prefix: "PUBLIC_" }), // this is to make it so babel doesn't break when trying to acess process.env in the client
12-
devtoolsJson()
12+
devtoolsJson(),
1313
],
1414
build: {
1515
// Having these on helps with local development

0 commit comments

Comments
 (0)