feat: support dynamic port and manifest URLs

1. start script: npm run start passes args to next start
   - Usage: npm run start -- -p 3000

2. /docs: dynamic fetch from docs-manifest.json
   - URL: https://dl.svc.plus/dl-index/docs-manifest.json

3. /download: dynamic fetch from offline-package-manifest.json
   - URL: https://dl.svc.plus/dl-index/offline-package-manifest.json

🤖 Generated with Claude Code
This commit is contained in:
Haitao Pan 2025-11-11 22:32:21 +08:00
parent 086ab779a4
commit eae77beeea
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@
},
"scripts": {
"dev": "next dev --turbo",
"prebuild": "tsx ../scripts/export-slugs.ts && tsx ../scripts/scan-md.ts && tsx ../scripts/fetch-dl-index.ts",
"prebuild": "tsx ../scripts/export-slugs.ts && tsx ../scripts/scan-md.ts && tsx ../scripts/fetch-dl-index.ts && node ../scripts/copy-manifests.js",
"build": "next build",
"build:static": "npm run prebuild && next build",
"start": "next start",

View File

@ -2,7 +2,7 @@ import type { DirListing } from './types'
import { buildDownloadSections, countFiles, findListing, formatSegmentLabel, type DownloadSection } from '../download-data'
import fallbackOfflinePackage from '../../../public/_build/offline-package.json'
const OFFLINE_PACKAGE_URL = 'https://dl.svc.plus/dl-index/offline-package.json'
const OFFLINE_PACKAGE_URL = 'https://dl.svc.plus/dl-index/offline-package-manifest.json'
/**
* Fetch the offline-package download listings