-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
74 lines (70 loc) · 2.5 KB
/
Copy pathvite.config.ts
File metadata and controls
74 lines (70 loc) · 2.5 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
import { recommended } from "@effect/tsgo/oxlint-presets";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite-plus";
import { configDefaults } from "vite-plus/test/config";
const ignoredPaths = [
"dist/**",
"**/dist/**",
"node_modules/**",
"**/node_modules/**",
".pnpm-store/**",
".zed/**",
".vercel/**",
"**/.vercel/**",
];
const aliases = {
"@codeworksh/harness/effect": fileURLToPath(new URL("./packages/harness/src/effect.ts", import.meta.url)),
"@codeworksh/harness/sandbox": fileURLToPath(new URL("./packages/harness/src/sandbox.ts", import.meta.url)),
"@codeworksh/aikit/failure": fileURLToPath(new URL("./packages/aikit/src/llm/failure.ts", import.meta.url)),
"@codeworksh/aikit": fileURLToPath(new URL("./packages/aikit/src/index.ts", import.meta.url)),
"@codeworksh/harness": fileURLToPath(new URL("./packages/harness/src/index.ts", import.meta.url)),
};
// Packages written against Effect. Kept as a list so lint overrides and the
// Effect rule set stay in one place as more Effect packages land.
const effectPackages = ["packages/harness/src/**/*.ts", "packages/codework/src/**/*.ts"];
const effectRules = {
...recommended.rules,
// These packages have explicit Node host/provider boundaries; their Effect
// language-service policy permits these imports for the same reason.
"effecttsgo/node-builtin-import": "off",
// These APIs intentionally return fresh streams/layers or perform setup when
// called. Treating every zero-argument constructor as redundant is incorrect.
"effecttsgo/lazy-effect": "off",
} as const;
export default defineConfig({
resolve: {
alias: aliases,
},
test: {
include: ["packages/**/*.test.ts"],
exclude:
process.env.CODEWORK_SANDBOX_E2E_REQUIRED === "1"
? configDefaults.exclude
: [...configDefaults.exclude, "packages/**/*.e2e.test.ts"],
},
lint: {
// Effect rules from @effect/tsgo, scoped to the Effect codebases here -- aikit
// is plain TypeScript and would drown in false positives. Overrides cannot
// `extends`, so the preset's plugins/rules are spread in directly. These need Oxlint's
// type-aware mode, which the patched oxlint-tsgolint binary provides (`prepare`).
overrides: [
{
files: effectPackages,
...(recommended.plugins && { plugins: recommended.plugins }),
rules: effectRules,
},
],
ignorePatterns: ignoredPaths,
options: {
typeAware: true,
typeCheck: true,
},
},
fmt: {
ignorePatterns: ignoredPaths,
printWidth: 120,
useTabs: true,
tabWidth: 3,
sortPackageJson: true,
},
});