-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix symbol link support in pnpm workspace (#21)
Co-authored-by: hardfist <[email protected]>
- Loading branch information
Showing
9 changed files
with
219 additions
and
24 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
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,2 @@ | ||
node_modules | ||
.DS_Store |
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": "monorepo", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"packageManager": "[email protected]", | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"enhanced-resolve": "^5.17.1", | ||
"oxc-resolver": "latest" | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"name": "@monorepo/app", | ||
"private": true, | ||
"dependencies": { | ||
"@monorepo/lib": "workspace:*" | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"name": "@monorepo/lib", | ||
"version": "0.0.1", | ||
"private": true, | ||
"type": "module", | ||
"dependencies": { | ||
"react": "^18.3.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 |
---|---|---|
|
@@ -231,7 +231,7 @@ for (const [title, context, request, expected] of [ | |
} | ||
|
||
test('resolve pnpm package', (t) => { | ||
const rootDir = join(currentDir, '..', '..'); | ||
const rootDir = join(currentDir, '..', '..') | ||
const pnpmProjectPath = join(rootDir, 'fixtures', 'pnpm') | ||
const resolver = new ResolverFactory({ | ||
aliasFields: ['browser'], | ||
|
@@ -258,3 +258,22 @@ test('resolve pnpm package', (t) => { | |
} | ||
) | ||
}) | ||
|
||
test('resolve recursive symbol link', (t) => { | ||
const rootDir = join(currentDir, '..', '..') | ||
const workspaceProjectPath = join(rootDir, 'fixtures', 'pnpm-workspace') | ||
const resolver = new ResolverFactory({}) | ||
|
||
t.deepEqual( | ||
resolver.sync( | ||
join(workspaceProjectPath, './packages/app'), | ||
'./node_modules/@monorepo/lib/node_modules/react/package.json' | ||
), | ||
{ | ||
path: join( | ||
rootDir, | ||
'node_modules/.pnpm/[email protected]/node_modules/react/package.json' | ||
), | ||
} | ||
) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ packages: | |
- 'npm' | ||
- 'napi' | ||
- 'fixtures/pnpm' | ||
- 'fixtures/pnpm-workspace/**' |
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