-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "fix(core): support subpath exports when constructing the proj…
…ect graph" (#29762) Reverts #29577 There is an issue with workspaces using tsconfig path alias, and when an invalid import is found, it'll match on the wrong package due to the name matching the prefix.
- Loading branch information
Showing
3 changed files
with
3 additions
and
71 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 |
---|---|---|
|
@@ -1011,52 +1011,6 @@ describe('TargetProjectLocator', () => { | |
expect(result).toEqual('npm:[email protected]'); | ||
}); | ||
}); | ||
|
||
describe('findDependencyInWorkspaceProjects', () => { | ||
it.each` | ||
pkgName | project | exports | dependency | ||
${'@org/pkg1'} | ${'pkg1'} | ${undefined} | ${'@org/pkg1'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${undefined} | ${'@org/pkg1/subpath'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${'dist/index.js'} | ${'@org/pkg1'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{}} | ${'@org/pkg1'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{}} | ${'@org/pkg1/subpath'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{ '.': 'dist/index.js' }} | ${'@org/pkg1'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{ '.': 'dist/index.js' }} | ${'@org/pkg1/subpath'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{ './subpath': './dist/subpath.js' }} | ${'@org/pkg1'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{ './subpath': './dist/subpath.js' }} | ${'@org/pkg1/subpath'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{ import: './dist/index.js', default: './dist/index.js' }} | ${'@org/pkg1'} | ||
${'@org/pkg1'} | ${'pkg1'} | ${{ import: './dist/index.js', default: './dist/index.js' }} | ${'@org/pkg1/subpath'} | ||
`( | ||
'should find "$dependency" as "$project" when exports="$exports"', | ||
({ pkgName, project, exports, dependency }) => { | ||
let projects: Record<string, ProjectGraphProjectNode> = { | ||
[project]: { | ||
name: project, | ||
type: 'lib' as const, | ||
data: { | ||
root: project, | ||
metadata: { | ||
js: { | ||
packageName: pkgName, | ||
packageExports: exports, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
const targetProjectLocator = new TargetProjectLocator( | ||
projects, | ||
{}, | ||
new Map() | ||
); | ||
const result = | ||
targetProjectLocator.findDependencyInWorkspaceProjects(dependency); | ||
|
||
expect(result).toEqual(project); | ||
} | ||
); | ||
}); | ||
}); | ||
|
||
describe('isBuiltinModuleImport()', () => { | ||
|
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