From a921fcb7e1206b132b275cb817ab9299d9b307e8 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Fri, 17 Jul 2026 21:32:35 +0800 Subject: [PATCH] fix(website): resolve package manifests on Windows --- scripts/gen-website-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gen-website-api.ts b/scripts/gen-website-api.ts index bd0da34fde..669faba572 100644 --- a/scripts/gen-website-api.ts +++ b/scripts/gen-website-api.ts @@ -444,9 +444,9 @@ function collectHarnessServices(violations: string[]): HarnessService[] { if (!text.includes('interface Context')) continue const body = cordisModuleBody(sf) if (!body) continue - const pkgJson = rel.replace(/src\/index\.ts$/, 'package.json') + const pkgJson = resolve(root, dirname(dirname(rel)), 'package.json') // Manifest shape is repo-owned; `name` is the one field read here. - const manifest = JSON.parse(readFileSync(resolve(root, pkgJson), 'utf8')) as { name: string } + const manifest = JSON.parse(readFileSync(pkgJson, 'utf8')) as { name: string } const pkg = manifest.name for (const { key, type, cls, abstract, doc: clsDoc } of serviceClasses(body, sf, rel, violations)) { const groups = new Map()