Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz authored Feb 6, 2024
2 parents 40781c8 + a8d7490 commit c404443
Show file tree
Hide file tree
Showing 55 changed files with 3,985 additions and 2,901 deletions.
7 changes: 4 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
const { builtinModules } = require('node:module')
const { defineConfig } = require('eslint-define-config')
const pkg = require('./package.json')

module.exports = defineConfig({
root: true,
Expand All @@ -14,7 +15,7 @@ module.exports = defineConfig({
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021,
ecmaVersion: 2022,
},
rules: {
eqeqeq: ['warn', 'always', { null: 'never' }],
Expand Down Expand Up @@ -163,13 +164,13 @@ module.exports = defineConfig({
'node/no-unsupported-features/es-builtins': [
'error',
{
version: '^14.18.0 || >=16.0.0',
version: pkg.engines.node,
},
],
'node/no-unsupported-features/node-builtins': [
'error',
{
version: '^14.18.0 || >=16.0.0',
version: pkg.engines.node,
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
Expand Down
13 changes: 7 additions & 6 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "all",
"overrides": [
{
"files": ["*.json5"],
"files": [
"*.json5"
],
"options": {
"singleQuote": false,
"quoteProps": "preserve"
}
},
{
"files": ["*.yml"],
"files": [
"*.yml"
],
"options": {
"singleQuote": false
}
}
]
}
}
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"rpc.enabled": true,
"eslint.packageManager": "pnpm"
"rpc.enabled": true
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<a href="https://npmjs.com/package/vite"><img src="https://img.shields.io/npm/v/vite.svg" alt="npm package"></a>
<a href="https://nodejs.org/en/about/releases/"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatibility"></a>
<a href="https://github.com/vitejs/vite/actions/workflows/ci.yml"><img src="https://github.com/vitejs/vite/actions/workflows/ci.yml/badge.svg?branch=main" alt="build status"></a>
<a href="https://pr.new/vitejs/vite"><img src="https://developer.stackblitz.com/img/start_pr_dark_small.svg" alt="Start new PR in StackBlitz Codeflow"></a>
<a href="https://chat.vitejs.dev"><img src="https://img.shields.io/badge/chat-discord-blue?style=flat&logo=discord" alt="discord chat"></a>
</p>
<br/>
Expand Down
50 changes: 50 additions & 0 deletions docs/.vitepress/buildEnd.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import path from 'path'
import { writeFileSync } from 'fs'
import { Feed } from 'feed'
import { createContentLoader, type SiteConfig } from 'vitepress'

const siteUrl = 'https://es.vitejs.dev'
const blogUrl = `${siteUrl}/blog`

export const buildEnd = async (config: SiteConfig) => {
const feed = new Feed({
title: 'Vite',
description: 'Herramienta frontend de próxima generación',
id: blogUrl,
link: blogUrl,
language: 'es',
image: 'https://es.vitejs.dev/og-image.png',
favicon: 'https://es.vitejs.dev/logo.svg',
copyright:
'Derechos reservados © 2019-actualidad Evan You & los colaboradores de Vite',
})

const posts = await createContentLoader('blog/*.md', {
excerpt: true,
render: true,
}).load()

posts.sort(
(a, b) =>
+new Date(b.frontmatter.date as string) -
+new Date(a.frontmatter.date as string),
)

for (const { url, excerpt, frontmatter, html } of posts) {
feed.addItem({
title: frontmatter.title,
id: `${siteUrl}${url}`,
link: `${siteUrl}${url}`,
description: excerpt,
content: html,
author: [
{
name: frontmatter.author.name,
},
],
date: frontmatter.date,
})
}

writeFileSync(path.join(config.outDir, 'blog.rss'), feed.rss2())
}
56 changes: 36 additions & 20 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig, DefaultTheme } from 'vitepress'
import { buildEnd } from './buildEnd.config'

const ogDescription = 'Herramienta frontend de próxima generación'
const ogImage = 'https://es.vitejs.dev/og-image.png'
Expand Down Expand Up @@ -33,26 +34,8 @@ const versionLinks = ((): DefaultTheme.NavItemWithLink[] => {
switch (deployType) {
case 'main':
case 'local':
return [
{
text: 'Documentación de Vite 4 (Producción)',
link: 'https://es.vitejs.dev',
},
{
text: 'Documentación de Vite 3',
link: 'https://es.vitejs.dev',
},
{
text: 'Documentación de Vite 2',
link: 'https://v2.vitejs.dev',
},
]
case 'release':
return [
{
text: 'Documentación de Vite 3',
link: 'https://es.vitejs.dev',
},
{
text: 'Documentación de Vite 2',
link: 'https://v2.vitejs.dev',
Expand All @@ -67,6 +50,11 @@ export default defineConfig({
description: 'Herramienta frontend de próxima generación',
head: [
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
[
'link',
{ rel: 'alternate', type: 'application/rss+xml', href: '/blog.rss' },
],
['link', { rel: 'me', href: 'https://m.webtoo.ls/@vite' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: ogTitle }],
['meta', { property: 'og:image', content: ogImage }],
Expand All @@ -92,6 +80,7 @@ export default defineConfig({
ja: { label: '日本語', link: 'https://ja.vitejs.dev' },
pt: { label: 'Português', link: 'https://pt.vitejs.dev' },
ko: { label: '한국어', link: 'https://ko.vitejs.dev' },
de: { label: 'Deutsch', link: 'https://de.vitejs.dev' },
},

themeConfig: {
Expand All @@ -106,6 +95,7 @@ export default defineConfig({
{ icon: 'discord', link: 'https://chat.vitejs.dev' },
{ icon: 'github', link: 'https://github.com/vitejs/vite' },
],
darkModeSwitchLabel: 'Apariencia',
algolia: {
appId: '7H67QR5P0A',
apiKey: 'deaab78bcdfe96b599497d25acc6460e',
Expand Down Expand Up @@ -168,7 +158,8 @@ export default defineConfig({

footer: {
message: `Publicado bajo licencia MIT. (${commitRef})`,
copyright: 'Copyright © 2019-actualidad Evan You & colaboradores de Vite',
copyright:
'Copyright © 2019-actualidad Evan You & colaboradores de Vite',
},

nav: [
Expand All @@ -179,6 +170,7 @@ export default defineConfig({
text: 'Recursos',
items: [
{ text: 'Equipo', link: '/team' },
{ text: 'Blog', link: '/blog' },
{ text: 'Lanzamientos', link: '/releases' },
{
items: [
Expand All @@ -194,6 +186,10 @@ export default defineConfig({
text: 'Awesome Vite',
link: 'https://github.com/vitejs/awesome-vite',
},
{
text: 'ViteConf',
link: 'https://viteconf.org',
},
{
text: 'DEV Community',
link: 'https://dev.to/t/vite',
Expand All @@ -206,6 +202,10 @@ export default defineConfig({
text: 'Lista de Cambios',
link: 'https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md',
},
{
text: 'Contribución',
link: 'https://github.com/vitejs/docs-es/blob/main/CONTRIBUTING.md',
},
],
},
],
Expand Down Expand Up @@ -277,12 +277,24 @@ export default defineConfig({
text: 'Solución de problemas',
link: '/guide/troubleshooting',
},
{
text: 'Rendimiento',
link: '/guide/performance',
},
{
text: 'Filosofía',
link: '/guide/philosophy',
},
// {
// text: 'Migración desde v2',
// link: '/guide/migration-v2-to-v3',
// },
// {
// text: 'Migración desde v3',
// link: '/guide/migration-v3-to-v4',
// },
{
text: 'Migración desde v3',
text: 'Migración desde v4',
link: '/guide/migration',
},
],
Expand Down Expand Up @@ -349,5 +361,9 @@ export default defineConfig({
},
],
},
outline: {
level: [2, 3],
},
},
buildEnd,
})
39 changes: 21 additions & 18 deletions docs/.vitepress/theme/components/AsideSponsors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@
import { computed } from 'vue'
import { VPDocAsideSponsors } from 'vitepress/theme'
import { useSponsor } from '../composables/sponsor'
const { data } = useSponsor()
const sponsors = computed(() => {
return (
data?.value.map((sponsor) => {
return {
size: sponsor.size === 'big' ? 'mini' : 'xmini',
items: sponsor.items
items: sponsor.items,
}
}) ?? []
)
})
</script>

<template>
<!-- <a class="viteconf" href="https://viteconf.org" target="_blank">
<a
class="viteconf"
href="https://viteconf.org/23/replay?utm=vite-sidebar"
target="_blank"
>
<img width="22" height="22" src="/viteconf.svg" />
<span>
<p class="extra-info">Conferencia Online Gratis</p>
<p class="heading">ViteConf - Oct 11</p>
<p class="extra-info">¡Adquiere tu entrada!</p>
<p class="extra-info">Más allá de la velocidad</p>
<p class="heading">ViteConf 2023</p>
<p class="extra-info"Mira la repetición!</p>
</span>
</a> -->
</a>
<VPDocAsideSponsors v-if="data" :data="sponsors" />
</template>

Expand All @@ -32,40 +38,37 @@ const sponsors = computed(() => {
margin-top: 1rem;
margin-bottom: 1rem;
border-radius: 14px;
padding-left: 2.5rem;
padding-top: 0.4rem;
padding-bottom: 0.4rem;
position: relative;
font-size: 1rem;
font-size: 0.9rem;
font-weight: 700;
line-height: 1.1rem;
filter: grayscale(100%);
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
width: 100%;
gap: 1rem;
background-color: var(--vp-c-bg-alt);
border: 2px solid var(--vp-c-bg-alt);
transition: border-color 0.5s;
}
.viteconf:hover {
filter: grayscale(0%);
border: 2px solid var(--vp-c-brand-light);
}
.viteconf img {
position: absolute;
left: 1.5rem;
transition: transform 0.5s;
transform: scale(1.25);
}
.viteconf:hover img {
transform: scale(1.75);
}
.viteconf:hover .heading {
.viteconf .heading {
background-image: linear-gradient(
120deg,
#bd34fe 16%,
var(--vp-c-brand-light),
var(--vp-c-brand-light)
#b047ff 16%,
var(--vp-c-brand-lighter),
var(--vp-c-brand-lighter)
);
background-clip: text;
-webkit-background-clip: text;
Expand All @@ -81,4 +84,4 @@ const sponsors = computed(() => {
.viteconf:hover .extra-info {
opacity: 0.9;
}
</style>
</style>
Loading

0 comments on commit c404443

Please sign in to comment.