Skip to content

Commit 7e4c738

Browse files
authored
Merge pull request #1257 from privy-open-source/release/1.0.0-rc.4
release: `1.0.0-rc.4`
2 parents 35ef9eb + 6363979 commit 7e4c738

File tree

457 files changed

+24532
-322
lines changed

Some content is hidden

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

457 files changed

+24532
-322
lines changed

.github/workflows/ci.yml

+17-48
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ on:
1111
merge_group:
1212
types: [checks_requested]
1313

14+
env:
15+
NODE_VERSION: 18
16+
1417
jobs:
1518
test:
16-
runs-on: ${{ matrix.os }}
19+
runs-on: ubuntu-latest
1720

1821
strategy:
1922
fail-fast: false
2023
matrix:
21-
os:
22-
- ubuntu-latest
2324
node-version:
2425
- 18
2526
- 20
@@ -57,20 +58,12 @@ jobs:
5758

5859
- name: Upload to Codecov
5960
uses: codecov/codecov-action@v4
60-
if: matrix.node-version == 18 && matrix.os == 'ubuntu-latest'
61+
if: matrix.node-version == 18
6162
with:
6263
fail_ci_if_error: false
6364

6465
lint:
65-
runs-on: ${{ matrix.os }}
66-
67-
strategy:
68-
fail-fast: false
69-
matrix:
70-
os:
71-
- ubuntu-latest
72-
node-version:
73-
- 18
66+
runs-on: ubuntu-latest
7467

7568
steps:
7669
- name: Git Checkout
@@ -91,10 +84,10 @@ jobs:
9184
restore-keys: |
9285
${{ runner.os }}-yarn-
9386
94-
- name: Use Node.js ${{ matrix.node-version }}
87+
- name: Use Node.js ${{ env.NODE_VERSION }}
9588
uses: actions/setup-node@v4
9689
with:
97-
node-version: ${{ matrix.node-version }}
90+
node-version: ${{ env.NODE_VERSION }}
9891
cache: "yarn"
9992

10093
- name: Install Deps
@@ -104,15 +97,7 @@ jobs:
10497
run: yarn lint:ci
10598

10699
typecheck:
107-
runs-on: ${{ matrix.os }}
108-
109-
strategy:
110-
fail-fast: false
111-
matrix:
112-
os:
113-
- ubuntu-latest
114-
node-version:
115-
- 18
100+
runs-on: ubuntu-latest
116101

117102
steps:
118103
- name: Git Checkout
@@ -133,10 +118,10 @@ jobs:
133118
restore-keys: |
134119
${{ runner.os }}-yarn-
135120
136-
- name: Use Node.js ${{ matrix.node-version }}
121+
- name: Use Node.js ${{ env.NODE_VERSION }}
137122
uses: actions/setup-node@v4
138123
with:
139-
node-version: ${{ matrix.node-version }}
124+
node-version: ${{ env.NODE_VERSION }}
140125
cache: "yarn"
141126

142127
- name: Install Deps
@@ -146,29 +131,21 @@ jobs:
146131
run: yarn typecheck
147132

148133
analyze:
149-
runs-on: ${{ matrix.os }}
134+
runs-on: ubuntu-latest
150135

151136
permissions:
152137
actions: read
153138
contents: read
154139
security-events: write
155140

156-
strategy:
157-
fail-fast: false
158-
matrix:
159-
os:
160-
- ubuntu-latest
161-
language:
162-
- javascript
163-
164141
steps:
165142
- name: Git Checkout
166143
uses: actions/checkout@v4
167144

168145
- name: Initialize CodeQL
169146
uses: github/codeql-action/init@v3
170147
with:
171-
languages: ${{ matrix.language }}
148+
languages: javascript
172149

173150
- name: Autobuild
174151
uses: github/codeql-action/autobuild@v3
@@ -183,15 +160,7 @@ jobs:
183160
- analyze
184161
- test
185162

186-
runs-on: ${{ matrix.os }}
187-
188-
strategy:
189-
fail-fast: false
190-
matrix:
191-
os:
192-
- ubuntu-latest
193-
node-version:
194-
- 18
163+
runs-on: ubuntu-latest
195164

196165
steps:
197166
- name: Git Checkout
@@ -212,10 +181,10 @@ jobs:
212181
restore-keys: |
213182
${{ runner.os }}-yarn-
214183
215-
- name: Use Node.js ${{ matrix.node-version }}
184+
- name: Use Node.js ${{ env.NODE_VERSION }}
216185
uses: actions/setup-node@v4
217186
with:
218-
node-version: ${{ matrix.node-version }}
187+
node-version: ${{ env.NODE_VERSION }}
219188
cache: "yarn"
220189

221190
- name: Install Deps
@@ -226,7 +195,7 @@ jobs:
226195

