cool-easter-32542
07/10/2025, 6:54 AMfoo.d.ts, that contain just type declarations, similar to .pyi in Python. One can import from them like normal, e.g. import { SomeType } from './foo';.
Pants doesn't currently infer these.
Reproducer, using this typescript file:
import { SomeType } from './declaration';
const f = (x: SomeType) => {};
cd $(mktemp -d)
cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.29.0.dev0"
backend_packages = [
"pants.backend.experimental.javascript",
"pants.backend.experimental.typescript",
]
EOF
echo 'typescript_sources(name="ts")' > BUILD
echo 'export interface SomeType {}' > declaration.d.ts
cat > main.ts <<EOF
import { SomeType } from './declaration';
const f = (x: SomeType) => {};
EOF
# BUG: "Pants cannot infer owners for the following imports in the target //main.tsts ... ./declaration"
pants dependencies main.ts
# Baseline: tsc main.ts runs successfully
Pants version
2.29.0.dev0
OS
macOS
Additional info
N/A
pantsbuild/pantscool-easter-32542
07/10/2025, 11:31 PM