handoff-app 0.4.2 → 0.4.3
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 +30 -1
- package/docs/components/alert.md +4 -6
- package/docs/components/button.md +6 -7
- package/docs/components/checkbox.md +4 -6
- package/docs/components/input.md +4 -6
- package/docs/components/modal.md +4 -6
- package/docs/components/pagination.md +4 -6
- package/docs/components/radio.md +4 -6
- package/docs/components/select.md +4 -6
- package/docs/components/switch.md +4 -6
- package/docs/components/tooltip.md +4 -6
- package/figma-exporter/dist/declarations/src/utils/preview.d.ts +1 -1
- package/figma-exporter/dist/figma-exporter.cjs.dev.js +57 -32
- package/figma-exporter/dist/figma-exporter.cjs.prod.js +57 -32
- package/figma-exporter/src/index.ts +10 -8
- package/figma-exporter/src/utils/preview.ts +65 -42
- package/integrations/bootstrap/5.2/sass/extended/_select.scss +5 -0
- package/package.json +1 -1
- package/public/assets/icons.html +35 -35
- package/public/assets/icons.svg +1 -1
- package/public/components/bundle.js +1 -1
- package/public/tokens.zip +0 -0
- package/scripts/build/scripts.js +38 -4
package/Changelog.md
CHANGED
|
@@ -6,6 +6,35 @@ 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.3] - 2023-04-19
|
|
10
|
+
|
|
11
|
+
Continuing incremental improvement over the 0.4.0 release. This release fixes
|
|
12
|
+
a couple of small build inconsistencies, improves debug mode when running the
|
|
13
|
+
build and fetch, and
|
|
14
|
+
|
|
15
|
+
### Improvements
|
|
16
|
+
|
|
17
|
+
- Errors in the webpack execution will now cause the fetch script to halt and
|
|
18
|
+
bubble up into the error handling.
|
|
19
|
+
- Running build/fetch with `-- --debug` will now send the error trace from the
|
|
20
|
+
webpack when building a preview. This is especially useful when there is an error
|
|
21
|
+
either in the template or scss maps.
|
|
22
|
+
- Running build/fetch with `-- --fast` will execute the script but if there is
|
|
23
|
+
already a built temp directory, it will use the built dir rather than recreating
|
|
24
|
+
it. This speeds up runtime significantly. If this option is supplied but the
|
|
25
|
+
temp dir does not yet exist, it will be created.
|
|
26
|
+
|
|
27
|
+
### Bugfixes
|
|
28
|
+
|
|
29
|
+
- The transformer stand alone pipelines weren't working. This release fixes that
|
|
30
|
+
so executing `npm run transform:preview` or
|
|
31
|
+
`node node_modules/handoff-app/scripts/fetch.js preview` will properly execute
|
|
32
|
+
just a single portion of the pipeline rather than the whole pipeline.
|
|
33
|
+
- The default component guidelines were not rendering the `<ul>` wrapper for the
|
|
34
|
+
subsequent lists.
|
|
35
|
+
- The bootstrap 5.2 scss mapping had an error that caused the carrot and icon
|
|
36
|
+
on error and disabled state select boxes to display incorrectly.
|
|
37
|
+
|
|
9
38
|
## [0.4.2] - 2023-04-16
|
|
10
39
|
|
|
11
40
|
When 0.4.0 was released, we found a structural problem with the way
|
|
@@ -13,7 +42,7 @@ integrations were published into projects. 0.4.1 resolved a couple of issues,
|
|
|
13
42
|
but a couple of significant new pieces of code were required to fully resolve
|
|
14
43
|
the issue.
|
|
15
44
|
|
|
16
|
-
The resolution is fixing paths so that they work properly when running the
|
|
45
|
+
The resolution is fixing paths so that they work properly when running the
|
|
17
46
|
handoff source as well as running handoff in a project.
|
|
18
47
|
|
|
19
48
|
### Bugfixes
|
package/docs/components/alert.md
CHANGED
|
@@ -11,17 +11,15 @@ Make it clear what this alert does for the user.
|
|
|
11
11
|
|
|
12
12
|
<div className="c-do-dont">
|
|
13
13
|
<div className="c-do-dont__do">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</p>
|
|
14
|
+
|
|
15
|
+
<Icon name="check" className="" /> DO
|
|
17
16
|
|
|
18
17
|
- What to do with alerts
|
|
19
18
|
|
|
20
19
|
</div>
|
|
21
20
|
<div className="c-do-dont__dont">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</p>
|
|
21
|
+
|
|
22
|
+
<Icon name="x" className="" /> DON'T
|
|
25
23
|
|
|
26
24
|
- What not to do with alerts
|
|
27
25
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Buttons
|
|
3
|
-
description: Buttons allow users to take actions and make choices, with a single click.
|
|
3
|
+
description: Buttons allow users to take actions and make choices, with a single click.
|
|
4
4
|
image: component-button
|
|
5
5
|
metaTitle: 'Buttons | Handoff Design System'
|
|
6
6
|
metaDescription: 'Buttons allow users to take actions and make choices, with a single click.'
|
|
7
7
|
---
|
|
8
|
+
|
|
8
9
|
### Accessibility
|
|
9
10
|
|
|
10
11
|
Make it clear what this button does for the user.
|
|
11
12
|
|
|
12
13
|
<div className="c-do-dont">
|
|
13
14
|
<div className="c-do-dont__do">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</p>
|
|
15
|
+
|
|
16
|
+
<Icon name="check" className="" /> DO
|
|
17
17
|
|
|
18
18
|
- Make it clear what this button does for the user.
|
|
19
19
|
- Use at most two buttons in one group.
|
|
@@ -21,9 +21,8 @@ Make it clear what this button does for the user.
|
|
|
21
21
|
|
|
22
22
|
</div>
|
|
23
23
|
<div className="c-do-dont__dont">
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</p>
|
|
24
|
+
|
|
25
|
+
<Icon name="x" className="" /> DON'T
|
|
27
26
|
|
|
28
27
|
- Use more than two words for call to action.
|
|
29
28
|
- First letter of each sentence defaults to a capital letter.
|
|
@@ -12,17 +12,15 @@ Make it clear what this checkboxes does for the user.
|
|
|
12
12
|
|
|
13
13
|
<div className="c-do-dont">
|
|
14
14
|
<div className="c-do-dont__do">
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</p>
|
|
15
|
+
|
|
16
|
+
<Icon name="check" className="" /> DO
|
|
18
17
|
|
|
19
18
|
- What to do with checkboxes
|
|
20
19
|
|
|
21
20
|
</div>
|
|
22
21
|
<div className="c-do-dont__dont">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</p>
|
|
22
|
+
|
|
23
|
+
<Icon name="x" className="" /> DON'T
|
|
26
24
|
|
|
27
25
|
- What not to do with checkboxes
|
|
28
26
|
|
package/docs/components/input.md
CHANGED
|
@@ -13,17 +13,15 @@ Make it clear what this input does for the user.
|
|
|
13
13
|
|
|
14
14
|
<div className="c-do-dont">
|
|
15
15
|
<div className="c-do-dont__do">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</p>
|
|
16
|
+
|
|
17
|
+
<Icon name="check" className="" /> DO
|
|
19
18
|
|
|
20
19
|
- What to do with inputs
|
|
21
20
|
|
|
22
21
|
</div>
|
|
23
22
|
<div className="c-do-dont__dont">
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</p>
|
|
23
|
+
|
|
24
|
+
<Icon name="x" className="" /> DON'T
|
|
27
25
|
|
|
28
26
|
- What not to do with inputs
|
|
29
27
|
|
package/docs/components/modal.md
CHANGED
|
@@ -14,17 +14,15 @@ Make it clear what this modal does for the user.
|
|
|
14
14
|
|
|
15
15
|
<div className="c-do-dont">
|
|
16
16
|
<div className="c-do-dont__do">
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</p>
|
|
17
|
+
|
|
18
|
+
<Icon name="check" className="" /> DO
|
|
20
19
|
|
|
21
20
|
- What to do with modals
|
|
22
21
|
|
|
23
22
|
</div>
|
|
24
23
|
<div className="c-do-dont__dont">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</p>
|
|
24
|
+
|
|
25
|
+
<Icon name="x" className="" /> DON'T
|
|
28
26
|
|
|
29
27
|
- What not to do with modals
|
|
30
28
|
|
|
@@ -12,17 +12,15 @@ Make it clear what this pagination widget does for the user.
|
|
|
12
12
|
|
|
13
13
|
<div className="c-do-dont">
|
|
14
14
|
<div className="c-do-dont__do">
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</p>
|
|
15
|
+
|
|
16
|
+
<Icon name="check" className="" /> DO
|
|
18
17
|
|
|
19
18
|
- What to do with pagination
|
|
20
19
|
|
|
21
20
|
</div>
|
|
22
21
|
<div className="c-do-dont__dont">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</p>
|
|
22
|
+
|
|
23
|
+
<Icon name="x" className="" /> DON'T
|
|
26
24
|
|
|
27
25
|
- What not to do with pagination
|
|
28
26
|
|
package/docs/components/radio.md
CHANGED
|
@@ -11,17 +11,15 @@ Make it clear what this radio widget does for the user.
|
|
|
11
11
|
|
|
12
12
|
<div className="c-do-dont">
|
|
13
13
|
<div className="c-do-dont__do">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</p>
|
|
14
|
+
|
|
15
|
+
<Icon name="check" className="" /> DO
|
|
17
16
|
|
|
18
17
|
- What to do with radio
|
|
19
18
|
|
|
20
19
|
</div>
|
|
21
20
|
<div className="c-do-dont__dont">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</p>
|
|
21
|
+
|
|
22
|
+
<Icon name="x" className="" /> DON'T
|
|
25
23
|
|
|
26
24
|
- What not to do with radio
|
|
27
25
|
|
|
@@ -13,17 +13,15 @@ Make it clear what this select widget does for the user.
|
|
|
13
13
|
|
|
14
14
|
<div className="c-do-dont">
|
|
15
15
|
<div className="c-do-dont__do">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</p>
|
|
16
|
+
|
|
17
|
+
<Icon name="check" className="" /> DO
|
|
19
18
|
|
|
20
19
|
- What to do with select
|
|
21
20
|
|
|
22
21
|
</div>
|
|
23
22
|
<div className="c-do-dont__dont">
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</p>
|
|
23
|
+
|
|
24
|
+
<Icon name="x" className="" /> DON'T
|
|
27
25
|
|
|
28
26
|
- What not to do with select
|
|
29
27
|
|
|
@@ -12,17 +12,15 @@ Make it clear what this switch widget does for the user.
|
|
|
12
12
|
|
|
13
13
|
<div className="c-do-dont">
|
|
14
14
|
<div className="c-do-dont__do">
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</p>
|
|
15
|
+
|
|
16
|
+
<Icon name="check" className="" /> DO
|
|
18
17
|
|
|
19
18
|
- What to do with switches
|
|
20
19
|
|
|
21
20
|
</div>
|
|
22
21
|
<div className="c-do-dont__dont">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</p>
|
|
22
|
+
|
|
23
|
+
<Icon name="x" className="" /> DON'T
|
|
26
24
|
|
|
27
25
|
- What not to do with switches
|
|
28
26
|
|
|
@@ -11,17 +11,15 @@ Make it clear what this tooltip widget does for the user.
|
|
|
11
11
|
|
|
12
12
|
<div className="c-do-dont">
|
|
13
13
|
<div className="c-do-dont__do">
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</p>
|
|
14
|
+
|
|
15
|
+
<Icon name="check" className="" /> DO
|
|
17
16
|
|
|
18
17
|
- What to do with tooltips
|
|
19
18
|
|
|
20
19
|
</div>
|
|
21
20
|
<div className="c-do-dont__dont">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</p>
|
|
21
|
+
|
|
22
|
+
<Icon name="x" className="" /> DON'T
|
|
25
23
|
|
|
26
24
|
- What not to do with tooltips
|
|
27
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const buildClientFiles: () =>
|
|
1
|
+
export declare const buildClientFiles: () => Promise<string>;
|
|
@@ -5191,37 +5191,59 @@ async function previewTransformer(documentationObject$1) {
|
|
|
5191
5191
|
};
|
|
5192
5192
|
}
|
|
5193
5193
|
|
|
5194
|
-
const buildClientFiles = () => {
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5194
|
+
const buildClientFiles = async () => {
|
|
5195
|
+
return new Promise((resolve, reject) => {
|
|
5196
|
+
const compile = webpack__default["default"]({
|
|
5197
|
+
mode: 'production',
|
|
5198
|
+
entry: path__default["default"].resolve(__dirname, '../../templates/main.js'),
|
|
5199
|
+
resolve: {
|
|
5200
|
+
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')]
|
|
5201
|
+
},
|
|
5202
|
+
output: {
|
|
5203
|
+
path: path__default["default"].resolve(__dirname, '../../public/components'),
|
|
5204
|
+
filename: 'bundle.js'
|
|
5205
|
+
},
|
|
5206
|
+
module: {
|
|
5207
|
+
rules: [{
|
|
5208
|
+
test: /\.s[ac]ss$/i,
|
|
5209
|
+
use: [
|
|
5210
|
+
// Creates `style` nodes from JS strings
|
|
5211
|
+
'style-loader',
|
|
5212
|
+
// Translates CSS into CommonJS
|
|
5213
|
+
'css-loader',
|
|
5214
|
+
// Compiles Sass to CSS
|
|
5215
|
+
'sass-loader']
|
|
5216
|
+
}]
|
|
5217
|
+
}
|
|
5218
|
+
});
|
|
5219
|
+
compile.run((err, stats) => {
|
|
5220
|
+
if (err) {
|
|
5221
|
+
let error = "Errors encountered trying to build preview styles.\n";
|
|
5222
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
5223
|
+
error += err.stack || err;
|
|
5224
|
+
}
|
|
5225
|
+
return reject(error);
|
|
5226
|
+
}
|
|
5227
|
+
if (stats) {
|
|
5228
|
+
if (stats.hasErrors()) {
|
|
5229
|
+
let buildErrors = stats.compilation.errors?.map(err => err.message);
|
|
5230
|
+
let error = "Errors encountered trying to build preview styles.\n";
|
|
5231
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
5232
|
+
error += buildErrors;
|
|
5233
|
+
}
|
|
5234
|
+
return reject(error);
|
|
5235
|
+
}
|
|
5236
|
+
if (stats.hasWarnings()) {
|
|
5237
|
+
let buildWarnings = stats.compilation.warnings?.map(err => err.message);
|
|
5238
|
+
let error = "Warnings encountered when building preview styles.\n";
|
|
5239
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
5240
|
+
error += buildWarnings;
|
|
5241
|
+
console.error(chalk__default["default"].yellow(error));
|
|
5242
|
+
}
|
|
5243
|
+
}
|
|
5244
|
+
}
|
|
5245
|
+
return resolve("Preview template styles built");
|
|
5246
|
+
});
|
|
5225
5247
|
});
|
|
5226
5248
|
};
|
|
5227
5249
|
|
|
@@ -9889,7 +9911,10 @@ const buildPreview = async documentationObject => {
|
|
|
9889
9911
|
if (Object.keys(documentationObject.components).filter(name => documentationObject.components[name].length > 0).length > 0) {
|
|
9890
9912
|
await Promise.all([previewTransformer(documentationObject).then(out => fs__namespace.writeJSON(previewFilePath, out, {
|
|
9891
9913
|
spaces: 2
|
|
9892
|
-
}))
|
|
9914
|
+
}))]);
|
|
9915
|
+
await buildClientFiles().then(value => chalk__default["default"].green(console.log(value))).catch(error => {
|
|
9916
|
+
throw new Error(error);
|
|
9917
|
+
});
|
|
9893
9918
|
} else {
|
|
9894
9919
|
console.log(chalk__default["default"].red('Skipping preview generation'));
|
|
9895
9920
|
}
|
|
@@ -5191,37 +5191,59 @@ async function previewTransformer(documentationObject$1) {
|
|
|
5191
5191
|
};
|
|
5192
5192
|
}
|
|
5193
5193
|
|
|
5194
|
-
const buildClientFiles = () => {
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5194
|
+
const buildClientFiles = async () => {
|
|
5195
|
+
return new Promise((resolve, reject) => {
|
|
5196
|
+
const compile = webpack__default["default"]({
|
|
5197
|
+
mode: 'production',
|
|
5198
|
+
entry: path__default["default"].resolve(__dirname, '../../templates/main.js'),
|
|
5199
|
+
resolve: {
|
|
5200
|
+
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')]
|
|
5201
|
+
},
|
|
5202
|
+
output: {
|
|
5203
|
+
path: path__default["default"].resolve(__dirname, '../../public/components'),
|
|
5204
|
+
filename: 'bundle.js'
|
|
5205
|
+
},
|
|
5206
|
+
module: {
|
|
5207
|
+
rules: [{
|
|
5208
|
+
test: /\.s[ac]ss$/i,
|
|
5209
|
+
use: [
|
|
5210
|
+
// Creates `style` nodes from JS strings
|
|
5211
|
+
'style-loader',
|
|
5212
|
+
// Translates CSS into CommonJS
|
|
5213
|
+
'css-loader',
|
|
5214
|
+
// Compiles Sass to CSS
|
|
5215
|
+
'sass-loader']
|
|
5216
|
+
}]
|
|
5217
|
+
}
|
|
5218
|
+
});
|
|
5219
|
+
compile.run((err, stats) => {
|
|
5220
|
+
if (err) {
|
|
5221
|
+
let error = "Errors encountered trying to build preview styles.\n";
|
|
5222
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
5223
|
+
error += err.stack || err;
|
|
5224
|
+
}
|
|
5225
|
+
return reject(error);
|
|
5226
|
+
}
|
|
5227
|
+
if (stats) {
|
|
5228
|
+
if (stats.hasErrors()) {
|
|
5229
|
+
let buildErrors = stats.compilation.errors?.map(err => err.message);
|
|
5230
|
+
let error = "Errors encountered trying to build preview styles.\n";
|
|
5231
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
5232
|
+
error += buildErrors;
|
|
5233
|
+
}
|
|
5234
|
+
return reject(error);
|
|
5235
|
+
}
|
|
5236
|
+
if (stats.hasWarnings()) {
|
|
5237
|
+
let buildWarnings = stats.compilation.warnings?.map(err => err.message);
|
|
5238
|
+
let error = "Warnings encountered when building preview styles.\n";
|
|
5239
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
5240
|
+
error += buildWarnings;
|
|
5241
|
+
console.error(chalk__default["default"].yellow(error));
|
|
5242
|
+
}
|
|
5243
|
+
}
|
|
5244
|
+
}
|
|
5245
|
+
return resolve("Preview template styles built");
|
|
5246
|
+
});
|
|
5225
5247
|
});
|
|
5226
5248
|
};
|
|
5227
5249
|
|
|
@@ -9889,7 +9911,10 @@ const buildPreview = async documentationObject => {
|
|
|
9889
9911
|
if (Object.keys(documentationObject.components).filter(name => documentationObject.components[name].length > 0).length > 0) {
|
|
9890
9912
|
await Promise.all([previewTransformer(documentationObject).then(out => fs__namespace.writeJSON(previewFilePath, out, {
|
|
9891
9913
|
spaces: 2
|
|
9892
|
-
}))
|
|
9914
|
+
}))]);
|
|
9915
|
+
await buildClientFiles().then(value => chalk__default["default"].green(console.log(value))).catch(error => {
|
|
9916
|
+
throw new Error(error);
|
|
9917
|
+
});
|
|
9893
9918
|
} else {
|
|
9894
9919
|
console.log(chalk__default["default"].red('Skipping preview generation'));
|
|
9895
9920
|
}
|
|
@@ -75,8 +75,10 @@ const buildPreview = async (documentationObject: DocumentationObject) => {
|
|
|
75
75
|
if (Object.keys(documentationObject.components).filter((name) => documentationObject.components[name].length > 0).length > 0) {
|
|
76
76
|
await Promise.all([
|
|
77
77
|
previewTransformer(documentationObject).then((out) => fs.writeJSON(previewFilePath, out, { spaces: 2 })),
|
|
78
|
-
buildClientFiles(),
|
|
79
78
|
]);
|
|
79
|
+
await buildClientFiles()
|
|
80
|
+
.then((value) => chalk.green(console.log(value)))
|
|
81
|
+
.catch((error) => { throw new Error(error) });
|
|
80
82
|
} else {
|
|
81
83
|
console.log(chalk.red('Skipping preview generation'));
|
|
82
84
|
}
|
|
@@ -160,13 +162,13 @@ const entirePipeline = async () => {
|
|
|
160
162
|
fs.writeJSON(changelogFilePath, changelog, { spaces: 2 }),
|
|
161
163
|
...(!process.env.CREATE_ASSETS_ZIP_FILES || process.env.CREATE_ASSETS_ZIP_FILES !== 'false'
|
|
162
164
|
? [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
zipAssets(documentationObject.assets.icons, fs.createWriteStream(iconsZipFilePath)).then((writeStream) =>
|
|
166
|
+
stream.promises.finished(writeStream)
|
|
167
|
+
),
|
|
168
|
+
zipAssets(documentationObject.assets.logos, fs.createWriteStream(logosZipFilePath)).then((writeStream) =>
|
|
169
|
+
stream.promises.finished(writeStream)
|
|
170
|
+
),
|
|
171
|
+
]
|
|
170
172
|
: []),
|
|
171
173
|
]);
|
|
172
174
|
await buildCustomFonts(documentationObject);
|
|
@@ -2,47 +2,70 @@ import webpack from 'webpack';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
|
|
5
|
-
export const buildClientFiles = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(err, stats) => {
|
|
39
|
-
if (err || stats?.hasErrors()) {
|
|
40
|
-
// ...
|
|
41
|
-
console.log(chalk.red('Client styles failed'));
|
|
42
|
-
throw err;
|
|
5
|
+
export const buildClientFiles = async (): Promise<string> => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const compile = webpack(
|
|
8
|
+
{
|
|
9
|
+
mode: 'production',
|
|
10
|
+
entry: path.resolve(__dirname, '../../templates/main.js'),
|
|
11
|
+
resolve: {
|
|
12
|
+
modules: [
|
|
13
|
+
path.resolve(__dirname, '../..'),
|
|
14
|
+
path.resolve(__dirname, '../../..'),
|
|
15
|
+
path.resolve(__dirname, '../../node_modules'),
|
|
16
|
+
path.resolve(__dirname, '../../../../node_modules'),
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
output: {
|
|
20
|
+
path: path.resolve(__dirname, '../../public/components'),
|
|
21
|
+
filename: 'bundle.js',
|
|
22
|
+
},
|
|
23
|
+
module: {
|
|
24
|
+
rules: [
|
|
25
|
+
{
|
|
26
|
+
test: /\.s[ac]ss$/i,
|
|
27
|
+
use: [
|
|
28
|
+
// Creates `style` nodes from JS strings
|
|
29
|
+
'style-loader',
|
|
30
|
+
// Translates CSS into CommonJS
|
|
31
|
+
'css-loader',
|
|
32
|
+
// Compiles Sass to CSS
|
|
33
|
+
'sass-loader',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
43
38
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
);
|
|
40
|
+
compile.run((err, stats) => {
|
|
41
|
+
if (err) {
|
|
42
|
+
let error = "Errors encountered trying to build preview styles.\n";
|
|
43
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
44
|
+
error += err.stack || err;
|
|
45
|
+
}
|
|
46
|
+
return reject(error);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (stats) {
|
|
50
|
+
if (stats.hasErrors()) {
|
|
51
|
+
let buildErrors = stats.compilation.errors?.map((err) => err.message);
|
|
52
|
+
let error = "Errors encountered trying to build preview styles.\n";
|
|
53
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
54
|
+
error += buildErrors;
|
|
55
|
+
}
|
|
56
|
+
return reject(error);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (stats.hasWarnings()) {
|
|
60
|
+
let buildWarnings = stats.compilation.warnings?.map((err) => err.message);
|
|
61
|
+
let error = "Warnings encountered when building preview styles.\n";
|
|
62
|
+
if (process.argv.indexOf('--debug') > 0) {
|
|
63
|
+
error += buildWarnings;
|
|
64
|
+
console.error(chalk.yellow(error));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return resolve("Preview template styles built");
|
|
69
|
+
});
|
|
70
|
+
});
|
|
48
71
|
};
|