-
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.
- Loading branch information
Showing
17 changed files
with
443 additions
and
271 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 |
---|---|---|
@@ -1 +1 @@ | ||
FROM ghcr.io/containerbase/devcontainer:10.3.11 | ||
FROM ghcr.io/containerbase/devcontainer:10.3.13 |
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
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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { codeBlock } from 'common-tags'; | ||
import { Fixtures } from '../../../../../test/fixtures'; | ||
import { fs } from '../../../../../test/util'; | ||
import { logger } from '../../../../logger'; | ||
|
@@ -293,6 +294,30 @@ describe('modules/manager/npm/extract/index', () => { | |
).toBeArrayIncludingOnly(['https://registry.example.com']); | ||
}); | ||
|
||
it('resolves registry URLs using the package name if set', async () => { | ||
fs.readLocalFile.mockImplementation((fileName): Promise<any> => { | ||
if (fileName === '.yarnrc.yml') { | ||
return Promise.resolve(codeBlock` | ||
npmScopes: | ||
yarnpkg: | ||
npmRegistryServer: https://registry.example.com | ||
`); | ||
} | ||
return Promise.resolve(null); | ||
}); | ||
const res = await npmExtract.extractPackageFile( | ||
'{"packageManager": "[email protected]"}', | ||
'package.json', | ||
{}, | ||
); | ||
expect(res?.deps).toEqual([ | ||
expect.objectContaining({ | ||
depName: 'yarn', | ||
registryUrls: ['https://registry.example.com'], | ||
}), | ||
]); | ||
}); | ||
|
||
it('finds complex yarn workspaces', async () => { | ||
fs.readLocalFile.mockImplementation((fileName): Promise<any> => { | ||
return Promise.resolve(null); | ||
|
@@ -869,6 +894,87 @@ describe('modules/manager/npm/extract/index', () => { | |
], | ||
}); | ||
}); | ||
|
||
it('extracts dependencies from pnpm.overrides', async () => { | ||
const content = `{ | ||
"devDependencies": { | ||
"@types/react": "18.0.5" | ||
}, | ||
"pnpm": { | ||
"overrides": { | ||
"node": "8.9.2", | ||
"@types/react": "18.0.5", | ||
"baz": { | ||
"node": "8.9.2", | ||
"bar": { | ||
"foo": "1.0.0" | ||
} | ||
}, | ||
"foo2": { | ||
".": "1.0.0", | ||
"bar2": "1.0.0" | ||
}, | ||
"emptyObject":{} | ||
} | ||
} | ||
}`; | ||
const res = await npmExtract.extractPackageFile( | ||
content, | ||
'package.json', | ||
defaultExtractConfig, | ||
); | ||
expect(res).toMatchObject({ | ||
deps: [ | ||
{ | ||
depType: 'devDependencies', | ||
depName: '@types/react', | ||
currentValue: '18.0.5', | ||
datasource: 'npm', | ||
prettyDepType: 'devDependency', | ||
}, | ||
{ | ||
depType: 'overrides', | ||
depName: 'node', | ||
currentValue: '8.9.2', | ||
datasource: 'npm', | ||
commitMessageTopic: 'Node.js', | ||
prettyDepType: 'overrides', | ||
}, | ||
{ | ||
depType: 'overrides', | ||
depName: '@types/react', | ||
currentValue: '18.0.5', | ||
datasource: 'npm', | ||
prettyDepType: 'overrides', | ||
}, | ||
{ | ||
depName: 'node', | ||
managerData: { parents: ['baz'] }, | ||
commitMessageTopic: 'Node.js', | ||
currentValue: '8.9.2', | ||
datasource: 'npm', | ||
}, | ||
{ | ||
depName: 'foo', | ||
managerData: { parents: ['baz', 'bar'] }, | ||
currentValue: '1.0.0', | ||
datasource: 'npm', | ||
}, | ||
{ | ||
depName: 'foo2', | ||
managerData: { parents: ['foo2'] }, | ||
currentValue: '1.0.0', | ||
datasource: 'npm', | ||
}, | ||
{ | ||
depName: 'bar2', | ||
managerData: { parents: ['foo2'] }, | ||
currentValue: '1.0.0', | ||
datasource: 'npm', | ||
}, | ||
], | ||
}); | ||
}); | ||
}); | ||
|
||
describe('.extractAllPackageFiles()', () => { | ||
|
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
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
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
Oops, something went wrong.