Skip to content

Commit

Permalink
chore: bump dependencies (#224)
Browse files Browse the repository at this point in the history
Signed-off-by: Neko Ayaka <[email protected]>
  • Loading branch information
nekomeowww authored May 24, 2024
1 parent a407735 commit 1595676
Show file tree
Hide file tree
Showing 26 changed files with 589 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-docs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/production-docs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: '9.1.0'
version: '9.1.2'
run_install: false

- name: Get pnpm store directory
Expand Down
3 changes: 3 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dictionaryDefinitions: []
dictionaries: []
words:
- antfu
- apng
- asciicast
- asciinema
- Astro
Expand Down Expand Up @@ -31,6 +32,7 @@ words:
- Gitea
- graymatter
- iconify
- jfif
- Logseq
- mkdist
- napi
Expand All @@ -43,6 +45,7 @@ words:
- Noto
- octicon
- Petch
- pjpeg
- quotepath
- Rehype
- resvg
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"docs:preview": "vitepress preview"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.32",
"@iconify-json/carbon": "^1.1.34",
"@iconify-json/fluent-emoji": "^1.1.18",
"@iconify-json/icon-park-outline": "^1.1.15",
"@iconify-json/octicon": "^1.1.54",
Expand All @@ -33,7 +33,7 @@
"@nolebase/vitepress-plugin-thumbnail-hash": "workspace:^",
"@rive-app/canvas": "^2.15.6",
"@rollup/plugin-yaml": "^4.1.2",
"@shikijs/vitepress-twoslash": "^1.5.1",
"@shikijs/vitepress-twoslash": "^1.6.0",
"@types/markdown-it": "^13.0.8",
"@types/markdown-it-footnote": "^3.0.4",
"@vueuse/motion": "^2.1.0",
Expand All @@ -44,6 +44,6 @@
"motion": "^10.17.0",
"thumbhash": "^0.1.1",
"unlazy": "^0.11.3",
"vite-plugin-vue-devtools": "^7.1.3"
"vite-plugin-vue-devtools": "^7.2.1"
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nolebase/integrations",
"type": "module",
"version": "2.0.0-rc14",
"packageManager": "[email protected].0",
"packageManager": "[email protected].2",
"description": "A collection of diverse documentation engineering tools.",
"author": {
"name": "Nólëbase",
Expand Down Expand Up @@ -36,9 +36,9 @@
"test:run": "vitest run"
},
"devDependencies": {
"@antfu/eslint-config": "^2.17.0",
"@antfu/eslint-config": "^2.18.1",
"@antfu/ni": "^0.21.12",
"@types/node": "^20.12.11",
"@types/node": "^20.12.12",
"@unocss/cli": "^0.59.4",
"@unocss/eslint-config": "^0.58.9",
"@unocss/eslint-plugin": "^0.58.9",
Expand All @@ -49,14 +49,14 @@
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"less": "^4.2.0",
"rimraf": "^5.0.6",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"unbuild": "^2.0.0",
"unocss": "^0.57.7",
"unplugin-vue-macros": "^2.9.2",
"vite": "^5.2.11",
"vite-plugin-inspect": "^0.8.4",
"vitepress": "^1.1.4",
"vitepress": "^1.2.2",
"vitest": "^1.6.0",
"vue": "3.4.26",
"vue-tsc": "^1.8.27"
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-it-bi-directional-links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"colorette": "^2.0.20",
"debug": "^4.3.4",
"glob": "^10.3.14"
"glob": "^10.4.1"
},
"devDependencies": {
"@types/debug": "^4.1.12",
Expand Down
5 changes: 3 additions & 2 deletions packages/markdown-it-bi-directional-links/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import packageJSON from '../package.json'
import { findBiDirectionalLinks, genImage, genLink } from './utils'

/** it will match [[file]] and [[file|text]] */
const biDirectionalLinkPattern = /\!?\[\[([^|\]\n]+)(\|([^\]\n]+))?\]\](?!\()/
const biDirectionalLinkPattern = /!?\[\[([^|\]\n]+)(\|([^\]\n]+))?\]\](?!\()/
/** it will match [[file]] and [[file|text]] but only at the start of the text */
const biDirectionalLinkPatternWithStart = /^\!?\[\[([^|\]\n]+)(\|([^\]\n]+))?\]\](?!\()/
// eslint-disable-next-line regexp/no-unused-capturing-group
const biDirectionalLinkPatternWithStart = /^!?\[\[[^|\]\n]+(\|[^\]\n]+)?\]\](?!\()/

const IMAGES_EXTENSIONS = [
'.png',
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown-it-unlazy-img/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"dependencies": {
"colorette": "^2.0.20",
"glob": "^10.3.14",
"glob": "^10.4.1",
"vite": "^5.2.11"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"vitepress": "^1.1.4"
},
"dependencies": {
"@iconify-json/carbon": "^1.1.32",
"@iconify-json/carbon": "^1.1.34",
"@iconify-json/icon-park-outline": "^1.1.15",
"@nolebase/ui": "workspace:^",
"less": "^4.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest'
import type { Contributor } from '../../types'
import type { Commit, Contributor } from '../../types'
import {
extractAuthorsWithMultiple,
findMapAuthorByEmail,
findMapAuthorByName,
findMapAuthorLink,
Expand Down Expand Up @@ -286,3 +287,28 @@ describe('mapCommitAuthors', () => {
})
})
})