227196
- name: Deploy Docs
228197
uses: peaceiris/actions-gh-pages@v3
229-
if: matrix.node-version == 18 && github.ref == 'refs/heads/main'
198+
if: github.ref == 'refs/heads/main'
230199
with:
231200
github_token: ${{ secrets.GITHUB_TOKEN }}
232201
publish_dir: ./src/.vitepress/dist

.github/workflows/sync.yml

+9-14
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@ permissions:
88
contents: write
99
pull-requests: write
1010

11+
env:
12+
NODE_VERSION: 18
13+
1114
jobs:
1215
test:
13-
runs-on: ${{ matrix.os }}
14-
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
os:
19-
- ubuntu-latest
20-
node-version:
21-
- 18
16+
runs-on: ubuntu-latest
2217

2318
steps:
2419
- name: Git Checkout
@@ -41,17 +36,17 @@ jobs:
4136
restore-keys: |
4237
${{ runner.os }}-yarn-
4338
44-
- name: Use Node.js ${{ matrix.node-version }}
39+
- name: Use Node.js ${{ env.NODE_VERSION }}
4540
uses: actions/setup-node@v4
4641
with:
47-
node-version: ${{ matrix.node-version }}
42+
node-version: ${{ env.NODE_VERSION }}
4843
cache: "yarn"
4944

5045
- name: Install Deps
5146
run: yarn install --immutable
5247

