-
-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathvite.config.ts
More file actions
125 lines (116 loc) · 3.11 KB
/
Copy pathvite.config.ts
File metadata and controls
125 lines (116 loc) · 3.11 KB
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
import { defineConfig } from "vite-plus"
import { fileURLToPath } from "node:url"
export default defineConfig({
staged: {
"*.{js,jsx,ts,tsx,mjs,cjs,md,mdx,yaml,yml,toml,json}":
"vp fmt --no-error-on-unmatched-pattern",
"*.astro": "prettier --write",
},
fmt: {
printWidth: 80,
semi: false,
sortPackageJson: false,
},
lint: {
plugins: ["typescript", "import"],
jsPlugins: [{ name: "vite-plus", specifier: "vite-plus/oxlint-plugin" }],
ignorePatterns: [".direnv", "dist"],
options: {
typeAware: true,
typeCheck: true,
},
rules: {
"import/namespace": "off",
"typescript/no-misused-spread": "off",
"typescript/unbound-method": "off",
"vite-plus/prefer-vite-plus-imports": "error",
},
},
test: {
projects: [
{
resolve: {
alias: {
"@/": fileURLToPath(new URL("./apps/web/src/", import.meta.url)),
"astro:assets": fileURLToPath(
new URL("./apps/web/test/stubs/astro-assets.ts", import.meta.url),
),
"astro:content": fileURLToPath(
new URL(
"./apps/web/test/stubs/astro-content.ts",
import.meta.url,
),
),
"virtual:open-graph-metadata": fileURLToPath(
new URL(
"./apps/web/test/stubs/open-graph-metadata.ts",
import.meta.url,
),
),
},
},
test: {
name: "web",
root: "apps/web",
include: ["test/**/*.test.ts"],
},
},
"apps/!(web)",
"packages/*",
],
},
run: {
cache: true,
tasks: {
"api-reference:generate": "vp exec api-reference generate",
"icons:generate": [
"vp exec icon-generator generate",
"fa7-brands:github",
"fa7-brands:discord",
"fa7-brands:x-twitter",
"fa7-brands:youtube",
"fa7-brands:linkedin",
"fa7-brands:bluesky",
"fa7-brands:spotify",
"fa7-brands:npm",
"--output apps/web/src/assets/icons",
].join(" "),
"astro:sync": {
command: "vp -C apps/web exec astro sync",
cache: false,
},
build: {
command: "vp -C apps/web exec astro build",
dependsOn: ["icons:generate"],
},
check: {
command: ["vp check", "vp -C apps/web exec astro check"],
dependsOn: ["astro:sync", "icons:generate"],
},
"dev:web": {
command: "vp -C apps/web exec astro dev",
cache: false,
dependsOn: ["icons:generate"],
},
fmt: ["vp fmt --check", 'prettier --check "**/*.astro"'],
"fmt:fix": {
command: ["vp fmt", 'prettier --write "**/*.astro"'],
cache: false,
},
lint: {
command: "vp lint",
dependsOn: ["astro:sync"],
},
"lint:fix": {
command: "vp lint --fix",
cache: false,
dependsOn: ["astro:sync"],
},
test: "vp test",
"test:e2e": {
command: "vp exec playwright test",
cache: false,
},
},
},
})