Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May fail with symlinks #107

Closed
nonara opened this issue Jun 11, 2021 · 1 comment
Closed

May fail with symlinks #107

nonara opened this issue Jun 11, 2021 · 1 comment
Labels
Bug Something isn't working

Comments

@nonara
Copy link
Collaborator

nonara commented Jun 11, 2021

In looking into TS compiler's resolver code, I have discovered an internal property called originalPath in the ResolvedModuleFull type returned by the resolveModuleName API function. This is the function we rely on to get our resolved path for output.

Looking further into the code, it seems that the originalPath value is set when the compilerOptions.preserveSymlinks option is false in tsconfig.json and the resolved module is a symlink.

At present, if a resolved module is a symlink, our transformer output will use the symlink path as opposed to the original, which could cause issues. To mitigate, we should prefer originalPath (when it is available) to avoid this issue.

Simply put, this will keep us from "following" symlinks during our own resolution.

@nonara nonara added the Bug Something isn't working label Jun 11, 2021
nonara added a commit that referenced this issue Jun 16, 2021
- Several improvements were made for speed and efficiency.
- Now accommodating for new TS empty baseURL provision (closes #109)
- Pre-checking necessity before overwriting paths (closes #110)
- Rewrote core resolution methodology to:
  - Properly handle implicit indexes (closes #106)
  - Properly handle implicit sub-package indexes set via package.json 'main' #108)
  - Not follow symlinks (#107)
  - Resolve from output path as opposed to SourceFile path (#103)
nonara added a commit that referenced this issue Jun 16, 2021
- Several improvements were made for speed and efficiency.
- Now accommodating for new TS empty baseURL provision (closes #109)
- Pre-checking necessity before overwriting paths (closes #110)
- Rewrote core resolution methodology to:
  - Properly handle implicit indexes (closes #106)
  - Properly handle implicit sub-package indexes set via package.json 'main' #108)
  - Not follow symlinks (#107)
  - Resolve from output path as opposed to SourceFile path (#103)
nonara added a commit that referenced this issue Jun 16, 2021
- Several improvements were made for speed and efficiency.
- Now accommodating for new TS empty baseURL provision (closes #109)
- Pre-checking necessity before overwriting paths (closes #110)
- Rewrote core resolution methodology to:
  - Properly handle implicit indexes (closes #106)
  - Properly handle implicit sub-package indexes set via package.json 'main' #108)
  - Not follow symlinks (#107)
  - Resolve from output path as opposed to SourceFile path (#103)
nonara added a commit that referenced this issue Jun 16, 2021
- Several improvements were made for speed and efficiency.
- Now accommodating for new TS empty baseURL provision (closes #109)
- Pre-checking necessity before overwriting paths (closes #110)
- Rewrote core resolution methodology to:
  - Properly handle implicit indexes (closes #106)
  - Properly handle implicit sub-package indexes set via package.json 'main' #108)
  - Not follow symlinks (#107)
  - Resolve from output path as opposed to SourceFile path (#103)
@nonara nonara closed this as completed Jun 16, 2021
@nonara
Copy link
Collaborator Author

nonara commented Jun 16, 2021

Sorted in v3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant