Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the IPluginInfo to contain also the description #41

Open
karlitos opened this issue Nov 2, 2020 · 1 comment
Open

Enhance the IPluginInfo to contain also the description #41

karlitos opened this issue Nov 2, 2020 · 1 comment

Comments

@karlitos
Copy link

karlitos commented Nov 2, 2020

I would really appreciate, if the IPluginInfo could also include the the descritpion of the installed package. My application make a a very good use of live-plugin-manager in a way which offers users the possibility to install additional packages from NPM or local filesystem. The installable packages are shown in a list showing their name and the description.

Having the IPluginInfos location property I can parse the package.json, but this is basically the same thing live-plugin-manager is doing when creating the IPluginInfo.

So far I investigated the code a little bit an it seems, that only a small addition would be necessary to the createPluginInfo method in the PluginManager.ts file

private async createPluginInfo(name: string): Promise<IPluginInfo> {
		const location = this.getPluginLocation(name);
		const packageJson = await this.readPackageJsonFromPath(location);

		const mainFile = path.normalize(path.join(location, packageJson.main || DefaultMainFile));

		return {
			name: packageJson.name,
			description: packageJson.description,
			version: packageJson.version,
			location,
			mainFile,
			dependencies: packageJson.dependencies || {}
		};
	}
@davideicardi
Copy link
Owner

I confirm that it should be easy. If you are able to create a PR I will be happy to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants