chore(deps): update dependency nuxt to ^3.13.1 (#2946)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
344ec56da0
commit
dd6fab86ee
13 changed files with 1489 additions and 1837 deletions
|
@ -1,4 +1,4 @@
|
|||
import { Buffer } from 'node:buffer'
|
||||
import { writeFile } from 'node:fs/promises'
|
||||
import { join, resolve } from 'pathe'
|
||||
import fs from 'fs-extra'
|
||||
import { ofetch } from 'ofetch'
|
||||
|
@ -12,7 +12,7 @@ async function download(url: string, fileName: string) {
|
|||
console.log('downloading', fileName)
|
||||
try {
|
||||
const image = await ofetch(url, { responseType: 'arrayBuffer' })
|
||||
await fs.writeFile(fileName, Buffer.from(image))
|
||||
await writeFile(fileName, new Uint8Array(image))
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Buffer } from 'node:buffer'
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { flatten, unflatten } from 'flat'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import fs from 'fs-extra'
|
||||
import { currentLocales } from '../config/i18n'
|
||||
|
||||
const resolver = createResolver(import.meta.url)
|
||||
|
@ -27,7 +27,7 @@ const sourceTranslations: Record<string, string> = {}
|
|||
|
||||
for (const file of sourceFiles) {
|
||||
const data = JSON.parse(Buffer.from(
|
||||
await fs.readFile(resolver.resolve(`../locales/${file as string}`), 'utf-8'),
|
||||
await readFile(resolver.resolve(`../locales/${file as string}`), 'utf-8'),
|
||||
).toString()) as Record<string, unknown>
|
||||
|
||||
merge(flatten(data), sourceTranslations)
|
||||
|
@ -41,7 +41,7 @@ async function removeOutdatedTranslations() {
|
|||
const path = resolver.resolve(`../locales/${file}`)
|
||||
|
||||
const data = JSON.parse(Buffer.from(
|
||||
await fs.readFile(path, 'utf-8'),
|
||||
await readFile(path, 'utf-8'),
|
||||
).toString())
|
||||
|
||||
const targetTranslations: Record<string, string> = flatten(data)
|
||||
|
@ -53,7 +53,7 @@ async function removeOutdatedTranslations() {
|
|||
|
||||
const unflattened = unflatten(targetTranslations)
|
||||
|
||||
await fs.writeFile(
|
||||
await writeFile(
|
||||
path,
|
||||
`${JSON.stringify(unflattened, null, 2)}\n`,
|
||||
{ encoding: 'utf-8' },
|
||||
|
|
|
@ -148,7 +148,7 @@ async function generatePWAIconForEnv(folder: string, icons: ResolvedIcons) {
|
|||
const png = await sharp(
|
||||
resolve(folder, icons.iconName('transparent', size).replace(/-temp\.png$/, '.png')),
|
||||
).toFormat('png').toBuffer()
|
||||
await writeFile(resolve(folder, icoName(size)), ico.encode([png]))
|
||||
await writeFile(resolve(folder, icoName(size)), new Uint8Array(ico.encode([png])))
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Buffer } from 'node:buffer'
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { flatten } from 'flat'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import fs from 'fs-extra'
|
||||
import { countryLocaleVariants, currentLocales } from '../config/i18n'
|
||||
import type { LocaleEntry } from '../docs/types'
|
||||
import type { ElkTranslationStatus } from '~/types/translation-status'
|
||||
|
@ -28,7 +28,7 @@ async function readI18nFile(file: string | string[]) {
|
|||
if (Array.isArray(file)) {
|
||||
const files = await Promise.all(file.map(f => async () => {
|
||||
return JSON.parse(Buffer.from(
|
||||
await fs.readFile(resolver.resolve(`../locales/${f}`), 'utf-8'),
|
||||
await readFile(resolver.resolve(`../locales/${f}`), 'utf-8'),
|
||||
).toString())
|
||||
})).then(f => f.map(f => f()))
|
||||
const data: Record<string, any> = files[0]
|
||||
|
@ -38,7 +38,7 @@ async function readI18nFile(file: string | string[]) {
|
|||
}
|
||||
else {
|
||||
return JSON.parse(Buffer.from(
|
||||
await fs.readFile(resolver.resolve(`../locales/${file}`), 'utf-8'),
|
||||
await readFile(resolver.resolve(`../locales/${file}`), 'utf-8'),
|
||||
).toString())
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ async function prepareTranslationStatus() {
|
|||
|
||||
const resolver = createResolver(import.meta.url)
|
||||
|
||||
await fs.writeFile(
|
||||
await writeFile(
|
||||
resolver.resolve('../docs/translation-status.json'),
|
||||
JSON.stringify(sorted, null, 2),
|
||||
{ encoding: 'utf-8' },
|
||||
|
@ -136,7 +136,7 @@ async function prepareTranslationStatus() {
|
|||
}
|
||||
})
|
||||
|
||||
await fs.writeFile(
|
||||
await writeFile(
|
||||
resolver.resolve('../elk-translation-status.json'),
|
||||
JSON.stringify(translationStatus, null, 2),
|
||||
{ encoding: 'utf-8' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue