Skip to content

Commit c72d371

Browse files
committed
feat: update deps and fix lint error, types error
1 parent 7045a9e commit c72d371

45 files changed

Lines changed: 2002 additions & 1470 deletions

Some content is hidden

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

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ module.exports = {
1010
'prettier/prettier': 'error',
1111
'antfu/if-newline': 'off',
1212
},
13+
globals: {
14+
process: true,
15+
},
1316
}

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@
1111
"prepublishOnly": "pnpm run build",
1212
"test": "vitest",
1313
"release": "bumpp packages/*/package.json templates/*/package.json --no-verify --commit --push --tag",
14-
"check-type": "tsc --noEmit"
14+
"typecheck": "tsc --noEmit"
1515
},
1616
"dependencies": {
17-
"eslint-plugin-prettier": "^4.2.1"
17+
"eslint-plugin-prettier": "^5.0.0"
1818
},
1919
"devDependencies": {
20-
"@antfu/eslint-config-react": "^0.38.2",
20+
"@antfu/eslint-config-react": "^0.40.2",
2121
"@resumejs/components": "workspace:*",
22-
"@testing-library/jest-dom": "^5.16.5",
22+
"@testing-library/jest-dom": "^5.17.0",
2323
"@testing-library/react": "14.0.0",
24-
"@types/node": "^18.15.11",
25-
"@types/react": "^18.0.32",
26-
"@types/react-dom": "^18.0.11",
27-
"@vitejs/plugin-react": "^3.1.0",
28-
"bumpp": "^9.1.0",
29-
"eslint": "^8.37.0",
30-
"eslint-config-prettier": "^8.8.0",
31-
"jsdom": "^21.1.1",
32-
"pnpm": "^8.1.0",
33-
"prettier": "^2.8.7",
24+
"@types/node": "^20.4.9",
25+
"@types/react": "^18.2.20",
26+
"@types/react-dom": "^18.2.7",
27+
"@vitejs/plugin-react": "^4.0.4",
28+
"bumpp": "^9.1.1",
29+
"eslint": "^8.46.0",
30+
"eslint-config-prettier": "^9.0.0",
31+
"jsdom": "^22.1.0",
32+
"pnpm": "^8.6.12",
33+
"prettier": "^3.0.1",
3434
"react": "^18.2.0",
3535
"react-dom": "^18.2.0",
36-
"typescript": "^5.0.3",
37-
"vite": "^4.2.1",
38-
"vitest": "^0.29.8"
36+
"typescript": "^5.1.6",
37+
"vite": "^4.4.9",
38+
"vitest": "^0.34.1"
3939
},
4040
"pnpm": {
4141
"overrides": {

packages/components/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"exports": {
1919
".": {
2020
"types": "./dist/index.d.ts",
21-
"require": "./dist/index.js",
22-
"import": "./dist/index.mjs"
21+
"import": "./dist/index.mjs",
22+
"require": "./dist/index.js"
2323
}
2424
},
2525
"main": "dist/index.js",
@@ -37,28 +37,28 @@
3737
"dependencies": {
3838
"@resumejs/template": "workspace:*",
3939
"@resumejs/template-default": "workspace:*",
40-
"@types/hast": "^2.3.4",
41-
"clsx": "^1.2.1",
42-
"hast-util-has-property": "^2.0.1",
40+
"@types/hast": "^3.0.0",
41+
"clsx": "^2.0.0",
42+
"hast-util-has-property": "^3.0.0",
4343
"react": "^18.2.0",
4444
"react-dom": "^18.2.0",
45-
"react-markdown": "^8.0.6",
45+
"react-markdown": "^8.0.7",
4646
"rehype-raw": "^6.1.1",
4747
"remark-frontmatter": "^4.0.1",
4848
"remark-gfm": "^3.0.1",
4949
"unified": "^10.1.2",
50-
"unist-builder": "^3.0.1",
51-
"unist-util-is": "^5.2.1",
52-
"unist-util-visit": "^4.1.2",
53-
"vite-plugin-dts": "^2.1.0",
54-
"yaml": "^2.2.1"
50+
"unist-builder": "^4.0.0",
51+
"unist-util-is": "^6.0.0",
52+
"unist-util-visit": "^5.0.0",
53+
"vite-plugin-dts": "^3.5.1",
54+
"yaml": "^2.3.1"
5555
},
5656
"devDependencies": {
57-
"@types/mdast": "^3.0.11",
58-
"@types/react": "^18.0.32",
59-
"@types/react-dom": "^18.0.11",
60-
"@vitejs/plugin-react": "^3.1.0",
61-
"vite": "^4.2.1"
57+
"@types/mdast": "^4.0.0",
58+
"@types/react": "^18.2.20",
59+
"@types/react-dom": "^18.2.7",
60+
"@vitejs/plugin-react": "^4.0.4",
61+
"vite": "^4.4.9"
6262
},
6363
"publishConfig": {
6464
"access": "public"

packages/components/src/Resume.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface ResumeProps extends Omit<ReactMarkdownOptions, 'components'> {
3636
onDarkClass?: (className: string, action: 'add' | 'remove') => void
3737
}
3838

39-
export const Resume = (props: ResumeProps) => {
39+
export function Resume(props: ResumeProps) {
4040
const {
4141
children,
4242
rehypePlugins = [],
@@ -91,7 +91,7 @@ export const Resume = (props: ResumeProps) => {
9191
dark: !props.onDarkClass && dark,
9292
},
9393
'r-resume',
94-
props.className
94+
props.className,
9595
)}
9696
components={components}
9797
remarkPlugins={[...remarkPlugins, remarkFrontmatter, meta, remarkGfm]}

packages/components/src/plugins/_util.ts

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,31 @@ import { is } from 'unist-util-is'
33

44
const HeadingTag = ['h1', 'h2', 'h3']
55

6-
export const isTag = (t: any, tagName: string | string[]) =>
7-
is(t, { type: 'element' }) &&
8-
[tagName].flat().includes((t as Element).tagName)
9-
export const isHeading = (t: any, tagName?: string | string[]): t is Element =>
10-
is(t, { type: 'element' }) && tagName
6+
export function isTag(t: any, tagName: string | string[]) {
7+
return (
8+
is(t, { type: 'element' }) &&
9+
[tagName].flat().includes((t as Element).tagName)
10+
)
11+
}
12+
export function isHeading(t: any, tagName?: string | string[]): t is Element {
13+
return is(t, { type: 'element' }) && tagName
1114
? [tagName].flat().includes((t as Element)?.tagName)
1215
: HeadingTag.includes((t as Element)?.tagName)
16+
}
1317
export const isParagraph = (t: any) => is(t, { type: 'element', tagName: 'p' })
14-
export const isTable = (t: any): t is Element =>
15-
is(t, { type: 'element', tagName: 'table' }) &&
16-
HeadingTag.includes((t as Element).tagName)
18+
export function isTable(t: any): t is Element {
19+
return (
20+
is(t, { type: 'element', tagName: 'table' }) &&
21+
HeadingTag.includes((t as Element).tagName)
22+
)
23+
}
1724
export const isText = (t: any): t is Text => is(t, { type: 'text' })
18-
export const isUl = <T>(t: T): t is T =>
19-
is(t, { type: 'element', tagName: 'ul' })
20-
export const isBlockquote = (t: any) =>
21-
is(t, { type: 'element', tagName: 'blockquote' })
22-
export const isImage = (t: any): t is Element =>
23-
is(t, { type: 'element', tagName: 'img' })
25+
export function isUl<T>(t: T): t is T {
26+
return is(t, { type: 'element', tagName: 'ul' })
27+
}
28+
export function isBlockquote(t: any) {
29+
return is(t, { type: 'element', tagName: 'blockquote' })
30+
}
31+
export function isImage(t: any): t is Element {
32+
return is(t, { type: 'element', tagName: 'img' })
33+
}

packages/components/src/plugins/card.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const card: Plugin<[], Root> = function () {
4141
cardList.push({
4242
type: 'element',
4343
tagName: 'card',
44+
properties: {},
4445
position: table.position,
4546
children: cardInfo.map((item, ii) => {
4647
return u(
@@ -51,15 +52,15 @@ export const card: Plugin<[], Root> = function () {
5152
index: ii,
5253
},
5354
},
54-
[item.label, u('text', item.label ? ':' : ''), item.value!]
55+
[item.label, u('text', item.label ? ':' : ''), item.value!],
5556
)
5657
}),
5758
})
58-
}
59+
},
5960
)
6061

6162
parent?.children.splice(index!, 1, ...cardList)
62-
}
63+
},
6364
)
6465
}
6566
}

packages/components/src/plugins/className.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const className: Plugin<[], Element> = function () {
1212
(element as Element).properties,
1313
{
1414
className: clsx(`r-${(element as Element).tagName}`, className),
15-
}
15+
},
1616
)
1717
})
1818
}

packages/components/src/plugins/description.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const description: Plugin<[], Element> = function () {
1616

1717
const prev = parent!.children[index! - 2]
1818
if (isTable(prev) || isHeading(prev)) element.tagName = 'description'
19-
}
19+
},
2020
)
2121
}
2222
}

packages/components/src/plugins/header.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ export const header: Plugin<[], Element> = function () {
5858
parent!.children.splice(index!, 1, {
5959
type: 'element',
6060
tagName: 'header',
61+
properties: {},
6162
children: headerChildren,
6263
})
63-
}
64+
},
6465
)
6566
}
6667
}

packages/components/src/plugins/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const meta: Plugin<[], YAML> = function () {
1212
},
1313
(el) => {
1414
file.data.meta = yaml.parse(el.value)
15-
}
15+
},
1616
)
1717
}
1818
}

0 commit comments

Comments
 (0)