@emulsify/core 0.0.0-development → 1.1.1
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/.history/.storybook/main_20240401184129.js +22 -0
- package/.history/.storybook/main_20240607162805.js +22 -0
- package/.history/.storybook/manager_20240311205454.js +15 -0
- package/.history/.storybook/manager_20240607162817.js +15 -0
- package/.history/.storybook/preview_20240401184023.js +40 -0
- package/.history/.storybook/preview_20240607162826.js +40 -0
- package/.history/.storybook/setupTwig.test_20240228163244.js +33 -0
- package/.history/.storybook/setupTwig.test_20240607163045.js +33 -0
- package/.history/.storybook/setupTwig_20240326081425.js +59 -0
- package/.history/.storybook/setupTwig_20240607163001.js +43 -0
- package/.history/.storybook/setupTwig_20240607163019.js +43 -0
- package/.history/README_20240312154948.md +72 -0
- package/.history/README_20240607162731.md +94 -0
- package/.history/config/a11y.config_20240607110020.js +61 -0
- package/.history/config/a11y.config_20240607163052.js +61 -0
- package/.history/config/a11y.config_20240607163120.js +61 -0
- package/.history/config/webpack/css/style_20240228152007.js +1 -0
- package/.history/config/webpack/css/style_20240607163238.js +1 -0
- package/.history/config/webpack/css_20240317194751.js +1 -0
- package/.history/config/webpack/css_20240607163108.js +1 -0
- package/.history/config/webpack/css_20240607163132.js +1 -0
- package/.history/config/webpack/plugins_20240401184104.js +48 -0
- package/.history/config/webpack/plugins_20240607163148.js +48 -0
- package/.history/config/webpack/svgSprite_20240401184053.js +5 -0
- package/.history/config/webpack/svgSprite_20240607163207.js +5 -0
- package/.history/config/webpack/webpack.common_20240607090919.js +72 -0
- package/.history/config/webpack/webpack.common_20240607163224.js +72 -0
- package/.history/package_20240607155640.json +136 -0
- package/.history/package_20240607163353.json +135 -0
- package/.storybook/main.js +1 -1
- package/.storybook/manager.js +1 -1
- package/.storybook/preview.js +2 -2
- package/.storybook/setupTwig.js +5 -21
- package/.storybook/setupTwig.test.js +5 -5
- package/README.md +31 -9
- package/config/a11y.config.js +1 -1
- package/config/webpack/css/style.js +1 -1
- package/config/webpack/css.js +1 -1
- package/config/webpack/plugins.js +1 -1
- package/config/webpack/svgSprite.js +1 -1
- package/config/webpack/webpack.common.js +2 -2
- package/package.json +2 -3
package/.storybook/setupTwig.js
CHANGED
|
@@ -5,34 +5,18 @@ const twigAddAttributes = require('add-attributes-twig-extension');
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Fetches project-based variant configuration. If no such configuration
|
|
8
|
-
* exists, returns default values.
|
|
8
|
+
* exists, returns default values as a flat component structure.
|
|
9
9
|
*
|
|
10
10
|
* @returns project-based variant configuration, or default config.
|
|
11
11
|
*/
|
|
12
12
|
const fetchVariantConfig = () => {
|
|
13
13
|
try {
|
|
14
|
-
return require('
|
|
14
|
+
return require('../../../../project.emulsify.json').variant.structureImplementations;
|
|
15
15
|
} catch (e) {
|
|
16
16
|
return [
|
|
17
17
|
{
|
|
18
|
-
name: '
|
|
19
|
-
directory: '
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'atoms',
|
|
23
|
-
directory: '../../components/01-atoms',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: 'molecules',
|
|
27
|
-
directory: '../../components/02-molecules',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'organisms',
|
|
31
|
-
directory: '../../components/03-organisms',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'templates',
|
|
35
|
-
directory: '../../components/04-templates',
|
|
18
|
+
name: 'components',
|
|
19
|
+
directory: '../../../../components',
|
|
36
20
|
},
|
|
37
21
|
];
|
|
38
22
|
}
|
|
@@ -40,7 +24,7 @@ const fetchVariantConfig = () => {
|
|
|
40
24
|
|
|
41
25
|
module.exports.namespaces = {};
|
|
42
26
|
for (const { name, directory } of fetchVariantConfig()) {
|
|
43
|
-
module.exports.namespaces[name] = resolve(__dirname, '
|
|
27
|
+
module.exports.namespaces[name] = resolve(__dirname, '../../../../', directory);
|
|
44
28
|
}
|
|
45
29
|
|
|
46
30
|
/**
|
|
@@ -23,11 +23,11 @@ describe('setupTwig', () => {
|
|
|
23
23
|
|
|
24
24
|
it('exports emulsifys namespaces', () => {
|
|
25
25
|
expect(namespaces).toEqual({
|
|
26
|
-
base: '
|
|
27
|
-
atoms: '
|
|
28
|
-
molecules: '
|
|
29
|
-
organisms: '
|
|
30
|
-
templates: '
|
|
26
|
+
base: '../../../../components/00-base',
|
|
27
|
+
atoms: '../../../../components/01-atoms',
|
|
28
|
+
molecules: '../../../../components/02-molecules',
|
|
29
|
+
organisms: '../../../../components/03-organisms',
|
|
30
|
+
templates: '../../../../components/04-templates',
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
});
|
package/README.md
CHANGED
|
@@ -1,24 +1,46 @@
|
|
|
1
|
-
> [!WARNING]
|
|
2
|
-
> Work in progress.
|
|
3
|
-
|
|
4
1
|

|
|
5
2
|
|
|
6
3
|
# Emulsify Core
|
|
7
4
|
|
|
8
5
|
An open-source toolset for creating and implementing design systems.
|
|
9
6
|
|
|
10
|
-
### Storybook development and Webpack build
|
|
11
|
-
|
|
12
7
|
**Emulsify Core** provides a [Storybook](https://storybook.js.org/) component library and a [Webpack](https://webpack.js.org/) development environment. It is meant to make project setup and ongoing development easier by bundling all necessary configuration and providing it as an extendable package for your theme or standalone project.
|
|
13
8
|
|
|
14
|
-
##
|
|
9
|
+
## Installation and usage
|
|
10
|
+
Installation and configuration is setup by the provided base theme project(s). As of this writing, Emulsify Drupal is the only base theme project [with this integration](https://github.com/emulsify-ds/emulsify-drupal/blob/main/whisk/package.json#L36).
|
|
11
|
+
|
|
12
|
+
### Manual installation
|
|
13
|
+
- `npm install @emulsify/core` within your repository or project theme.
|
|
14
|
+
- Copy the provided `npm run` scripts from [Emulsify Drupal's package.json](https://github.com/emulsify-ds/emulsify-drupal/blob/main/whisk/package.json#L15)
|
|
15
|
+
- Copy the contents of `whisk/config/emulsify-core/` from [Emulsify Drupal](https://github.com/emulsify-ds/emulsify-drupal/tree/main/whisk/config/emulsify-core) into your project so `config/` exists at the root of your repository or project theme. The files within `config/` allow you to extend or overwrite configuration provided by Emulsify Core.
|
|
16
|
+
|
|
17
|
+
### Common Scripts
|
|
18
|
+
|
|
19
|
+
Run `nvm use` prior to running any of the following commands to verify you are using Node 20.
|
|
20
|
+
(Each is prefixed with `npm run `)
|
|
21
|
+
|
|
22
|
+
**develop**
|
|
23
|
+
Starts and instance of storybook, watches for any files changes, recompiles CSS/JS, and live reloads storybook assets.
|
|
24
|
+
|
|
25
|
+
**lint**
|
|
26
|
+
Lints all JS/SCSS within your components and reports any violations.
|
|
27
|
+
|
|
28
|
+
**lint-fix**
|
|
29
|
+
Automatically fixes any simple violations.
|
|
30
|
+
|
|
31
|
+
**prettier**
|
|
32
|
+
Outputs any code formatting violations.
|
|
33
|
+
|
|
34
|
+
**prettier-fix**
|
|
35
|
+
Automatically fixes any simple code formatting violations.
|
|
36
|
+
|
|
37
|
+
**storybook-build**
|
|
38
|
+
Builds a static output of the storybook instance.
|
|
15
39
|
|
|
16
|
-
[docs.emulsify.info](https://emulsify.info/docs)
|
|
17
40
|
|
|
18
41
|
### Quick Links
|
|
19
42
|
|
|
20
|
-
|
|
21
|
-
2. [Usage](https://www.emulsify.info/docs/emulsify-drupal/basic-usage/commands)
|
|
43
|
+
- [Emulsify Homepage](https://www.emulsify.info/)
|
|
22
44
|
|
|
23
45
|
## Demo
|
|
24
46
|
|
package/config/a11y.config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../../../../../components/style.scss';
|
package/config/webpack/css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../../../../../components/style.scss';
|
|
@@ -7,7 +7,7 @@ const _ImageminPlugin = require('imagemin-webpack-plugin').default;
|
|
|
7
7
|
const _SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
|
|
8
8
|
const glob = require('glob');
|
|
9
9
|
|
|
10
|
-
const imagePath = path.resolve(__dirname, '
|
|
10
|
+
const imagePath = path.resolve(__dirname, '../../../../../assets/images');
|
|
11
11
|
|
|
12
12
|
const MiniCssExtractPlugin = new _MiniCssExtractPlugin({
|
|
13
13
|
filename: '[name].css',
|
|
@@ -4,8 +4,8 @@ const loaders = require('./loaders');
|
|
|
4
4
|
const plugins = require('./plugins');
|
|
5
5
|
|
|
6
6
|
const webpackDir = path.resolve(__dirname);
|
|
7
|
-
const rootDir = path.resolve(__dirname, '
|
|
8
|
-
const distDir = path.resolve(__dirname, '
|
|
7
|
+
const rootDir = path.resolve(__dirname, '../../../../..');
|
|
8
|
+
const distDir = path.resolve(__dirname, '../../../../../dist');
|
|
9
9
|
|
|
10
10
|
// Glob pattern for scss files that ignore file names prefixed with underscore.
|
|
11
11
|
const scssPattern = path.resolve(rootDir, 'components/**/!(_*).scss');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emulsify/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Bundled tooling for Storybook development + Webpack Build",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component library",
|
|
@@ -131,6 +131,5 @@
|
|
|
131
131
|
},
|
|
132
132
|
"overrides": {
|
|
133
133
|
"graceful-fs": "^4.2.11"
|
|
134
|
-
}
|
|
135
|
-
"main": "commitlint.config.js"
|
|
134
|
+
}
|
|
136
135
|
}
|