Skip to content

Commit

Permalink
chore: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Apr 29, 2024
1 parent 66013f7 commit 5ada7db
Show file tree
Hide file tree
Showing 17 changed files with 7,353 additions and 5,711 deletions.
57 changes: 16 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install
run: pnpm install

- name: Build type stubs
run: pnpm dev:prepare

- name: Lint
run: pnpm run lint
node-version: 20
- run: pnpm install
- run: pnpm run dev:prepare
- run: pnpm run lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 18

- name: Install
run: pnpm install

- name: Build type stubs
run: pnpm dev:prepare

- name: Typecheck
run: pnpm run test:types
node-version: 20
- run: pnpm install
- run: pnpm run dev:prepare
- run: pnpm run test:types

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [18]
os: [ubuntu-latest]
fail-fast: false

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install
run: pnpm install

- name: Build type stubs
run: pnpm dev:prepare

- name: Test
run: pnpm run test
node-version: 20
- run: pnpm install
- run: pnpm run dev:prepare
- run: pnpm run test
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: corepack enable
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- run: npx changelogithub
- name: Publish changelog
run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install
run: pnpm install

- name: Build type stubs
run: pnpm dev:prepare
run: pnpm run dev:prepare

- name: Publish to npm
run: npm publish --access public
Expand Down
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
shamefully-hoist=true
strict-peer-dependencies=false
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// Silent the stylistic rules in you IDE, but still auto-fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "@stylistic/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
Expand Down
12 changes: 8 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import antfu from '@antfu/eslint-config'
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'

export default await antfu({
rules: {
'node/prefer-global/process': 'off',
export default createConfigForNuxt({
features: {
tooling: true,
stylistic: true,
},
dirs: {
src: ['./playground'],
},
})
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "@byjohann/nuxt-i18n",
"type": "module",
"version": "1.0.3",
"packageManager": "pnpm@8.11.0",
"packageManager": "pnpm@9.0.6",
"description": "Minimal module for i18n with locale auto-imports & localized routing",
"author": "Johann Schopplich <pkg@johannschopplich.com>",
"author": "Johann Schopplich <hello@johannschopplich.com>",
"license": "MIT",
"homepage": "https://github.com/johannschopplich/nuxt-i18n#readme",
"repository": {
Expand All @@ -13,9 +13,8 @@
},
"bugs": "https://github.com/johannschopplich/nuxt-i18n/issues",
"keywords": [
"nuxt",
"nuxt3",
"i18n"
"i18n",
"nuxt"
],
"exports": {
".": {
Expand All @@ -42,21 +41,21 @@
},
"dependencies": {
"@byjohann/vue-i18n": "^1.2.1",
"@nuxt/kit": "^3.8.2",
"knitwork": "^1.0.0",
"pathe": "^1.1.1"
"@nuxt/kit": "^3.11.2",
"knitwork": "^1.1.0",
"pathe": "^1.1.2"
},
"devDependencies": {
"@antfu/eslint-config": "^2.3.4",
"@nuxt/eslint-config": "0.3.0-beta.9",
"@byjohann/nuxt-i18n": "workspace:*",
"@nuxt/module-builder": "^0.5.4",
"@nuxt/test-utils": "^3.8.1",
"@types/node": "^20.10.3",
"bumpp": "^9.2.0",
"eslint": "^8.55.0",
"nuxt": "^3.8.2",
"typescript": "^5.3.2",
"vitest": "^1.0.1",
"vue-tsc": "^1.8.25"
"@nuxt/module-builder": "^0.6.0",
"@nuxt/test-utils": "^3.12.1",
"@types/node": "^20.12.7",
"bumpp": "^9.4.0",
"eslint": "^8.57.0",
"nuxt": "^3.11.2",
"typescript": "^5.4.5",
"vitest": "^1.5.2",
"vue-tsc": "^2.0.14"
}
}
5 changes: 4 additions & 1 deletion playground/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<Head>
<Title>@byjohann/nuxt-i18n</Title>
<Link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@exampledev/new.css@1.1.2/new.min.css" />
<Link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@exampledev/new.css@1.1.2/new.min.css"
/>
</Head>

<NuxtLayout>
Expand Down
2 changes: 1 addition & 1 deletion playground/composables/test-result.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useHead } from '#imports'

export function useTestResult(data: any) {
export function useTestResult(data: unknown) {
useHead({
script: [
{
Expand Down
52 changes: 30 additions & 22 deletions playground/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const routeMap: Record<string, Record<string, string>> = {
watch(localeSelect, async (newLocale) => {
const to = useLocalizedPath(route.fullPath, newLocale)
// eslint-disable-next-line no-console
console.log(to)
await navigateTo(
Expand All @@ -22,28 +21,37 @@ watch(localeSelect, async (newLocale) => {
</script>

<template>
<header>
<h2>@byjohann/nuxt-i18n</h2>
<div>
<header>
<h2>@byjohann/nuxt-i18n</h2>

<NuxtLink :to=" `/${locale}`">
{{ t('menu.home') }}
</NuxtLink>
/
<NuxtLink :to="`/${locale}${routeMap.about[locale]}`">
{{ t('menu.about') }}
</NuxtLink>
<NuxtLink :to=" `/${locale}`">
{{ t('menu.home') }}
</NuxtLink>
/
<NuxtLink :to="`/${locale}${routeMap.about[locale]}`">
{{ t('menu.about') }}
</NuxtLink>

<form>
<label for="locale-select">{{ t('language') }}:&nbsp;</label>
<select id="locale-select" v-model="localeSelect">
<option v-for="i in locales" :key="i" :value="i">
{{ i }}
</option>
</select>
</form>
</header>
<form>
<label for="locale-select">{{ t('language') }}:&nbsp;</label>
<select
id="locale-select"
v-model="localeSelect"
>
<option
v-for="i in locales"
:key="i"
:value="i"
>
{{ i }}
</option>
</select>
</form>
</header>

<main>
<slot />
</main>
<main>
<slot />
</main>
</div>
</template>
4 changes: 2 additions & 2 deletions playground/middleware/redirects.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function useServerOrClientLocale() {
let long: string | undefined
let short: string | undefined

if (process.server) {
if (import.meta.server) {
const headers = useRequestHeaders()
long = headers['accept-language']
short = long?.split(',')?.[0]?.slice(0, 2)
}
else if (process.client) {
else if (import.meta.client) {
long = navigator.language
short = long.slice(0, 2)
}
Expand Down
8 changes: 0 additions & 8 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,4 @@ export default defineNuxtConfig({
},
logs: true,
},

experimental: {
typescriptBundlerResolution: true,
},

typescript: {
shim: false,
},
})
1 change: 0 additions & 1 deletion playground/pages/test/routes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const routes = useRouter().getRoutes()
useTestResult(
// eslint-disable-next-line unused-imports/no-unused-vars
routes.map(({ components, ...rest }) => rest),

Check warning on line 5 in playground/pages/test/routes.vue

View workflow job for this annotation

GitHub Actions / lint

'components' is defined but never used
)
</script>
Loading

0 comments on commit 5ada7db

Please sign in to comment.