fix(installer): pass version and repoUrl to manifest for custom plugins
installFromResolution was passing empty strings for version and repoUrl, which the manifest stores as null. Now threads the repo URL from ui.js through resolvePlugin into each ResolvedModule, and passes the plugin version and URL to the manifest correctly.
This commit is contained in:
parent
489067fdda
commit
ffe84a9f17
|
|
@ -188,15 +188,17 @@ class CustomModuleManager {
|
|||
* Results are cached in _resolutionCache keyed by module code.
|
||||
* @param {string} repoPath - Absolute path to the cloned repository
|
||||
* @param {Object} plugin - Raw plugin object from marketplace.json
|
||||
* @param {string} [repoUrl] - Original GitHub URL for manifest tracking
|
||||
* @returns {Promise<Array<Object>>} Array of ResolvedModule objects
|
||||
*/
|
||||
async resolvePlugin(repoPath, plugin) {
|
||||
async resolvePlugin(repoPath, plugin, repoUrl) {
|
||||
const { PluginResolver } = require('./plugin-resolver');
|
||||
const resolver = new PluginResolver();
|
||||
const resolved = await resolver.resolve(repoPath, plugin);
|
||||
|
||||
// Cache each resolved module by its code for lookup during install
|
||||
// Stamp repo URL onto each resolved module for manifest tracking
|
||||
for (const mod of resolved) {
|
||||
if (repoUrl) mod.repoUrl = repoUrl;
|
||||
CustomModuleManager._resolutionCache.set(mod.code, mod);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,10 +336,10 @@ class OfficialModules {
|
|||
const manifestObj = new Manifest();
|
||||
|
||||
await manifestObj.addModule(bmadDir, resolved.code, {
|
||||
version: resolved.version || '',
|
||||
source: `custom:${resolved.pluginName}`,
|
||||
npmPackage: '',
|
||||
repoUrl: '',
|
||||
version: resolved.version || null,
|
||||
source: 'custom',
|
||||
npmPackage: null,
|
||||
repoUrl: resolved.repoUrl || null,
|
||||
});
|
||||
|
||||
return { success: true, module: resolved.code, path: targetPath, versionInfo: { version: resolved.version || '' } };
|
||||
|
|
|
|||
|
|
@ -881,7 +881,7 @@ class UI {
|
|||
const allResolved = [];
|
||||
for (const plugin of plugins) {
|
||||
try {
|
||||
const resolved = await customMgr.resolvePlugin(repoPath, plugin.rawPlugin);
|
||||
const resolved = await customMgr.resolvePlugin(repoPath, plugin.rawPlugin, url.trim());
|
||||
if (resolved.length > 0) {
|
||||
allResolved.push(...resolved);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue