Skip to content

Commit

Permalink
chore:enforce format line prettier in the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegShchavelev committed Aug 17, 2024
1 parent f1533bf commit 173817d
Show file tree
Hide file tree
Showing 35 changed files with 581 additions and 458 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/pr-check-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Test: Build Vitepress'
name: "Test: Build Vitepress"

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check-cspell.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Check: Markdown Spell Check (CSpell)'
name: "Check: Markdown Spell Check (CSpell)"

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check-remark.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Check: ReMark-Lint Markdown Check'
name: "Check: ReMark-Lint Markdown Check"

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check-spell.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Check: Markdown Spell Check (YaSpeller)'
name: "Check: Markdown Spell Check (YaSpeller)"

on:
pull_request:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.prettierrc
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"trailingComma": none,
"trailingComma": "none",
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
Expand Down
42 changes: 27 additions & 15 deletions .tools/gitlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ import * as fs from 'fs'
import * as path from 'path'
import ora from 'ora'
import { cyan, gray, red } from 'colorette'
import { transliterate as tr } from 'transliteration';
import { transliterate as tr } from 'transliteration'

/*
CLI Arguments
*/
const args = yargs(process.argv)
.options({
key: { type: 'string', default: '' },
repoUrl: { type: 'string', default: 'https://github.com/OlegShchavelev/ALTMobileWiki' },
repoUrl: {
type: 'string',
default: 'https://github.com/OlegShchavelev/ALTMobileWiki'
},
debug: { type: 'boolean', default: false }
})
.parse()

const authors = {
'root': [],
'en': []
root: [],
en: []
}

