Replies: 2 comments 2 replies
-
Hey @mjarosch ! We've added a "filter" feature to our backlog so that files can be configured to be ignored by component factory / component builder. |
Beta Was this translation helpful? Give feedback.
-
Hey @art-alexeyenko - is there currently any approach we can take with the latest JSS version (21.6.0) to filter out stories files that live under src/components? (e.g., /src/components/Footer/Footer.stories.tsx) I tried updating the /**
* Generates the component builder file.
*/
class ComponentBuilderPlugin implements ComponentBuilderPluginType {
order = 9999;
exec(config: ComponentBuilderPluginConfig) {
generateComponentBuilder(config);
console.log('AFTER generateComponentBuilder:');
console.log(JSON.stringify(config.components));
config.components = config.components.filter((c) => {
console.log(`module name: ${c.moduleName}`);
console.log(`component name: ${c.componentName}`);
console.log(`component path: ${c.path}`);
return !c.componentName.includes('.stories') && !c.componentName.includes('.spec') && c.componentName !== 'index';
});
return config;
}
} Update: I can see that writeComponentBuilder within the next-js package ultimately controls the output of the component-builder file, so anything that comes after that call to |
Beta Was this translation helpful? Give feedback.
-
Is your suggestion related to a problem? Please describe.
If a large component is spread across multiple .tsx files, each .tsx file is picked up by the bootstrapping code.
Describe the solution you'd like
While it is simple to come up with a naming scheme for these helper files and add it as an exclusion for the bootstrap code. It would be nice to either have a naming convention for the main component, so that additional exclusions do not need to be added. Or, have a configuration file for the exclusions, so that we don't have to modify the bootstrap code directly, making future upgrades easier.
Is there a way to achieve this functionality with exisiting tools?
No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions