-
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.
fix(js): detect helpers correctly when pnpm external nodes are suffix…
…ed with version (#17694)
- Loading branch information
Showing
5 changed files
with
69 additions
and
10 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,44 @@ | ||
import { | ||
getHelperDependency, | ||
HelperDependency, | ||
} from './compiler-helper-dependency'; | ||
import { join } from 'path'; | ||
|
||
describe('getHelperDependency', () => { | ||
it('should support pnpm external nodes where the name is suffixed with the version', () => { | ||
const helperDependency = HelperDependency.tsc; | ||
const configPath = join(__dirname, 'test-fixtures', 'tsconfig.json'); | ||
const dependencies = []; | ||
const projectGraph = { | ||
nodes: {}, | ||
externalNodes: { | ||
'[email protected]': { | ||
name: 'npm:[email protected]' as const, | ||
type: 'npm' as const, | ||
data: { | ||
packageName: 'tslib', | ||
version: '2.0.0', | ||
}, | ||
}, | ||
}, | ||
dependencies: {}, | ||
}; | ||
|
||
const result = getHelperDependency( | ||
helperDependency, | ||
configPath, | ||
dependencies, | ||
projectGraph | ||
); | ||
|
||
expect(result).toEqual({ | ||
name: 'npm:tslib', | ||
outputs: [], | ||
node: { | ||
name: 'npm:[email protected]', | ||
type: 'npm', | ||
data: { packageName: 'tslib', version: '2.0.0' }, | ||
}, | ||
}); | ||
}); | ||
}); |
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,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"importHelpers": true | ||
} | ||
} |
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
335c2d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev