-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathvite.config.ts
More file actions
106 lines (105 loc) · 3.87 KB
/
Copy pathvite.config.ts
File metadata and controls
106 lines (105 loc) · 3.87 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
import { defineConfig } from "vite-plus";
export default defineConfig({
staged: {
"*": "vp check --fix",
},
run: {
// We use pnpm until
// https://github.com/voidzero-dev/vite-plus/issues/2238 is fixed.
tasks: {
"gen:demos": {
command: "pnpm --filter @cloudflare/kumo-docs-astro codegen:demos",
},
"gen:registry": {
command: "tsx packages/kumo/scripts/component-registry/index.ts",
dependsOn: ["gen:demos"],
// The registry's own incremental cache is memoization, not an input.
input: [{ auto: true }, "!packages/kumo/.cache/**"],
},
"build:kumo": {
command: "pnpm --filter @cloudflare/kumo build",
// Pre-warms the registry memo so the in-build codegen pass is incremental.
dependsOn: ["gen:registry"],
// The build regenerates these itself; outputs, not inputs.
input: [
{ auto: true },
"!packages/kumo/ai/**",
"!packages/kumo/dist/**",
"!packages/kumo/.cache/**",
"!packages/kumo-docs-astro/dist/**",
],
},
"gen:figma-data": {
command: "pnpm --filter @cloudflare/kumo-figma build:data",
},
"build:docs": {
command: "pnpm --filter @cloudflare/kumo-docs-astro build",
// The docs site consumes the built kumo package.
dependsOn: ["build:kumo"],
// The build regenerates these itself; outputs, not inputs.
input: [
{ auto: true },
"!packages/kumo-docs-astro/.astro/**",
"!packages/kumo-docs-astro/public/skill.md",
"!packages/kumo-docs-astro/dist/**",
],
},
},
},
fmt: {
// Match the repo's previous Prettier print width.
printWidth: 80,
ignorePatterns: [
// Mustache tag names in plop templates break Oxfmt's Handlebars parser.
"**/*.hbs",
// Generated by `wrangler types`.
"packages/kumo-screenshot-worker/worker-configuration.d.ts",
// TEMPORARY: MDX formatting changes rendered output (JSX-children
// whitespace); native support tracked in https://github.com/oxc-project/oxc/issues/24608
"**/*.mdx",
// Oxfmt diffs from Prettier on long CSS lines: https://github.com/oxc-project/oxc/issues/24843
"packages/kumo/src/styles/kumo.css",
// TEMPORARY: Oxfmt doesn't follow Prettier 3.9's union wrapping yet: https://github.com/oxc-project/oxc/issues/23923
"packages/kumo-docs-astro/src/components/demos/Chart/ColorDemo.tsx",
"packages/kumo-figma/src/generators/shared.ts",
"packages/kumo-figma/src/parsers/tailwind-to-figma.ts",
"packages/kumo/src/components/chart/Color.ts",
"packages/kumo/src/components/dialog/dialog.tsx",
"packages/kumo/src/components/toast/toast.tsx",
"packages/kumo/src/utils/portal-provider.tsx",
"packages/kumo/src/utils/resolve-variant.ts",
"tools/deployments/validate-pr-description.ts",
],
// Replaces prettier-plugin-tailwindcss; the stylesheet teaches kumo-* utilities.
sortTailwindcss: {
functions: ["cn", "clsx"],
stylesheet: "./packages/kumo/src/styles/kumo-standalone.css",
},
},
lint: {
// ci/ and tools/ were never linted; figma scripts import kumo's non-exported files.
ignorePatterns: ["ci/**", "tools/**", "packages/kumo-figma/scripts/**"],
jsPlugins: [
"./packages/kumo/lint/kumo-plugin.js",
{
name: "vite-plus",
specifier: "vite-plus/oxlint-plugin",
},
],
plugins: ["eslint", "typescript"],
categories: {
correctness: "error",
},
rules: {
"kumo/no-cross-package-imports": "error",
"kumo/no-primitive-colors": "error",
"kumo/no-tailwind-dark-variant": "error",
"kumo/no-flow-node-custom-render": "error",
"vite-plus/prefer-vite-plus-imports": "error",
},
options: {
typeAware: true,
typeCheck: true,
},
},
});