forked from civictheme/monorepo-drupal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
773ee6c
commit 51d56ba
Showing
277 changed files
with
18,869 additions
and
50,676 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
web/themes/contrib/civictheme_base/.storybook/addon-config.js
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
web/themes/contrib/civictheme_base/.storybook/components_css.stories.js
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
web/themes/contrib/civictheme_base/.storybook/drupal_behaviors.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,17 @@ | ||
// phpcs:ignoreFile | ||
/** | ||
* Custom configuration for Storybook. | ||
*/ | ||
|
||
// Using Production version of the asset building Webpack configuration to | ||
// unify the building pipeline. | ||
const path = require('path'); | ||
const { merge } = require('webpack-merge'); | ||
const webpack = require('webpack'); | ||
const custom = require('../webpack/webpack.prod'); | ||
const scssVariables = require('./importer.scss_variables'); | ||
const iconUtils = require('../components/00-base/icon/icon.utils'); | ||
const backgroundUtils = require('../components/00-base/background/background.utils'); | ||
const logoUtils = require('../components/02-molecules/logo/logo.utils'); | ||
const addonConfig = require('./addon-config').default(); | ||
|
||
const customPlugin = new webpack.DefinePlugin({ | ||
BACKGROUNDS: JSON.stringify(backgroundUtils.getBackgrounds()), | ||
ICONS: JSON.stringify(iconUtils.getIcons()), | ||
LOGOS: JSON.stringify(logoUtils.getLogos()), | ||
SCSS_VARIABLES: JSON.stringify(scssVariables.getVariables()), | ||
}); | ||
|
||
module.exports = { | ||
const config = { | ||
stories: [ | ||
'../components/**/*.stories.js', | ||
], | ||
addons: addonConfig, | ||
webpackFinal: async (config) => { | ||
// Replace normal CSS import with stories CSS import, which already includes | ||
// normal CSS import. This is to allow to resolve variables and mixins in | ||
// stories CSS. | ||
custom.entry = custom.entry.main.map((value) => (value.indexOf('components_css.js') > -1 ? path.resolve(__dirname, 'components_css.stories.js') : value)); | ||
|
||
// Remove theme-related entries as components should not have them. | ||
custom.entry = custom.entry.filter((p) => !/\/theme_/g.test(p)); | ||
|
||
// Modify common configs to let Storybook take over. | ||
delete custom.output; | ||
delete custom.plugins; | ||
custom.plugins = [ | ||
customPlugin, | ||
]; | ||
// Special case: override whatever loader is used to load styles with a | ||
// style-loader in order to have styles injected during the runtime. | ||
custom.module.rules[1].use[0] = 'style-loader'; | ||
|
||
// Override assets location for Storybook. | ||
custom.module.rules[1].use[2].options.additionalData = custom.module.rules[1].use[2].options.additionalData.replace(/\$ct-assets-directory:\s*[^;]+;/, "$ct-assets-directory: './assets/';"); | ||
|
||
return merge(config, custom); | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@whitespace/storybook-addon-html', | ||
], | ||
framework: { | ||
name: '@storybook/html-vite', | ||
options: {}, | ||
}, | ||
staticDirs: [{ from: '../assets', to: '/assets' }, './static'], | ||
}; | ||
|
||
export default config; |
7 changes: 0 additions & 7 deletions
7
web/themes/contrib/civictheme_base/.storybook/manager-head.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
// phpcs:ignoreFile | ||
import { addons } from '@storybook/addons'; | ||
import { addons } from '@storybook/manager-api'; | ||
import theme from './theme'; | ||
|
||
addons.setConfig({ | ||
theme, | ||
toolbar: { | ||
zoom: { | ||
hidden: true, | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.