Tools for discovering, installing, and managing Gatsby plugins in projects, including documentation access and plugin listing functionality.
Main interface for plugin-related operations and information.
/**
* Plugin management commands
* @param cmd - Plugin command (docs, ls)
* @param plugins - Plugin names (optional, for future expansion)
*/
gatsby plugin <cmd> [plugins...]
type PluginCommand = "docs" | "ls";Usage Examples:
# Show plugin documentation links
gatsby plugin docs
# List installed plugins
gatsby plugin lsAccess comprehensive documentation and resources for Gatsby plugin development and usage.
/**
* Display plugin documentation links and resources
* Provides links to plugin development guides and community resources
*/
gatsby plugin docsDocumentation Categories:
Using Plugins:
Creating Plugins:
Community:
List all plugins currently installed and configured in the Gatsby project.
/**
* List installed Gatsby plugins
* Parses gatsby-config.js to show configured plugins
*/
gatsby plugin lsUsage Examples:
# List all installed plugins
gatsby plugin lsSample Output:
Following plugins are installed:
- gatsby-plugin-react-helmet
- gatsby-plugin-image
- gatsby-plugin-sharp
- gatsby-transformer-sharp
- gatsby-source-filesystem
- gatsby-plugin-manifest
- gatsby-plugin-offlinePlugin Information Displayed:
Advanced programmatic plugin installation functionality for automated workflows.
/**
* Programmatic plugin installation
* Used internally by Gatsby CLI for automated plugin management
*/
function addPlugins(
plugins: Array<string>,
pluginOptions: Record<string, Record<string, unknown>>,
directory: string,
packages: Array<string>
): Promise<void>;
/**
* Normalize plugin names to standard Gatsby plugin format
* @param plugin - Plugin name to normalize
* @returns Normalized plugin name with gatsby- prefix
*/
function normalizePluginName(plugin: string): string;Plugin Name Normalization:
// Input -> Output examples
"react-helmet" -> "gatsby-plugin-react-helmet"
"source-filesystem" -> "gatsby-source-filesystem"
"transformer-sharp" -> "gatsby-transformer-sharp"
"plugin-image" -> "gatsby-plugin-image"
"gatsby-plugin-sharp" -> "gatsby-plugin-sharp" // Already normalizedInstallation Process:
Tools for managing plugin configuration in gatsby-config.js.
/**
* Plugin configuration structure
* Represents how plugins are configured in gatsby-config.js
*/
interface PluginConfig {
resolve: string; // Plugin name
options?: Record<string, unknown>; // Plugin options
__key?: string; // Unique key for duplicate plugins
}
/**
* Gatsby configuration with plugins
*/
interface GatsbyConfig {
plugins: Array<string | PluginConfig>; // Plugin list
// ... other config options
}Configuration Examples:
// gatsby-config.js
module.exports = {
plugins: [
// Simple plugin (string format)
"gatsby-plugin-react-helmet",
// Plugin with options (object format)
{
resolve: "gatsby-source-filesystem",
options: {
name: "pages",
path: "./src/pages/",
},
},
// Duplicate plugin with key
{
resolve: "gatsby-source-filesystem",
options: {
name: "images",
path: "./src/images/",
},
__key: "images",
},
],
};Utilities and tools for plugin development and testing.
/**
* Plugin validation and development utilities
* Internal functions used by the plugin management system
*/
interface PluginValidation {
validatePluginName(name: string): boolean;
validatePluginConfig(config: PluginConfig): boolean;
checkPluginCompatibility(name: string, version: string): boolean;
}Plugin Development Workflow:
gatsby developgatsby plugin lsUnderstanding different types of Gatsby plugins and their purposes.
Source Plugins:
gatsby-source-contentful, gatsby-source-wordpressTransformer Plugins:
gatsby-transformer-remark, gatsby-transformer-sharpFunctional Plugins:
gatsby-plugin-react-helmet, gatsby-plugin-manifestStyling Plugins:
gatsby-plugin-styled-components, gatsby-plugin-sassSEO and Performance Plugins:
gatsby-plugin-sitemap, gatsby-plugin-offlineCommon plugin issues and resolution strategies.
Configuration Errors:
# Check plugin configuration
gatsby plugin ls
# Validate gatsby-config.js syntax
node -e "console.log(JSON.stringify(require('./gatsby-config.js'), null, 2))"Plugin Conflicts:
Resolution Steps:
gatsby cleanPlugin management includes comprehensive error handling:
Configuration Parsing Errors:
Installation Errors:
Runtime Errors:
Error Resolution: