Skip to content

Commit a8560b8

Browse files
committed
chore(dependencies): dependencies update part 2
1 parent 79ccc07 commit a8560b8

File tree

2 files changed

+50
-53
lines changed

2 files changed

+50
-53
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
"@material-ui/icons": "4.11.2",
171171
"@material-ui/lab": "4.0.0-alpha.57",
172172
"@material-ui/styles": "4.11.2",
173-
"@rollup/plugin-commonjs": "15.0.0",
173+
"@rollup/plugin-commonjs": "17.0.0",
174174
"@rollup/plugin-html": "0.2.0",
175175
"@rollup/plugin-json": "4.1.0",
176176
"@rollup/plugin-node-resolve": "9.0.0",
@@ -201,8 +201,8 @@
201201
"@types/enzyme-adapter-react-16": "1.0.6",
202202
"@types/express": "4.17.9",
203203
"@types/faker": "5.1.5",
204-
"@types/favicons": "5.5.0",
205-
"@types/jest": "26.0.18",
204+
"@types/favicons": "6.2.0",
205+
"@types/jest": "26.0.19",
206206
"@types/jest-image-snapshot": "4.1.3",
207207
"@types/node": "14.14.12",
208208
"@types/object-assign": "4.0.30",
@@ -214,7 +214,7 @@
214214
"@types/react-router-dom": "5.1.5",
215215
"@types/react-test-renderer": "16.9.3",
216216
"@types/react-transition-group": "4.4.0",
217-
"@types/recharts": "1.8.14",
217+
"@types/recharts": "1.8.17",
218218
"@types/recharts-scale": "1.0.0",
219219
"@types/recoil": "0.0.1",
220220
"@types/scheduler": "0.16.1",

scripts/favicon.ts

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,52 @@
11
import * as favicons from 'favicons';
22
import * as fs from 'fs';
33
import * as packageJson from '../package.json';
4+
// eslint-disable-next-line unicorn/import-style
45
import * as path from 'path';
56

67
const icon = 'react.svg';
78

8-
const configuration: favicons.Configuration = {
9-
path: `${packageJson.basename}assets`,
10-
appName: packageJson.name,
11-
appShortName: packageJson.name,
12-
appDescription: packageJson.description,
13-
developerName: packageJson.author,
14-
developerURL: packageJson.homepage,
15-
dir: 'auto',
16-
lang: 'en-US',
17-
background: '#000',
18-
theme_color: '#000',
19-
appleStatusBarStyle: 'black-translucent',
20-
display: 'standalone',
21-
orientation: 'any',
22-
scope: '/',
23-
start_url: `${packageJson.basename}index.html`,
24-
version: '1.0',
25-
logging: false,
26-
pixel_art: false,
27-
loadManifestWithCredentials: false,
28-
manifestRelativePaths: false,
29-
pipeHTML: true,
30-
icons: {
31-
android: true,
32-
appleIcon: true,
33-
appleStartup: true,
34-
coast: true,
35-
favicons: true,
36-
firefox: true,
37-
windows: true,
38-
yandex: true,
39-
},
9+
const configuration: favicons.FaviconOptions = {
10+
path: `${packageJson.basename}assets`,
11+
appName: packageJson.name,
12+
appShortName: packageJson.name,
13+
appDescription: packageJson.description,
14+
developerName: packageJson.author,
15+
developerURL: packageJson.homepage,
16+
dir: 'auto',
17+
lang: 'en-US',
18+
background: '#000',
19+
theme_color: '#000',
20+
appleStatusBarStyle: 'black-translucent',
21+
display: 'standalone',
22+
orientation: 'any',
23+
scope: '/',
24+
start_url: `${packageJson.basename}index.html`,
25+
version: '1.0',
26+
logging: false,
27+
pixel_art: false,
28+
loadManifestWithCredentials: false,
29+
manifestRelativePaths: false,
30+
pipeHTML: true,
31+
icons: {
32+
android: true,
33+
appleIcon: true,
34+
appleStartup: true,
35+
coast: true,
36+
favicons: true,
37+
firefox: true,
38+
windows: true,
39+
yandex: true,
4040
},
41-
callback = (
42-
error: Error | null,
43-
response: {
44-
images: { name: string; contents: Buffer }[];
45-
files: { name: string; contents: Buffer }[];
46-
html: string[];
47-
},
48-
) => {
49-
if (error) {
50-
console.log(error.message);
51-
return;
52-
}
41+
};
5342

43+
favicons(icon, configuration)
44+
.then((response) => {
5445
const assetPath = path.resolve('public', 'assets');
5546

56-
const writeFiles = (files: { name: string; contents: Buffer }[]) => {
47+
const writeFiles = (
48+
files: { name: string; contents: Buffer | string }[],
49+
) => {
5750
files.forEach((file) => {
5851
fs.writeFileSync(path.resolve(assetPath, file.name), file.contents);
5952
});
@@ -64,7 +57,11 @@ const configuration: favicons.Configuration = {
6457
writeFiles(response.images);
6558
writeFiles(response.files);
6659

67-
fs.writeFileSync(path.resolve('public', 'favicon.html'), response.html.join('\n'));
68-
};
69-
70-
favicons(icon, configuration, callback);
60+
fs.writeFileSync(
61+
path.resolve('public', 'favicon.html'),
62+
response.html.join('\n'),
63+
);
64+
})
65+
.catch((error) => {
66+
console.log(error);
67+
});

0 commit comments

Comments
 (0)