Merge pull request #85 from crazy-max/dev-deps

Update dev deps
This commit is contained in:
CrazyMax 2021-07-06 20:26:29 +02:00 committed by GitHub
commit 5d62c58fc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 4372 additions and 4608 deletions

View file

@ -1,5 +1,5 @@
{ {
"printWidth": 120, "printWidth": 240,
"tabWidth": 2, "tabWidth": 2,
"useTabs": false, "useTabs": false,
"semi": true, "semi": true,

View file

@ -74,21 +74,9 @@ describe('getRegion', () => {
describe('getAccountIDs', () => { describe('getAccountIDs', () => {
test.each([ test.each([
['012345678901.dkr.ecr.eu-west-3.amazonaws.com', undefined, ['012345678901']], ['012345678901.dkr.ecr.eu-west-3.amazonaws.com', undefined, ['012345678901']],
[ ['012345678901.dkr.ecr.eu-west-3.amazonaws.com', '012345678910,023456789012', ['012345678901', '012345678910', '023456789012']],
'012345678901.dkr.ecr.eu-west-3.amazonaws.com', ['012345678901.dkr.ecr.eu-west-3.amazonaws.com', '012345678901,012345678910,023456789012', ['012345678901', '012345678910', '023456789012']],
'012345678910,023456789012', ['390948362332.dkr.ecr.cn-northwest-1.amazonaws.com.cn', '012345678910,023456789012', ['390948362332', '012345678910', '023456789012']],
['012345678901', '012345678910', '023456789012']
],
[
'012345678901.dkr.ecr.eu-west-3.amazonaws.com',
'012345678901,012345678910,023456789012',
['012345678901', '012345678910', '023456789012']
],
[
'390948362332.dkr.ecr.cn-northwest-1.amazonaws.com.cn',
'012345678910,023456789012',
['390948362332', '012345678910', '023456789012']
],
['public.ecr.aws', undefined, []] ['public.ecr.aws', undefined, []]
])('given registry %p', async (registry, accountIDsEnv, expected) => { ])('given registry %p', async (registry, accountIDsEnv, expected) => {
if (accountIDsEnv) { if (accountIDsEnv) {

3
codecov.yml Normal file
View file

@ -0,0 +1,3 @@
comment: false
github_checks:
annotations: false

6883
dist/index.js generated vendored

File diff suppressed because it is too large Load diff

View file

@ -33,16 +33,16 @@
"semver": "^7.3.5" "semver": "^7.3.5"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.3", "@types/jest": "^26.0.23",
"@types/node": "^14.0.14", "@types/node": "^14.17.4",
"@vercel/ncc": "^0.23.0", "@vercel/ncc": "^0.28.6",
"dotenv": "^8.2.0", "dotenv": "^8.6.0",
"jest": "^26.1.0", "jest": "^26.6.3",
"jest-circus": "^26.1.0", "jest-circus": "^26.6.3",
"jest-runtime": "^26.1.0", "jest-runtime": "^26.6.3",
"prettier": "^2.0.5", "prettier": "^2.3.2",
"ts-jest": "^26.1.1", "ts-jest": "^26.5.6",
"typescript": "^3.9.5", "typescript": "^3.9.10",
"typescript-formatter": "^7.2.2" "typescript-formatter": "^7.2.2"
} }
} }

View file

@ -71,27 +71,14 @@ export const parseCLIVersion = async (stdout: string): Promise<string> => {
return semver.clean(matches[1]); return semver.clean(matches[1]);
}; };
export const getDockerLoginCmds = async ( export const getDockerLoginCmds = async (cliVersion: string, registry: string, region: string, accountIDs: string[]): Promise<string[]> => {
cliVersion: string,
registry: string,
region: string,
accountIDs: string[]
): Promise<string[]> => {
let ecrCmd = (await isPubECR(registry)) ? 'ecr-public' : 'ecr'; let ecrCmd = (await isPubECR(registry)) ? 'ecr-public' : 'ecr';
if (semver.satisfies(cliVersion, '>=2.0.0') || (await isPubECR(registry))) { if (semver.satisfies(cliVersion, '>=2.0.0') || (await isPubECR(registry))) {
return execCLI([ecrCmd, 'get-login-password', '--region', region]).then(pwd => { return execCLI([ecrCmd, 'get-login-password', '--region', region]).then(pwd => {
return [`docker login --username AWS --password ${pwd} ${registry}`]; return [`docker login --username AWS --password ${pwd} ${registry}`];
}); });
} else { } else {
return execCLI([ return execCLI([ecrCmd, 'get-login', '--region', region, '--registry-ids', accountIDs.join(' '), '--no-include-email']).then(dockerLoginCmds => {
ecrCmd,
'get-login',
'--region',
region,
'--registry-ids',
accountIDs.join(' '),
'--no-include-email'
]).then(dockerLoginCmds => {
return dockerLoginCmds.trim().split(`\n`); return dockerLoginCmds.trim().split(`\n`);
}); });
} }

2037
yarn.lock

File diff suppressed because it is too large Load diff