Skip to content

Commit 53327d5

Browse files
authored
chore(dep): upgrading typescript and eslint dependencies (#7214)
1 parent 4a96bc2 commit 53327d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+308
-299
lines changed

.changeset/two-toes-care.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"app-builder-lib": patch
3+
"builder-util-runtime": patch
4+
"builder-util": patch
5+
"dmg-builder": patch
6+
"electron-builder-squirrel-windows": patch
7+
"electron-builder": patch
8+
---
9+
10+
chore(dep): upgrading typescript and eslint dependencies

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828
"@typescript-eslint/no-unsafe-member-access": "off",
2929
"@typescript-eslint/restrict-template-expressions": "off",
3030
"@typescript-eslint/no-unsafe-return": "off",
31+
"@typescript-eslint/no-unsafe-argument": "off",
3132
"@typescript-eslint/no-unsafe-assignment": "off",
3233
"@typescript-eslint/no-explicit-any": "off",
3334
"@typescript-eslint/no-unsafe-call": "off",

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@
4949
"@changesets/changelog-github": "0.4.2",
5050
"@changesets/cli": "2.19.0",
5151
"@types/node": "16.11.43",
52-
"@typescript-eslint/eslint-plugin": "4.33.0",
53-
"@typescript-eslint/parser": "4.33.0",
52+
"@typescript-eslint/eslint-plugin": "5.41.0",
53+
"@typescript-eslint/parser": "5.41.0",
5454
"catharsis": "0.9.0",
5555
"conventional-changelog-cli": "2.1.1",
5656
"dmd": "6.0.0",
57-
"eslint": "7.30.0",
58-
"eslint-config-prettier": "8.3.0",
59-
"eslint-plugin-prettier": "3.4.0",
57+
"eslint": "8.26.0",
58+
"eslint-config-prettier": "8.5.0",
59+
"eslint-plugin-prettier": "4.2.1",
6060
"fs-extra": "10.0.0",
6161
"globby": "11.1.0",
6262
"husky": "7.0.4",
@@ -69,7 +69,7 @@
6969
"replace-in-file": "6.2.0",
7070
"source-map-support": "0.5.21",
7171
"ts-jsdoc": "3.2.2",
72-
"typescript": "4.3.5",
72+
"typescript": "4.8.4",
7373
"typescript-json-schema": "0.51.0",
7474
"v8-compile-cache": "2.3.0"
7575
},

