Skip to content

Commit 6b484be

Browse files
authored
Merge pull request #446 from ruisaraiva19/develop
chore: release
2 parents d532fdd + d71ff13 commit 6b484be

File tree

14 files changed

+2085
-2110
lines changed

14 files changed

+2085
-2110
lines changed

.eslintrc.json

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
"rules": {
4747
"@typescript-eslint/no-var-requires": "off"
4848
}
49+
},
50+
{
51+
"files": ["components/**/*.stories.tsx", "pages/api/**/*.ts"],
52+
"rules": {
53+
"import/no-anonymous-default-export": "off"
54+
}
4955
}
5056
]
5157
}

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v2
12-
- name: Use Node.js 12
13-
uses: actions/setup-node@v1
12+
- name: Use Node.js 14
13+
uses: actions/setup-node@v2
1414
with:
15-
node-version: "12"
15+
node-version: "14"
1616
- name: Install dependencies
1717
uses: bahmutov/npm-install@v1
1818
- name: Lint Scripts

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2
15-
- name: Use Node.js 12
16-
uses: actions/setup-node@v1
15+
- name: Use Node.js 14
16+
uses: actions/setup-node@v2
1717
with:
18-
node-version: '12'
18+
node-version: '14'
1919
- name: Install dependencies
2020
uses: bahmutov/npm-install@v1
2121
- name: Cache Next.js build cache

.github/workflows/tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111

12-
- name: Use Node.js 12
13-
uses: actions/setup-node@v1
12+
- name: Use Node.js 14
13+
uses: actions/setup-node@v2
1414
with:
15-
node-version: "12"
15+
node-version: "14"
1616

1717
- name: Install dependencies
1818
uses: bahmutov/npm-install@v1

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.19.0
1+
14.15.4

components/favycon-info/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,21 @@ const people = [
2121
name: 'Augusto Lopes',
2222
role: 'Product Designer',
2323
social: 'twitter',
24+
placeholderHash: 'UrLqFOIUS$-o_Nt6NGRkEkt7M{RjM{NHMxof',
2425
},
2526
{
2627
screenName: 'ruisaraiva19',
2728
name: 'Rui Saraiva',
2829
role: 'Full-Stack Developer',
2930
social: 'twitter',
31+
placeholderHash: 'UNMQLqof_LWU?FRkkqt605fk9cjZbaWBt8of',
3032
},
3133
{
3234
screenName: 'miguellteixeira',
3335
name: 'Miguel Teixeira',
3436
role: 'Full-Stack Developer',
3537
social: 'github',
38+
placeholderHash: 'UcI~*]o0uPXS?wWAMxog8_kCQ,e-tmbIVsjF',
3639
},
3740
]
3841

