handoff-app 0.4.1 → 0.4.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/Changelog.md +27 -0
- package/default-config.js +74 -0
- package/figma-exporter/dist/declarations/src/transformers/integration/index.d.ts +5 -1
- package/figma-exporter/dist/figma-exporter.cjs.dev.js +10 -6
- package/figma-exporter/dist/figma-exporter.cjs.prod.js +10 -6
- package/figma-exporter/src/index.ts +0 -1
- package/figma-exporter/src/transformers/integration/index.ts +12 -7
- package/figma-exporter/src/utils/preview.ts +1 -0
- package/installer/template/config.js +1 -3
- package/installer/template/package.json +4 -4
- package/installer/template/pages/styles/accessability.md +3 -3
- package/installer/template/pages/styles.md +2 -2
- package/integrations/bootstrap/5.2/templates/main.scss +1 -1
- package/package.json +1 -1
- package/public/assets/icons.html +33 -33
- package/public/assets/icons.svg +1 -1
- package/public/tokens.zip +0 -0
- package/scripts/build/scripts.js +71 -33
- package/scripts/watch.js +10 -3
package/Changelog.md
CHANGED
|
@@ -6,9 +6,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [0.4.2] - 2023-04-16
|
|
10
|
+
|
|
11
|
+
When 0.4.0 was released, we found a structural problem with the way
|
|
12
|
+
integrations were published into projects. 0.4.1 resolved a couple of issues,
|
|
13
|
+
but a couple of significant new pieces of code were required to fully resolve
|
|
14
|
+
the issue.
|
|
15
|
+
|
|
16
|
+
The resolution is fixing paths so that they work properly when running the
|
|
17
|
+
handoff source as well as running handoff in a project.
|
|
18
|
+
|
|
19
|
+
### Bugfixes
|
|
20
|
+
|
|
21
|
+
- Build and Start scripts were restructured to handle sparsely merging sass and
|
|
22
|
+
templates into the source directory.
|
|
23
|
+
- The integration transformer was restructured to support correct path
|
|
24
|
+
- The webpack config has been altered to support paths in projects
|
|
25
|
+
- The bootstrap templates were updated to use this updated path structure
|
|
26
|
+
|
|
27
|
+
### Improvements
|
|
28
|
+
|
|
29
|
+
- The figma exporter built library built code is now published to the repo to
|
|
30
|
+
make it easier to test pre release code
|
|
31
|
+
- A default config is now part of the project so that projects that can inherit
|
|
32
|
+
a config rather than having to keep their config up to date.
|
|
33
|
+
- The installer now has the proper script paths in the package
|
|
34
|
+
|
|
9
35
|
## [0.4.1] - 2023-04-16
|
|
10
36
|
|
|
11
37
|
### Bugfixes
|
|
38
|
+
|
|
12
39
|
- Fixes a typing error in the project config
|
|
13
40
|
- Fixes an issue where the path of the integrations are relative to the project
|
|
14
41
|
- Fixes an issue where local integrations aren't properly merged on watch
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: 'Convertiv Design System',
|
|
3
|
+
client: 'Convertiv',
|
|
4
|
+
google_tag_manager: null,
|
|
5
|
+
integration: {
|
|
6
|
+
name: 'bootstrap',
|
|
7
|
+
version: '5.2',
|
|
8
|
+
},
|
|
9
|
+
favicon: '/favicon.ico',
|
|
10
|
+
logo: '/logo.svg',
|
|
11
|
+
poweredBy: true,
|
|
12
|
+
type_sort: [
|
|
13
|
+
'Heading 1',
|
|
14
|
+
'Heading 2',
|
|
15
|
+
'Heading 3',
|
|
16
|
+
'Heading 4',
|
|
17
|
+
'Heading 5',
|
|
18
|
+
'Heading 6',
|
|
19
|
+
'Paragraph',
|
|
20
|
+
'Subheading',
|
|
21
|
+
'Blockquote',
|
|
22
|
+
'Input Labels',
|
|
23
|
+
'Link',
|
|
24
|
+
],
|
|
25
|
+
figma: {
|
|
26
|
+
size: [
|
|
27
|
+
{
|
|
28
|
+
figma: 'small',
|
|
29
|
+
css: 'sm',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
figma: 'medium',
|
|
33
|
+
css: 'md',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
figma: 'large',
|
|
37
|
+
css: 'lg',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
components: {
|
|
41
|
+
alert: {
|
|
42
|
+
search: 'Alert',
|
|
43
|
+
},
|
|
44
|
+
button: {
|
|
45
|
+
search: 'Button',
|
|
46
|
+
},
|
|
47
|
+
checkbox: {
|
|
48
|
+
search: 'Checkbox',
|
|
49
|
+
},
|
|
50
|
+
input: {
|
|
51
|
+
search: 'Input',
|
|
52
|
+
},
|
|
53
|
+
modal: {
|
|
54
|
+
search: 'Modal',
|
|
55
|
+
},
|
|
56
|
+
pagination: null,
|
|
57
|
+
radio: {
|
|
58
|
+
search: 'Radio',
|
|
59
|
+
},
|
|
60
|
+
select: {
|
|
61
|
+
search: 'Select',
|
|
62
|
+
},
|
|
63
|
+
switch: {
|
|
64
|
+
search: 'Switch',
|
|
65
|
+
},
|
|
66
|
+
tooltip: {
|
|
67
|
+
search: 'Tooltip',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
type_copy: 'Almost before we knew it, we had left the ground.',
|
|
72
|
+
color_sort: ['primary', 'secondary', 'extra', 'system'],
|
|
73
|
+
component_sort: ['primary', 'secondary', 'transparent'],
|
|
74
|
+
};
|
|
@@ -7,7 +7,11 @@ import * as stream from 'node:stream';
|
|
|
7
7
|
* integration if desired
|
|
8
8
|
*/
|
|
9
9
|
export declare const getPathToIntegration: () => string;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Get the name of the current integration
|
|
12
|
+
* @returns string
|
|
13
|
+
*/
|
|
14
|
+
export declare const getIntegrationName: () => string;
|
|
11
15
|
/**
|
|
12
16
|
* Find the integration to sync and sync the sass files and template files.
|
|
13
17
|
*/
|
|
@@ -5196,7 +5196,7 @@ const buildClientFiles = () => {
|
|
|
5196
5196
|
mode: 'production',
|
|
5197
5197
|
entry: path__default["default"].resolve(__dirname, '../../templates/main.js'),
|
|
5198
5198
|
resolve: {
|
|
5199
|
-
modules: [path__default["default"].resolve(__dirname, '../..'), path__default["default"].resolve(__dirname, '../../node_modules'), path__default["default"].resolve(__dirname, '../../../../node_modules')]
|
|
5199
|
+
modules: [path__default["default"].resolve(__dirname, '../..'), path__default["default"].resolve(__dirname, '../../..'), path__default["default"].resolve(__dirname, '../../node_modules'), path__default["default"].resolve(__dirname, '../../../../node_modules')]
|
|
5200
5200
|
},
|
|
5201
5201
|
output: {
|
|
5202
5202
|
path: path__default["default"].resolve(__dirname, '../../public/components'),
|
|
@@ -9744,18 +9744,18 @@ const getPathToIntegration = () => {
|
|
|
9744
9744
|
const integrationFolder = 'integrations';
|
|
9745
9745
|
const defaultIntegration = 'bootstrap';
|
|
9746
9746
|
const defaultVersion = '5.2';
|
|
9747
|
-
const defaultPath = path__default["default"].resolve(path__default["default"].join(__dirname, integrationFolder, defaultIntegration, defaultVersion));
|
|
9747
|
+
const defaultPath = path__default["default"].resolve(path__default["default"].join(__dirname, '../..', integrationFolder, defaultIntegration, defaultVersion));
|
|
9748
9748
|
const config = documentationObject.getFetchConfig();
|
|
9749
9749
|
if (config.integration) {
|
|
9750
9750
|
if (config.integration.name === 'custom') {
|
|
9751
9751
|
// Look for a custom integration
|
|
9752
|
-
const customPath = path__default["default"].resolve(path__default["default"].join(
|
|
9752
|
+
const customPath = path__default["default"].resolve(path__default["default"].join(__dirname, '../..', integrationFolder));
|
|
9753
9753
|
if (!fs__namespace["default"].existsSync(customPath)) {
|
|
9754
9754
|
throw Error(`The config is set to use a custom integration but no custom integration found at integrations/custom`);
|
|
9755
9755
|
}
|
|
9756
9756
|
return customPath;
|
|
9757
9757
|
}
|
|
9758
|
-
const searchPath = path__default["default"].resolve(path__default["default"].join(integrationFolder, config.integration.name, config.integration.version));
|
|
9758
|
+
const searchPath = path__default["default"].resolve(path__default["default"].join(__dirname, '../..', integrationFolder, config.integration.name, config.integration.version));
|
|
9759
9759
|
if (!fs__namespace["default"].existsSync(searchPath)) {
|
|
9760
9760
|
throw Error(`The requested integration was ${config.integration.name} version ${config.integration.version} but no integration plugin with that name was found`);
|
|
9761
9761
|
}
|
|
@@ -9763,6 +9763,11 @@ const getPathToIntegration = () => {
|
|
|
9763
9763
|
}
|
|
9764
9764
|
return defaultPath;
|
|
9765
9765
|
};
|
|
9766
|
+
|
|
9767
|
+
/**
|
|
9768
|
+
* Get the name of the current integration
|
|
9769
|
+
* @returns string
|
|
9770
|
+
*/
|
|
9766
9771
|
const getIntegrationName = () => {
|
|
9767
9772
|
const config = documentationObject.getFetchConfig();
|
|
9768
9773
|
const defaultIntegration = 'bootstrap';
|
|
@@ -9782,7 +9787,7 @@ async function integrationTransformer() {
|
|
|
9782
9787
|
const integrationPath = getPathToIntegration();
|
|
9783
9788
|
const integrationName = getIntegrationName();
|
|
9784
9789
|
const sassFolder = `exported/${integrationName}-tokens`;
|
|
9785
|
-
const templatesFolder =
|
|
9790
|
+
const templatesFolder = path__default["default"].resolve(__dirname, '../../templates');
|
|
9786
9791
|
const integrationsSass = path__default["default"].resolve(integrationPath, 'sass');
|
|
9787
9792
|
const integrationTemplates = path__default["default"].resolve(integrationPath, 'templates');
|
|
9788
9793
|
fs__namespace["default"].copySync(integrationsSass, sassFolder);
|
|
@@ -9876,7 +9881,6 @@ const buildCustomFonts = async documentationObject => {
|
|
|
9876
9881
|
const buildIntegration = async documentationObject => {
|
|
9877
9882
|
return await integrationTransformer();
|
|
9878
9883
|
};
|
|
9879
|
-
|
|
9880
9884
|
/**
|
|
9881
9885
|
* Run just the preview
|
|
9882
9886
|
* @param documentationObject
|
|
@@ -5196,7 +5196,7 @@ const buildClientFiles = () => {
|
|
|
5196
5196
|
mode: 'production',
|
|
5197
5197
|
entry: path__default["default"].resolve(__dirname, '../../templates/main.js'),
|
|
5198
5198
|
resolve: {
|
|
5199
|
-
modules: [path__default["default"].resolve(__dirname, '../..'), path__default["default"].resolve(__dirname, '../../node_modules'), path__default["default"].resolve(__dirname, '../../../../node_modules')]
|
|
5199
|
+
modules: [path__default["default"].resolve(__dirname, '../..'), path__default["default"].resolve(__dirname, '../../..'), path__default["default"].resolve(__dirname, '../../node_modules'), path__default["default"].resolve(__dirname, '../../../../node_modules')]
|
|
5200
5200
|
},
|
|
5201
5201
|
output: {
|
|
5202
5202
|
path: path__default["default"].resolve(__dirname, '../../public/components'),
|
|
@@ -9744,18 +9744,18 @@ const getPathToIntegration = () => {
|
|
|
9744
9744
|
const integrationFolder = 'integrations';
|
|
9745
9745
|
const defaultIntegration = 'bootstrap';
|
|
9746
9746
|
const defaultVersion = '5.2';
|
|
9747
|
-
const defaultPath = path__default["default"].resolve(path__default["default"].join(__dirname, integrationFolder, defaultIntegration, defaultVersion));
|
|
9747
|
+
const defaultPath = path__default["default"].resolve(path__default["default"].join(__dirname, '../..', integrationFolder, defaultIntegration, defaultVersion));
|
|
9748
9748
|
const config = documentationObject.getFetchConfig();
|
|
9749
9749
|
if (config.integration) {
|
|
9750
9750
|
if (config.integration.name === 'custom') {
|
|
9751
9751
|
// Look for a custom integration
|
|
9752
|
-
const customPath = path__default["default"].resolve(path__default["default"].join(
|
|
9752
|
+
const customPath = path__default["default"].resolve(path__default["default"].join(__dirname, '../..', integrationFolder));
|
|
9753
9753
|
if (!fs__namespace["default"].existsSync(customPath)) {
|
|
9754
9754
|
throw Error(`The config is set to use a custom integration but no custom integration found at integrations/custom`);
|
|
9755
9755
|
}
|
|
9756
9756
|
return customPath;
|
|
9757
9757
|
}
|
|
9758
|
-
const searchPath = path__default["default"].resolve(path__default["default"].join(integrationFolder, config.integration.name, config.integration.version));
|
|
9758
|
+
const searchPath = path__default["default"].resolve(path__default["default"].join(__dirname, '../..', integrationFolder, config.integration.name, config.integration.version));
|
|
9759
9759
|
if (!fs__namespace["default"].existsSync(searchPath)) {
|
|
9760
9760
|
throw Error(`The requested integration was ${config.integration.name} version ${config.integration.version} but no integration plugin with that name was found`);
|
|
9761
9761
|
}
|
|
@@ -9763,6 +9763,11 @@ const getPathToIntegration = () => {
|
|
|
9763
9763
|
}
|
|
9764
9764
|
return defaultPath;
|
|
9765
9765
|
};
|
|
9766
|
+
|
|
9767
|
+
/**
|
|
9768
|
+
* Get the name of the current integration
|
|
9769
|
+
* @returns string
|
|
9770
|
+
*/
|
|
9766
9771
|
const getIntegrationName = () => {
|
|
9767
9772
|
const config = documentationObject.getFetchConfig();
|
|
9768
9773
|
const defaultIntegration = 'bootstrap';
|
|
@@ -9782,7 +9787,7 @@ async function integrationTransformer() {
|
|
|
9782
9787
|
const integrationPath = getPathToIntegration();
|
|
9783
9788
|
const integrationName = getIntegrationName();
|
|
9784
9789
|
const sassFolder = `exported/${integrationName}-tokens`;
|
|
9785
|
-
const templatesFolder =
|
|
9790
|
+
const templatesFolder = path__default["default"].resolve(__dirname, '../../templates');
|
|
9786
9791
|
const integrationsSass = path__default["default"].resolve(integrationPath, 'sass');
|
|
9787
9792
|
const integrationTemplates = path__default["default"].resolve(integrationPath, 'templates');
|
|
9788
9793
|
fs__namespace["default"].copySync(integrationsSass, sassFolder);
|
|
@@ -9876,7 +9881,6 @@ const buildCustomFonts = async documentationObject => {
|
|
|
9876
9881
|
const buildIntegration = async documentationObject => {
|
|
9877
9882
|
return await integrationTransformer();
|
|
9878
9883
|
};
|
|
9879
|
-
|
|
9880
9884
|
/**
|
|
9881
9885
|
* Run just the preview
|
|
9882
9886
|
* @param documentationObject
|
|
@@ -67,7 +67,6 @@ const buildCustomFonts = async (documentationObject: DocumentationObject) => {
|
|
|
67
67
|
const buildIntegration = async (documentationObject: DocumentationObject) => {
|
|
68
68
|
return await integrationTransformer();
|
|
69
69
|
};
|
|
70
|
-
|
|
71
70
|
/**
|
|
72
71
|
* Run just the preview
|
|
73
72
|
* @param documentationObject
|
|
@@ -14,19 +14,19 @@ export const getPathToIntegration = () => {
|
|
|
14
14
|
const defaultIntegration = 'bootstrap';
|
|
15
15
|
const defaultVersion = '5.2';
|
|
16
16
|
|
|
17
|
-
const defaultPath = path.resolve(path.join(__dirname, integrationFolder, defaultIntegration, defaultVersion));
|
|
17
|
+
const defaultPath = path.resolve(path.join(__dirname, '../..', integrationFolder, defaultIntegration, defaultVersion));
|
|
18
18
|
|
|
19
19
|
const config = getFetchConfig();
|
|
20
20
|
if (config.integration) {
|
|
21
21
|
if (config.integration.name === 'custom') {
|
|
22
22
|
// Look for a custom integration
|
|
23
|
-
const customPath = path.resolve(path.join(
|
|
23
|
+
const customPath = path.resolve(path.join(__dirname, '../..', integrationFolder));
|
|
24
24
|
if (!fs.existsSync(customPath)) {
|
|
25
25
|
throw Error(`The config is set to use a custom integration but no custom integration found at integrations/custom`);
|
|
26
26
|
}
|
|
27
27
|
return customPath;
|
|
28
28
|
}
|
|
29
|
-
const searchPath = path.resolve(path.join(integrationFolder, config.integration.name, config.integration.version));
|
|
29
|
+
const searchPath = path.resolve(path.join(__dirname, '../..', integrationFolder, config.integration.name, config.integration.version));
|
|
30
30
|
if (!fs.existsSync(searchPath)) {
|
|
31
31
|
throw Error(
|
|
32
32
|
`The requested integration was ${config.integration.name} version ${config.integration.version} but no integration plugin with that name was found`
|
|
@@ -36,7 +36,12 @@ export const getPathToIntegration = () => {
|
|
|
36
36
|
}
|
|
37
37
|
return defaultPath;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the name of the current integration
|
|
42
|
+
* @returns string
|
|
43
|
+
*/
|
|
44
|
+
export const getIntegrationName = (): string => {
|
|
40
45
|
const config = getFetchConfig();
|
|
41
46
|
const defaultIntegration = 'bootstrap';
|
|
42
47
|
if (config.integration) {
|
|
@@ -55,7 +60,7 @@ export default async function integrationTransformer() {
|
|
|
55
60
|
const integrationPath = getPathToIntegration();
|
|
56
61
|
const integrationName = getIntegrationName();
|
|
57
62
|
const sassFolder = `exported/${integrationName}-tokens`;
|
|
58
|
-
const templatesFolder =
|
|
63
|
+
const templatesFolder = path.resolve(__dirname, '../../templates');
|
|
59
64
|
const integrationsSass = path.resolve(integrationPath, 'sass');
|
|
60
65
|
const integrationTemplates = path.resolve(integrationPath, 'templates');
|
|
61
66
|
fs.copySync(integrationsSass, sassFolder);
|
|
@@ -100,11 +105,11 @@ export const addFileToZip = async (directory: string[], dirPath: string, archive
|
|
|
100
105
|
const pathFile = path.join(dirPath, file);
|
|
101
106
|
if (fs.lstatSync(pathFile).isDirectory()) {
|
|
102
107
|
const recurse = await fs.readdir(pathFile);
|
|
103
|
-
archive = await addFileToZip(recurse, pathFile, archive)
|
|
108
|
+
archive = await addFileToZip(recurse, pathFile, archive);
|
|
104
109
|
} else {
|
|
105
110
|
const data = fs.readFileSync(pathFile, 'utf-8');
|
|
106
111
|
archive.append(data, { name: pathFile });
|
|
107
112
|
}
|
|
108
113
|
}
|
|
109
114
|
return archive;
|
|
110
|
-
}
|
|
115
|
+
};
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "node ./node_modules/handoff-app/scripts/watch.js",
|
|
8
8
|
"build": "node node_modules/handoff-app/scripts/build.js",
|
|
9
|
-
"fetch": "node node_modules/handoff-app/
|
|
10
|
-
"transform:preview": "node node_modules/handoff-app/
|
|
11
|
-
"transform:styles": "node node_modules/handoff-app/
|
|
12
|
-
"transform:fonts": "node node_modules/handoff-app/
|
|
9
|
+
"fetch": "node node_modules/handoff-app/scripts/fetch.js",
|
|
10
|
+
"transform:preview": "node node_modules/handoff-app/scripts/fetch.js preview",
|
|
11
|
+
"transform:styles": "node node_modules/handoff-app/scripts/fetch.js styles",
|
|
12
|
+
"transform:fonts": "node node_modules/handoff-app/scripts/fetch.js styles",
|
|
13
13
|
"postinstall": "cd node_modules/handoff-app/figma-exporter && npm install --omit=dev"
|
|
14
14
|
|
|
15
15
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: A sample page documenting how you can build
|
|
4
|
-
metaTitle: '
|
|
2
|
+
title: Accessibility Standards
|
|
3
|
+
description: A sample page documenting how you can build accessibility standards
|
|
4
|
+
metaTitle: 'Accessibility Guide | Handoff Design System'
|
|
5
5
|
metaDescription: 'A sample page in the handoff design system, in markdown'
|
|
6
6
|
---
|
|
7
7
|
|