Commit graph

41 commits

Author SHA1 Message Date
Boshen
7e84369cad
refactor(resolver): move tests folder to fixtures (#964) 2023-10-08 13:29:02 +08:00
Boshen
a077e877ba
fix(resolver): fix tsconfig lookup when a directory is provided (#900) 2023-09-13 14:20:04 +08:00
Boshen
5bbad73db5
feat(resolver): tsconfig project references (#862)
closes #751
2023-09-07 14:01:48 +08:00
Boshen
6ed57532cd
fix(resolver): fix a case where ignored package has a fallback (#837) 2023-09-02 17:22:35 +08:00
Boshen
6ae6532245
fix(resolver): add test case for resolve_to_context (#834) 2023-09-02 12:03:07 +08:00
Boshen
777cc003a5
fix(resolver): resolve exports field that are directories (#820) 2023-08-31 16:10:03 +08:00
Boshen
589a4d6cd8
fix(resolver): do not resolve browser field that are strings (#816) 2023-08-30 14:00:59 +08:00
Boshen
66e883ae8c
fix(resolver): make sure package name is valid when loading package self (#810) 2023-08-29 22:56:48 +08:00
Boshen
6ab4ce0a6b
feat(resolver): implement tsconfig-paths (#750)
This PR includes 3 core functinalies of tsconfig-paths:

* matching tsconfig.compilerOptions.paths
* use tsconfig.compilerOptions.baseUrl
* extend tsconfig with tsconfig.extends

This PR does not include tsconfig.references
2023-08-17 16:24:46 +08:00
Boshen
17e525cc0f feat(resolver): complete browser_field implementation 2023-08-11 19:46:57 +08:00
Boshen
66c9d764d1 fix(resolver): add a case with multi-dot filename 2023-08-10 19:48:30 +08:00
Boshen
702d5b0120
refactor(resolver): change internal funcs to non-pub by moving to unit tests (#682) 2023-08-02 16:24:16 +08:00
Boshen
2e3934db49
feat(resolver): imports field (#681) 2023-08-02 15:54:07 +08:00
Boshen
c4669e1f78
feat(resolver): finish most of exports field (#674)
Found a behaviour mismatch: when an array is provided in exports field,
enhanced-resolve will try to read the file and try the next one if it
fails. But in the spec, the path is not read, it's only tested against
"invalid package target".

```
For each item targetValue in target, do
1. Let resolved be the result of PACKAGE_TARGET_RESOLVE( packageURL, targetValue, patternMatch, isImports, conditions), continuing the loop on any Invalid Package Target error.
2. If resolved is undefined, continue the loop.
3. Return resolved.
```

I tested against node.js and verifies node.js conforms to the spec.
2023-08-01 15:53:31 +08:00
Boshen
3b9cc474e9
feat(resolver): port the rest of the exports field tests (#659) 2023-07-30 01:03:10 +08:00
Boshen
6631336f5c
feat(resolver): implement more of exports field (#648) 2023-07-28 10:19:29 +08:00
Boshen
32b8ad2b57
feat(resolver): initialize implementation of package.json exports field (#630) 2023-07-26 16:54:54 +08:00
Boshen
eafad4dfd1
perf(resolver): reduce the total number of hashes by passing the cached value around (#602) 2023-07-24 20:42:09 +08:00
Boshen
c0d06c5598
feat(resolver): check for directory before loading a directory (#590) 2023-07-23 18:10:06 +08:00
Boshen
378505f244
perf(resolver): improve cache hit for package.json (#585)
perf(resolver): implement proper file system caching
2023-07-23 01:06:40 +08:00
Boshen
585e48fe9b
feat(resolver): implement symlinks (#582) 2023-07-21 19:10:59 +08:00
Boshen
3c5333c828
perf(resolver): use fs::symlink_metadata, which doesn't traverse symlinks (#581) 2023-07-21 17:54:55 +08:00
Boshen
fa20844802
feat(resolver): complete query and fragment parsing (#579) 2023-07-20 17:48:51 +08:00
Boshen
30b9731843
feat(resolver): add preferRelative and preferAbsolute (#577) 2023-07-20 15:41:06 +08:00
Boshen
beb0ae9d8e
feat(resolver): implement roots (#576) 2023-07-20 14:23:25 +08:00
Boshen
3875ebc6cb
refactor(resolver): check against Result for better assertion message (#573) 2023-07-20 11:10:56 +08:00
Boshen
3f07306be0
feat(resolver): implement fallback (#572) 2023-07-19 14:42:43 +08:00
Boshen
c32dd32bad
feat(resolver): implement enforceExtension (#566) 2023-07-18 15:05:02 +08:00
Boshen
e5de977279
feat(resolver): implement descriptionFiles option (#565) 2023-07-18 14:11:43 +08:00
Boshen
0c17f4f783
feat(resolver): implement the basics of path alias (#564) 2023-07-18 13:30:14 +08:00
Boshen
d410d1a2d7
feat(resolver): accept different file system implementations (#562) 2023-07-17 18:29:41 +08:00
Boshen
cac4e73461
feat(resolver): implement browser field (#561) 2023-07-17 15:16:08 +08:00
Boshen
b2152ec050
feat(resolver): implement scoped packages (#558) 2023-07-16 20:36:47 +08:00
Boshen
e0a17ace8f
feat(resolver): port incorrect description file test (#557) 2023-07-16 17:13:32 +08:00
Boshen
05c9b5dfd8
feat(resolver): implement extension_alias (#556) 2023-07-16 16:39:51 +08:00
Boshen
2375bc8ccc
feat(resolver): port resolve tests (#555) 2023-07-16 15:09:09 +08:00
Boshen
fda6d83712
feat(resolver): resolve extensions (#549) 2023-07-14 23:25:47 +08:00
Boshen
789626e01c
perf(resolver): add file system cache (#547) 2023-07-14 16:02:13 +08:00
Boshen
ca4d2fa248
feat(resolver): resolve as module (#544) 2023-07-14 11:59:22 +08:00
Boshen
4d187ce963
feat(resolver): resolve js file (#543) 2023-07-13 18:04:00 +08:00
Boshen
a9debc9fdb
feat(resolver): add resolver test fixtures (#542) 2023-07-13 13:37:29 +08:00