Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ pnpm-debug.log*
.idea/

.cache
.data-cache
.data-cache
34 changes: 34 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react": "^19.2.0",
"react-dom": "^19.2.0",
"tailwindcss": "^4.1.17",
"unzipper": "^0.12.3",
"uuid": "^13.0.0"
},
"scripts": {
Expand All @@ -33,6 +34,7 @@
},
"type": "module",
"devDependencies": {
"@types/markdown-it-footnote": "^3.0.4"
"@types/markdown-it-footnote": "^3.0.4",
"@types/unzipper": "^0.10.11"
}
}
}
19 changes: 10 additions & 9 deletions scripts/fetch-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import markdownItFootnote from 'markdown-it-footnote';
import markdownItGitHubAlerts from 'markdown-it-github-alerts';
import { full as markdownItEmoji } from 'markdown-it-emoji';
import { Octokit } from '@octokit/rest';
import { exec } from 'child_process';
import { promisify } from 'util';

const execAsync = promisify(exec);
import unzipper from 'unzipper';

// Concurrent execution helper with limit
async function pMap<T, R>(
Expand Down Expand Up @@ -559,11 +556,15 @@ function replacePrivateImage(markdown: string, html: string): string {

async function extractModulePropsFromZip(downloadUrl: string): Promise<Record<string, string>> {
try {
// Extract module.prop content from zip URL (internal network, stable)
const { stdout: modulePropContent } = await execAsync(`runzip -p "${downloadUrl}" module.prop`, {
encoding: 'utf8',
maxBuffer: 64 * 1024 // 64KB buffer
});
// Extract module.prop content from zip URL using unzipper
const directory = await unzipper.Open.url(fetch, downloadUrl);
const modulePropFile = directory.files.find(f => f.path === 'module.prop');

if (!modulePropFile) {
return {};
}

const modulePropContent = (await modulePropFile.buffer()).toString('utf8');

// Parse module.prop content
const props: Record<string, string> = {};
Expand Down
Loading