{"version":"1.0","type":"rich","title":"Transform import statement","description":"This example shows a code-modification workflow that rewrites JavaScript import statements by mapping component names to their file paths. It uses jscodeshift to parse source files into abstract syntax trees, filter import declarations from `components` or `component-library`, and replace them with direct path imports. The process generates path mappings from export declarations in index files, combines them into a single JSON dictionary, and then applies the transformation via the `transform-import.js` script, which leverages `jscodeshift`’s `ImportDeclaration` finder and `replaceWith` API. The run.sh script orchestrates the entire pipeline using npm scripts and Node.js file operations.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-8a8772f779ed9c7b8d54b758f18041c5?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}