/*
Expand Down Expand Up @@ -79,7 +82,9 @@ const userGetMore = async (user) => {
)
}

for await (const gitter of await contributorsRawBase().then((response) => response)) {
for await (const gitter of await contributorsRawBase().then(
(response) => response
)) {
const userMore = await userGetMore(gitter.author.login)
.then((response) => response.data)
.catch((err) =>
Expand Down Expand Up @@ -123,27 +128,34 @@ for await (const gitter of await contributorsRawBase().then((response) => respon
contributions.root.forEach((memberRaw) => {
if (
memberRaw.name == userMore.name ||
Object.values(memberRaw.links[0])[1] == Object.values(author.links[0])[1] ||
(memberRaw.mapByNameAliases && memberRaw.mapByNameAliases.includes(gitter.author.login))
Object.values(memberRaw.links[0])[1] ==
Object.values(author.links[0])[1] ||
(memberRaw.mapByNameAliases &&
memberRaw.mapByNameAliases.includes(gitter.author.login))
) {
Object.keys(memberRaw).forEach((key) => {
key == 'mapByNameAliases'
? memberRaw[key].forEach((alias) => {
author[key].push(alias)
})
: key == 'title'
? author[key].root = memberRaw[key]
: (author[key] = memberRaw[key])
? (author[key].root = memberRaw[key])
: (author[key] = memberRaw[key])
})
}
})

console.log(author.title)
author.title.root.includes('Разработчик') ? author.title.en = 'Developer, Member' : ''
author.name? '' : author.name = gitter.author.login

authors.en.push({...author, ...{title: author.title.en , name: tr(author.name)}})
authors.root.push({...author, ...{title: author.title.root}})
author.title.root.includes('Разработчик')
? (author.title.en = 'Developer, Member')
: ''
author.name ? '' : (author.name = gitter.author.login)

authors.en.push({
...author,
...{ title: author.title.en, name: tr(author.name) }
})
authors.root.push({ ...author, ...{ title: author.title.root } })
}

fs.writeFile(
Expand All @@ -152,4 +164,4 @@ fs.writeFile(
(err) => err && spiner.fail(err.toString())
)

spiner.succeed(`${toolname} Список успешно сгенерирован!\n`)
spiner.succeed(`${toolname} Список успешно сгенерирован!\n`)
12 changes: 6 additions & 6 deletions .vitepress/config/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { ru } from './ru'
import { en } from './en'

export default defineConfig({
...shared,
locales: {
root: { label: 'Русский', ...ru },
en: { label: 'English', ...en },
}
})
...shared,
locales: {
root: { label: 'Русский', ...ru },
en: { label: 'English', ...en }
}
})
20 changes: 13 additions & 7 deletions .vitepress/config/plugins/NolebaseEnhancedReadabilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ export const NolebaseEnhancedReadabilitiesOptions = {
optionFullWidthAriaLabel: 'Полноэкранный',
titleScreenNavWarningMessage:
'Изменить внешний вид страницы недоступен на экране мобильного устройства',
optionFullWidthHelpMessage: 'Боковая панель и область содержимого занимают всю ширину экрана.',
optionSidebarWidthAdjustableOnly: 'Боковая панель с пользовательской настройкой',
optionSidebarWidthAdjustableOnlyAriaLabel: 'Боковая панель с пользовательской настройкой',
optionFullWidthHelpMessage:
'Боковая панель и область содержимого занимают всю ширину экрана.',
optionSidebarWidthAdjustableOnly:
'Боковая панель с пользовательской настройкой',
optionSidebarWidthAdjustableOnlyAriaLabel:
'Боковая панель с пользовательской настройкой',
optionSidebarWidthAdjustableOnlyHelpMessage:
'Увеличьте ширину боковой панели, максимальная ширина боковой панели может изменяться, но ширина области содержимого останется прежней.',
optionBothWidthAdjustable: 'Полноэрканный с пользовательской настройкой',
optionBothWidthAdjustableAriaLabel: 'Полноэрканный с пользовательской настройкой',
optionBothWidthAdjustable:
'Полноэрканный с пользовательской настройкой',
optionBothWidthAdjustableAriaLabel:
'Полноэрканный с пользовательской настройкой',
optionBothWidthAdjustableHelpMessage:
'Управляется шириной боковой панели, и шириной содержания документа. Настройте желаемую ширину максимальной ширины боковой панели и содержимого документа.',
optionOriginalWidth: 'Оригинальная ширина',
Expand Down Expand Up @@ -55,7 +60,8 @@ export const NolebaseEnhancedReadabilitiesOptions = {
titleAriaLabel: 'Фокус',
titleHelpMessage:
'Выделите строку, на которой в данный момент находится курсор мыши, в содержимом, для удобства пользователей, у которых могут возникнуть трудности с чтением и фокусировкой.',
titleScreenNavWarningMessage: 'Фокус недоступен на экране мобильного устройства.',
titleScreenNavWarningMessage:
'Фокус недоступен на экране мобильного устройства.',
optionOn: 'Включить',
optionOnAriaLabel: 'Включить',
optionOnHelpMessage: 'Включите фокус.',
Expand All @@ -77,4 +83,4 @@ export const NolebaseEnhancedReadabilitiesOptions = {
}
}
}
}
}
20 changes: 10 additions & 10 deletions .vitepress/config/plugins/NolebaseGitChangelog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ export const NolebaseGitChangelogOptions = {
locales: {
'ru-RU': {
changelog: {
title: 'История изменений',
noData: 'Нет изменений',
lastEdited: 'Последнее редактирование: {{daysAgo}}',
lastEditedDateFnsLocaleName: 'ru',
viewFullHistory: 'Показать историю',
committedOn: ' от {{date}}'
},
contributors: {
title: 'История изменений',
noData: 'Нет изменений',
lastEdited: 'Последнее редактирование: {{daysAgo}}',
lastEditedDateFnsLocaleName: 'ru',
viewFullHistory: 'Показать историю',
committedOn: ' от {{date}}'
},
contributors: {
title: 'Авторы',
noData: 'Нет информации'
}
}
},
}
}
}
2 changes: 1 addition & 1 deletion .vitepress/config/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { NolebaseEnhancedReadabilitiesOptions } from './NolebaseEnhancedReadabilities/index'
export { NolebaseGitChangelogOptions } from './NolebaseGitChangelog/index'
export { NolebaseGitChangelogOptions } from './NolebaseGitChangelog/index'
6 changes: 4 additions & 2 deletions .vitepress/config/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const ru = defineConfigWithTheme({
next: 'Следующая страница'
},
editLink: {
pattern: 'https://github.com/OlegShchavelev/ALTMobileWiki/tree/main/docs/:path',
pattern:
'https://github.com/OlegShchavelev/ALTMobileWiki/tree/main/docs/:path',
text: 'Предложить изменения на этой странице'
},
lastUpdated: {
Expand All @@ -23,7 +24,8 @@ export const ru = defineConfigWithTheme({
outlineTitle: 'Оглавление',
notFound: {
title: 'Страница не найдена',
quote: 'Похоже, что вы перешли по неверной или устаревшей ссылке. Вы можете воспользоваться поиском.',
quote:
'Похоже, что вы перешли по неверной или устаревшей ссылке. Вы можете воспользоваться поиском.',
linkText: 'Вернуться на главную'
},
footer: {
Expand Down
18 changes: 14 additions & 4 deletions .vitepress/config/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import markdownTimeline from 'vitepress-markdown-timeline'
import { tabsMarkdownPlugin as markdownItTabs } from 'vitepress-plugin-tabs'
import markdownItTaskLists from 'markdown-it-task-lists'
import UnoCSS from 'unocss/vite'
import { GitChangelog, GitChangelogMarkdownSection } from '@nolebase/vitepress-plugin-git-changelog/vite'
import {
GitChangelog,
GitChangelogMarkdownSection
} from '@nolebase/vitepress-plugin-git-changelog/vite'

import { telegram } from '../data/icons'

Expand All @@ -27,14 +30,20 @@ export const shared = defineConfig({
exclude: ['@nolebase/vitepress-plugin-enhanced-readabilities/client']
},
ssr: {
noExternal: ['@nolebase/vitepress-plugin-enhanced-readabilities', '@nolebase/ui']
noExternal: [
'@nolebase/vitepress-plugin-enhanced-readabilities',
'@nolebase/ui'
]
}
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: { src: '/logo.svg', width: 36, height: 36, alt: 'ALT Mobile Wike' },
socialLinks: [
{ icon: 'github', link: 'https://github.com/OlegShchavelev/ALTMobileWiki' },
{
icon: 'github',
link: 'https://github.com/OlegShchavelev/ALTMobileWiki'
},
{
icon: {
svg: telegram
Expand All @@ -43,7 +52,8 @@ export const shared = defineConfig({
}
],
editLink: {
pattern: 'https://github.com/OlegShchavelev/ALTMobileWiki/tree/main/docs/:path'
pattern:
'https://github.com/OlegShchavelev/ALTMobileWiki/tree/main/docs/:path'
},
outline: {
level: [2, 3]
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/data/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ const gitverse = `
</svg>
`

export { telegram, gitflic, gitlab, vk, messager, gitverse }
export { telegram, gitflic, gitlab, vk, messager, gitverse }
10 changes: 8 additions & 2 deletions .vitepress/data/navigations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export const sidebar = {
items: [
{ text: 'Загрузчик', link: '/booting/' },
{ text: 'Мобильные устройства', link: '/mobile-devices/' },
{ text: 'Портативные игровые приставки', link: '/portable-game-consoles/' },
{
text: 'Портативные игровые приставки',
link: '/portable-game-consoles/'
},
{ text: 'Виртуальная машина', link: '/virtual-machine/' }
],
collapsed: true
Expand Down Expand Up @@ -94,7 +97,10 @@ export const sidebar = {
items: [
{ text: 'The loader', link: '/booting/' },
{ text: 'Mobile devices', link: '/mobile-devices/' },
{ text: 'Portable Game Consoles', link: '/portable-game-consoles/' },
{
text: 'Portable Game Consoles',
link: '/portable-game-consoles/'
},
{ text: 'Virtual machine', link: '/virtual-machine/' }
],
collapsed: true
Expand Down
Loading

0 comments on commit 173817d

Please sign in to comment.