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 Storybook in app gen for Volto 18 #5911

Merged
merged 2 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ module.exports = {
'@storybook/addon-essentials',
// '@storybook/preset-scss',
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript-plugin',
reactDocgenTypescriptOptions: {
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
propFilter: () => true,
},
},
webpackFinal: async (config, { configType }) => {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
Expand All @@ -91,7 +103,7 @@ module.exports = {
[],
defaultRazzleOptions,
);
const AddonConfigurationRegistry = require('@plone/volto/addon-registry');
const AddonConfigurationRegistry = require('@plone/registry/src/addon-registry');

const registry = new AddonConfigurationRegistry(projectRootPath);

Expand Down Expand Up @@ -135,9 +147,10 @@ module.exports = {
};

// Addons have to be loaded with babel
const addonPaths = registry.addonNames.map((addon) =>
fs.realpathSync(registry.packages[addon].modulePath),
);
const addonPaths = registry
.getAddons()
.map((addon) => fs.realpathSync(addon.modulePath));

resultConfig.module.rules[1].exclude = (input) =>
// exclude every input from node_modules except from @plone/volto
/node_modules\/(?!(@plone\/volto)\/)/.test(input) &&
Expand Down
1 change: 1 addition & 0 deletions packages/generator-volto/news/5911.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix StoryBook for project generator in Volto 18 @sneridagh
5 changes: 3 additions & 2 deletions packages/volto/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const webpack = require('webpack');
const fs = require('fs');
const path = require('path');
const makeLoaderFinder = require('razzle-dev-utils/makeLoaderFinder');
const fileLoaderFinder = makeLoaderFinder('file-loader');

const projectRootPath = path.resolve('.');
const lessPlugin = require('../webpack-plugins/webpack-less-plugin');

const createConfig = require('../node_modules/razzle/config/createConfigAsync.js');
const razzleConfig = require(path.join(projectRootPath, 'razzle.config.js'));

const SVGLOADER = {
test: /icons\/.*\.svg$/,
use: [
Expand Down
1 change: 1 addition & 0 deletions packages/volto/news/5911.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove dangling unused lines in StoryBook config @sneridagh
Loading