-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5695cdc
commit 07777f1
Showing
11 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
/node_modules | ||
.turbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# oxc symlink bug reproduction | ||
|
||
The bug occurs when a symlink is nested inside a directory that is also symlinked. | ||
This occurs with pnpm since it recreates a conventional node_modules structure using | ||
a content addressed store and symlinks. | ||
|
||
Here's the setup: | ||
|
||
- `apps/web/nm/@repo/typescript-config` is a symlink pointing to `tooling/typescript-config` (imagine `typescript-config` is a workspace package and symlinked into `apps/web`'s node modules) | ||
- `tooling/typescript-config/index.js` is a _relative_ symlink pointing to `../../nm/index.js` | ||
- Therefore, `apps/web/nm/@repo/typescript-config/index.js` is resolved as: | ||
|
||
``` | ||
apps/web/nm/@repo/typescript-config/index.js | ||
-> tooling/typescript-config/index.js | ||
-> tooling/typescript-config/../../nm/index.js | ||
-> nm/index.js | ||
``` | ||
|
||
However, when oxc resolves this, it does not do the first resolution, so we get: | ||
|
||
``` | ||
apps/web/nm/@repo/typescript-config/index.js | ||
-> apps/web/nm/@repo/typescript-config/../../nm/index.js | ||
-> apps/web/nm/nm/index.js | ||
``` | ||
|
||
You can validate this by running `node main.mjs`, which attempts to resolve | ||
both `apps/web/nm/@repo/typescript-config/index.js` and `apps/web/nm/@repo/index.js`. | ||
The first fails while the second succeeds. |
1 change: 1 addition & 0 deletions
1
turborepo-tests/integration/fixtures/oxc_repro/apps/web/nm/@repo/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const foo = "10"; |
1 change: 1 addition & 0 deletions
1
turborepo-tests/integration/fixtures/oxc_repro/apps/web/nm/@repo/typescript-config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../tooling/typescript-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import foo from "./apps/web/nm/@repo/typescript-config/index.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import resolve from "oxc-resolver"; | ||
|
||
console.log('resolving "./apps/web/nm/@repo/typescript-config/index.js"'); | ||
console.log( | ||
resolve.sync(".", "./apps/web/nm/@repo/typescript-config/index.js") | ||
); | ||
console.log('resolving "./apps/web/nm/@repo/index.js"'); | ||
console.log(resolve.sync(".", "./apps/web/nm/@repo/index.js")); |
Empty file.
14 changes: 14 additions & 0 deletions
14
turborepo-tests/integration/fixtures/oxc_repro/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "oxc-repro", | ||
"version": "1.0.0", | ||
"description": "", | ||
"workspaces": ["c"], | ||
"packageManager": "[email protected]", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": {} | ||
} |
1 change: 1 addition & 0 deletions
1
turborepo-tests/integration/fixtures/oxc_repro/tooling/typescript-config/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../nm/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Setup | ||
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh oxc_repro | ||
|
||
$ ${TURBO} query "query { file(path: \"./index.js\") { path dependencies { files { items { path } } errors { items { message import } } } } }" |