Merge branch 'dependencies-p' into 'main'

upgrade nuxt and typescript

See merge request PronounsPage/PronounsPage!546
This commit is contained in:
Valentyne Stigloher 2024-12-30 10:33:00 +00:00
commit e118975c13
11 changed files with 2961 additions and 2731 deletions

View File

@ -178,6 +178,14 @@ so to test them, you have to build a production build (`make deploy` and `nuxt s
### Troubleshooting
#### Invalid caches after changing code
Due to how [caches in Nitro](https://nitro.build/guide/cache) work, they automatically invalidate during development
when their function changes. However, this heuristic does not cover other functions the cached function depends on.
You can manually clear caches:
```bash
rm -rf .nuxt/cache
```
#### Module did not self-register
If you encounter an error `Module did not self-register`, triggered by the `canvas` dependency,

View File

@ -71,11 +71,11 @@ export default {
data: {
labels: this.isMultiDataset(this.data)
? Array.from(Object.values(this.data).reduce((carry, item) => {
for (const key in item) {
carry.add(key);
}
return carry;
}, new Set()))
for (const key in item) {
carry.add(key);
}
return carry;
}, new Set()))
: Object.keys(this.data),
datasets: this.isMultiDataset(this.data)
? Object.entries(this.data).map(([key, data]) => this.buildDataset(data, key, COLOURS[colourIndex++ % COLOURS.length]))

View File

@ -44,9 +44,12 @@ const { floatingStyles, placement: calculatedPlacement, middlewareData } = useFl
const visible = ref(false);
const slots = useSlots();
const slots = defineSlots<{
default(): VNode;
content(): VNode[];
}>();
const hasContent = computed((): boolean => {
return !!slots.content?.()[0];
return !!slots.content()[0];
});
const arrowStyles = computed((): CSSProperties | undefined => {

View File

@ -66,9 +66,9 @@ const longPath = computed((): string => {
return base
? Compressor.compress(
selectedPronoun.value.toArray().map((x) => x.split('|')[0]),
base.toArray().map((x) => x.split('|')[0]),
).join(',')
selectedPronoun.value.toArray().map((x) => x.split('|')[0]),
base.toArray().map((x) => x.split('|')[0]),
).join(',')
: selectedPronoun.value.toString();
});
const path = computed((): string | null => {

View File

@ -155,6 +155,13 @@ export default defineNuxtConfig({
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
css: {
preprocessorOptions: {
scss: {
api: 'legacy',
},
},
},
resolve: {
alias: {
'~@fortawesome': path.resolve(__dirname, 'node_modules/@fortawesome'),

View File

@ -19,14 +19,14 @@
"@aws-sdk/client-polly": "^3.525.0",
"@aws-sdk/client-s3": "^3.525.0",
"@floating-ui/vue": "^1.1.5",
"@nuxt/eslint": "^0.6.1",
"@nuxtjs/plausible": "^1.0.0",
"@pinia/nuxt": "^0.5.1",
"@nuxt/eslint": "^0.7.4",
"@nuxtjs/plausible": "^1.2.0",
"@pinia/nuxt": "^0.9.0",
"@sentry/browser": "^7.109.0",
"@sentry/cli": "^2.31.0",
"@sentry/node": "^7.109.0",
"@sentry/vue": "^7.109.0",
"@vite-pwa/nuxt": "^0.10.1",
"@vite-pwa/nuxt": "^0.10.6",
"@vuepic/vue-datepicker": "^8.8.1",
"@vueuse/core": "^12.2.0",
"abort-controller": "^3.0.0",
@ -63,7 +63,7 @@
"nepali-calendar-js": "https://github.com/pixunil/nepali-calendar-js",
"node-fetch": "^2.6.12",
"nodemailer": "^6.7.8",
"nuxt": "^3.14.159",
"nuxt": "^3.15.0",
"pageres": "^8.1.0",
"papaparse": "^5.4.1",
"plausible-api": "https://github.com/avo7/plausible-api.git#main",
@ -89,7 +89,7 @@
"@babel/eslint-parser": "^7.24.5",
"@babel/plugin-syntax-import-assertions": "^7.24.1",
"@fortawesome/fontawesome-pro": "git+ssh://git@gitlab.com:Avris/FontAwesomePro.git",
"@nuxt/test-utils": "^3.14.1",
"@nuxt/test-utils": "^3.15.1",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-yaml": "^4.1.2",
"@sentry/types": "^7.109.0",
@ -106,7 +106,7 @@
"@types/luxon": "^1.27.1",
"@types/markdown-it": "^14.0.1",
"@types/multer": "1.4.5",
"@types/node": "^20.11.5",
"@types/node": "^20.16.5",
"@types/node-fetch": "^2.6.11",
"@types/nodemailer": "^6.4.14",
"@types/papaparse": "^5.3.14",
@ -114,7 +114,7 @@
"@types/sharp": "^0.31.1",
"@types/speakeasy": "^2.0.10",
"@types/uuid": "8.3.2",
"@vitest/coverage-v8": "^2.0.3",
"@vitest/coverage-v8": "^2.1.8",
"@vue/test-utils": "^2.4.6",
"avris-daemonise": "^0.0.2",
"bootstrap": "^5.3.1",
@ -136,11 +136,10 @@
"sharp": "^0.33.4",
"ts-json-schema-generator": "^1.5.0",
"tsconfig-paths": "3.14.2",
"typescript": "^5.5.2",
"vite": "^5.3.5",
"vitest": "^2.0.3",
"typescript": "^5.7.2",
"vitest": "^2.1.8",
"vue-component-type-helpers": "^2.1.6",
"vue-tsc": "^2.1.10"
"vue-tsc": "^2.2.0"
},
"peerDependencies": {
"postcss": "^8.0.0"

5613
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -90,7 +90,7 @@ const selectFragment = (sourcesMap: Record<string, SourceRow>, keyAndFragment: s
const fragments = source.fragments
? source.fragments.replace(/\\@/g, '###').split('@')
.map((x) => x.replace(/###/g, '@'))
.map((x) => x.replace(/###/g, '@'))
: [];
source.fragments = fragments[parseInt(fragment) - 1];

View File

@ -1118,7 +1118,7 @@ router.post('/profile/import', handleErrorAsync(async (req, res) => {
return res.status(401).json({ error: 'One file expected' });
}
const contentParts = zlib.gunzipSync(files[0].data).toString('utf-8')
const contentParts = zlib.gunzipSync(files[0].data as zlib.InputType).toString('utf-8')
.split('\n');
if (contentParts.length !== 2) {
return res.status(401).json({ error: 'profile.backup.error.signature' });

View File

@ -227,9 +227,9 @@ const applyTemplate = (
} else {
return context === 'html'
? Object.keys(value).map((s) => `<li><strong>${s}:</strong> ${value[s]}</li>`)
.join('')
.join('')
: Object.keys(value).map((s) => ` - ${s}: ${value[s]}`)
.join('\n');
.join('\n');
}
}
if (key.startsWith('nl2br:')) {

View File

@ -91,9 +91,9 @@ export class Example {
: pronoun.config.pronunciation?.ipa && morpheme
? morpheme.split('').map((c) => [' ', ',', '.', ':', ';', '', '-'].includes(c)
? c
: `/${c}/`)
.join('')
? c
: `/${c}/`)
.join('')
: morpheme
;
};
@ -237,8 +237,8 @@ export class Source implements Entry {
this.year = year;
this.fragments = fragments
? fragments.replace(/\|/g, '\n').replace(/\\@/g, '###')
.split('@')
.map((x) => x.replace(/###/g, '@'))
.split('@')
.map((x) => x.replace(/###/g, '@'))
: [];
this.comment = comment;
this.link = link;