@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
|
2 | 2 | import path from "node:path"; |
3 | 3 | import type { PluginInstallRecord } from "../../config/types.plugins.js"; |
4 | 4 | import { resolvePackageExtensionEntries, type PackageManifest } from "../../plugins/manifest.js"; |
| 5 | +import { validatePackageExtensionEntriesForInstall } from "../../plugins/package-entry-resolution.js"; |
5 | 6 | import { resolveUserPath } from "../../utils.js"; |
6 | 7 | |
7 | 8 | export type PluginPayloadSmokeFailureReason = |
@@ -101,17 +102,18 @@ export async function runPluginPayloadSmokeCheck(params: {
|
101 | 102 | |
102 | 103 | const extensionResolution = resolvePackageExtensionEntries(manifest); |
103 | 104 | if (extensionResolution.status === "ok") { |
104 | | -for (const extensionRel of extensionResolution.entries) { |
105 | | -const extensionPath = path.join(installPath, extensionRel); |
106 | | -const extensionStat = await safeStat(extensionPath); |
107 | | -if (!extensionStat?.isFile()) { |
108 | | -failures.push({ |
109 | | - pluginId, |
110 | | - installPath, |
111 | | -reason: "missing-extension-entry", |
112 | | -detail: `Plugin extension entry "${extensionRel}" not found at ${extensionPath}`, |
113 | | -}); |
114 | | -} |
| 105 | +const extensionValidation = await validatePackageExtensionEntriesForInstall({ |
| 106 | +packageDir: installPath, |
| 107 | +extensions: extensionResolution.entries, |
| 108 | + manifest, |
| 109 | +}); |
| 110 | +if (!extensionValidation.ok) { |
| 111 | +failures.push({ |
| 112 | + pluginId, |
| 113 | + installPath, |
| 114 | +reason: "missing-extension-entry", |
| 115 | +detail: `Plugin extension entry validation failed: ${extensionValidation.error}`, |
| 116 | +}); |
115 | 117 | } |
116 | 118 | } |
117 | 119 | |
|