-
Notifications
You must be signed in to change notification settings - Fork 0
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 When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
- Loading branch information
Showing
5 changed files
with
71 additions
and
4 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