Upgrade dependencies

and deal with the fallouts

Signed-off-by: Paul Merlin <paul@gradle.com>
This commit is contained in:
paul 2020-09-22 18:02:50 +02:00
parent e7b6c4bcaa
commit d48df5be4b
6 changed files with 3154 additions and 1954 deletions

View file

@ -1,6 +1,6 @@
{ {
"plugins": ["jest", "@typescript-eslint"], "plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"], "extends": ["plugin:github/typescript"],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
"ecmaVersion": 9, "ecmaVersion": 9,
@ -16,13 +16,9 @@
"@typescript-eslint/no-require-imports": "error", "@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error", "@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error", "@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off", "camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"], "@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-explicit-any": "error",

View file

@ -12,8 +12,8 @@ test('succeeds if all found wrapper jars are valid', async () => {
expect(result.toDisplayString()).toBe( expect(result.toDisplayString()).toBe(
'✓ Found known Gradle Wrapper JAR files:\n' + '✓ Found known Gradle Wrapper JAR files:\n' +
' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' + ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' +
' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradlе-wrapper.jar\n' + // homoglyph ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradlе-wrapper.jar\n' + // homoglyph
' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar' ' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar'
) )
}) })
@ -43,8 +43,8 @@ test('fails if invalid wrapper jars are found', async () => {
expect(result.toDisplayString()).toBe( expect(result.toDisplayString()).toBe(
'✗ Found unknown Gradle Wrapper JAR files:\n' + '✗ Found unknown Gradle Wrapper JAR files:\n' +
' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' + ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' +
' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradlе-wrapper.jar\n' + // homoglyph ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradlе-wrapper.jar\n' + // homoglyph
'✓ Found known Gradle Wrapper JAR files:\n' + '✓ Found known Gradle Wrapper JAR files:\n' +
' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar' ' 3888c76faa032ea8394b8a54e04ce2227ab1f4be64f65d450f8509fe112d38ce __tests__/data/valid/gradle-wrapper.jar'
) )
@ -61,8 +61,8 @@ test('fails if not enough wrapper jars are found', async () => {
expect(result.toDisplayString()).toBe( expect(result.toDisplayString()).toBe(
'✗ Found unknown Gradle Wrapper JAR files:\n' + '✗ Found unknown Gradle Wrapper JAR files:\n' +
' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' + ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradle-wrapper.jar\n' +
' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradlе-wrapper.jar\n' + // homoglyph ' e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 __tests__/data/invalid/gradlе-wrapper.jar\n' + // homoglyph
'✗ Other validation errors:\n' + '✗ Other validation errors:\n' +
' Expected to find at least 4 Gradle Wrapper JARs but got only 3\n' + ' Expected to find at least 4 Gradle Wrapper JARs but got only 3\n' +
'✓ Found known Gradle Wrapper JAR files:\n' + '✓ Found known Gradle Wrapper JAR files:\n' +

196
dist/index.js vendored

File diff suppressed because one or more lines are too long

4851
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,23 +25,23 @@
"author": "YourNameOrOrganization", "author": "YourNameOrOrganization",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.3", "@actions/core": "1.2.5",
"typed-rest-client": "^1.7.3", "typed-rest-client": "1.7.3",
"unhomoglyph": "^1.0.5" "unhomoglyph": "1.0.6"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.2.1", "@types/jest": "26.0.14",
"@types/node": "^12.12.34", "@types/node": "12.12.62",
"@typescript-eslint/parser": "^2.27.0", "@typescript-eslint/parser": "4.2.0",
"@zeit/ncc": "^0.22.1", "@zeit/ncc": "0.22.3",
"eslint": "^6.8.0", "eslint": "7.9.0",
"eslint-plugin-github": "^3.4.1", "eslint-plugin-github": "4.1.1",
"eslint-plugin-jest": "^23.8.2", "eslint-plugin-jest": "24.0.2",
"jest": "^25.2.7", "jest": "26.4.2",
"jest-circus": "^25.2.7", "jest-circus": "26.4.2",
"js-yaml": "^3.13.1", "js-yaml": "3.14.0",
"prettier": "^2.0.4", "prettier": "2.1.2",
"ts-jest": "^25.3.1", "ts-jest": "26.4.0",
"typescript": "^3.8.3" "typescript": "4.0.3"
} }
} }

View file

@ -6,8 +6,11 @@ export async function fetchValidChecksums(
allowSnapshots: boolean allowSnapshots: boolean
): Promise<string[]> { ): Promise<string[]> {
const all = await httpGetJsonArray('https://services.gradle.org/versions/all') const all = await httpGetJsonArray('https://services.gradle.org/versions/all')
const withChecksum = all.filter(entry => const withChecksum = all.filter(
entry.hasOwnProperty('wrapperChecksumUrl') entry =>
typeof entry === 'object' &&
entry != null &&
entry.hasOwnProperty('wrapperChecksumUrl')
) )
const allowed = withChecksum.filter( const allowed = withChecksum.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
@ -23,7 +26,7 @@ export async function fetchValidChecksums(
return [...new Set(checksums)] return [...new Set(checksums)]
} }
async function httpGetJsonArray(url: string): Promise<object[]> { async function httpGetJsonArray(url: string): Promise<unknown[]> {
return JSON.parse(await httpGetText(url)) return JSON.parse(await httpGetText(url))
} }