@emulsify/core 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/addtoprojects.yml +1 -1
- package/.storybook/main.js +6 -1
- package/.storybook/manager.js +1 -2
- package/.storybook/preview.js +2 -5
- package/.storybook/webpack.config.js +64 -12
- package/config/eslintrc.config.json +0 -1
- package/config/webpack/loaders.js +11 -3
- package/config/webpack/optimizers.js +18 -0
- package/config/webpack/plugins.js +52 -12
- package/config/webpack/resolves.js +79 -0
- package/config/webpack/sdc-loader.js +8 -0
- package/config/webpack/webpack.common.js +119 -23
- package/package.json +34 -28
- package/.history/.storybook/main_20240722090919.js +0 -153
- package/.history/.storybook/main_20240809140306.js +0 -153
- package/.history/package_20240806084328.json +0 -135
- package/.history/package_20240809140648.json +0 -135
- package/config/webpack/css/style.js +0 -1
- package/config/webpack/css.js +0 -1
package/.storybook/main.js
CHANGED
|
@@ -4,7 +4,12 @@ const safeConfigOverrides = configOverrides || {};
|
|
|
4
4
|
|
|
5
5
|
const config = {
|
|
6
6
|
stories: [
|
|
7
|
-
'../../../../components/**/*.stories.@(js|jsx|ts|tsx)',
|
|
7
|
+
'../../../../(src|components)/**/*.stories.@(js|jsx|ts|tsx)',
|
|
8
|
+
],
|
|
9
|
+
staticDirs: [
|
|
10
|
+
'../../../../assets/images',
|
|
11
|
+
'../../../../assets/icons',
|
|
12
|
+
'../../../../dist',
|
|
8
13
|
],
|
|
9
14
|
addons: [
|
|
10
15
|
'../../../@storybook/addon-a11y',
|
package/.storybook/manager.js
CHANGED
package/.storybook/preview.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { useEffect } from '@storybook/
|
|
1
|
+
import { useEffect } from '@storybook/preview-api';
|
|
2
2
|
import Twig from 'twig';
|
|
3
3
|
import { setupTwig } from './setupTwig';
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
import('../../../../dist/css/style.css');
|
|
7
|
-
|
|
8
|
-
// Custom theme preview config if it exists.
|
|
5
|
+
// Project config to import stylesheets.
|
|
9
6
|
import('../../../../config/emulsify-core/storybook/preview');
|
|
10
7
|
|
|
11
8
|
// If in a Drupal project, it's recommended to import a symlinked version of drupal.js.
|
|
@@ -1,22 +1,66 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const globImporter = require('node-sass-glob-importer');
|
|
3
|
+
|
|
3
4
|
const _StyleLintPlugin = require('stylelint-webpack-plugin');
|
|
4
|
-
const { namespaces } = require('./setupTwig');
|
|
5
5
|
const ESLintPlugin = require('eslint-webpack-plugin');
|
|
6
|
+
const resolves = require('../config/webpack/resolves');
|
|
7
|
+
|
|
8
|
+
// Emulsify project configuration.
|
|
9
|
+
const emulsifyConfig = require('../../../../project.emulsify.json');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Transforms namespace:component to @namespace/template/path
|
|
13
|
+
*/
|
|
14
|
+
class ProjectNameResolverPlugin {
|
|
15
|
+
constructor(options = {}) {
|
|
16
|
+
this.prefix = options.projectName;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
apply(resolver) {
|
|
20
|
+
const target = resolver.ensureHook('resolve');
|
|
21
|
+
resolver
|
|
22
|
+
.getHook('before-resolve')
|
|
23
|
+
.tapAsync('ProjectNameResolverPlugin', (request, resolveContext, callback) => {
|
|
24
|
+
const requestPath = request.request;
|
|
25
|
+
|
|
26
|
+
if (requestPath && requestPath.startsWith(`${this.prefix}:`)) {
|
|
27
|
+
const newRequestPath = requestPath.replace(`${this.prefix}:`, `${this.prefix}/`);
|
|
28
|
+
const newRequest = {
|
|
29
|
+
...request,
|
|
30
|
+
request: newRequestPath,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
resolver.doResolve(
|
|
34
|
+
target,
|
|
35
|
+
newRequest,
|
|
36
|
+
`Resolved ${this.prefix} URI: ${resolves.TwigResolve.alias[requestPath]}`,
|
|
37
|
+
resolveContext,
|
|
38
|
+
callback
|
|
39
|
+
);
|
|
40
|
+
} else {
|
|
41
|
+
callback();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
6
46
|
|
|
7
47
|
module.exports = async ({ config }) => {
|
|
48
|
+
// Alias
|
|
49
|
+
Object.assign(config.resolve.alias, resolves.TwigResolve.alias);
|
|
50
|
+
|
|
8
51
|
// Twig
|
|
9
52
|
config.module.rules.push({
|
|
10
53
|
test: /\.twig$/,
|
|
11
54
|
use: [
|
|
12
55
|
{
|
|
13
|
-
loader: '
|
|
56
|
+
loader: path.resolve(__dirname, '../config/webpack/sdc-loader.js'),
|
|
14
57
|
options: {
|
|
15
|
-
|
|
16
|
-
namespaces,
|
|
17
|
-
},
|
|
58
|
+
projectName: emulsifyConfig.project.name,
|
|
18
59
|
},
|
|
19
60
|
},
|
|
61
|
+
{
|
|
62
|
+
loader: 'twigjs-loader',
|
|
63
|
+
},
|
|
20
64
|
],
|
|
21
65
|
});
|
|
22
66
|
|
|
@@ -43,25 +87,33 @@ module.exports = async ({ config }) => {
|
|
|
43
87
|
],
|
|
44
88
|
});
|
|
45
89
|
|
|
90
|
+
// YAML
|
|
91
|
+
config.module.rules.push({
|
|
92
|
+
test: /\.ya?ml$/,
|
|
93
|
+
loader: 'js-yaml-loader',
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Plugins
|
|
46
97
|
config.plugins.push(
|
|
47
98
|
new _StyleLintPlugin({
|
|
48
99
|
configFile: path.resolve(__dirname, '../', '.stylelintrc.json'),
|
|
49
|
-
context: path.resolve(__dirname, '../', '
|
|
100
|
+
context: path.resolve(__dirname, '../', 'src'),
|
|
50
101
|
files: '**/*.scss',
|
|
51
102
|
failOnError: false,
|
|
52
103
|
quiet: false,
|
|
53
104
|
}),
|
|
54
105
|
new ESLintPlugin({
|
|
55
|
-
context: path.resolve(__dirname, '../', '
|
|
106
|
+
context: path.resolve(__dirname, '../', 'src'),
|
|
56
107
|
extensions: ['js'],
|
|
57
108
|
}),
|
|
58
109
|
);
|
|
59
110
|
|
|
60
|
-
//
|
|
61
|
-
config.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
111
|
+
// Resolver Plugins
|
|
112
|
+
config.resolve.plugins = [
|
|
113
|
+
new ProjectNameResolverPlugin({
|
|
114
|
+
projectName: emulsifyConfig.project.name,
|
|
115
|
+
}),
|
|
116
|
+
];
|
|
65
117
|
|
|
66
118
|
return config;
|
|
67
119
|
};
|
|
@@ -29,9 +29,8 @@ const JSLoader = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const ImageLoader = {
|
|
32
|
-
test: /\.(png|
|
|
33
|
-
|
|
34
|
-
loader: 'file-loader',
|
|
32
|
+
test: /\.(png|jpe?g|gif)$/i,
|
|
33
|
+
type: 'asset',
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
const CSSLoader = {
|
|
@@ -76,13 +75,22 @@ const SVGSpriteLoader = {
|
|
|
76
75
|
options: {
|
|
77
76
|
extract: true,
|
|
78
77
|
runtimeCompat: true,
|
|
78
|
+
outputPath: 'dist/',
|
|
79
79
|
spriteFilename: './icons.svg',
|
|
80
80
|
},
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
const TwigLoader = {
|
|
84
|
+
test: /\.twig$/,
|
|
85
|
+
use: {
|
|
86
|
+
loader: 'twigjs-loader',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
83
90
|
module.exports = {
|
|
84
91
|
JSLoader,
|
|
85
92
|
CSSLoader,
|
|
86
93
|
SVGSpriteLoader,
|
|
87
94
|
ImageLoader,
|
|
95
|
+
TwigLoader,
|
|
88
96
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');
|
|
2
|
+
|
|
3
|
+
const ImageMinimizer = new ImageMinimizerPlugin({
|
|
4
|
+
minimizer: {
|
|
5
|
+
implementation: ImageMinimizerPlugin.imageminMinify,
|
|
6
|
+
options: {
|
|
7
|
+
plugins: [
|
|
8
|
+
['gifsicle', { interlaced: true }],
|
|
9
|
+
['jpegtran', { progressive: true }],
|
|
10
|
+
['optipng', { optimizationLevel: 5 }],
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
minimizer: [ImageMinimizer],
|
|
18
|
+
};
|
|
@@ -3,37 +3,77 @@ const path = require('path');
|
|
|
3
3
|
const webpack = require('webpack');
|
|
4
4
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
5
5
|
const _MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
6
|
-
const _ImageminPlugin = require('imagemin-webpack-plugin').default;
|
|
7
6
|
const _SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
|
|
7
|
+
const CopyPlugin = require('copy-webpack-plugin');
|
|
8
8
|
const glob = require('glob');
|
|
9
|
+
const fs = require('fs-extra');
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
// Get directories for file contexts.
|
|
12
|
+
const projectDir = path.resolve(__dirname, '../../../../..');
|
|
13
|
+
const srcDir = path.resolve(projectDir, 'src');
|
|
11
14
|
|
|
15
|
+
// Emulsify project configuration.
|
|
16
|
+
const emulsifyConfig = require('../../../../../project.emulsify.json');
|
|
17
|
+
|
|
18
|
+
// Compress images plugin.
|
|
12
19
|
const MiniCssExtractPlugin = new _MiniCssExtractPlugin({
|
|
13
20
|
filename: '[name].css',
|
|
14
21
|
chunkFilename: '[id].css',
|
|
15
22
|
});
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
disable: process.env.NODE_ENV !== 'production',
|
|
19
|
-
externalImages: {
|
|
20
|
-
context: imagePath,
|
|
21
|
-
sources: glob.sync(path.resolve(imagePath, '**/*.{png,jpg,gif,svg}')),
|
|
22
|
-
destination: imagePath,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
|
|
24
|
+
// Create SVG sprite.
|
|
26
25
|
const SpriteLoaderPlugin = new _SpriteLoaderPlugin({
|
|
27
26
|
plainSprite: true,
|
|
28
27
|
});
|
|
29
28
|
|
|
29
|
+
// Enable Webpack progress plugin.
|
|
30
30
|
const ProgressPlugin = new webpack.ProgressPlugin();
|
|
31
31
|
|
|
32
|
+
// Glob pattern for markup files.
|
|
33
|
+
const componentFilesPattern = path.resolve(srcDir, '**/*.{twig,yml}');
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Prepare list of twig files to copy to "compiled" directories.
|
|
37
|
+
* @constructor
|
|
38
|
+
* @param {string} filesMatcher - Glob pattern.
|
|
39
|
+
*/
|
|
40
|
+
function getPatterns(filesMatcher) {
|
|
41
|
+
const patterns = [];
|
|
42
|
+
glob.sync(filesMatcher).forEach((file) => {
|
|
43
|
+
const projectPath = file.split('/src/')[0];
|
|
44
|
+
const srcStructure = file.split(`${srcDir}/`)[1];
|
|
45
|
+
const parentDir = srcStructure.split('/')[0];
|
|
46
|
+
const filePath = file.split(/(foundation\/|components\/|layout\/)/)[2];
|
|
47
|
+
const consolidateDirs =
|
|
48
|
+
parentDir === 'layout' || parentDir === 'foundation'
|
|
49
|
+
? '/components/'
|
|
50
|
+
: '/';
|
|
51
|
+
const newfilePath =
|
|
52
|
+
emulsifyConfig.project.platform === 'drupal'
|
|
53
|
+
? `${projectPath}${consolidateDirs}${parentDir}/${filePath}`
|
|
54
|
+
: `${projectPath}/dist/${parentDir}/${filePath}`;
|
|
55
|
+
patterns.push({
|
|
56
|
+
from: file,
|
|
57
|
+
to: newfilePath,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return patterns;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Copy twig files from src directory.
|
|
65
|
+
const CopyTwigPlugin = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
66
|
+
? new CopyPlugin({
|
|
67
|
+
patterns: getPatterns(componentFilesPattern),
|
|
68
|
+
})
|
|
69
|
+
: '';
|
|
70
|
+
|
|
71
|
+
// Export plugin configuration.
|
|
32
72
|
module.exports = {
|
|
33
73
|
ProgressPlugin,
|
|
34
74
|
MiniCssExtractPlugin,
|
|
35
|
-
ImageminPlugin,
|
|
36
75
|
SpriteLoaderPlugin,
|
|
76
|
+
CopyTwigPlugin,
|
|
37
77
|
CleanWebpackPlugin: new CleanWebpackPlugin({
|
|
38
78
|
protectWebpackAssets: false, // Required for removal of extra, unwanted dist/css/*.js files.
|
|
39
79
|
cleanOnceBeforeBuildPatterns: ['!*.{png,jpg,gif,svg}'],
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const glob = require('glob');
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
|
|
5
|
+
// Emulsify project configuration.
|
|
6
|
+
const emulsifyConfig = require('../../../../../project.emulsify.json');
|
|
7
|
+
|
|
8
|
+
// Get directories for file contexts.
|
|
9
|
+
const projectDir = path.resolve(__dirname, '../../../../..');
|
|
10
|
+
const projectName = emulsifyConfig.project.name;
|
|
11
|
+
const srcDir = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
12
|
+
? path.resolve(projectDir, 'src')
|
|
13
|
+
: path.resolve(projectDir, 'components');
|
|
14
|
+
|
|
15
|
+
// Glob pattern for twig aliases.
|
|
16
|
+
const aliasPattern = path.resolve(srcDir, '**/!(_*).twig');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Return all top-level directories from the projects source directory.
|
|
20
|
+
* @constructor
|
|
21
|
+
* @param {string} source - Path to source directory.
|
|
22
|
+
*/
|
|
23
|
+
function getDirectories(source) {
|
|
24
|
+
const dirs = fs
|
|
25
|
+
.readdirSync(source, { withFileTypes: true }) // Read contents of the directory
|
|
26
|
+
.filter((dirent) => dirent.isDirectory()) // Filter only directories
|
|
27
|
+
.map((dirent) => dirent.name);
|
|
28
|
+
return dirs;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Return clean directory names if numbering is used for sorting.
|
|
33
|
+
* @constructor
|
|
34
|
+
* @param {string} dir - Given directory name.
|
|
35
|
+
*/
|
|
36
|
+
function cleanDirectoryName(dir) {
|
|
37
|
+
if (/^\d{2}/.test(dir)) {
|
|
38
|
+
return dir.slice(3);
|
|
39
|
+
}
|
|
40
|
+
return dir;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Return a list of twig file file paths from the project source directory.
|
|
45
|
+
* @constructor
|
|
46
|
+
* @param {string} aliasMatcher - Glob pattern.
|
|
47
|
+
*/
|
|
48
|
+
function getAliases(aliasMatcher) {
|
|
49
|
+
// Create default aliases
|
|
50
|
+
let aliases = {};
|
|
51
|
+
// Add SDC compatible aliases.
|
|
52
|
+
glob.sync(aliasMatcher).forEach((file) => {
|
|
53
|
+
const filePath = file.split(`${srcDir}/`)[1];
|
|
54
|
+
const fileName = path.basename(filePath);
|
|
55
|
+
|
|
56
|
+
if (emulsifyConfig.project.platform === 'drupal') {
|
|
57
|
+
aliases[`${projectName}/${fileName.replace('.twig', '')}`] = file;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
// Add typical @namespace (path to directory) aliases for twig partials.
|
|
61
|
+
const dirs = getDirectories(srcDir);
|
|
62
|
+
dirs.forEach((dir) => {
|
|
63
|
+
const name = cleanDirectoryName(dir);
|
|
64
|
+
Object.assign(aliases, {
|
|
65
|
+
[`@${name}`]: `${projectDir}/${path.basename(srcDir)}/${dir}`,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
return aliases;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Alias twig namespaces.
|
|
72
|
+
const TwigResolve = {
|
|
73
|
+
extensions: ['.twig'],
|
|
74
|
+
alias: getAliases(aliasPattern),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
module.exports = {
|
|
78
|
+
TwigResolve,
|
|
79
|
+
};
|
|
@@ -2,43 +2,129 @@ const path = require('path');
|
|
|
2
2
|
const glob = require('glob');
|
|
3
3
|
const loaders = require('./loaders');
|
|
4
4
|
const plugins = require('./plugins');
|
|
5
|
+
const resolves = require('./resolves');
|
|
6
|
+
const optimizers = require('./optimizers');
|
|
7
|
+
const emulsifyConfig = require('../../../../../project.emulsify.json');
|
|
8
|
+
const fs = require('fs-extra');
|
|
5
9
|
|
|
10
|
+
// Get directories for file contexts.
|
|
6
11
|
const webpackDir = path.resolve(__dirname);
|
|
7
|
-
const
|
|
8
|
-
const
|
|
12
|
+
const projectDir = path.resolve(__dirname, '../../../../..');
|
|
13
|
+
const srcDir = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
14
|
+
? path.resolve(projectDir, 'src')
|
|
15
|
+
: path.resolve(projectDir, 'components');
|
|
9
16
|
|
|
10
17
|
// Glob pattern for scss files that ignore file names prefixed with underscore.
|
|
11
|
-
const
|
|
18
|
+
const BaseScssPattern = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
19
|
+
? path.resolve(srcDir, '!(components|util)/**/!(_*|cl-*|sb-*).scss')
|
|
20
|
+
: '';
|
|
21
|
+
const ComponentScssPattern = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
22
|
+
? path.resolve(srcDir, 'components/**/!(_*|cl-*|sb-*).scss')
|
|
23
|
+
: path.resolve(srcDir, '**/!(_*|cl-*|sb-*).scss');
|
|
24
|
+
const ComponentLibraryScssPattern = path.resolve(srcDir, 'util/**/!(_).scss');
|
|
25
|
+
|
|
12
26
|
// Glob pattern for JS files.
|
|
13
|
-
const jsPattern = path.resolve(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
27
|
+
const jsPattern = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
28
|
+
? path.resolve(
|
|
29
|
+
srcDir,
|
|
30
|
+
'components/**/!(*.stories|*.component|*.min|*.test).js',
|
|
31
|
+
)
|
|
32
|
+
: path.resolve(srcDir, '**/!(*.stories|*.component|*.min|*.test).js');
|
|
33
|
+
|
|
34
|
+
// Glob pattern for svgSprite config.
|
|
35
|
+
const spritePattern = path.resolve(webpackDir, 'svgSprite.js');
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Return all scss/js/svg files that Webpack needs to compile.
|
|
39
|
+
* @constructor
|
|
40
|
+
* @param {string} str - Path to file.
|
|
41
|
+
* @param {string} replacement - string to replace str.
|
|
42
|
+
*/
|
|
43
|
+
function replaceLastSlash(str, replacement) {
|
|
44
|
+
// Find the last occurrence of '/'
|
|
45
|
+
const lastSlashIndex = str.lastIndexOf('/');
|
|
46
|
+
// If there is no '/' in the string, return the original string
|
|
47
|
+
if (lastSlashIndex === -1) {
|
|
48
|
+
return str;
|
|
49
|
+
}
|
|
50
|
+
// Replace the last '/' with the specified replacement
|
|
51
|
+
return (
|
|
52
|
+
str.slice(0, lastSlashIndex) + replacement + str.slice(lastSlashIndex + 1)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
17
55
|
|
|
18
|
-
|
|
19
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Return all scss/js/svg files that Webpack needs to compile.
|
|
58
|
+
* @constructor
|
|
59
|
+
* @param {string} BaseScssMatcher - Glob pattern.
|
|
60
|
+
* @param {string} ComponentScssMatcher - Glob pattern.
|
|
61
|
+
* @param {string} ComponentLibraryScssMatcher - Glob pattern.
|
|
62
|
+
* @param {string} jsMatcher - Glob pattern.
|
|
63
|
+
* @param {string} spriteMatcher - Glob pattern.
|
|
64
|
+
*/
|
|
65
|
+
function getEntries(
|
|
66
|
+
BaseScssMatcher,
|
|
67
|
+
ComponentScssMatcher,
|
|
68
|
+
ComponentLibraryScssMatcher,
|
|
69
|
+
jsMatcher,
|
|
70
|
+
spriteMatcher,
|
|
71
|
+
) {
|
|
20
72
|
const entries = {};
|
|
21
73
|
|
|
22
|
-
// SCSS entries
|
|
23
|
-
glob.sync(
|
|
24
|
-
const filePath = file.split(
|
|
25
|
-
const
|
|
74
|
+
// Non-component or global SCSS entries.
|
|
75
|
+
glob.sync(BaseScssMatcher).forEach((file) => {
|
|
76
|
+
const filePath = file.split(`${srcDir}/`)[1];
|
|
77
|
+
const filePathDist = filePath.split('/')[1]
|
|
78
|
+
? filePath.split('/')[1]
|
|
79
|
+
: filePath.split('/')[0];
|
|
80
|
+
const newfilePath = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
81
|
+
? `dist/global/${filePathDist.replace('.scss', '')}`
|
|
82
|
+
: `dist/css/${filePathDist.replace('.scss', '')}`;
|
|
26
83
|
entries[newfilePath] = file;
|
|
27
84
|
});
|
|
28
85
|
|
|
29
|
-
//
|
|
30
|
-
glob.sync(
|
|
86
|
+
// Component SCSS entries.
|
|
87
|
+
glob.sync(ComponentScssMatcher).forEach((file) => {
|
|
31
88
|
const filePath = file.split('components/')[1];
|
|
32
|
-
const
|
|
89
|
+
const filePathDist = replaceLastSlash(filePath, '/css/');
|
|
90
|
+
const distStructure = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
91
|
+
? 'components'
|
|
92
|
+
: 'css';
|
|
93
|
+
const newfilePath =
|
|
94
|
+
emulsifyConfig.project.platform === 'drupal' &&
|
|
95
|
+
fs.existsSync(path.resolve(projectDir, 'src'))
|
|
96
|
+
? `components/${filePathDist.replace('.scss', '')}`
|
|
97
|
+
: `dist/${distStructure}/${filePathDist.replace('.scss', '')}`;
|
|
33
98
|
entries[newfilePath] = file;
|
|
34
99
|
});
|
|
35
100
|
|
|
36
|
-
|
|
101
|
+
// Component Library SCSS entries.
|
|
102
|
+
glob.sync(ComponentLibraryScssMatcher).forEach((file) => {
|
|
103
|
+
const filePath = file.split(/util/)[1];
|
|
104
|
+
const newfilePath = `dist/storybook/${filePath.replace('.scss', '')}`;
|
|
105
|
+
entries[newfilePath] = file;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// JS entries.
|
|
109
|
+
glob.sync(jsMatcher).forEach((file) => {
|
|
110
|
+
if (!file.includes('dist/')) {
|
|
111
|
+
const filePath = file.split('components/')[1];
|
|
112
|
+
const filePathDist = replaceLastSlash(filePath, '/js/');
|
|
113
|
+
const distStructure = fs.existsSync(path.resolve(projectDir, 'src'))
|
|
114
|
+
? 'components'
|
|
115
|
+
: 'js';
|
|
116
|
+
const newfilePath =
|
|
117
|
+
emulsifyConfig.project.platform === 'drupal' &&
|
|
118
|
+
fs.existsSync(path.resolve(projectDir, 'src'))
|
|
119
|
+
? `components/${filePathDist.replace('.js', '')}`
|
|
120
|
+
: `dist/${distStructure}/${filePathDist.replace('.js', '')}`;
|
|
121
|
+
entries[newfilePath] = file;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
37
124
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
const newfilePath = `css/${baseFileName.replace('.js', '')}`;
|
|
125
|
+
glob.sync(spriteMatcher).forEach((file) => {
|
|
126
|
+
const filePath = file.split('/webpack/')[1];
|
|
127
|
+
const newfilePath = `dist/${filePath.replace('.js', '')}`;
|
|
42
128
|
entries[newfilePath] = file;
|
|
43
129
|
});
|
|
44
130
|
|
|
@@ -49,13 +135,20 @@ module.exports = {
|
|
|
49
135
|
stats: {
|
|
50
136
|
errorDetails: true,
|
|
51
137
|
},
|
|
52
|
-
entry: getEntries(
|
|
138
|
+
entry: getEntries(
|
|
139
|
+
BaseScssPattern,
|
|
140
|
+
ComponentScssPattern,
|
|
141
|
+
ComponentLibraryScssPattern,
|
|
142
|
+
jsPattern,
|
|
143
|
+
spritePattern,
|
|
144
|
+
),
|
|
53
145
|
module: {
|
|
54
146
|
rules: [
|
|
55
147
|
loaders.CSSLoader,
|
|
56
148
|
loaders.SVGSpriteLoader,
|
|
57
149
|
loaders.ImageLoader,
|
|
58
150
|
loaders.JSLoader,
|
|
151
|
+
loaders.TwigLoader,
|
|
59
152
|
],
|
|
60
153
|
},
|
|
61
154
|
plugins: [
|
|
@@ -63,10 +156,13 @@ module.exports = {
|
|
|
63
156
|
plugins.ImageminPlugin,
|
|
64
157
|
plugins.SpriteLoaderPlugin,
|
|
65
158
|
plugins.ProgressPlugin,
|
|
159
|
+
plugins.CopyTwigPlugin,
|
|
66
160
|
plugins.CleanWebpackPlugin,
|
|
67
161
|
],
|
|
68
162
|
output: {
|
|
69
|
-
path:
|
|
163
|
+
path: `${projectDir}`,
|
|
70
164
|
filename: '[name].js',
|
|
71
165
|
},
|
|
166
|
+
resolve: resolves.TwigResolve,
|
|
167
|
+
optimization: optimizers,
|
|
72
168
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emulsify/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Bundled tooling for Storybook development + Webpack Build",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component library",
|
|
@@ -47,16 +47,18 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/core": "^7.25.2",
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@storybook/addon-
|
|
53
|
-
"@storybook/addon-
|
|
54
|
-
"@storybook/addon-
|
|
55
|
-
"@storybook/addon-links": "^7.6.17",
|
|
50
|
+
"@emulsify/cli": "^1.11.0",
|
|
51
|
+
"@storybook/addon-a11y": "^8.2.9",
|
|
52
|
+
"@storybook/addon-actions": "^8.2.9",
|
|
53
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
54
|
+
"@storybook/addon-links": "^8.2.9",
|
|
56
55
|
"@storybook/addon-styling-webpack": "^1.0.0",
|
|
57
|
-
"@storybook/addon-themes": "^
|
|
58
|
-
"@storybook/html": "^
|
|
59
|
-
"@storybook/html-webpack5": "^
|
|
56
|
+
"@storybook/addon-themes": "^8.2.9",
|
|
57
|
+
"@storybook/html": "^8.2.9",
|
|
58
|
+
"@storybook/html-webpack5": "^8.2.9",
|
|
59
|
+
"@storybook/manager-api": "^8.2.9",
|
|
60
|
+
"@storybook/preview-api": "^8.2.9",
|
|
61
|
+
"@storybook/theming": "^8.2.9",
|
|
60
62
|
"add-attributes-twig-extension": "^0.1.0",
|
|
61
63
|
"autoprefixer": "^10.4.20",
|
|
62
64
|
"babel-loader": "^9.1.3",
|
|
@@ -66,33 +68,36 @@
|
|
|
66
68
|
"chalk": "^5.2.0",
|
|
67
69
|
"clean-webpack-plugin": "^4.0.0",
|
|
68
70
|
"concurrently": "^8.2.2",
|
|
71
|
+
"copy-webpack-plugin": "^12.0.2",
|
|
69
72
|
"css-loader": "^7.1.1",
|
|
70
73
|
"eslint": "^8.57.0",
|
|
71
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
74
|
"eslint-config-prettier": "^9.1.0",
|
|
73
75
|
"eslint-plugin-import": "^2.29.1",
|
|
74
|
-
"eslint-plugin-jest": "^
|
|
76
|
+
"eslint-plugin-jest": "^28.8.0",
|
|
75
77
|
"eslint-plugin-prettier": "^5.1.3",
|
|
76
|
-
"eslint-plugin-security": "^
|
|
78
|
+
"eslint-plugin-security": "^3.0.1",
|
|
77
79
|
"eslint-plugin-storybook": "^0.8.0",
|
|
78
80
|
"eslint-webpack-plugin": "^4.1.0",
|
|
79
81
|
"file-loader": "^6.2.0",
|
|
80
82
|
"fs-extra": "^11.2.0",
|
|
81
|
-
"glob": "^
|
|
83
|
+
"glob": "^11.0.0",
|
|
82
84
|
"graceful-fs": "^4.2.11",
|
|
83
85
|
"html-webpack-plugin": "^5.6.0",
|
|
84
|
-
"
|
|
86
|
+
"image-minimizer-webpack-plugin": "^4.1.0",
|
|
87
|
+
"imagemin": "^9.0.0",
|
|
88
|
+
"imagemin-gifsicle": "^7.0.0",
|
|
89
|
+
"imagemin-jpegtran": "^7.0.0",
|
|
90
|
+
"imagemin-optipng": "^8.0.0",
|
|
85
91
|
"jest": "^29.7.0",
|
|
86
92
|
"jest-environment-jsdom": "^29.7.0",
|
|
87
93
|
"js-yaml": "^4.1.0",
|
|
88
94
|
"js-yaml-loader": "^1.2.2",
|
|
89
|
-
"
|
|
90
|
-
"mini-css-extract-plugin": "^2.9.0",
|
|
95
|
+
"mini-css-extract-plugin": "^2.9.1",
|
|
91
96
|
"node-sass-glob-importer": "^5.3.3",
|
|
92
97
|
"normalize.css": "^8.0.1",
|
|
93
98
|
"open-cli": "^8.0.0",
|
|
94
99
|
"pa11y": "^8.0.0",
|
|
95
|
-
"postcss": "^8.4.
|
|
100
|
+
"postcss": "^8.4.44",
|
|
96
101
|
"postcss-loader": "^8.1.1",
|
|
97
102
|
"postcss-scss": "^4.0.9",
|
|
98
103
|
"ramda": "^0.30.1",
|
|
@@ -100,10 +105,11 @@
|
|
|
100
105
|
"react-dom": "^18.2.0",
|
|
101
106
|
"regenerator-runtime": "^0.14.1",
|
|
102
107
|
"sass": "^1.75.0",
|
|
103
|
-
"sass-loader": "^16.0.
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
108
|
+
"sass-loader": "^16.0.1",
|
|
109
|
+
"semantic-release": "^24.1.0",
|
|
110
|
+
"storybook": "^8.2.9",
|
|
111
|
+
"style-dictionary": "^4.1.0",
|
|
112
|
+
"stylelint": "^16.9.0",
|
|
107
113
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
108
114
|
"stylelint-prettier": "^5.0.0",
|
|
109
115
|
"stylelint-selector-bem-pattern": "^4.0.0",
|
|
@@ -111,23 +117,23 @@
|
|
|
111
117
|
"svg-sprite-loader": "^6.0.11",
|
|
112
118
|
"token-transformer": "^0.0.33",
|
|
113
119
|
"twig-drupal-filters": "^3.2.0",
|
|
114
|
-
"twig-loader": "github:fourkitchens/twig-loader",
|
|
115
120
|
"twig-testing-library": "^1.2.0",
|
|
121
|
+
"twigjs-loader": "^1.0.3",
|
|
116
122
|
"webpack": "^5.91.0",
|
|
117
123
|
"webpack-cli": "^5.1.4",
|
|
118
124
|
"webpack-merge": "^6.0.1",
|
|
119
125
|
"yaml": "^2.5.0"
|
|
120
126
|
},
|
|
121
127
|
"devDependencies": {
|
|
122
|
-
"@commitlint/cli": "^19.
|
|
123
|
-
"@commitlint/config-conventional": "^19.1
|
|
128
|
+
"@commitlint/cli": "^19.4.1",
|
|
129
|
+
"@commitlint/config-conventional": "^19.4.1",
|
|
124
130
|
"@semantic-release/changelog": "^6.0.2",
|
|
125
131
|
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
126
132
|
"@semantic-release/git": "^10.0.1",
|
|
127
|
-
"@semantic-release/github": "^10.
|
|
133
|
+
"@semantic-release/github": "^10.3.0",
|
|
128
134
|
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
129
|
-
"husky": "^9.1.
|
|
130
|
-
"
|
|
135
|
+
"husky": "^9.1.5",
|
|
136
|
+
"lint-staged": "^15.2.10"
|
|
131
137
|
},
|
|
132
138
|
"overrides": {
|
|
133
139
|
"graceful-fs": "^4.2.11"
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
const { configOverrides } = require('../../../../config/emulsify-core/storybook/main');
|
|
2
|
-
|
|
3
|
-
const defaultConfig = {
|
|
4
|
-
stories: [
|
|
5
|
-
'../../../../components/**/*.stories.@(js|jsx|ts|tsx)',
|
|
6
|
-
],
|
|
7
|
-
addons: [
|
|
8
|
-
'../../../@storybook/addon-a11y',
|
|
9
|
-
'../../../@storybook/addon-links',
|
|
10
|
-
'../../../@storybook/addon-essentials',
|
|
11
|
-
'../../../@storybook/addon-themes',
|
|
12
|
-
'../../../@storybook/addon-styling-webpack'
|
|
13
|
-
],
|
|
14
|
-
core: {
|
|
15
|
-
builder: 'webpack5',
|
|
16
|
-
},
|
|
17
|
-
framework: {
|
|
18
|
-
name: '@storybook/html-webpack5',
|
|
19
|
-
options: {},
|
|
20
|
-
},
|
|
21
|
-
docs: {
|
|
22
|
-
autodocs: true,
|
|
23
|
-
},
|
|
24
|
-
managerHead: (head) => `
|
|
25
|
-
${head}
|
|
26
|
-
<style>
|
|
27
|
-
:root {
|
|
28
|
-
--colors-emulsify-blue-100: #e6f5fc;
|
|
29
|
-
--colors-emulsify-blue-200: #CCECFA;
|
|
30
|
-
--colors-emulsify-blue-300: #99D9F4;
|
|
31
|
-
--colors-emulsify-blue-400: #66c5ef;
|
|
32
|
-
--colors-emulsify-blue-500: #33b2e9;
|
|
33
|
-
--colors-emulsify-blue-600: #009fe4;
|
|
34
|
-
--colors-emulsify-blue-700: #007FB6;
|
|
35
|
-
--colors-emulsify-blue-800: #005f89;
|
|
36
|
-
--colors-emulsify-blue-900: #00405b;
|
|
37
|
-
--colors-emulsify-blue-1000: #00202e;
|
|
38
|
-
--colors-purple: #8B1E7E;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sidebar-container {
|
|
42
|
-
background: url('https://raw.githubusercontent.com/fourkitchens/emulsify-core/main/assets/images/corner-bkg.png?token=GHSAT0AAAAAACIEXLVDMX56QK3ZIZWHWHTEZNYFYIA') no-repeat top left;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.sidebar-container .sidebar-subheading {
|
|
46
|
-
color: var(--colors-emulsify-blue-200);
|
|
47
|
-
font-size: 13px;
|
|
48
|
-
letter-spacing: 0.15em;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.sidebar-container .sidebar-subheading button:focus {
|
|
52
|
-
color: var(--colors-emulsify-blue-300);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Triangle icon **/
|
|
56
|
-
.sidebar-container .sidebar-subheading button span {
|
|
57
|
-
color: var(--colors-emulsify-blue-300);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.sidebar-container .search-field input {
|
|
61
|
-
border-color: var(--colors-emulsify-blue-700);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.sidebar-container .search-field input:active {
|
|
65
|
-
border-color: var(--colors-emulsify-blue-700);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.sidebar-container .search-result-recentlyOpened,
|
|
69
|
-
.sidebar-container .search-result-back,
|
|
70
|
-
.sidebar-container .search-result-clearHistory {
|
|
71
|
-
color: var(--colors-emulsify-blue-300) !important;
|
|
72
|
-
letter-spacing: 0.15em;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.sidebar-container .search-result-back span,
|
|
76
|
-
.sidebar-container .search-result-back svg,
|
|
77
|
-
.sidebar-container .search-result-clearHistory span,
|
|
78
|
-
.sidebar-container .search-result-clearHistory svg {
|
|
79
|
-
letter-spacing: normal;
|
|
80
|
-
color: white;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.sidebar-container .sidebar-item svg {
|
|
84
|
-
margin-top: 1px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.sidebar-container .sidebar-item span {
|
|
88
|
-
margin-top: 4px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.sidebar-container .sidebar-subheading-action svg {
|
|
92
|
-
color: var(--colors-emulsify-blue-400);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.sidebar-container .sidebar-subheading-action:hover svg {
|
|
96
|
-
color: var(--colors-emulsify-blue-300);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.sidebar-header button[title="Shortcuts"] {
|
|
100
|
-
box-shadow: none;
|
|
101
|
-
border: 1px solid var(--colors-emulsify-blue-700);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.sidebar-header button[title="Shortcuts"]:active {
|
|
105
|
-
border: 1px solid var(--colors-emulsify-blue-500);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.sidebar-header button[title="Shortcuts"]:focus {
|
|
109
|
-
background: transparent;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
#shortcuts {
|
|
113
|
-
border-bottom-color: var(--colors-emulsify-blue-900) !important;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
[role="main"]:not(:nth-child(3)) {
|
|
117
|
-
top: 1rem !important;
|
|
118
|
-
height: calc(100vh - 2rem) !important;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
[role="main"] .os-host .os-content button:hover {
|
|
122
|
-
background: var(--colors-emulsify-blue-100);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
[role="main"] .os-host .os-content button:hover svg {
|
|
126
|
-
color: var(--colors-emulsify-blue-900);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
#panel-tab-content,
|
|
130
|
-
#panel-tab-content>* {
|
|
131
|
-
color: var(--colors-emulsify-blue-1000) !important;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
#panel-tab-content a,
|
|
135
|
-
#panel-tab-content a span,
|
|
136
|
-
#panel-tab-content a span svg {
|
|
137
|
-
color: var(--colors-emulsify-blue-800);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
#panel-tab-content>div>div>div>div>div>div {
|
|
141
|
-
background: transparent;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
#panel-tab-content>div>div>div>div>div>div>div {
|
|
145
|
-
color: var(--colors-emulsify-blue-1000) !important;
|
|
146
|
-
}
|
|
147
|
-
</style>
|
|
148
|
-
`,
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const config = Object.keys(configOverrides).length ? configOverrides : defaultConfig;
|
|
152
|
-
|
|
153
|
-
module.exports = config;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
const { configOverrides } = require('../../../../config/emulsify-core/storybook/main');
|
|
2
|
-
|
|
3
|
-
const defaultConfig = {
|
|
4
|
-
stories: [
|
|
5
|
-
'../../../../components/**/*.stories.@(js|jsx|ts|tsx)',
|
|
6
|
-
],
|
|
7
|
-
addons: [
|
|
8
|
-
'../../../@storybook/addon-a11y',
|
|
9
|
-
'../../../@storybook/addon-links',
|
|
10
|
-
'../../../@storybook/addon-essentials',
|
|
11
|
-
'../../../@storybook/addon-themes',
|
|
12
|
-
'../../../@storybook/addon-styling-webpack'
|
|
13
|
-
],
|
|
14
|
-
core: {
|
|
15
|
-
builder: 'webpack5',
|
|
16
|
-
},
|
|
17
|
-
framework: {
|
|
18
|
-
name: '@storybook/html-webpack5',
|
|
19
|
-
options: {},
|
|
20
|
-
},
|
|
21
|
-
docs: {
|
|
22
|
-
autodocs: false,
|
|
23
|
-
},
|
|
24
|
-
managerHead: (head) => `
|
|
25
|
-
${head}
|
|
26
|
-
<style>
|
|
27
|
-
:root {
|
|
28
|
-
--colors-emulsify-blue-100: #e6f5fc;
|
|
29
|
-
--colors-emulsify-blue-200: #CCECFA;
|
|
30
|
-
--colors-emulsify-blue-300: #99D9F4;
|
|
31
|
-
--colors-emulsify-blue-400: #66c5ef;
|
|
32
|
-
--colors-emulsify-blue-500: #33b2e9;
|
|
33
|
-
--colors-emulsify-blue-600: #009fe4;
|
|
34
|
-
--colors-emulsify-blue-700: #007FB6;
|
|
35
|
-
--colors-emulsify-blue-800: #005f89;
|
|
36
|
-
--colors-emulsify-blue-900: #00405b;
|
|
37
|
-
--colors-emulsify-blue-1000: #00202e;
|
|
38
|
-
--colors-purple: #8B1E7E;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.sidebar-container {
|
|
42
|
-
background: url('https://raw.githubusercontent.com/fourkitchens/emulsify-core/main/assets/images/corner-bkg.png?token=GHSAT0AAAAAACIEXLVDMX56QK3ZIZWHWHTEZNYFYIA') no-repeat top left;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.sidebar-container .sidebar-subheading {
|
|
46
|
-
color: var(--colors-emulsify-blue-200);
|
|
47
|
-
font-size: 13px;
|
|
48
|
-
letter-spacing: 0.15em;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.sidebar-container .sidebar-subheading button:focus {
|
|
52
|
-
color: var(--colors-emulsify-blue-300);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Triangle icon **/
|
|
56
|
-
.sidebar-container .sidebar-subheading button span {
|
|
57
|
-
color: var(--colors-emulsify-blue-300);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.sidebar-container .search-field input {
|
|
61
|
-
border-color: var(--colors-emulsify-blue-700);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.sidebar-container .search-field input:active {
|
|
65
|
-
border-color: var(--colors-emulsify-blue-700);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.sidebar-container .search-result-recentlyOpened,
|
|
69
|
-
.sidebar-container .search-result-back,
|
|
70
|
-
.sidebar-container .search-result-clearHistory {
|
|
71
|
-
color: var(--colors-emulsify-blue-300) !important;
|
|
72
|
-
letter-spacing: 0.15em;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.sidebar-container .search-result-back span,
|
|
76
|
-
.sidebar-container .search-result-back svg,
|
|
77
|
-
.sidebar-container .search-result-clearHistory span,
|
|
78
|
-
.sidebar-container .search-result-clearHistory svg {
|
|
79
|
-
letter-spacing: normal;
|
|
80
|
-
color: white;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.sidebar-container .sidebar-item svg {
|
|
84
|
-
margin-top: 1px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.sidebar-container .sidebar-item span {
|
|
88
|
-
margin-top: 4px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.sidebar-container .sidebar-subheading-action svg {
|
|
92
|
-
color: var(--colors-emulsify-blue-400);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.sidebar-container .sidebar-subheading-action:hover svg {
|
|
96
|
-
color: var(--colors-emulsify-blue-300);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.sidebar-header button[title="Shortcuts"] {
|
|
100
|
-
box-shadow: none;
|
|
101
|
-
border: 1px solid var(--colors-emulsify-blue-700);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.sidebar-header button[title="Shortcuts"]:active {
|
|
105
|
-
border: 1px solid var(--colors-emulsify-blue-500);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.sidebar-header button[title="Shortcuts"]:focus {
|
|
109
|
-
background: transparent;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
#shortcuts {
|
|
113
|
-
border-bottom-color: var(--colors-emulsify-blue-900) !important;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
[role="main"]:not(:nth-child(3)) {
|
|
117
|
-
top: 1rem !important;
|
|
118
|
-
height: calc(100vh - 2rem) !important;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
[role="main"] .os-host .os-content button:hover {
|
|
122
|
-
background: var(--colors-emulsify-blue-100);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
[role="main"] .os-host .os-content button:hover svg {
|
|
126
|
-
color: var(--colors-emulsify-blue-900);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
#panel-tab-content,
|
|
130
|
-
#panel-tab-content>* {
|
|
131
|
-
color: var(--colors-emulsify-blue-1000) !important;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
#panel-tab-content a,
|
|
135
|
-
#panel-tab-content a span,
|
|
136
|
-
#panel-tab-content a span svg {
|
|
137
|
-
color: var(--colors-emulsify-blue-800);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
#panel-tab-content>div>div>div>div>div>div {
|
|
141
|
-
background: transparent;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
#panel-tab-content>div>div>div>div>div>div>div {
|
|
145
|
-
color: var(--colors-emulsify-blue-1000) !important;
|
|
146
|
-
}
|
|
147
|
-
</style>
|
|
148
|
-
`,
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const config = Object.keys(configOverrides).length ? configOverrides : defaultConfig;
|
|
152
|
-
|
|
153
|
-
module.exports = config;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@emulsify/core",
|
|
3
|
-
"version": "1.3.1",
|
|
4
|
-
"description": "Bundled tooling for Storybook development + Webpack Build",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"component library",
|
|
7
|
-
"design system",
|
|
8
|
-
"drupal",
|
|
9
|
-
"pattern library",
|
|
10
|
-
"storybook",
|
|
11
|
-
"styleguide"
|
|
12
|
-
],
|
|
13
|
-
"author": "Four Kitchens <shout@fourkitchens.com>",
|
|
14
|
-
"license": "GPL-2.0",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/emulsify-ds/emulsify-core.git"
|
|
21
|
-
},
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/emulsify-ds/emulsify-core/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/emulsify-ds/emulsify-core#readme",
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"coverage": "npm run test && open-cli .coverage/lcov-report/index.html",
|
|
31
|
-
"format": "npm run lint-fix; npm run prettier-fix",
|
|
32
|
-
"husky:commit-msg": "commitlint --edit $1",
|
|
33
|
-
"husky:pre-commit": "npm run lint",
|
|
34
|
-
"lint": "npm run lint-js",
|
|
35
|
-
"lint-fix": "npm run lint-js -- --fix",
|
|
36
|
-
"lint-js": "eslint --config config/eslintrc.config.json --no-error-on-unmatched-pattern ./config ./storybook",
|
|
37
|
-
"lint-staged": "lint-staged",
|
|
38
|
-
"prepare": "[ -d '.git' ] && (husky install) || true",
|
|
39
|
-
"prettier": "prettier --config config/prettierrc.json --ignore-unknown \"**/*.{js,yml,scss,md}\"",
|
|
40
|
-
"prettier-fix": "prettier --config config/prettierrc.json --write --ignore-unknown \"**/*.{js,yml,scss,md}\"",
|
|
41
|
-
"semantic-release": "semantic-release",
|
|
42
|
-
"storybook": "storybook dev --ci -s ../../dist,../../assets/images,../../assets/icons,../../assets/videos -p 6006",
|
|
43
|
-
"storybook-build": "storybook build -s ../../dist,../../assets/images,../../assets/icons,../../assets/videos -o .out",
|
|
44
|
-
"storybook-deploy": "storybook-to-ghpages -o .out",
|
|
45
|
-
"test": "jest --coverage --config ./config/jest.config.js",
|
|
46
|
-
"twatch": "jest --no-coverage --watch --verbose"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@babel/core": "^7.25.2",
|
|
50
|
-
"@babel/eslint-parser": "^7.25.1",
|
|
51
|
-
"@emulsify/cli": "^1.10.2",
|
|
52
|
-
"@storybook/addon-a11y": "^7.6.17",
|
|
53
|
-
"@storybook/addon-actions": "^7.6.17",
|
|
54
|
-
"@storybook/addon-essentials": "^7.6.17",
|
|
55
|
-
"@storybook/addon-links": "^7.6.17",
|
|
56
|
-
"@storybook/addon-styling-webpack": "^1.0.0",
|
|
57
|
-
"@storybook/addon-themes": "^7.6.17",
|
|
58
|
-
"@storybook/html": "^7.6.17",
|
|
59
|
-
"@storybook/html-webpack5": "^7.6.17",
|
|
60
|
-
"add-attributes-twig-extension": "^0.1.0",
|
|
61
|
-
"autoprefixer": "^10.4.20",
|
|
62
|
-
"babel-loader": "^9.1.3",
|
|
63
|
-
"babel-preset-minify": "^0.5.2",
|
|
64
|
-
"bem-twig-extension": "^0.1.1",
|
|
65
|
-
"breakpoint-sass": "^3.0.0",
|
|
66
|
-
"chalk": "^5.2.0",
|
|
67
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
68
|
-
"concurrently": "^8.2.2",
|
|
69
|
-
"css-loader": "^7.1.1",
|
|
70
|
-
"eslint": "^8.57.0",
|
|
71
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
|
-
"eslint-config-prettier": "^9.1.0",
|
|
73
|
-
"eslint-plugin-import": "^2.29.1",
|
|
74
|
-
"eslint-plugin-jest": "^27.9.0",
|
|
75
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
76
|
-
"eslint-plugin-security": "^2.1.1",
|
|
77
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
78
|
-
"eslint-webpack-plugin": "^4.1.0",
|
|
79
|
-
"file-loader": "^6.2.0",
|
|
80
|
-
"fs-extra": "^11.2.0",
|
|
81
|
-
"glob": "^10.3.12",
|
|
82
|
-
"graceful-fs": "^4.2.11",
|
|
83
|
-
"html-webpack-plugin": "^5.6.0",
|
|
84
|
-
"imagemin-webpack-plugin": "^2.4.2",
|
|
85
|
-
"jest": "^29.7.0",
|
|
86
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
87
|
-
"js-yaml": "^4.1.0",
|
|
88
|
-
"js-yaml-loader": "^1.2.2",
|
|
89
|
-
"lint-staged": "^15.2.8",
|
|
90
|
-
"mini-css-extract-plugin": "^2.9.0",
|
|
91
|
-
"node-sass-glob-importer": "^5.3.3",
|
|
92
|
-
"normalize.css": "^8.0.1",
|
|
93
|
-
"open-cli": "^8.0.0",
|
|
94
|
-
"pa11y": "^8.0.0",
|
|
95
|
-
"postcss": "^8.4.41",
|
|
96
|
-
"postcss-loader": "^8.1.1",
|
|
97
|
-
"postcss-scss": "^4.0.9",
|
|
98
|
-
"ramda": "^0.30.1",
|
|
99
|
-
"react": "^18.2.0",
|
|
100
|
-
"react-dom": "^18.2.0",
|
|
101
|
-
"regenerator-runtime": "^0.14.1",
|
|
102
|
-
"sass": "^1.75.0",
|
|
103
|
-
"sass-loader": "^16.0.0",
|
|
104
|
-
"storybook": "^7.6.17",
|
|
105
|
-
"style-dictionary": "^3.9.2",
|
|
106
|
-
"stylelint": "^16.8.1",
|
|
107
|
-
"stylelint-config-standard-scss": "^13.1.0",
|
|
108
|
-
"stylelint-prettier": "^5.0.0",
|
|
109
|
-
"stylelint-selector-bem-pattern": "^4.0.0",
|
|
110
|
-
"stylelint-webpack-plugin": "^5.0.1",
|
|
111
|
-
"svg-sprite-loader": "^6.0.11",
|
|
112
|
-
"token-transformer": "^0.0.33",
|
|
113
|
-
"twig-drupal-filters": "^3.2.0",
|
|
114
|
-
"twig-loader": "github:fourkitchens/twig-loader",
|
|
115
|
-
"twig-testing-library": "^1.2.0",
|
|
116
|
-
"webpack": "^5.91.0",
|
|
117
|
-
"webpack-cli": "^5.1.4",
|
|
118
|
-
"webpack-merge": "^6.0.1",
|
|
119
|
-
"yaml": "^2.5.0"
|
|
120
|
-
},
|
|
121
|
-
"devDependencies": {
|
|
122
|
-
"@commitlint/cli": "^19.3.0",
|
|
123
|
-
"@commitlint/config-conventional": "^19.1.0",
|
|
124
|
-
"@semantic-release/changelog": "^6.0.2",
|
|
125
|
-
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
126
|
-
"@semantic-release/git": "^10.0.1",
|
|
127
|
-
"@semantic-release/github": "^10.1.3",
|
|
128
|
-
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
129
|
-
"husky": "^9.1.4",
|
|
130
|
-
"semantic-release": "^24.0.0"
|
|
131
|
-
},
|
|
132
|
-
"overrides": {
|
|
133
|
-
"graceful-fs": "^4.2.11"
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@emulsify/core",
|
|
3
|
-
"version": "1.4.0",
|
|
4
|
-
"description": "Bundled tooling for Storybook development + Webpack Build",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"component library",
|
|
7
|
-
"design system",
|
|
8
|
-
"drupal",
|
|
9
|
-
"pattern library",
|
|
10
|
-
"storybook",
|
|
11
|
-
"styleguide"
|
|
12
|
-
],
|
|
13
|
-
"author": "Four Kitchens <shout@fourkitchens.com>",
|
|
14
|
-
"license": "GPL-2.0",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/emulsify-ds/emulsify-core.git"
|
|
21
|
-
},
|
|
22
|
-
"bugs": {
|
|
23
|
-
"url": "https://github.com/emulsify-ds/emulsify-core/issues"
|
|
24
|
-
},
|
|
25
|
-
"homepage": "https://github.com/emulsify-ds/emulsify-core#readme",
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"coverage": "npm run test && open-cli .coverage/lcov-report/index.html",
|
|
31
|
-
"format": "npm run lint-fix; npm run prettier-fix",
|
|
32
|
-
"husky:commit-msg": "commitlint --edit $1",
|
|
33
|
-
"husky:pre-commit": "npm run lint",
|
|
34
|
-
"lint": "npm run lint-js",
|
|
35
|
-
"lint-fix": "npm run lint-js -- --fix",
|
|
36
|
-
"lint-js": "eslint --config config/eslintrc.config.json --no-error-on-unmatched-pattern ./config ./storybook",
|
|
37
|
-
"lint-staged": "lint-staged",
|
|
38
|
-
"prepare": "[ -d '.git' ] && (husky install) || true",
|
|
39
|
-
"prettier": "prettier --config config/prettierrc.json --ignore-unknown \"**/*.{js,yml,scss,md}\"",
|
|
40
|
-
"prettier-fix": "prettier --config config/prettierrc.json --write --ignore-unknown \"**/*.{js,yml,scss,md}\"",
|
|
41
|
-
"semantic-release": "semantic-release",
|
|
42
|
-
"storybook": "storybook dev --ci -s ../../dist,../../assets/images,../../assets/icons,../../assets/videos -p 6006",
|
|
43
|
-
"storybook-build": "storybook build -s ../../dist,../../assets/images,../../assets/icons,../../assets/videos -o .out",
|
|
44
|
-
"storybook-deploy": "storybook-to-ghpages -o .out",
|
|
45
|
-
"test": "jest --coverage --config ./config/jest.config.js",
|
|
46
|
-
"twatch": "jest --no-coverage --watch --verbose"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@babel/core": "^7.25.2",
|
|
50
|
-
"@babel/eslint-parser": "^7.25.1",
|
|
51
|
-
"@emulsify/cli": "^1.10.2",
|
|
52
|
-
"@storybook/addon-a11y": "^7.6.17",
|
|
53
|
-
"@storybook/addon-actions": "^7.6.17",
|
|
54
|
-
"@storybook/addon-essentials": "^7.6.17",
|
|
55
|
-
"@storybook/addon-links": "^7.6.17",
|
|
56
|
-
"@storybook/addon-styling-webpack": "^1.0.0",
|
|
57
|
-
"@storybook/addon-themes": "^7.6.17",
|
|
58
|
-
"@storybook/html": "^7.6.17",
|
|
59
|
-
"@storybook/html-webpack5": "^7.6.17",
|
|
60
|
-
"add-attributes-twig-extension": "^0.1.0",
|
|
61
|
-
"autoprefixer": "^10.4.20",
|
|
62
|
-
"babel-loader": "^9.1.3",
|
|
63
|
-
"babel-preset-minify": "^0.5.2",
|
|
64
|
-
"bem-twig-extension": "^0.1.1",
|
|
65
|
-
"breakpoint-sass": "^3.0.0",
|
|
66
|
-
"chalk": "^5.2.0",
|
|
67
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
68
|
-
"concurrently": "^8.2.2",
|
|
69
|
-
"css-loader": "^7.1.1",
|
|
70
|
-
"eslint": "^8.57.0",
|
|
71
|
-
"eslint-config-airbnb-base": "^15.0.0",
|
|
72
|
-
"eslint-config-prettier": "^9.1.0",
|
|
73
|
-
"eslint-plugin-import": "^2.29.1",
|
|
74
|
-
"eslint-plugin-jest": "^27.9.0",
|
|
75
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
76
|
-
"eslint-plugin-security": "^2.1.1",
|
|
77
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
78
|
-
"eslint-webpack-plugin": "^4.1.0",
|
|
79
|
-
"file-loader": "^6.2.0",
|
|
80
|
-
"fs-extra": "^11.2.0",
|
|
81
|
-
"glob": "^10.3.12",
|
|
82
|
-
"graceful-fs": "^4.2.11",
|
|
83
|
-
"html-webpack-plugin": "^5.6.0",
|
|
84
|
-
"imagemin-webpack-plugin": "^2.4.2",
|
|
85
|
-
"jest": "^29.7.0",
|
|
86
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
87
|
-
"js-yaml": "^4.1.0",
|
|
88
|
-
"js-yaml-loader": "^1.2.2",
|
|
89
|
-
"lint-staged": "^15.2.8",
|
|
90
|
-
"mini-css-extract-plugin": "^2.9.0",
|
|
91
|
-
"node-sass-glob-importer": "^5.3.3",
|
|
92
|
-
"normalize.css": "^8.0.1",
|
|
93
|
-
"open-cli": "^8.0.0",
|
|
94
|
-
"pa11y": "^8.0.0",
|
|
95
|
-
"postcss": "^8.4.41",
|
|
96
|
-
"postcss-loader": "^8.1.1",
|
|
97
|
-
"postcss-scss": "^4.0.9",
|
|
98
|
-
"ramda": "^0.30.1",
|
|
99
|
-
"react": "^18.2.0",
|
|
100
|
-
"react-dom": "^18.2.0",
|
|
101
|
-
"regenerator-runtime": "^0.14.1",
|
|
102
|
-
"sass": "^1.75.0",
|
|
103
|
-
"sass-loader": "^16.0.0",
|
|
104
|
-
"storybook": "^7.6.17",
|
|
105
|
-
"style-dictionary": "^3.9.2",
|
|
106
|
-
"stylelint": "^16.8.1",
|
|
107
|
-
"stylelint-config-standard-scss": "^13.1.0",
|
|
108
|
-
"stylelint-prettier": "^5.0.0",
|
|
109
|
-
"stylelint-selector-bem-pattern": "^4.0.0",
|
|
110
|
-
"stylelint-webpack-plugin": "^5.0.1",
|
|
111
|
-
"svg-sprite-loader": "^6.0.11",
|
|
112
|
-
"token-transformer": "^0.0.33",
|
|
113
|
-
"twig-drupal-filters": "^3.2.0",
|
|
114
|
-
"twig-loader": "github:fourkitchens/twig-loader",
|
|
115
|
-
"twig-testing-library": "^1.2.0",
|
|
116
|
-
"webpack": "^5.91.0",
|
|
117
|
-
"webpack-cli": "^5.1.4",
|
|
118
|
-
"webpack-merge": "^6.0.1",
|
|
119
|
-
"yaml": "^2.5.0"
|
|
120
|
-
},
|
|
121
|
-
"devDependencies": {
|
|
122
|
-
"@commitlint/cli": "^19.3.0",
|
|
123
|
-
"@commitlint/config-conventional": "^19.1.0",
|
|
124
|
-
"@semantic-release/changelog": "^6.0.2",
|
|
125
|
-
"@semantic-release/commit-analyzer": "^13.0.0",
|
|
126
|
-
"@semantic-release/git": "^10.0.1",
|
|
127
|
-
"@semantic-release/github": "^10.1.3",
|
|
128
|
-
"@semantic-release/release-notes-generator": "^14.0.0",
|
|
129
|
-
"husky": "^9.1.4",
|
|
130
|
-
"semantic-release": "^24.0.0"
|
|
131
|
-
},
|
|
132
|
-
"overrides": {
|
|
133
|
-
"graceful-fs": "^4.2.11"
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../../../../../../components/style.scss';
|
package/config/webpack/css.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '../../../../../../components/style.scss';
|