Skip to content

Commit 8bd6fc7

Browse files
committed
fix build
1 parent fdeeb24 commit 8bd6fc7

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@
6262
"build": "rescript && npm run update-index && next build",
6363
"test": "node scripts/test-examples.mjs && node scripts/test-hrefs.mjs",
6464
"reanalyze": "reanalyze -all-cmt .",
65-
"update-index": "npm run generate-llms && node scripts/extract-indices.mjs && node scripts/extract-tocs.mjs && node scripts/extract-syntax.mjs && node scripts/generate_feed.mjs > public/blog/feed.xml",
66-
"sync-bundles": "node scripts/sync-playground-bundles.mjs",
67-
"generate-llms": "node scripts/generate_llms.mjs",
68-
"generate-resources": "node scripts/generate_resources.mjs"
65+
"update-index": "node scripts/extract-tocs.mjs && node scripts/extract-syntax.mjsl"
6966
},
7067
"devDependencies": {
7168
"@mdx-js/react": "^2.3.0",
@@ -81,4 +78,4 @@
8178
"simple-functional-loader": "^1.2.1",
8279
"tailwindcss": "^3.3.3"
8380
}
84-
}
81+
}

scripts/extract-tocs.mjs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -160,32 +160,6 @@ const createReactToc = (version) => {
160160
fs.writeFileSync(TARGET_FILE, JSON.stringify(toc), "utf8");
161161
};
162162

163-
const createCommunityToc = () => {
164-
const MD_DIR = path.join(__dirname, "../pages/community");
165-
// Skip Community TOC generation if the community directory doesn't exist. This avoids build-time
166-
// errors when the community section has been removed or hasn't been migrated yet.
167-
if (!fs.existsSync(MD_DIR)) {
168-
console.warn(`Skipping Community TOC generation: Directory not found -> ${MD_DIR}`);
169-
return;
170-
}
171-
const SIDEBAR_JSON = path.join(__dirname, "../data/sidebar_community.json");
172-
const TARGET_FILE = path.join(__dirname, "../index_data/community_toc.json");
173-
174-
const sidebarJson = JSON.parse(fs.readFileSync(SIDEBAR_JSON));
175-
176-
const FILE_ORDER = Object.values(sidebarJson).reduce((acc, items) => {
177-
return acc.concat(items);
178-
}, []);
179-
180-
const files = glob.sync(`${MD_DIR}/*.?(js|md?(x))`);
181-
const ordered = orderFiles(files, FILE_ORDER);
182-
183-
const result = ordered.map((filepath) => processFile(filepath, sidebarJson));
184-
const toc = createTOC(result);
185-
186-
fs.writeFileSync(TARGET_FILE, JSON.stringify(toc), "utf8");
187-
};
188-
189163
/*
190164
const debugToc = () => {
191165
const MD_DIR = path.join(__dirname, "../pages/docs/manual/latest");
@@ -206,4 +180,3 @@ let reactManualVersions = ["latest", "v0.10.0", "v0.11.0"];
206180

207181
manualVersions.forEach(createManualToc);
208182
reactManualVersions.forEach(createReactToc);
209-
createCommunityToc();

0 commit comments

Comments
 (0)