Skip to content

Commit 40b73cf

Browse files
authored
Merge pull request #1488 from privy-open-source/fix/sync-icon
release: `1.0.0-rc.13`
2 parents d9e9828 + f0db359 commit 40b73cf

File tree

2,825 files changed

+42383
-40650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,825 files changed

+42383
-40650
lines changed

packages/persona-icon/font/persona-icon.css

Lines changed: 282 additions & 273 deletions
Large diffs are not rendered by default.
3.07 KB
Binary file not shown.

packages/persona-icon/font/persona-icon.svg

Lines changed: 889 additions & 835 deletions
Loading
3.07 KB
Binary file not shown.
1.25 KB
Binary file not shown.
404 Bytes
Binary file not shown.

packages/persona-icon/scripts/changelog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { readJSON } from 'fs-extra'
77
import { name } from '../package.json'
88
import type { MetaData } from './types'
99
import { ofetch } from 'ofetch'
10-
import ohash from 'ohash'
10+
import * as ohash from 'ohash'
1111
import minimist from 'minimist'
1212
import {
1313
groupBy,

packages/persona-icon/scripts/create-font.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ export async function createFont () {
3434

3535
if (result.ttf) {
3636
await ensureFile(resolve(FONT_DIR, 'persona-icon.ttf'))
37-
await writeFile(resolve(FONT_DIR, 'persona-icon.ttf'), result.ttf)
37+
await writeFile(resolve(FONT_DIR, 'persona-icon.ttf'), result.ttf.toString())
3838
}
3939

4040
if (result.woff) {
4141
await ensureFile(resolve(FONT_DIR, 'persona-icon.woff'))
42-
await writeFile(resolve(FONT_DIR, 'persona-icon.woff'), result.woff)
42+
await writeFile(resolve(FONT_DIR, 'persona-icon.woff'), result.woff.toString())
4343
}
4444

4545
if (result.woff2) {
4646
await ensureFile(resolve(FONT_DIR, 'persona-icon.woff2'))
47-
await writeFile(resolve(FONT_DIR, 'persona-icon.woff2'), result.woff2)
47+
await writeFile(resolve(FONT_DIR, 'persona-icon.woff2'), result.woff2.toString())
4848
}
4949

5050
if (result.eot) {
5151
await ensureFile(resolve(FONT_DIR, 'persona-icon.eot'))
52-
await writeFile(resolve(FONT_DIR, 'persona-icon.eot'), result.eot)
52+
await writeFile(resolve(FONT_DIR, 'persona-icon.eot'), result.eot.toString())
5353
}
5454

5555
if (result.svg) {
5656
await ensureFile(resolve(FONT_DIR, 'persona-icon.svg'))
57-
await writeFile(resolve(FONT_DIR, 'persona-icon.svg'), result.svg)
57+
await writeFile(resolve(FONT_DIR, 'persona-icon.svg'), result.svg.toString())
5858
}
5959

6060
await createCss(result)
6161
}
6262

6363
function hash (buffer: Buffer | string, length = 4) {
6464
return createHash('shake256', { outputLength: length })
65-
.update(buffer)
65+
.update(buffer.toString())
6666
.digest('hex')
6767
}
6868

packages/persona-icon/scripts/sync.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import type { ObjectData, MetaData } from './types'
2929
import { fixPath } from './fix-svg'
3030
import { createFont } from './create-font'
3131
import pAll from 'p-all'
32-
import ohash from 'ohash'
32+
import * as ohash from 'ohash'
3333
import minimist from 'minimist'
3434
import { ofetch } from 'ofetch'
3535
import { parseISO, isEqual } from 'date-fns'
@@ -82,7 +82,7 @@ const svgoConfig: Config = {
8282
if (node.attributes.d)
8383
node.attributes.d = fixPath(node.attributes.d)
8484

85-
if (node.attributes.fill !== 'none' && !node.attributes.fill.startsWith('url'))
85+
if (node.attributes.fill && node.attributes.fill !== 'none' && !node.attributes.fill.startsWith('url'))
8686
node.attributes.fill = 'currentColor'
8787
}
8888
},
@@ -280,6 +280,17 @@ async function main () {
280280
spinner.start(`[${count}/${total}] - Downloading ${object.filename}`)
281281

282282
const res = await ofetch(url, { responseType: 'text', retry: 3 })
283+
284+
if (!res) {
285+
objects.delete(id)
286+
spinner.warn(`[${count}/${total}] - Skip ${object.filename} because it's empty / not found`)
287+
288+
await remove(resolve(SVG_DIR, object.filepath))
289+
await remove(resolve(VUE_DIR, `${object.filename}.vue`))
290+
291+
return
292+
}
293+
283294
const svg = optimize(res, { path: object.filepath, ...svgoConfig }).data
284295

285296
await ensureFile(resolve(SVG_DIR, object.filepath))
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading
Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)