





















@@ -16,6 +16,14 @@ function runListProdStorePackages(input: unknown, cwd = process.cwd()) {
1616});
1717}
181819+function runListProdStorePackagesRaw(input: string, cwd = process.cwd()) {
20+return spawnSync(process.execPath, [scriptPath], {
21+ cwd,
22+encoding: "utf8",
23+ input,
24+});
25+}
26+1927describe("list-prod-store-packages", () => {
2028afterEach(() => {
2129cleanupTempDirs(tempDirs);
@@ -101,6 +109,64 @@ describe("list-prod-store-packages", () => {
101109expect(result.stdout).toBe("source-map-support@0.5.21\nsource-map@0.6.1");
102110});
103111112+it("adds production importer dependency closures without pnpm list input", () => {
113+const cwd = makeTempRepoRoot(tempDirs, "openclaw-prod-store-packages-");
114+writeFileSync(
115+join(cwd, "pnpm-lock.yaml"),
116+[
117+"lockfileVersion: '10.0'",
118+"",
119+"importers:",
120+" .:",
121+" dependencies:",
122+" '@homebridge/ciao':",
123+" specifier: 1.3.9",
124+" version: 1.3.9",
125+" fetch-blob:",
126+" specifier: 3.2.0",
127+" version: 3.2.0",
128+"",
129+"packages:",
130+" '@homebridge/ciao@1.3.9':",
131+" resolution: {integrity: sha512-test}",
132+" source-map-support@0.5.21:",
133+" resolution: {integrity: sha512-test}",
134+" source-map@0.6.1:",
135+" resolution: {integrity: sha512-test}",
136+" fetch-blob@3.2.0:",
137+" resolution: {integrity: sha512-test}",
138+" '@nolyfill/domexception@1.0.28':",
139+" resolution: {integrity: sha512-test}",
140+"",
141+"snapshots:",
142+" '@homebridge/ciao@1.3.9':",
143+" dependencies:",
144+" source-map-support: 0.5.21",
145+" source-map-support@0.5.21:",
146+" dependencies:",
147+" source-map: 0.6.1",
148+" source-map@0.6.1: {}",
149+" fetch-blob@3.2.0:",
150+" dependencies:",
151+" node-domexception: '@nolyfill/domexception@1.0.28'",
152+" '@nolyfill/domexception@1.0.28': {}",
153+"",
154+].join("\n"),
155+);
156+const result = runListProdStorePackagesRaw("", cwd);
157+158+expect(result.status).toBe(0);
159+expect(result.stdout.split("\n")).toEqual(
160+[
161+"@homebridge/ciao@1.3.9",
162+"fetch-blob@3.2.0",
163+"@nolyfill/domexception@1.0.28",
164+"source-map-support@0.5.21",
165+"source-map@0.6.1",
166+].toSorted((a, b) => a.localeCompare(b)),
167+);
168+});
169+104170it("adds target optional dependencies from peer-resolved lockfile snapshots", () => {
105171const cwd = makeTempRepoRoot(tempDirs, "openclaw-prod-store-packages-");
106172const platformPackages = [
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。