-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrstack.config.mts
More file actions
75 lines (72 loc) · 1.96 KB
/
Copy pathrstack.config.mts
File metadata and controls
75 lines (72 loc) · 1.96 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
// Configuration guide: https://rstack.rs/config
import path from "node:path";
import { define } from "rstack";
define.test({
projects: [
{
name: "resolver",
testEnvironment: "node",
include: ["napi/__test__/**/*.test.mjs"],
output: {
externals: [
({ request }, callback) => {
// Load native and WASI bindings at runtime instead of bundling them.
if (
request === "../index.js" ||
request === "../resolver.wasi.cjs"
) {
callback(
undefined,
`node-commonjs ${path.resolve("napi", path.basename(request))}`
);
return;
}
callback();
}
]
}
},
{
name: "enhanced-resolve-compatible",
testEnvironment: "node",
include: ["napi/tests/**/*.test.mjs"],
output: {
externals: [
({ request }, callback) => {
// Externalize the NAPI binding so native .node files load at runtime.
if (request === "../index.js") {
callback(
undefined,
`node-commonjs ${path.resolve("napi/index.js")}`
);
return;
}
callback();
}
]
}
}
]
});
define.fmt({
trailingComma: "none",
arrowParens: "avoid",
ignorePatterns: [
"fixtures/tsconfig/tsconfig_broken.json",
"fixtures/enhanced_resolve/test/fixtures/incorrect-package/pack1/package.json",
"fixtures/enhanced_resolve/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json",
"**/.pnp.cjs",
".claude/worktrees",
"bindings"
],
overrides: [{ files: "*.json", options: { parser: "json" } }]
});
define.staged({
"*.rs": [
() => "cargo fmt",
() => "cargo clippy --all-features -- -D warnings"
],
"*.{ts,tsx,mts,js,mjs,yml,yaml}": "rs fmt",
"package.json": "rs fmt",
"*.toml": "pnpm exec taplo format"
});