describe('extractAuthorsWithMultiple', () => {
it('should match multiple authors', async () => {
const multipleAuthors = `
Co-authored-by: Standard <[email protected]>
Co-authored-by: Spaced LastSpaced <[email protected]> `

const authors = {}
await extractAuthorsWithMultiple([], authors, { body: multipleAuthors } as Commit)
expect(authors).toEqual({
'Standard': {
name: 'Standard',
commitsCount: 1,
avatarUrl: 'https://gravatar.com/avatar/1f39f2ec8cfad7452e421075f63b5c70fbee98736bd91b52d20161f8148ce38d?d=retro',
url: undefined,
},
'Spaced LastSpaced': {
name: 'Spaced LastSpaced',
commitsCount: 1,
avatarUrl: 'https://gravatar.com/avatar/d2bb5cf8baea77e9c60741c9815f13128ea1928b8a5342362af99d1f6fa69e07?d=retro',
url: undefined,
},
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ export function findMapAuthorLink(creator: Contributor): string | undefined {
* @see {@link https://en.wikipedia.org/wiki/Email_address#Local-part | Email addres}
* @see {@link https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors | Creating a commit with multiple authors in GitHub}
*/
const multipleAuthorsRegex = /^ *?Co-authored-by: ?(.*) ?(?:<)(.*)(?:>) *?/gmi
const multipleAuthorsRegex = /^ *Co-authored-by: ?([^<]*)<([^>]*)> */gim

// This function handles multiple authors in a commit.
// It uses the regular expression to extract the name and email of each author from the commit message.
// About the docs: https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors
export async function extractAuthorsWithMultiple(
mapContributors: Contributor[] | undefined,
map: Record<string, AuthorInfo>,
c: Commit,
authorDataMap: Record<string, AuthorInfo>,
c: Pick<Commit, 'body'>,
) {
if (!c.body)
return
Expand All @@ -73,7 +73,7 @@ export async function extractAuthorsWithMultiple(
// eslint-disable-next-line no-cond-assign
while (result = multipleAuthorsRegex.exec(c.body)) {
const [, name, email] = result
await mapCommitAuthors(mapContributors, map, {
await mapCommitAuthors(mapContributors, authorDataMap, {
author_name: name.trim(),
author_email: email.trim(),
author_avatar: await digestStringAsSHA256(email.trim()),
Expand Down
26 changes: 13 additions & 13 deletions packages/vitepress-plugin-git-changelog/src/client/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import { subtle } from 'uncrypto'

export function renderMarkdown(markdownText = '') {
const htmlText = markdownText
.replace(/</gm, '&lt;')
.replace(/>/gm, '&gt;')
.replace(/^### (.*$)/gim, '<h3>$1</h3>')
.replace(/^## (.*$)/gim, '<h2>$1</h2>')
.replace(/^# (.*$)/gim, '<h1>$1</h1>')
.replace(/^\> (.*$)/gim, '<blockquote>$1</blockquote>')
.replace(/\*\*(.*)\*\*/gim, '<b>$1</b>')
.replace(/\*(.*)\*/gim, '<i>$1</i>')
.replace(/!\[(.*?)\]\((.*?)\)/gim, '<img alt=\'$1\' src=\'$2\' />')
.replace(/\[(.*?)\]\((.*?)\)/gim, '<a href=\'$2\'>$1</a>')
.replace(/`(.*?)`/gim, '<code>$1</code>')
.replace(/\n$/gim, '<br />')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/^### (.*$)/gm, '<h3>$1</h3>')
.replace(/^## (.*$)/gm, '<h2>$1</h2>')
.replace(/^# (.*$)/gm, '<h1>$1</h1>')
.replace(/^> (.*$)/gm, '<blockquote>$1</blockquote>')
.replace(/\*\*(.*)\*\*/g, '<b>$1</b>')
.replace(/\*(.*)\*/g, '<i>$1</i>')
.replace(/!\[(.*?)\]\((.*?)\)/g, '<img alt=\'$1\' src=\'$2\' />')
.replace(/\[(.*?)\]\((.*?)\)/g, '<a href=\'$2\'>$1</a>')
.replace(/`(.*?)`/g, '<code>$1</code>')
.replace(/\n$/gm, '<br />')

return htmlText.trim()
}

export function renderCommitMessage(repoLink: string, msg: string) {
return renderMarkdown(msg)
.replace(/\#([0-9]+)/g, `<a href=\'${repoLink}/issues/$1\'>#$1</a>`)
.replace(/#(\d+)/g, `<a href=\'${repoLink}/issues/$1\'>#$1</a>`)
}

export function formatDistanceToNowFromValue(value: Date, localeName = 'enUS') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export async function parseCommits(
commit.hash_url = (await returnOrResolvePromise(getCommitURL(commit))) ?? defaultCommitURLHandler(commit)

// remove `()` in refs, e.g. ` (tag: v2.0.0-rc7)`
const tags = parseGitLogRefsAsTags(refs?.replace(/[\(\)]/g, ''))
const tags = parseGitLogRefsAsTags(refs?.replace(/[()]/g, ''))

// release logs
if (tags && tags.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-plugin-graph-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"colorette": "^2.0.20",
"d3": "^7.9.0",
"d3-force": "^3.0.0",
"glob": "^10.3.14",
"glob": "^10.4.1",
"less": "^4.2.0",
"ora": "^8.0.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export const InlineLinkPreviewElementTransform: PluginWithOptions<{ tag: string
transform(token) {
switch (token.type) {
case 'html_inline':
if (/<a.*(data-inline-link-preview="false").*>/.test(token.content))
if (/<a.*data-inline-link-preview="false".*>/.test(token.content))
return

if (/<a.*class=("header-anchor"|".* header-anchor"|"header-anchor .*"|".* header-anchor .*").*>/.test(token.content))
if (/<a.*class="header-anchor"|".* header-anchor"|"header-anchor .*"|".* header-anchor [^\n\r"\u2028\u2029]*".*>/.test(token.content))
return

if (/<a.*class=("no-inline-link-preview"|".* no-inline-link-preview"|"no-inline-link-preview .*"|".* no-inline-link-preview .*").*>/.test(token.content))
if (/<a.*class="no-inline-link-preview"|".* no-inline-link-preview"|"no-inline-link-preview .*"|".* no-inline-link-preview [^\n\r"\u2028\u2029]*".*>/.test(token.content))
return

if (!transformNextHtmlInlineCloseToken) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-plugin-meta/src/vitepress/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function RehypeRetext(option: { selector: string, removeSelectors: string[] }):
return

const text = toText(vpDocElement)
.replaceAll(/(\n){2,}/gm, ' ')
.replaceAll(/(\n){2,}/g, ' ')

nodes.children = [{ type: 'text', value: text }]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-plugin-og-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"colorette": "^2.0.20",
"emoji-regex": "^10.3.0",
"fs-extra": "^11.2.0",
"glob": "^10.3.14",
"glob": "^10.4.1",
"gray-matter": "^4.0.3",
"ora": "^8.0.1",
"rehype": "^13.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const escapeMap: Record<string, string> = {
}

export function escape(content: string, ignore?: string): string {
ignore = (ignore || '').replace(/[^&"<>\']/g, '')
ignore = (ignore || '').replace(/[^&"<>']/g, '')
const pattern = '([&"<>\'])'.replace(new RegExp(`[${ignore}]`, 'g'), '')

return content.replace(new RegExp(pattern, 'g'), (_, item) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function templateSVG(siteName: string, siteDescription: string, title: st
line3: `${lines[2] || ''}${lines[3] ? '...' : ''}`,
}

return ogTemplate.replace(/\{\{([^}]+)}}/g, (_, name) => {
return ogTemplate.replace(/\{\{([^}]+)\}\}/g, (_, name) => {
if (!name || typeof name !== 'string' || !(name in data))
return ''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function PagePropertiesMarkdownSection(options?: PagePropertiesMarkdownSe
const hasFrontmatter = Object.keys(parsedMarkdownContent.data).length > 0

// match any heading and move heading to top, then insert component after heading
const headingMatch = parsedMarkdownContent.content.match(/^#{1} .*/m)
const headingMatch = parsedMarkdownContent.content.match(/^# .*/m)
if (!headingMatch || !headingMatch[0] || headingMatch.index === undefined) {
if (!hasFrontmatter)
return `${targetComponent}\n\n${code}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const languageHandlers: Record<string, LanguageHandler> = {
wordsPerMinute: 300, // Average reading speed for Chinese
},
latinCyrillic: {
regex: /[\p{Script=Latin}\p{Script=Cyrillic}\p{Mark}\p{Punctuation}\p{Number}'\b]+/gu, // Match Latin and Cyrillic characters
regex: /[\p{Script=Latin}\p{Script=Cyrillic}\p{Mark}\p{Punctuation}\p{Number}]+/gu, // Match Latin and Cyrillic characters
wordsPerMinute: 160, // Average reading speed for English and similar languages
},
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-plugin-thumbnail-hash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@unlazy/vue": "^0.11.3",
"canvaskit-wasm": "^0.39.1",
"colorette": "^2.0.20",
"glob": "^10.3.14",
"glob": "^10.4.1",
"less": "^4.2.0",
"ora": "^8.0.1",
"thumbhash": "^0.1.1",
Expand Down
Loading

0 comments on commit 1595676

Please sign in to comment.