stc
stc copied to clipboard
Implement more logic for file loader / resolver for multi-file tests
https://github.com/dudykr/stc/pull/700 enabled a multi-file testing system, but the loader/resolver is not good enough. But I want to work on other things first, so I'm filing an issue instead.
If you run check.sh
, you will see panic messages starting with not yet implemented:
.
e.g.
========== Running test moduleResolution/importFromDot.ts
Source:
// @module: commonjs
// @Filename: a.ts
export const rootA = 0;
// @Filename: a/index.ts
export const indexInA = 0;
// @Filename: a/b.ts
import { indexInA, rootA } from ".";
[crates/stc_ts_type_checker/tests/tsc.rs:305] &libs = [
Es5,
Dom,
]
load_file: Real("a/b.ts")
resolve: Real("a/b.ts") "."
thread 'conformance::moduleResolution::importFromDot.ts' panicked at 'not yet implemented: resolve: Real("a/b.ts") "."', crates/stc_ts_type_checker/tests/tsc.rs:523:9
stack backtrace:
0: rust_begin_unwind
Relevant code:
https://github.com/dudykr/stc/blob/86891e586d0162a7b737143910c8e2d30a1aefca/crates/stc_ts_type_checker/tests/tsc.rs#L506-L545
I'd love to work on this
Thank you!
Note: Additionally, we need to handle resolving like node_modules/foo/bar
.
Maybe we can create a temporary directory and reuse NodeResolver
instead of reimplementing a full resolver/loader for testing
That makes sense, I was extremely busy last week didn't have time to work on this, will try to find some time this weekend. Sorry for the delay man.
No worries, really. It's definitely not something you should be sorry.
I found that we need node_modules
support while trying to make more good first issues.
@infix Are you still willing to work on this?
Sorry for the delay, I'm still interested and I'll dedicate some time this weekend!
No worries, I'm just checking. And thank you!
Hi @kdy1! If this still needs attention, I'd be willing to work on it. I've already implemented the TypeScript Module Resolution system before (for my Turboprisma project), so it should be pretty easy to do.
It will be really nice, thank you!
@DavidHancu go for it man. I can't really dedicate time to this.
resolve import .
at #1064
resolve emit error about not exist file #1076