-
-
Notifications
You must be signed in to change notification settings - Fork 88
/
astro.config.ts
556 lines (546 loc) · 13.1 KB
/
astro.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
import netlify from "@astrojs/netlify";
import react from "@astrojs/react";
import starlight from "@astrojs/starlight";
import lunaria from "@lunariajs/starlight";
import { defineConfig } from "astro/config";
import rehypeSlug from "rehype-slug";
import starlightBlog from "starlight-blog";
import { searchForWorkspaceRoot } from "vite";
import { version as biomeVersion } from "./node_modules/@biomejs/wasm-web/package.json";
import { version as prettierVersion } from "./node_modules/prettier/package.json";
import { rehypeAutolink } from "./plugins/rehype-autolink";
const plugins = [
starlightBlog({
title: {
en: "Blog",
ja: "ブログ",
"zh-CN": "博客",
},
authors: {
conaclos: {
name: "Victorien Elvinger",
picture: "https://avatars.githubusercontent.com/u/2358560?s=96&v=4",
url: "https://twitter.com/Conaclos",
},
ema: {
name: "Emanuele Stoppa",
picture: "https://avatars.githubusercontent.com/u/602478?v=4",
url: "https://twitter.com/ematipico",
},
team: {
name: "Biome Core Team, Biome Maintainers",
picture: "/img/logo-avatar.png",
},
core: {
name: "Biome Core Team",
picture: "/img/logo-avatar.png",
},
},
}),
];
if (process.env?.E2E !== "true") {
plugins.push(
lunaria({
route: "i18n-dashboard",
sync: true,
}),
);
}
// https://astro.build/config
export default defineConfig({
site: "https://biomejs.dev",
output: "static",
compressHTML: true,
integrations: [
react(),
starlight({
title: "Biome",
defaultLocale: "root",
plugins,
locales: {
root: {
label: "English",
lang: "en",
},
fr: {
label: "Français",
lang: "fr",
},
ja: {
label: "日本語",
lang: "ja",
},
"zh-cn": {
label: "简体中文",
lang: "zh-CN",
},
"pt-br": {
label: "Português",
lang: "pt-BR",
},
},
sidebar: [
{
label: "Playground",
link: "../playground",
translations: {
fr: "Bac à sable",
ja: "プレイグラウンド",
"zh-CN": "演练场",
"pt-BR": "Ambiente de testes",
},
},
{
label: "Guides",
translations: { ja: "ガイド", "zh-CN": "指南", "pt-BR": "Guias" },
items: [
{
label: "Getting Started",
link: "/guides/getting-started",
translations: {
fr: "Démarrage",
ja: "はじめる",
"zh-CN": "入门",
"pt-BR": "Primeiros passos",
},
},
{
label: "Manual installation",
link: "/guides/manual-installation",
translations: {
fr: "Installation manuelle",
ja: "手動インストール",
"zh-CN": "手动安装",
"pt-BR": "Instalação manual",
},
},
{
label: "Configure Biome",
link: "/guides/configure-biome",
translations: {
fr: "Configurer Biome",
ja: "Biome の設定",
"zh-CN": "配置生物群落",
"pt-BR": "Configurar Bioma",
},
},
{
label: "Use Biome in big projects",
link: "/guides/big-projects",
translations: {
fr: "Utiliser Biome dans de gros projets",
ja: "大きなプロジェクトでのBiomeの使用方法",
"zh-CN": "大型项目中使用 Biome",
"pt-BR": "Usando o Biome em projetos grandes",
},
},
{
label: "Biome in your IDE",
translations: {
fr: "Biome dans votre IDE",
ja: "Biome をあなたのエディタに導入する",
"zh-CN": "编辑器中使用 Biome",
"pt-BR": "Biome no seu editor",
},
items: [
{
label: "First-party extensions",
link: "/guides/editors/first-party-extensions",
translations: {
fr: "Extensions officielles",
ja: "Biome 公式拡張機能",
},
},
{
label: "Third-party extensions",
link: "/guides/editors/third-party-extensions",
translations: {
fr: "Extensions tierces",
ja: "サードパーティの拡張機能",
},
},
{
label: "Integrate Biome in an editor extension",
link: "/guides/editors/create-a-extension",
translations: {
fr: "Intégrer Biome à une extension pour un éditeur",
ja: "エディタ拡張機能への Biome の統合",
},
},
],
},
{
label: "Integrate Biome with your VCS",
link: "/guides/integrate-in-vcs",
translations: {
fr: "Intégrer Biome à votre VCS",
ja: "Biome をあなたの VCS と統合する",
"zh-CN": "与版本控制系统集成",
"pt-BR": "Integrando o Biome com o seu VCS",
},
},
{
label: "Migrate from ESLint & Prettier",
link: "/guides/migrate-eslint-prettier",
translations: {
fr: "Migrer depuis ESLint & Prettier",
ja: "ESLintとPrettierからの移行",
},
},
],
},
{
label: "Tools",
translations: {
fr: "Outils",
ja: "ツール",
"zh-CN": "工具",
"pt-BR": "Ferramentas",
},
items: [
{
label: "Analyzer",
items: [
{
label: "Introduction",
link: "/analyzer",
translations: {
ja: "イントロダクション",
"zh-CN": "介绍",
"pt-BR": "Introdução",
},
},
{
label: "Import Sorting",
link: "/analyzer/import-sorting",
translations: {
fr: "Tri des imports",
ja: "Import文のソート",
"zh-CN": "导入排序",
"pt-BR": "Ordenação de importações",
},
},
],
translations: {
fr: "Analyseur",
ja: "Analyzer",
"zh-CN": "分析器",
"pt-BR": "Analisador",
},
},
{
label: "Formatter",
items: [
{
label: "Introduction",
link: "/formatter",
translations: {
ja: "イントロダクション",
"zh-CN": "介绍",
"pt-BR": "Introdução",
},
},
{
label: "Differences with Prettier",
link: "/formatter/differences-with-prettier",
translations: {
fr: "Différences par rapport à Prettier",
ja: "Prettier との違い",
"zh-CN": "与 Prettier 的区别",
"pt-BR": "Diferenças em relação ao Prettier",
},
},
{
label: "Formatter Option Philosophy",
link: "/formatter/option-philosophy",
translations: {
fr: "Philosophie d’option de formatage",
ja: "Formatterオプションに対する考え方",
"zh-CN": "格式化配置理念",
"pt-BR": "Princípios de configuração",
},
},
],
translations: {
fr: "Outil de formatage",
"zh-CN": "格式化程序",
"pt-BR": "Formatador",
},
},
{
label: "Linter",
items: [
{
label: "Introduction",
link: "/linter",
translations: {
ja: "イントロダクション",
"zh-CN": "介绍",
"pt-BR": "Introdução",
},
},
{
label: "Rules",
link: "/linter/rules",
translations: {
fr: "Règles",
ja: "ルール",
"zh-CN": "规则",
"pt-BR": "Regras",
},
},
{
label: "Rules sources",
link: "/linter/rules-sources",
translations: {
fr: "Sources des règles",
},
},
],
translations: {
fr: "Outil de linting",
},
},
],
},
{
label: "Reference",
translations: {
fr: "Références",
ja: "リファレンス",
"zh-CN": "参考",
"pt-BR": "Referências",
},
items: [
{
label: "CLI",
link: "/reference/cli",
},
{
label: "Diagnostics",
link: "/reference/diagnostics",
badge: "new",
},
{
label: "Environment variables",
link: "/reference/environment-variables",
translations: {
fr: "Variables d’environnement",
},
},
{
label: "Reporters",
link: "/reference/reporters",
translations: {
fr: "Outils de reporting",
},
},
{
label: "Configuration",
link: "/reference/configuration",
translations: {
ja: "設定",
"zh-CN": "配置",
"pt-BR": "Configuração",
},
},
{
label: "VSCode extension",
link: "/reference/vscode",
translations: {
fr: "Extension pour VSCode",
ja: "VSCode拡張機能",
"zh-CN": "VSCode 扩展",
"pt-BR": "Extensão do VSCode",
},
},
{
label: "Zed extension",
link: "/reference/zed",
badge: "new",
translations: {
fr: "Extension pour Zed",
ja: "Zed拡張機能",
"zh-CN": "Zed 扩展",
"pt-BR": "Extensão do Zed",
},
},
{
label: "GritQL",
link: "/reference/gritql",
badge: "experimental",
},
],
},
{
label: "Recipes",
translations: {
fr: "Recettes",
ja: "レシピ",
"zh-CN": "实例",
"pt-BR": "Receitas",
},
items: [
{
label: "Continuous Integration",
link: "/recipes/continuous-integration",
translations: {
fr: "Intégration continue",
ja: "継続的インテグレーション",
"zh-CN": "持续集成",
"pt-BR": "Integração Contínua",
},
},
{
label: "Git Hooks",
link: "/recipes/git-hooks",
},
{
label: "Renovate",
link: "/recipes/renovate",
},
{
label: "Social Badges",
link: "/recipes/badges",
translations: {
ja: "ソーシャルバッジ",
},
},
],
},
{
label: "Internals",
translations: {
fr: "Aspects internes",
ja: "内部原理",
"zh-CN": "内部原理",
"pt-BR": "Aspectos Internos",
},
items: [
{
label: "Philosophy",
link: "/internals/philosophy",
translations: {
fr: "Philosophie",
ja: "理念",
"zh-CN": "理念",
"pt-BR": "Filosofia",
},
},
{
label: "Language support",
link: "/internals/language-support",
translations: {
fr: "Langages pris en charge",
ja: "言語サポート",
"zh-CN": "语言支持",
"pt-BR": "Suporte de linguagens",
},
},
{
label: "Architecture",
link: "/internals/architecture",
translations: {
ja: "アーキテクチャ",
"zh-CN": "架构",
"pt-BR": "Arquitetura",
},
},
{
label: "Credits",
link: "/internals/credits",
translations: {
fr: "Crédits",
ja: "クレジット",
"zh-CN": "鸣谢",
"pt-BR": "Créditos",
},
},
{
label: "Versioning",
link: "/internals/versioning",
translations: {
fr: "Versionnage",
ja: "バージョニング",
"zh-CN": "版本控制",
"pt-BR": "Versionamento",
},
},
{
label: "Changelog",
link: "/internals/changelog",
translations: {
"zh-CN": "更新日志",
"pt-BR": "Alterações",
},
},
],
},
],
logo: {
light: "./src/assets/svg/logo-light-transparent.svg",
dark: "./src/assets/svg/logo-dark-transparent.svg",
replacesTitle: true,
},
favicon: "/img/favicon.svg",
customCss: [
// Relative path to your custom CSS file
"./src/styles/index.css",
],
social: {
discord: "https://biomejs.dev/chat",
github: "https://github.com/biomejs/biome",
"x.com": "https://twitter.com/biomejs",
mastodon: "https://fosstodon.org/@biomejs",
openCollective: "https://opencollective.com/biome",
youtube: "https://youtube.com/@Biomejs",
blueSky: "https://bsky.app/profile/biomejs.dev",
},
editLink: {
baseUrl: "https://github.com/biomejs/website/edit/main/",
},
components: {
SiteTitle: "./src/components/starlight/SiteTitle.astro",
Hero: "./src/components/starlight/Hero.astro",
Head: "./src/components/starlight/Head.astro",
},
}),
],
build: {
format: "directory",
},
markdown: {
syntaxHighlight: "shiki",
rehypePlugins: [rehypeSlug, ...rehypeAutolink()],
shikiConfig: {
langAlias: {
cjs: "javascript",
grit: "txt",
},
},
},
adapter: netlify({
imageCDN: false,
}),
vite: {
resolve: {
alias: {
"@": new URL("./src", import.meta.url).pathname,
},
},
plugins: [],
worker: {
format: "es",
},
server: {
fs: {
// https://vitejs.dev/config/server-options.html#server-fs-allow
allow: [searchForWorkspaceRoot(process.cwd())],
},
},
define: {
PRETTIER_VERSION: JSON.stringify(prettierVersion),
BIOME_VERSION: JSON.stringify(biomeVersion),
},
},
});