@@ -143,6 +146,8 @@ const FavyconInfo = ({
143146
srcRetina={`/images/people/${person.screenName}@2x.png`}
144147
alt={person.name}
145148
aspectRatio="56/56"
149+
placeholderHash={person.placeholderHash}
150+
rounded
146151
/>
147152
</div>
148153
<div>

components/favycon-wizard/index.tsx

+10-17
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ type FavyconWizardProps = {
1313
const unsplashImageProps = (isMobile: boolean) => ({
1414
src: `/images/unsplash${isMobile ? '-vertical' : ''}@1x.jpg`,
1515
srcRetina: `/images/unsplash${isMobile ? '-vertical' : ''}@2x.jpg`,
16-
srcPlaceholder: isMobile
17-
? 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgICAgJCAkKCgkNDgwODRMREBARExwUFhQWFBwrGx8bGx8bKyYuJSMlLiZENS8vNUROQj5CTl9VVV93cXecnNEBCAgICAkICQoKCQ0ODA4NExEQEBETHBQWFBYUHCsbHxsbHxsrJi4lIyUuJkQ1Ly81RE5CPkJOX1VVX3dxd5yc0f/CABEIAGQAUAMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAEBQECAwcABv/aAAgBAQAAAAD4x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1bJ36HBBggcflqZ3fogIGBhx+WqDyXRAQOEDj81ME66HChwgfDnqrZl0MFEBQ+GiquMV0MGFBRGDPVCuMehhAwMHH5qoVwX/8QAGAEAAwEBAAAAAAAAAAAAAAAAAwQFAgb/2gAIAQIQAAAA606cVUvRnDLT1dY0lPFYYKGep//EABoBAAEFAQAAAAAAAAAAAAAAAAUBAgMEBwb/2gAIAQMQAAAAzI6fvOTMDfQ3pEzE10FyVcyLH70z/wD/xAAhEAACAgEEAwEBAAAAAAAAAAAAAQIDMQQFIDMQQXEjEf/aAAgBAQABPwDcl+0vpesmojkvWS1EyQ+O4r9pFyNQsl6yXIsRJD47j3SLlk1CyahZLkWIkhrjuHdIuNQaj2XE0SQ0fzhuHdIuNR7NR7LiaJIaGuG4d0vpaXrJqFktRNDQ0NcNw7pfS1F8cl8cl0SaGhoaGvO4d0vpYXF/suLCQxj8/wD/xAAdEQACAgIDAQAAAAAAAAAAAAAAAgEDETIQEnEh/9oACAECAQE/AKtV84vj4XL9OpCleq+EFi5gurOhCleqikrmC2seswV6L4Lw8FqwTB//xAAgEQACAQQCAwEAAAAAAAAAAAAAAQIDBBAxIXIRIzND/9oACAEDAQE/AFL3z7FpLRReiOf2n2LR6KD4RFnnD+8+xaPRRfBFieJfafYtZaKL4RFix//Z',
16+
placeholderHash: isMobile ? 'UT0Lxlh2ghgMeSeoe@fkflf5e.e:e.e.f6fk' : 'Un0V-,h2g#gMe,f8f9fif8f6f6f8f6f7fQfQ',
1917
alt: 'Unsplash',
2018
aspectRatio: isMobile ? '614/768' : '540/354',
2119
stretch: isMobile,
2220
})
2321

22+
const dndImageProps = (isDark: boolean) => ({
23+
src: `/images/dnd-${isDark ? 'dark' : 'light'}@1x.png`,
24+
srcRetina: `/images/dnd-${isDark ? 'dark' : 'light'}@2x.png`,
25+
alt: 'Drag and drop here!',
26+
aspectRatio: '185/109',
27+
})
28+
2429
const FavyconWizardComponent = ({ children, showDndImage }: FavyconWizardProps) => {
2530
return (
2631
<div className={styles.root}>
@@ -30,20 +35,8 @@ const FavyconWizardComponent = ({ children, showDndImage }: FavyconWizardProps)
3035
</div>
3136
{children}
3237
<div className={classnames(styles.image, { [styles.hide]: !showDndImage })}>
33-
<LazyImage
34-
src={`/images/dnd-light@1x.png`}
35-
srcRetina={`/images/dnd-light@2x.png`}
36-
alt="Drag and drop here!"
37-
aspectRatio="185/109"
38-
className={styles.imageLight}
39-
/>
40-
<LazyImage
41-
src={`/images/dnd-dark@1x.png`}
42-
srcRetina={`/images/dnd-dark@2x.png`}
43-
alt="Drag and drop here!"
44-
aspectRatio="185/109"
45-
className={styles.imageDark}
46-
/>
38+
<LazyImage {...dndImageProps(false)} className={styles.imageLight} />
39+
<LazyImage {...dndImageProps(true)} className={styles.imageDark} />
4740
</div>
4841
</div>
4942
)

components/lazy-image/index.module.scss

+18
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@
88
height: 100%;
99
padding-bottom: 0 !important;
1010
}
11+
12+
&.rounded {
13+
border-radius: 50%;
14+
}
15+
16+
canvas {
17+
position: absolute;
18+
top: 0;
19+
right: 0;
20+
bottom: 0;
21+
left: 0;
22+
width: 100%;
23+
height: 100%;
24+
}
25+
26+
&.rounded canvas {
27+
border-radius: 50%;
28+
}
1129
}
1230

1331
.image {

components/lazy-image/index.tsx

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
import React, { useRef, useEffect } from 'react'
22
import { LazyImageFull, ImageState } from 'react-lazy-images'
33
import objectFitImages from 'object-fit-images'
4+
import { BlurhashCanvas } from 'react-blurhash'
45
import classNames from 'classnames'
56

67
import styles from './index.module.scss'
78

89
type LazyImageProps = {
910
src: string
1011
srcRetina?: string
11-
srcPlaceholder?: string
12+
placeholderHash?: string
1213
alt: string
1314
aspectRatio: string
1415
stretch?: boolean
16+
rounded?: boolean
1517
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
1618

1719
const LazyImage = ({
1820
src,
1921
srcRetina = src,
20-
srcPlaceholder = src,
22+
placeholderHash,
2123
alt,
2224
aspectRatio,
2325
stretch = false,
26+
rounded = false,
2427
...props
2528
}: LazyImageProps) => {
2629
const [widthString, heightString] = aspectRatio.split('/')
@@ -41,22 +44,26 @@ const LazyImage = ({
4144
const loaded = imageState === ImageState.LoadSuccess
4245
return (
4346
<div
44-
className={classNames(styles.root, { [styles.stretch]: stretch })}
47+
className={classNames(styles.root, { [styles.stretch]: stretch, [styles.rounded]: rounded })}
4548
ref={ref}
4649
style={{ paddingBottom: `${(height / width) * 100}%` }}
4750
{...props}>
48-
<img
49-
className={styles.placeholder}
50-
src={srcPlaceholder}
51-
alt={imageProps.alt}
52-
style={{ opacity: loaded ? 0 : 1 }}
53-
/>
51+
{placeholderHash ? (
52+
<BlurhashCanvas
53+
className={styles.placeholder}
54+
hash={placeholderHash}
55+
width={32}
56+
height={32}
57+
style={{ opacity: loaded ? 0 : 1 }}
58+
/>
59+
) : null}
5460
<img
5561
ref={imgRef}
5662
className={styles.normal}
5763
{...imageProps}
5864
alt={imageProps.alt}
5965
style={{ opacity: loaded ? 1 : 0 }}
66+
loading="lazy"
6067
/>
6168
</div>
6269
)

package.json

+40-41
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
"url": "https://github.com/ruisaraiva19/favycon/issues"
2626
},
2727
"homepage": "https://github.com/ruisaraiva19/favycon#readme",
28-
"engines": {
29-
"node": ">= 10.13"
30-
},
3128
"scripts": {
3229
"dev": "next dev",
3330
"build": "next build",
@@ -43,22 +40,24 @@
4340
},
4441
"dependencies": {
4542
"@fiahfy/ico-convert": "0.0.7",
46-
"@prefresh/next": "1.3.0",
43+
"@prefresh/next": "1.4.4",
4744
"adm-zip": "0.4.16",
45+
"blurhash": "1.1.3",
4846
"classnames": "2.2.6",
4947
"multer": "1.4.2",
50-
"next": "9.5.5",
48+
"next": "10.0.6",
5149
"nprogress": "0.2.0",
5250
"object-fit-images": "3.2.4",
53-
"preact": "10.5.4",
54-
"preact-render-to-string": "5.1.10",
55-
"preact-ssr-prepass": "1.1.2",
56-
"prismjs": "1.22.0",
51+
"preact": "10.5.12",
52+
"preact-render-to-string": "5.1.12",
53+
"preact-ssr-prepass": "1.1.3",
54+
"prismjs": "1.23.0",
5755
"prop-types": "15.7.2",
5856
"react": "16.14.0",
57+
"react-blurhash": "0.1.3",
5958
"react-clipboard.js": "2.0.16",
6059
"react-dom": "16.14.0",
61-
"react-dropzone": "11.2.0",
60+
"react-dropzone": "11.2.4",
6261
"react-lazy-images": "1.1.0",
6362
"react-modal": "3.11.2",
6463
"react-transition-group": "4.4.1",
@@ -68,7 +67,7 @@
6867
"use-media": "1.4.0"
6968
},
7069
"devDependencies": {
71-
"@babel/core": "7.11.6",
70+
"@babel/core": "7.12.13",
7271
"@commitlint/cli": "11.0.0",
7372
"@commitlint/config-conventional": "11.0.0",
7473
"@storybook/addon-actions": "5.3.21",
@@ -82,61 +81,61 @@
8281
"@storybook/react": "5.3.21",
8382
"@storybook/source-loader": "5.3.21",
8483
"@types/adm-zip": "0.4.33",
85-
"@types/classnames": "2.2.10",
84+
"@types/classnames": "2.2.11",
8685
"@types/multer": "1.4.4",
87-
"@types/node": "14.11.8",
86+
"@types/node": "14.14.25",
8887
"@types/nprogress": "0.2.0",
8988
"@types/object-fit-images": "3.2.0",
90-
"@types/prismjs": "1.16.1",
91-
"@types/react": "16.9.53",
89+
"@types/prismjs": "1.16.2",
90+
"@types/react": "17.0.1",
9291
"@types/react-modal": "3.10.6",
9392
"@types/react-transition-group": "4.4.0",
9493
"@types/sharp": "0.25.1",
95-
"@typescript-eslint/eslint-plugin": "4.4.1",
96-
"@typescript-eslint/parser": "4.4.1",
94+
"@typescript-eslint/eslint-plugin": "4.14.2",
95+
"@typescript-eslint/parser": "4.14.2",
9796
"all-contributors-cli": "6.19.0",
9897
"babel-eslint": "10.1.0",
99-
"babel-loader": "8.1.0",
98+
"babel-loader": "8.2.2",
10099
"babel-plugin-prismjs": "2.0.1",
101-
"babel-preset-react-app": "9.1.2",
102-
"commitizen": "4.2.1",
103-
"cypress": "5.4.0",
100+
"babel-preset-react-app": "10.0.0",
101+
"commitizen": "4.2.3",
102+
"cypress": "5.6.0",
104103
"cypress-file-upload": "4.1.1",
105104
"cz-conventional-changelog": "3.3.0",
106105
"dotenv": "8.2.0",
107-
"eslint": "7.11.0",
108-
"eslint-config-prettier": "6.12.0",
106+
"eslint": "7.19.0",
107+
"eslint-config-prettier": "7.2.0",
109108
"eslint-config-react": "1.1.7",
110-
"eslint-config-react-app": "5.2.1",
109+
"eslint-config-react-app": "6.0.0",
111110
"eslint-plugin-cypress": "2.11.2",
112111
"eslint-plugin-flowtype": "5.2.0",
113112
"eslint-plugin-import": "2.22.1",
114-
"eslint-plugin-jsx-a11y": "6.3.1",
115-
"eslint-plugin-prettier": "3.1.4",
116-
"eslint-plugin-react": "7.21.4",
117-
"eslint-plugin-react-hooks": "4.1.2",
118-
"husky": "4.3.0",
119-
"lint-staged": "10.4.0",
113+
"eslint-plugin-jsx-a11y": "6.4.1",
114+
"eslint-plugin-prettier": "3.3.1",
115+
"eslint-plugin-react": "7.22.0",
116+
"eslint-plugin-react-hooks": "4.2.0",
117+
"husky": "4.3.8",
118+
"lint-staged": "10.5.4",
120119
"npm-run-all": "4.1.5",
121-
"postcss-100vh-fix": "0.1.1",
122-
"postcss-flexbugs-fixes": "4.2.1",
120+
"postcss-100vh-fix": "1.0.2",
121+
"postcss-flexbugs-fixes": "5.0.2",
123122
"postcss-preset-env": "6.7.0",
124-
"prettier": "2.1.2",
125-
"react-refresh": "0.8.3",
123+
"prettier": "2.2.1",
124+
"react-refresh": "0.9.0",
126125
"regenerator-runtime": "0.13.7",
127-
"sass": "1.27.0",
128-
"sass-loader": "10.0.3",
129-
"semantic-release": "17.2.1",
130-
"start-server-and-test": "1.11.5",
131-
"stylelint": "13.7.2",
126+
"sass": "1.32.6",
127+
"sass-loader": "10.1.1",
128+
"semantic-release": "17.3.7",
129+
"start-server-and-test": "1.12.0",
130+
"stylelint": "13.9.0",
132131
"stylelint-config-css-modules": "2.2.0",
133132
"stylelint-config-prettier": "8.0.2",
134-
"stylelint-config-recess-order": "2.1.0",
133+
"stylelint-config-recess-order": "2.3.0",
135134
"stylelint-config-standard": "20.0.0",
136135
"stylelint-prettier": "1.1.2",
137136
"stylelint-scss": "3.18.0",
138137
"typescript": "3.9.7",
139-
"webpack-notifier": "1.8.0"
138+
"webpack-notifier": "1.13.0"
140139
},
141140
"config": {
142141
"commitizen": {

pages/api/favycon.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default async (req: MulterApiRequest, res: NextApiResponse) => {
5858
.toBuffer()
5959
.then((scaledPng) => {
6060
zip.addFile(`icons/favicon-${size}.png`, scaledPng)
61-
resolve()
61+
resolve(true)
6262
})
6363
})
6464
})
@@ -72,7 +72,7 @@ export default async (req: MulterApiRequest, res: NextApiResponse) => {
7272
.then(async (scaledPng) => {
7373
const ico = await convert(scaledPng)
7474
zip.addFile('icons/favicon.ico', ico)
75-
resolve()
75+
resolve(true)
7676
})
7777
})
7878

-784 Bytes
Binary file not shown.
-741 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)