Deprecated Storybook addon that throws migration errors directing users to the new package structure in Storybook 9.0
86
Create a configuration utility that generates Storybook configuration files with external references to remote Storybook instances.
Your task is to create a Node.js utility that:
The utility should output a configuration object that can be used in a .storybook/main.js or .storybook/main.ts file.
The utility should accept an array of reference configurations:
[
{
title: "Design System",
url: "https://design-system.example.com"
},
{
title: "Marketing Components",
url: "https://marketing.example.com/storybook"
}
]The utility should generate a configuration object with a refs property containing the external references, where each reference is keyed by a unique identifier derived from the title.
Given a single remote reference with title "Design System" and URL "https://design-system.example.com", the utility generates a configuration object with refs containing one reference with a valid key @test
Given two remote references, the utility generates a configuration object with refs containing both references, each with unique keys derived from their titles @test
Given a remote reference with an expanded configuration including a version property, the utility preserves the version in the generated refs configuration @test
@generates
/**
* Generates a unique key for a reference based on its title
* @param {string} title - The display title of the reference
* @returns {string} A kebab-case key suitable for use in refs
*/
function generateReferenceKey(title) {
// IMPLEMENTATION HERE
}
/**
* Creates a refs configuration object from an array of references
* @param {Array} references - Array of reference objects with title and url
* @returns {Object} Refs configuration object keyed by reference identifiers
*/
function createRefsConfig(references) {
// IMPLEMENTATION HERE
}
/**
* Generates a complete Storybook main configuration with external references
* @param {Array} references - Array of reference objects to include
* @returns {Object} Complete Storybook configuration object with refs
*/
function generateStorybookConfig(references) {
// IMPLEMENTATION HERE
}
module.exports = {
generateReferenceKey,
createRefsConfig,
generateStorybookConfig
};Provides configuration structure and external reference capabilities for linking to remote Storybook instances.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-storybook--addon-backgroundsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10