packages/app-builder-lib/src/ProtonFramework.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class ProtonFramework extends LibUiFramework {
3636
} else {
3737
try {
3838
babel = require("babel-core")
39-
} catch (e) {
39+
} catch (e: any) {
4040
// babel isn't installed
4141
log.debug(null, "don't transpile source code using Babel")
4242
return null

packages/app-builder-lib/src/asar/asarFileChecker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export async function checkFileInArchive(asarFile: string, relativeFile: string,
1010
let fs
1111
try {
1212
fs = await readAsar(asarFile)
13-
} catch (e) {
13+
} catch (e: any) {
1414
throw error(`is corrupted: ${e}`)
1515
}
1616

1717
let stat: Node | null
1818
try {
1919
stat = fs.getFile(relativeFile)
20-
} catch (e) {
20+
} catch (e: any) {
2121
const fileStat = await statOrNull(asarFile)
2222
if (fileStat == null) {
2323
throw error(`does not exist. Seems like a wrong configuration.`)

packages/app-builder-lib/src/asar/asarUtil.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class AsarPackager {
202202
.then(it => {
203203
writeStream.write(it, () => w(index + 1))
204204
})
205-
.catch(e => reject(`Cannot read file ${file}: ${e.stack || e}`))
205+
.catch((e: any) => reject(`Cannot read file ${file}: ${e.stack || e}`))
206206
} else {
207207
const readStream = createReadStream(file)
208208
readStream.on("error", reject)

packages/app-builder-lib/src/codeSign/macCodeSign.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export interface CreateKeychainOptions {
146146
}
147147

148148
export function removeKeychain(keychainFile: string, printWarn = true): Promise<any> {
149-
return exec("security", ["delete-keychain", keychainFile]).catch(e => {
149+
return exec("security", ["delete-keychain", keychainFile]).catch((e: any) => {
150150
if (printWarn) {
151151
log.warn({ file: keychainFile, error: e.stack || e }, "cannot delete keychain")
152152
}

packages/app-builder-lib/src/codeSign/windowsCodeSign.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export async function getCertInfo(file: string, password: string): Promise<Certi
8282
const errorMessagePrefix = "Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: "
8383
try {
8484
result = await executeAppBuilderAsJson<any>(["certificate-info", "--input", file, "--password", password])
85-
} catch (e) {
85+
} catch (e: any) {
8686
throw new Error(`${errorMessagePrefix}${e.stack || e}`)
8787
}
8888

@@ -165,7 +165,7 @@ export async function doSign(configuration: CustomWindowsSignTaskConfiguration,
165165

166166
try {
167167
await vm.exec(tool, args, { timeout, env })
168-
} catch (e) {
168+
} catch (e: any) {
169169
if (e.message.includes("The file is being used by another process") || e.message.includes("The specified timestamp server either could not be reached")) {
170170
log.warn(`First attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`)
171171
await new Promise((resolve, reject) => {

packages/app-builder-lib/src/electron/electronVersion.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function computeElectronVersion(projectDir: string, projectMetadata
8989
const version = releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name
9090
log.info({ version }, `resolve ${dependency.name}@${dependency.version}`)
9191
return version
92-
} catch (e) {
92+
} catch (e: any) {
9393
log.warn(e)
9494
}
9595

packages/app-builder-lib/src/fileTransformer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function createTransformer(srcDir: string, configuration: Configuration,
4444
isRemovePackageKeywords,
4545
})
4646
)
47-
.catch(e => log.warn(e))
47+
.catch((e: any) => log.warn(e))
4848
} else if (extraTransformer != null) {
4949
return extraTransformer(file)
5050
} else {
@@ -99,7 +99,7 @@ function cleanupPackageJson(data: any, options: CleanupPackageFileOptions): any
9999
if (changed) {
100100
return JSON.stringify(data, null, 2)
101101
}
102-
} catch (e) {
102+
} catch (e: any) {
103103
debug(e)
104104
}
105105

packages/app-builder-lib/src/packager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class Packager {
231231

232232
try {
233233
log.info({ version: PACKAGE_VERSION, os: getOsRelease() }, "electron-builder")
234-
} catch (e) {
234+
} catch (e: any) {
235235
// error in dev mode without babel
236236
if (!(e instanceof ReferenceError)) {
237237
throw e
@@ -381,7 +381,7 @@ export class Packager {
381381
const toDispose = this.toDispose.slice()
382382
this.toDispose.length = 0
383383
for (const disposer of toDispose) {
384-
await disposer().catch(e => {
384+
await disposer().catch((e: any) => {
385385
log.warn({ error: e }, "cannot dispose")
386386
})
387387
}

packages/app-builder-lib/src/platformPackager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ export function resolveFunction<T>(executor: T | string, name: string): T {
757757

758758
try {
759759
p = require.resolve(p)
760-
} catch (e) {
760+
} catch (e: any) {
761761
debug(e)
762762
p = path.resolve(p)
763763
}

packages/app-builder-lib/src/publish/KeygenPublisher.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ export class KeygenPublisher extends HttpPublisher {
185185
try {
186186
// First, we'll attempt to fetch the release.
187187
return await this.getRelease()
188-
} catch (e) {
188+
} catch (e: any) {
189189
if (e.statusCode !== 404) {
190190
throw e
191191
}
192192

193193
try {
194194
// Next, if the release doesn't exist, we'll attempt to create it.
195195
return await this.createRelease()
196-
} catch (e) {
196+
} catch (e: any) {
197197
if (e.statusCode !== 409 && e.statusCode !== 422) {
198198
throw e
199199
}

packages/app-builder-lib/src/publish/s3/s3Publisher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class S3Publisher extends BaseS3Publisher {
2020
// on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.
2121
try {
2222
options.region = await executeAppBuilder(["get-bucket-location", "--bucket", bucket])
23-
} catch (e) {
23+
} catch (e: any) {
2424
if (errorIfCannot) {
2525
throw e
2626
} else {

packages/app-builder-lib/src/targets/archive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export async function archive(format: string, outFile: string, dirToArchive: str
182182
},
183183
debug7z.enabled
184184
)
185-
} catch (e) {
185+
} catch (e: any) {
186186
if (e.code === "ENOENT" && !(await exists(dirToArchive))) {
187187
throw new Error(`Cannot create archive: "${dirToArchive}" doesn't exist`)
188188
} else {

packages/app-builder-lib/src/targets/nsis/NsisTarget.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ async function ensureNotBusy(outFile: string): Promise<void> {
753753
} else {
754754
fs.close(fd, () => resolve(true))
755755
}
756-
} catch (error) {
756+
} catch (error: any) {
757757
reject(error)
758758
}
759759
})

packages/app-builder-lib/src/util/appBuilder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function executeAppBuilderAsJson<T>(args: Array<string>): Promise<T> {
99

1010
try {
1111
return JSON.parse(rawResult) as T
12-
} catch (e) {
12+
} catch (e: any) {
1313
throw new Error(`Cannot parse result: ${e.message}: "${rawResult}"`)
1414
}
1515
})

packages/app-builder-lib/src/util/cacheManager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class BuildCacheManager {
4242
try {
4343
await copyFile(this.cacheFile, this.executableFile, false)
4444
return true
45-
} catch (e) {
45+
} catch (e: any) {
4646
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
4747
log.debug({ error: e.code }, "copy cached executable failed")
4848
} else {
@@ -66,7 +66,7 @@ export class BuildCacheManager {
6666
try {
6767
await mkdir(this.cacheDir, { recursive: true })
6868
await Promise.all([writeJson(this.cacheInfoFile, this.cacheInfo), copyFile(this.executableFile, this.cacheFile, false)])
69-
} catch (e) {
69+
} catch (e: any) {
7070
log.warn({ error: e.stack || e }, `cannot save build cache`)
7171
}
7272
}

packages/app-builder-lib/src/util/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function mergeFilters(value: Filter, other: Filter): string[] {
168168
}
169169

170170
function mergeFileSets(lists: FileSet[][]): FileSet[] {
171-
const result = []
171+
const result: FileSet[] = []
172172

173173
for (const list of lists) {
174174
for (const item of list) {

packages/app-builder-lib/src/winPackager.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
4040
if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {
4141
return this.vm.value
4242
.then(vm => getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))
43-
.catch(e => {
43+
.catch((e: any) => {
4444
// https://github.com/electron-userland/electron-builder/pull/2397
4545
if (platformSpecificBuildOptions.sign == null) {
4646
throw e
@@ -68,7 +68,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
6868
return (
6969
importCertificate(cscLink, this.info.tempDirManager, this.projectDir)
7070
// before then
71-
.catch(e => {
71+
.catch((e: any) => {
7272
if (e instanceof InvalidConfigurationError) {
7373
throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)
7474
} else {
@@ -170,7 +170,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
170170
case "squirrel":
171171
try {
172172
return require("electron-builder-squirrel-windows").default
173-
} catch (e) {
173+
} catch (e: any) {
174174
throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)
175175
}
176176

@@ -254,7 +254,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
254254
try {
255255
await sign(options, this)
256256
break
257-
} catch (e) {
257+
} catch (e: any) {
258258
// https://github.com/electron-userland/electron-builder/issues/1414
259259
const message = e.message
260260
if (message != null && message.includes("Couldn't resolve host name")) {

packages/builder-util-runtime/src/CancellationToken.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class CancellationToken extends EventEmitter {
8888
finallyHandler()
8989
return it
9090
})
91-
.catch(e => {
91+
.catch((e: any) => {
9292
finallyHandler()
9393
throw e
9494
})

packages/builder-util-runtime/src/httpExecutor.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Please double check that your authentication token is correct. Due to security r
206206
} else {
207207
resolve(data.length === 0 ? null : data)
208208
}
209-
} catch (e) {
209+
} catch (e: any) {
210210
reject(e)
211211
}
212212
})
@@ -349,7 +349,7 @@ Please double check that your authentication token is correct. Due to security r
349349
for (let attemptNumber = 0; ; attemptNumber++) {
350350
try {
351351
return task()
352-
} catch (e) {
352+
} catch (e: any) {
353353
if (attemptNumber < maxRetries && ((e instanceof HttpError && e.isServerError()) || e.code === "EPIPE")) {
354354
continue
355355
}
@@ -417,7 +417,7 @@ export class DigestTransform extends Transform {
417417
if (this.isValidateOnEnd) {
418418
try {
419419
this.validate()
420-
} catch (e) {
420+
} catch (e: any) {
421421
callback(e)
422422
return
423423
}

packages/builder-util/src/fs.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function exists(file: string): Promise<boolean> {
3535
try {
3636
await access(file)
3737
return true
38-
} catch (e) {
38+
} catch (e: any) {
3939
return false
4040
}
4141
}
@@ -185,7 +185,7 @@ export function copyOrLinkFile(src: string, dest: string, stats?: Stats | null,
185185
}
186186

187187
if (isUseHardLink) {
188-
return link(src, dest).catch(e => {
188+
return link(src, dest).catch((e: any) => {
189189
if (e.code === "EXDEV") {
190190
const isLog = exDevErrorHandler == null ? true : exDevErrorHandler()
191191
if (isLog && log.isDebugEnabled) {

packages/builder-util/src/promise.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export async function executeFinally<T>(promise: Promise<T>, task: (isErrorOccur
1010
let result: T | null = null
1111
try {
1212
result = await promise
13-
} catch (originalError) {
13+
} catch (originalError: any) {
1414
try {
1515
await task(true)
16-
} catch (taskError) {
16+
} catch (taskError: any) {
1717
throw new NestedError([originalError, taskError])
1818
}
1919

@@ -41,7 +41,7 @@ export function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null>
4141
}
4242

4343
export function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T> {
44-
return promise.catch(e => {
44+
return promise.catch((e: any) => {
4545
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
4646
return fallbackValue
4747
}

packages/builder-util/src/util.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function doSpawn(command: string, args: Array<string>, options?: SpawnOpt
173173
logSpawn(command, args, options)
174174
try {
175175
return _spawn(command, args, options)
176-
} catch (e) {
176+
} catch (e: any) {
177177
throw new Error(`Cannot spawn ${command}: ${e.stack || e}`)
178178
}
179179
}
@@ -399,7 +399,7 @@ export function executeAppBuilder(
399399
export async function retry<T>(task: () => Promise<T>, retriesLeft: number, interval: number): Promise<T> {
400400
try {
401401
return await task()
402-
} catch (error) {
402+
} catch (error: any) {
403403
log.info(`Above command failed, retrying ${retriesLeft} more times`)
404404
if (retriesLeft > 0) {
405405
await new Promise(resolve => setTimeout(resolve, interval))

packages/dmg-builder/src/dmg.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ async function customizeDmg(volumePath: string, specification: DmgOptions, packa
309309
}
310310
try {
311311
await executePython("python3")
312-
} catch (error) {
312+
} catch (error: any) {
313313
await executePython("python")
314314
}
315315
return packager.packagerOptions.effectiveOptionComputed == null || !(await packager.packagerOptions.effectiveOptionComputed({ volumePath, specification, packager }))

packages/dmg-builder/src/dmgUtil.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function attachAndExecute(dmgPath: string, readWrite: boolean, task
3636
export async function detach(name: string) {
3737
try {
3838
await exec("hdiutil", ["detach", "-quiet", name])
39-
} catch (e) {
39+
} catch (e: any) {
4040
await new Promise((resolve, reject) => {
4141
setTimeout(() => {
4242
exec("hdiutil", ["detach", "-force", name]).then(resolve).catch(reject)

0 commit comments

Comments
 (0)