Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy 20240102 #140

Merged
merged 7 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"files.associations": {
"*.css": "postcss"
},
"editor.formatOnSave": false,
"i18n-ally.localesPaths": [
"locale"
],
Expand All @@ -54,11 +53,34 @@
"i18n-ally.namespace": true,
"i18n-ally.sourceLanguage": "en",

// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
Expand All @@ -69,7 +91,7 @@
"markdown",
"json",
"jsonc",
"yaml"
"yaml",
"toml"
]

}
2 changes: 1 addition & 1 deletion components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const links: {
</div>
<div>
<p>
Cytoid built by <a href="https://cytoid.io/profile/tigerhix" class="link link-hover">TigerHix</a> and <a href="https://cytoid.io/profile/neo" class="link link-hover">Neo</a>. All rights
Cytoid built by <a href="https://cytoid.io/profile/tigerhix" class="link link-hover">TigerHix</a>, <a href="https://cytoid.io/profile/neo" class="link link-hover">Neo</a> and <a href="https://cytoid.io/profile/teages_0v0" class="link link-hover">Teages</a>. All rights
reserved.
</p>
</div>
Expand Down
3 changes: 1 addition & 2 deletions composables/cytoidPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ function getDefault() {

function getDefaultMeta(title?: string): Parameters<typeof useSeoMeta>[0] {
const config = useRuntimeConfig()
const { t } = useLocales()

const webUrl = config.public.webURL
const staticURL = config.public.staticURL
const _title = title || 'Cytoid'
const imageUrl = `${staticURL}/img/session.jpg`
const description = t('homepage.slogan')
const description = config.public.description // TODO: i18n
return {
title: _title,
description,
Expand Down
6 changes: 1 addition & 5 deletions composables/locales.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { useI18n } from 'vue-i18n'
import { formatDistanceToNow, formatRelative, parseISO } from 'date-fns'

// @ts-expect-error https://github.com/date-fns/date-fns/issues/2629
import { cs, de, enUS, es, hu, id, ja, ko, ptBR, th, vi, zhCN, zhTW } from 'date-fns/locale/index.js'

// import { enUS, zhCN, zhTW, ptBR, th, vi, ja, es, id, cs, de, hu, ko } from 'date-fns/locale'
// ^ TODO: back to this after https://github.com/date-fns/date-fns/pull/3099
import { cs, de, enUS, es, hu, id, ja, ko, ptBR, th, vi, zhCN, zhTW } from 'date-fns/locale'

export function useLocales() {
const locales: Array<{ name: string, code: string, loaded?: boolean }> = [
Expand Down
7 changes: 5 additions & 2 deletions composables/marked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { marked } from 'marked'
import sanitizeHtml from 'sanitize-html'

export function useSafeMarked(safeMdText: string) {
marked.use({})
return marked.parse(safeMdText)
marked.use({
async: false,
})
return marked.parse(safeMdText) as string
}

export function useMarkedWithCleaner(mdText: string) {
Expand All @@ -12,6 +14,7 @@ export function useMarkedWithCleaner(mdText: string) {
'img',
'details',
'summary',
'del',
]),
})
}
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default defineNuxtConfig({

runtimeConfig: {
public: {
description: pkg.description,
assetURL: config.get('assetURL'),
staticURL: config.get('staticURL'),
serviceURLClient: config.get('serviceURLClient'),
Expand Down Expand Up @@ -98,7 +99,6 @@ export default defineNuxtConfig({
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }, // would be replace in runtime
],
link: [
{ rel: 'icon', href: '/favicon.ico', sizes: 'any', type: 'image/vnd.microsoft.icon' },
Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"graphql": "^16.8.1"
},
"devDependencies": {
"@antfu/eslint-config": "^2.2.2",
"@antfu/eslint-config": "^2.4.5",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@headlessui/tailwindcss": "^0.2.0",
"@headlessui/vue": "^1.7.16",
"@nuxt/devtools": "^1.0.4",
"@nuxt/devtools": "^1.0.6",
"@nuxtjs/device": "^3.1.1",
"@nuxtjs/google-fonts": "^3.1.0",
"@nuxtjs/google-fonts": "^3.1.3",
"@nuxtjs/i18n": "8.0.0-rc.6",
"@nuxtjs/tailwindcss": "^6.10.1",
"@nuxtjs/turnstile": "^0.6.3",
Expand All @@ -37,33 +37,34 @@
"@types/glob": "^8.1.0",
"@types/howler": "^2.2.11",
"@types/lodash": "^4.14.202",
"@types/node": "^20.10.3",
"@types/node": "^20.10.4",
"@types/sanitize-html": "^2.9.5",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"@urql/core": "^4.2.0",
"@vite-pwa/nuxt": "^0.3.3",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@urql/core": "^4.2.2",
"@vite-pwa/nuxt": "^0.3.5",
"@vitejs/plugin-legacy": "^5.2.0",
"@vueuse/components": "^10.6.1",
"@vueuse/nuxt": "^10.6.1",
"@vueuse/components": "^10.7.0",
"@vueuse/nuxt": "^10.7.0",
"@wasm-audio-decoders/ogg-vorbis": "^0.1.14",
"apexcharts": "^3.44.1",
"apexcharts": "^3.44.2",
"config": "^3.3.9",
"cross-env": "^7.0.3",
"daisyui": "^3.9.4",
"date-fns": "^2.30.0",
"date-fns": "^3.0.6",
"dotenv": "^16.3.1",
"easymde": "^2.18.0",
"eslint": "^8.55.0",
"howler": "^2.2.4",
"marked": "^11.0.0",
"nuxt": "^3.8.2",
"marked": "^11.1.0",
"nuxt": "^3.9.0",
"nuxt-gtag": "^1.1.1",
"nuxt-icon": "^0.6.6",
"nuxt-icon": "^0.6.7",
"ogg-opus-decoder": "^1.6.10",
"sanitize-html": "^2.11.0",
"terser": "^5.24.0",
"typescript": "^5.3.2",
"terser": "^5.26.0",
"typescript": "^5.3.3",
"vue": "^3.4.3",
"vue-i18n": "^9.8.0",
"vue3-apexcharts": "^1.4.4"
}
Expand Down
2 changes: 1 addition & 1 deletion pages/levels/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ async function syncData() {
limit: pageSize,
},
})
totalPagesCount.value = Number.parseInt(res.headers.get('x-total-page') ?? '0')
totalLevelsCount.value = Number.parseInt(res.headers.get('x-total-entries') ?? '0')
totalPagesCount.value = Math.ceil(totalLevelsCount.value / pageSize)
if (res._data) {
levels.value = [...res._data]
}
Expand Down
Loading