@emulsify/core 0.0.0-development → 1.1.2
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/.github/workflows/contributors.yml +1 -1
- package/.history/.github/workflows/addtoprojects_20240130164835.yml +21 -0
- package/.history/.github/workflows/addtoprojects_20240607213528.yml +21 -0
- package/.history/.github/workflows/contributors_20240130164835.yml +23 -0
- package/.history/.github/workflows/contributors_20240607213836.yml +23 -0
- package/.history/.storybook/main_20240401184129.js +22 -0
- package/.history/.storybook/main_20240607162805.js +22 -0
- package/.history/.storybook/main_20240610082738.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/preview_20240610083720.js +37 -0
- package/.history/.storybook/preview_20240610083852.js +30 -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/loaders_20240401184511.js +87 -0
- package/.history/config/webpack/loaders_20240610084138.js +87 -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 +6 -6
- package/.storybook/manager.js +1 -1
- package/.storybook/preview.js +2 -12
- 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/loaders.js +2 -2
- 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 +5 -6
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Add to projects
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
pull_request:
|
|
8
|
+
types:
|
|
9
|
+
- opened
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
add-to-project:
|
|
13
|
+
name: Add issue to project
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/add-to-project@v0.3.0
|
|
17
|
+
with:
|
|
18
|
+
# You can target a repository in a different organization
|
|
19
|
+
# to the issue
|
|
20
|
+
project-url: https://github.com/orgs/emulsify-ds/projects/6
|
|
21
|
+
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Add to projects
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
pull_request:
|
|
8
|
+
types:
|
|
9
|
+
- opened
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
add-to-project:
|
|
13
|
+
name: Add issue to project
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/add-to-project@v0.3.0
|
|
17
|
+
with:
|
|
18
|
+
# You can target a repository in a different organization
|
|
19
|
+
# to the issue
|
|
20
|
+
project-url: https://github.com/orgs/emulsify-ds/projects/6
|
|
21
|
+
token: ${{ secrets.ADD_TO_PROJECT_PAT }}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Add contributors
|
|
2
|
+
on:
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: "20 20 * * *"
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- master
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
add-contributors:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v2
|
|
14
|
+
- uses: BobAnkh/add-contributors@master
|
|
15
|
+
with:
|
|
16
|
+
CONTRIBUTOR: "### Contributors"
|
|
17
|
+
COLUMN_PER_ROW: "6"
|
|
18
|
+
ACCESS_TOKEN: ${{secrets.ADD_TO_PROJECT_PAT}}
|
|
19
|
+
IMG_WIDTH: "100"
|
|
20
|
+
FONT_SIZE: "14"
|
|
21
|
+
PATH: "/README.md"
|
|
22
|
+
COMMIT_MESSAGE: "docs(README): update contributors"
|
|
23
|
+
AVATAR_SHAPE: "round"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Add contributors
|
|
2
|
+
on:
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: "20 20 * * *"
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
add-contributors:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v2
|
|
14
|
+
- uses: BobAnkh/add-contributors@master
|
|
15
|
+
with:
|
|
16
|
+
CONTRIBUTOR: "### Contributors"
|
|
17
|
+
COLUMN_PER_ROW: "6"
|
|
18
|
+
ACCESS_TOKEN: ${{secrets.ADD_TO_PROJECT_PAT}}
|
|
19
|
+
IMG_WIDTH: "100"
|
|
20
|
+
FONT_SIZE: "14"
|
|
21
|
+
PATH: "/README.md"
|
|
22
|
+
COMMIT_MESSAGE: "docs(README): update contributors"
|
|
23
|
+
AVATAR_SHAPE: "round"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
stories: [
|
|
3
|
+
'../../../components/**/*.stories.@(js|jsx|ts|tsx)',
|
|
4
|
+
],
|
|
5
|
+
addons: [
|
|
6
|
+
'../../@storybook/addon-a11y',
|
|
7
|
+
'../../@storybook/addon-links',
|
|
8
|
+
'../../@storybook/addon-essentials',
|
|
9
|
+
'../../@storybook/addon-themes',
|
|
10
|
+
'../../@storybook/addon-styling-webpack'
|
|
11
|
+
],
|
|
12
|
+
core: {
|
|
13
|
+
builder: 'webpack5',
|
|
14
|
+
},
|
|
15
|
+
framework: {
|
|
16
|
+
name: '@storybook/html-webpack5',
|
|
17
|
+
options: {},
|
|
18
|
+
},
|
|
19
|
+
docs: {
|
|
20
|
+
autodocs: true,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
stories: [
|
|
3
|
+
'../../../../components/**/*.stories.@(js|jsx|ts|tsx)',
|
|
4
|
+
],
|
|
5
|
+
addons: [
|
|
6
|
+
'../../@storybook/addon-a11y',
|
|
7
|
+
'../../@storybook/addon-links',
|
|
8
|
+
'../../@storybook/addon-essentials',
|
|
9
|
+
'../../@storybook/addon-themes',
|
|
10
|
+
'../../@storybook/addon-styling-webpack'
|
|
11
|
+
],
|
|
12
|
+
core: {
|
|
13
|
+
builder: 'webpack5',
|
|
14
|
+
},
|
|
15
|
+
framework: {
|
|
16
|
+
name: '@storybook/html-webpack5',
|
|
17
|
+
options: {},
|
|
18
|
+
},
|
|
19
|
+
docs: {
|
|
20
|
+
autodocs: true,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
stories: [
|
|
3
|
+
'../../../../components/**/*.stories.@(js|jsx|ts|tsx)',
|
|
4
|
+
],
|
|
5
|
+
addons: [
|
|
6
|
+
'../../../@storybook/addon-a11y',
|
|
7
|
+
'../../../@storybook/addon-links',
|
|
8
|
+
'../../../@storybook/addon-essentials',
|
|
9
|
+
'../../../@storybook/addon-themes',
|
|
10
|
+
'../../../@storybook/addon-styling-webpack'
|
|
11
|
+
],
|
|
12
|
+
core: {
|
|
13
|
+
builder: 'webpack5',
|
|
14
|
+
},
|
|
15
|
+
framework: {
|
|
16
|
+
name: '@storybook/html-webpack5',
|
|
17
|
+
options: {},
|
|
18
|
+
},
|
|
19
|
+
docs: {
|
|
20
|
+
autodocs: true,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { addons } from '@storybook/addons';
|
|
2
|
+
|
|
3
|
+
import emulsifyTheme from './emulsifyTheme';
|
|
4
|
+
|
|
5
|
+
import('../../../config/emulsify-core/storybook/theme')
|
|
6
|
+
.then((customTheme) => {
|
|
7
|
+
addons.setConfig({
|
|
8
|
+
theme: customTheme.default,
|
|
9
|
+
});
|
|
10
|
+
})
|
|
11
|
+
.catch(() => {
|
|
12
|
+
addons.setConfig({
|
|
13
|
+
theme: emulsifyTheme,
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { addons } from '@storybook/addons';
|
|
2
|
+
|
|
3
|
+
import emulsifyTheme from './emulsifyTheme';
|
|
4
|
+
|
|
5
|
+
import('../../../../config/emulsify-core/storybook/theme')
|
|
6
|
+
.then((customTheme) => {
|
|
7
|
+
addons.setConfig({
|
|
8
|
+
theme: customTheme.default,
|
|
9
|
+
});
|
|
10
|
+
})
|
|
11
|
+
.catch(() => {
|
|
12
|
+
addons.setConfig({
|
|
13
|
+
theme: emulsifyTheme,
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useEffect } from '@storybook/client-api';
|
|
2
|
+
import Twig from 'twig';
|
|
3
|
+
import { setupTwig } from './setupTwig';
|
|
4
|
+
|
|
5
|
+
// GLOBAL CSS
|
|
6
|
+
(async () => {
|
|
7
|
+
let compiled;
|
|
8
|
+
try {
|
|
9
|
+
compiled = await import('../../../dist/css/style.css');
|
|
10
|
+
} catch (e) {}
|
|
11
|
+
})();
|
|
12
|
+
|
|
13
|
+
// Custom theme preview config if it exists.
|
|
14
|
+
(async () => {
|
|
15
|
+
let preview;
|
|
16
|
+
try {
|
|
17
|
+
preview = await import('../../../config/emulsify-core/storybook/preview');
|
|
18
|
+
} catch (e) {}
|
|
19
|
+
})();
|
|
20
|
+
|
|
21
|
+
// If in a Drupal project, it's recommended to import a symlinked version of drupal.js.
|
|
22
|
+
import './_drupal.js';
|
|
23
|
+
|
|
24
|
+
export const decorators = [
|
|
25
|
+
(Story, { args }) => {
|
|
26
|
+
const { renderAs } = args || {};
|
|
27
|
+
|
|
28
|
+
// Usual emulsify hack to add Drupal behaviors.
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
Drupal.attachBehaviors();
|
|
31
|
+
}, [args]);
|
|
32
|
+
return Story();
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
setupTwig(Twig);
|
|
37
|
+
|
|
38
|
+
export const parameters = {
|
|
39
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useEffect } from '@storybook/client-api';
|
|
2
|
+
import Twig from 'twig';
|
|
3
|
+
import { setupTwig } from './setupTwig';
|
|
4
|
+
|
|
5
|
+
// GLOBAL CSS
|
|
6
|
+
(async () => {
|
|
7
|
+
let compiled;
|
|
8
|
+
try {
|
|
9
|
+
compiled = await import('../../../../dist/css/style.css');
|
|
10
|
+
} catch (e) {}
|
|
11
|
+
})();
|
|
12
|
+
|
|
13
|
+
// Custom theme preview config if it exists.
|
|
14
|
+
(async () => {
|
|
15
|
+
let preview;
|
|
16
|
+
try {
|
|
17
|
+
preview = await import('../../../../config/emulsify-core/storybook/preview');
|
|
18
|
+
} catch (e) {}
|
|
19
|
+
})();
|
|
20
|
+
|
|
21
|
+
// If in a Drupal project, it's recommended to import a symlinked version of drupal.js.
|
|
22
|
+
import './_drupal.js';
|
|
23
|
+
|
|
24
|
+
export const decorators = [
|
|
25
|
+
(Story, { args }) => {
|
|
26
|
+
const { renderAs } = args || {};
|
|
27
|
+
|
|
28
|
+
// Usual emulsify hack to add Drupal behaviors.
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
Drupal.attachBehaviors();
|
|
31
|
+
}, [args]);
|
|
32
|
+
return Story();
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
setupTwig(Twig);
|
|
37
|
+
|
|
38
|
+
export const parameters = {
|
|
39
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
40
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useEffect } from '@storybook/client-api';
|
|
2
|
+
import Twig from 'twig';
|
|
3
|
+
import { setupTwig } from './setupTwig';
|
|
4
|
+
|
|
5
|
+
(async () => {
|
|
6
|
+
let compiled;
|
|
7
|
+
let preview;
|
|
8
|
+
// GLOBAL CSS
|
|
9
|
+
try {
|
|
10
|
+
compiled = await import('../../../dist/css/style.css');
|
|
11
|
+
} catch (e) { }
|
|
12
|
+
// Custom theme preview config if it exists.
|
|
13
|
+
try {
|
|
14
|
+
preview = await import('../../../../config/emulsify-core/storybook/preview');
|
|
15
|
+
} catch (e) {}
|
|
16
|
+
})();
|
|
17
|
+
|
|
18
|
+
// If in a Drupal project, it's recommended to import a symlinked version of drupal.js.
|
|
19
|
+
import './_drupal.js';
|
|
20
|
+
|
|
21
|
+
export const decorators = [
|
|
22
|
+
(Story, { args }) => {
|
|
23
|
+
const { renderAs } = args || {};
|
|
24
|
+
|
|
25
|
+
// Usual emulsify hack to add Drupal behaviors.
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
Drupal.attachBehaviors();
|
|
28
|
+
}, [args]);
|
|
29
|
+
return Story();
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
setupTwig(Twig);
|
|
34
|
+
|
|
35
|
+
export const parameters = {
|
|
36
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
37
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useEffect } from '@storybook/client-api';
|
|
2
|
+
import Twig from 'twig';
|
|
3
|
+
import { setupTwig } from './setupTwig';
|
|
4
|
+
|
|
5
|
+
// GLOBAL CSS
|
|
6
|
+
import('../../../../dist/css/style.css');
|
|
7
|
+
|
|
8
|
+
// Custom theme preview config if it exists.
|
|
9
|
+
import('../../../../config/emulsify-core/storybook/preview');
|
|
10
|
+
|
|
11
|
+
// If in a Drupal project, it's recommended to import a symlinked version of drupal.js.
|
|
12
|
+
import './_drupal.js';
|
|
13
|
+
|
|
14
|
+
export const decorators = [
|
|
15
|
+
(Story, { args }) => {
|
|
16
|
+
const { renderAs } = args || {};
|
|
17
|
+
|
|
18
|
+
// Usual emulsify hack to add Drupal behaviors.
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
Drupal.attachBehaviors();
|
|
21
|
+
}, [args]);
|
|
22
|
+
return Story();
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
setupTwig(Twig);
|
|
27
|
+
|
|
28
|
+
export const parameters = {
|
|
29
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
30
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
jest.mock('path', () => ({
|
|
2
|
+
resolve: (...paths) => `${paths[1]}${paths[2]}`,
|
|
3
|
+
}));
|
|
4
|
+
jest.mock('twig-drupal-filters', () => jest.fn());
|
|
5
|
+
jest.mock('bem-twig-extension', () => jest.fn());
|
|
6
|
+
jest.mock('add-attributes-twig-extension', () => jest.fn());
|
|
7
|
+
|
|
8
|
+
import Twig from 'twig';
|
|
9
|
+
import twigDrupal from 'twig-drupal-filters';
|
|
10
|
+
import twigBEM from 'bem-twig-extension';
|
|
11
|
+
import twigAddAttributes from 'add-attributes-twig-extension';
|
|
12
|
+
|
|
13
|
+
import { namespaces, setupTwig } from './setupTwig';
|
|
14
|
+
|
|
15
|
+
describe('setupTwig', () => {
|
|
16
|
+
it('sets up a twig object with drupal, bem, and attribute decorations', () => {
|
|
17
|
+
expect.assertions(3);
|
|
18
|
+
setupTwig(Twig);
|
|
19
|
+
expect(twigDrupal).toHaveBeenCalledWith(Twig);
|
|
20
|
+
expect(twigBEM).toHaveBeenCalledWith(Twig);
|
|
21
|
+
expect(twigAddAttributes).toHaveBeenCalledWith(Twig);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('exports emulsifys namespaces', () => {
|
|
25
|
+
expect(namespaces).toEqual({
|
|
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
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
jest.mock('path', () => ({
|
|
2
|
+
resolve: (...paths) => `${paths[1]}${paths[2]}`,
|
|
3
|
+
}));
|
|
4
|
+
jest.mock('twig-drupal-filters', () => jest.fn());
|
|
5
|
+
jest.mock('bem-twig-extension', () => jest.fn());
|
|
6
|
+
jest.mock('add-attributes-twig-extension', () => jest.fn());
|
|
7
|
+
|
|
8
|
+
import Twig from 'twig';
|
|
9
|
+
import twigDrupal from 'twig-drupal-filters';
|
|
10
|
+
import twigBEM from 'bem-twig-extension';
|
|
11
|
+
import twigAddAttributes from 'add-attributes-twig-extension';
|
|
12
|
+
|
|
13
|
+
import { namespaces, setupTwig } from './setupTwig';
|
|
14
|
+
|
|
15
|
+
describe('setupTwig', () => {
|
|
16
|
+
it('sets up a twig object with drupal, bem, and attribute decorations', () => {
|
|
17
|
+
expect.assertions(3);
|
|
18
|
+
setupTwig(Twig);
|
|
19
|
+
expect(twigDrupal).toHaveBeenCalledWith(Twig);
|
|
20
|
+
expect(twigBEM).toHaveBeenCalledWith(Twig);
|
|
21
|
+
expect(twigAddAttributes).toHaveBeenCalledWith(Twig);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('exports emulsifys namespaces', () => {
|
|
25
|
+
expect(namespaces).toEqual({
|
|
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
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const { resolve } = require('path');
|
|
2
|
+
const twigDrupal = require('twig-drupal-filters');
|
|
3
|
+
const twigBEM = require('bem-twig-extension');
|
|
4
|
+
const twigAddAttributes = require('add-attributes-twig-extension');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Fetches project-based variant configuration. If no such configuration
|
|
8
|
+
* exists, returns default values.
|
|
9
|
+
*
|
|
10
|
+
* @returns project-based variant configuration, or default config.
|
|
11
|
+
*/
|
|
12
|
+
const fetchVariantConfig = () => {
|
|
13
|
+
try {
|
|
14
|
+
return require('../../../project.emulsify.json').variant.structureImplementations;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
name: 'base',
|
|
19
|
+
directory: '../../components/00-base',
|
|
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',
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
module.exports.namespaces = {};
|
|
42
|
+
for (const { name, directory } of fetchVariantConfig()) {
|
|
43
|
+
module.exports.namespaces[name] = resolve(__dirname, '../../../', directory);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Configures and extends a standard twig object.
|
|
48
|
+
*
|
|
49
|
+
* @param {Twig} twig - twig object that should be configured and extended.
|
|
50
|
+
*
|
|
51
|
+
* @returns {Twig} configured twig object.
|
|
52
|
+
*/
|
|
53
|
+
module.exports.setupTwig = function setupTwig(twig) {
|
|
54
|
+
twig.cache();
|
|
55
|
+
twigDrupal(twig);
|
|
56
|
+
twigBEM(twig);
|
|
57
|
+
twigAddAttributes(twig);
|
|
58
|
+
return twig;
|
|
59
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const { resolve } = require('path');
|
|
2
|
+
const twigDrupal = require('twig-drupal-filters');
|
|
3
|
+
const twigBEM = require('bem-twig-extension');
|
|
4
|
+
const twigAddAttributes = require('add-attributes-twig-extension');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Fetches project-based variant configuration. If no such configuration
|
|
8
|
+
* exists, returns default values as a flat component structure.
|
|
9
|
+
*
|
|
10
|
+
* @returns project-based variant configuration, or default config.
|
|
11
|
+
*/
|
|
12
|
+
const fetchVariantConfig = () => {
|
|
13
|
+
try {
|
|
14
|
+
return require('../../../../project.emulsify.json').variant.structureImplementations;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
name: 'components',
|
|
19
|
+
directory: '../../../../components',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
module.exports.namespaces = {};
|
|
26
|
+
for (const { name, directory } of fetchVariantConfig()) {
|
|
27
|
+
module.exports.namespaces[name] = resolve(__dirname, '../../../', directory);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Configures and extends a standard twig object.
|
|
32
|
+
*
|
|
33
|
+
* @param {Twig} twig - twig object that should be configured and extended.
|
|
34
|
+
*
|
|
35
|
+
* @returns {Twig} configured twig object.
|
|
36
|
+
*/
|
|
37
|
+
module.exports.setupTwig = function setupTwig(twig) {
|
|
38
|
+
twig.cache();
|
|
39
|
+
twigDrupal(twig);
|
|
40
|
+
twigBEM(twig);
|
|
41
|
+
twigAddAttributes(twig);
|
|
42
|
+
return twig;
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const { resolve } = require('path');
|
|
2
|
+
const twigDrupal = require('twig-drupal-filters');
|
|
3
|
+
const twigBEM = require('bem-twig-extension');
|
|
4
|
+
const twigAddAttributes = require('add-attributes-twig-extension');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Fetches project-based variant configuration. If no such configuration
|
|
8
|
+
* exists, returns default values as a flat component structure.
|
|
9
|
+
*
|
|
10
|
+
* @returns project-based variant configuration, or default config.
|
|
11
|
+
*/
|
|
12
|
+
const fetchVariantConfig = () => {
|
|
13
|
+
try {
|
|
14
|
+
return require('../../../../project.emulsify.json').variant.structureImplementations;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
name: 'components',
|
|
19
|
+
directory: '../../../../components',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
module.exports.namespaces = {};
|
|
26
|
+
for (const { name, directory } of fetchVariantConfig()) {
|
|
27
|
+
module.exports.namespaces[name] = resolve(__dirname, '../../../../', directory);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Configures and extends a standard twig object.
|
|
32
|
+
*
|
|
33
|
+
* @param {Twig} twig - twig object that should be configured and extended.
|
|
34
|
+
*
|
|
35
|
+
* @returns {Twig} configured twig object.
|
|
36
|
+
*/
|
|
37
|
+
module.exports.setupTwig = function setupTwig(twig) {
|
|
38
|
+
twig.cache();
|
|
39
|
+
twigDrupal(twig);
|
|
40
|
+
twigBEM(twig);
|
|
41
|
+
twigAddAttributes(twig);
|
|
42
|
+
return twig;
|
|
43
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
> [!WARNING]
|
|
2
|
+
> Work in progress.
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
# Emulsify Core
|
|
7
|
+
|
|
8
|
+
An open-source toolset for creating and implementing design systems.
|
|
9
|
+
|
|
10
|
+
### Storybook development and Webpack build
|
|
11
|
+
|
|
12
|
+
**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
|
+
|
|
14
|
+
## Documentation
|
|
15
|
+
|
|
16
|
+
[docs.emulsify.info](https://emulsify.info/docs)
|
|
17
|
+
|
|
18
|
+
### Quick Links
|
|
19
|
+
|
|
20
|
+
1. [Installation](https://www.emulsify.info/docs/emulsify-drupal)
|
|
21
|
+
2. [Usage](https://www.emulsify.info/docs/emulsify-drupal/basic-usage/commands)
|
|
22
|
+
|
|
23
|
+
## Demo
|
|
24
|
+
|
|
25
|
+
1. [Storybook](http://storybook.emulsify.info/)
|
|
26
|
+
|
|
27
|
+
## Contributing
|
|
28
|
+
|
|
29
|
+
### [Code of Conduct](https://github.com/emulsify-ds/emulsify-drupal/blob/master/CODE_OF_CONDUCT.md)
|
|
30
|
+
|
|
31
|
+
The project maintainers have adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
|
|
32
|
+
|
|
33
|
+
### Contribution Guide
|
|
34
|
+
|
|
35
|
+
Please also follow the issue template and pull request templates provided. See below for the correct places to post issues:
|
|
36
|
+
|
|
37
|
+
1. [Emulsify Drupal](https://github.com/emulsify-ds/emulsify-drupal/issues)
|
|
38
|
+
2. [Emulsify Twig Extensions](https://github.com/emulsify-ds/emulsify-twig-extensions/issues)
|
|
39
|
+
3. [Emulsify Tools (Drupal module)](https://www.drupal.org/project/issues/emulsify_tools)
|
|
40
|
+
|
|
41
|
+
### Committing Changes
|
|
42
|
+
|
|
43
|
+
To facilitate automatic semantic release versioning, we utilize the [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog) standard through Commitizen. Follow these steps when commiting your work to ensure semantic release can version correctly.
|
|
44
|
+
|
|
45
|
+
1. Stage your changes, ensuring they encompass exactly what you wish to change, no more.
|
|
46
|
+
2. Run the `commit` script via `yarn commit` or `npm run commit` and follow the prompts to craft the perfect commit message.
|
|
47
|
+
3. Your commit message will be used to create the changelog for the next version that includes that commit.
|
|
48
|
+
|
|
49
|
+
## Author
|
|
50
|
+
|
|
51
|
+
Emulsify® is a product of [Four Kitchens](https://fourkitchens.com).
|
|
52
|
+
|
|
53
|
+
### Contributors
|
|
54
|
+
|
|
55
|
+
<table>
|
|
56
|
+
<tr>
|
|
57
|
+
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
|
|
58
|
+
<a href=https://github.com/callinmullaney>
|
|
59
|
+
<img src=https://avatars.githubusercontent.com/u/369018?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Callin Mullaney/>
|
|
60
|
+
<br />
|
|
61
|
+
<sub style="font-size:14px"><b>Callin Mullaney</b></sub>
|
|
62
|
+
</a>
|
|
63
|
+
</td>
|
|
64
|
+
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
|
|
65
|
+
<a href=https://github.com/amazingrando>
|
|
66
|
+
<img src=https://avatars.githubusercontent.com/u/409903?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=Randy Oest/>
|
|
67
|
+
<br />
|
|
68
|
+
<sub style="font-size:14px"><b>Randy Oest</b></sub>
|
|
69
|
+
</a>
|
|
70
|
+
</td>
|
|
71
|
+
</tr>
|
|
72
|
+
</table>
|