5348
- name: Run Sync
54-
run: yarn icon:sync
49+
run: yarn icon:sync && yarn ilustration:sync
5550
env:
5651
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
5752
FIGMA_FILE_ID: ${{ secrets.FIGMA_FILE_ID }}
@@ -61,5 +56,5 @@ jobs:
6156
with:
6257
token: ${{ secrets.PAT }}
6358
branch: feat/sync-icon
64-
commit-message: "chore(persona-icon): sync with figma"
65-
title: "chore(persona-icon): sync with figma"
59+
commit-message: "chore: sync with figma"
60+
title: "chore: sync with figma"

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@privyid/design-system",
3-
"version": "1.0.0-rc.3",
3+
"version": "1.0.0-rc.4",
44
"packageManager": "[email protected]",
55
"private": true,
66
"type": "module",
@@ -23,22 +23,23 @@
2323
"release": "yarn workspaces foreach -A -v --topological-dev --no-private npm publish --tolerate-republish",
2424
"release:prepare": "yarn workspaces foreach -A -v --topological-dev version",
2525
"icon:sync": "yarn workspace @privyid/persona-icon sync",
26-
"icon:changelog": "yarn workspace @privyid/persona-icon changelog"
26+
"icon:changelog": "yarn workspace @privyid/persona-icon changelog",
27+
"ilustration:sync": "yarn workspace @privyid/persona-ilustration sync",
28+
"ilustration:changelog": "yarn workspace @privyid/persona-ilustration changelog"
2729
},
2830
"devDependencies": {
29-
"@interactjs/types": "1.10.26",
31+
"@interactjs/types": "1.10.27",
3032
"@privyid/browserslist-config": "workspace:^",
3133
"@privyid/eslint-config-persona": "workspace:^",
3234
"@privyid/tailwind-preset": "workspace:^",
33-
"@rushstack/eslint-patch": "1.9.0",
35+
"@rushstack/eslint-patch": "1.10.1",
3436
"@testing-library/jest-dom": "6.4.2",
3537
"@testing-library/vue": "8.0.3",
3638
"@types/html-escaper": "^3",
3739
"@types/lodash-es": "4.17.12",
3840
"@types/marked": "^6.0.0",
3941
"@types/sanitize-html": "^2",
4042
"@types/scroll-into-view": "^1",
41-
"@types/testing-library__jest-dom": "6.0.0",
4243
"@types/webfontloader": "1.6.38",
4344
"@types/zxcvbn": "^4",
4445
"@typescript-eslint/eslint-plugin": "5.62.0",
@@ -93,7 +94,7 @@
9394
"fast-equals": "^5.0.0",
9495
"fuse.js": "7.0.0",
9596
"html-escaper": "^3.0.3",
96-
"interactjs": "1.10.26",
97+
"interactjs": "1.10.27",
9798
"lodash-es": "4.17.21",
9899
"marked": "^12.0.0",
99100
"nanodelay": "2.0.2",

packages/browserslist-config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@privyid/browserslist-config",
33
"description": "Browserslist shareable config for Persona project",
4-
"version": "1.0.0-rc.3",
4+
"version": "1.0.0-rc.4",
55
"packageManager": "[email protected]",
66
"license": "MIT",
77
"repository": {

packages/eslint-config-persona/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@privyid/eslint-config-persona",
33
"description": "Eslint shareable config for Persona project",
4-
"version": "1.0.0-rc.3",
4+
"version": "1.0.0-rc.4",
55
"packageManager": "[email protected]",
66
"license": "MIT",
77
"repository": {

packages/persona-icon/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@privyid/persona-icon",
33
"description": "Persona icon package",
4-
"version": "1.0.0-rc.3",
4+
"version": "1.0.0-rc.4",
55
"packageManager": "[email protected]",
66
"type": "module",
77
"main": "./dist/module.cjs",
@@ -42,21 +42,21 @@
4242
],
4343
"scripts": {
4444
"prepack": "yarn build",
45-
"build": "nuxt-module-build",
45+
"build": "nuxt-module-build build",
4646
"lint": "jiti scripts/lint.ts",
4747
"sync": "jiti scripts/sync.ts",
4848
"changelog": "jiti scripts/changelog.ts"
4949
},
5050
"devDependencies": {
51-
"@nuxt/module-builder": "^0.5.0",
51+
"@nuxt/module-builder": "^0.5.5",
5252
"@types/fs-extra": "^11",
5353
"@types/minimist": "^1",
5454
"dotenv": "^16.0.3",
5555
"figma-api": "^1.11.0",
5656
"fs-extra": "^11.1.1",
57-
"got": "^14.2.1",
5857
"jiti": "^1.18.2",
5958
"minimist": "^1.2.8",
59+
"ofetch": "^1.3.4",
6060
"ohash": "^1.1.2",
6161
"ora": "^8.0.0",
6262
"p-all": "^5.0.0",

packages/persona-icon/scripts/changelog.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { resolve } from 'node:path'
66
import { readJSON } from 'fs-extra'
77
import { name } from '../package.json'
88
import type { MetaData } from './types'
9-
import got from 'got'
9+
import { ofetch } from 'ofetch'
1010
import ohash from 'ohash'
1111
import minimist from 'minimist'
1212
import {
@@ -29,12 +29,11 @@ function getFilesData (metadata: MetaData[]): Record<string, CompareMeta> {
2929

3030
async function getMeta (version: string): Promise<MetaData[]> {
3131
try {
32-
if (version === 'local')
33-
return await readJSON(META_FILE)
34-
35-
const response = await got(`https://unpkg.io/${name}@${version}/svg/meta.json`)
36-
37-
return JSON.parse(response.body)
32+
return await (
33+
version === 'local'
34+
? readJSON(META_FILE)
35+
: ofetch(`https://unpkg.io/${name}@${version}/svg/meta.json`, { responseType: 'json' })
36+
)
3837
} catch {
3938
return []
4039
}

packages/persona-icon/scripts/sync.ts

+19-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { createFont } from './create-font'
3131
import pAll from 'p-all'
3232
import ohash from 'ohash'
3333
import minimist from 'minimist'
34-
import got from 'got'
34+
import { ofetch } from 'ofetch'
3535

3636
const argv = minimist(process.argv.slice(2))
3737
const TOKEN = process.env.FIGMA_TOKEN ?? ''
@@ -81,7 +81,7 @@ const svgoConfig: Config = {
8181
if (node.attributes.d)
8282
node.attributes.d = fixPath(node.attributes.d)
8383

84-
if (node.attributes.fill !== 'none')
84+
if (node.attributes.fill !== 'none' && !node.attributes.fill.startsWith('url'))
8585
node.attributes.fill = 'currentColor'
8686
}
8787
},
@@ -101,9 +101,24 @@ const svgoConfig: Config = {
101101
name : 'preset-default',
102102
params: { overrides: { removeViewBox: false } },
103103
},
104+
{
105+
name : 'prefixIds',
106+
params: {
107+
delim : '_',
108+
prefix : genId,
109+
prefixClassNames: false,
110+
prefixIds : true,
111+
},
112+
},
104113
],
105114
}
106115

116+
let svgoId = 0
117+
118+
function genId () {
119+
return (++svgoId).toString(36)
120+
}
121+
107122
async function getLockData (): Promise<Map<string, ObjectData>> {
108123
let data: Record<string, ObjectData> = {}
109124

@@ -263,8 +278,8 @@ async function main () {
263278
if (object && url) {
264279
spinner.start(`[${count}/${total}] - Downloading ${object.filename}`)
265280

266-
const res = await got(url)
267-
const svg = optimize(res.body, svgoConfig).data
281+
const res = await ofetch(url, { responseType: 'text', retry: 3 })
282+
const svg = optimize(res, svgoConfig).data
268283

269284
await ensureFile(resolve(SVG_DIR, object.filepath))
270285
await writeFile(resolve(SVG_DIR, object.filepath), svg)
Loading
Loading

0 commit comments

Comments
 (0)