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

fix: plugins list json #94

Merged
merged 5 commits into from
Jan 29, 2025
Merged

fix: plugins list json #94

merged 5 commits into from
Jan 29, 2025

Conversation

sakshiarora386
Copy link
Contributor

@sakshiarora386 sakshiarora386 commented Dec 12, 2024

"npm search @godspeedsystems/plugins --json" is not giving accurate results,
So parsed a json (containing available plugins) to all three functions to add, remove, update godspeed plugins.

const availablePlugins = JSON.parse(pluginsData);

// Map to the format expected by the UI
const pluginNames = availablePlugins.map((plugin: { value: any; name: any; description: any }) => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add types for value, name, description

Description: plugin.description,
}));

console.log("Available plugins:", pluginNames);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove log

Description: plugin.description,
})
);

const commonPlugins = pluginNames.filter(
(plugin: { value: string | number }) => pluginsList[plugin.value]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need the number type, in value?

const availablePlugins = JSON.parse(pluginsData);

// Map to the format expected by the UI
const pluginNames = availablePlugins.map((plugin: { value: any; name: any; description: any }) => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code is repeated. Please see line #227
Merge the code if necessary.

const availablePlugins = JSON.parse(pluginsData);

// Map to the format expected by the UI
const pluginNames = availablePlugins.map((plugin: { value: any; name: any; description: any }) => ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same code repeated. Please check once

@sakshiarora386 sakshiarora386 merged commit 4387939 into main Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants