Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dep): upgrading typescript and eslint deps #7214

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/two-toes-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"app-builder-lib": patch
"builder-util-runtime": patch
"builder-util": patch
"dmg-builder": patch
"electron-builder-squirrel-windows": patch
"electron-builder": patch
---

chore(dep): upgrading typescript and eslint dependencies
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = {
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-call": "off",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
"@changesets/changelog-github": "0.4.2",
"@changesets/cli": "2.19.0",
"@types/node": "16.11.43",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"catharsis": "0.9.0",
"conventional-changelog-cli": "2.1.1",
"dmd": "6.0.0",
"eslint": "7.30.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"eslint": "8.26.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
"fs-extra": "10.0.0",
"globby": "11.1.0",
"husky": "7.0.4",
Expand All @@ -69,7 +69,7 @@
"replace-in-file": "6.2.0",
"source-map-support": "0.5.21",
"ts-jsdoc": "3.2.2",
"typescript": "4.3.5",
"typescript": "4.8.4",
"typescript-json-schema": "0.51.0",
"v8-compile-cache": "2.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/ProtonFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ProtonFramework extends LibUiFramework {
} else {
try {
babel = require("babel-core")
} catch (e) {
} catch (e: any) {
// babel isn't installed
log.debug(null, "don't transpile source code using Babel")
return null
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/asar/asarFileChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export async function checkFileInArchive(asarFile: string, relativeFile: string,
let fs
try {
fs = await readAsar(asarFile)
} catch (e) {
} catch (e: any) {
throw error(`is corrupted: ${e}`)
}

let stat: Node | null
try {
stat = fs.getFile(relativeFile)
} catch (e) {
} catch (e: any) {
const fileStat = await statOrNull(asarFile)
if (fileStat == null) {
throw error(`does not exist. Seems like a wrong configuration.`)
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/asar/asarUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class AsarPackager {
.then(it => {
writeStream.write(it, () => w(index + 1))
})
.catch(e => reject(`Cannot read file ${file}: ${e.stack || e}`))
.catch((e: any) => reject(`Cannot read file ${file}: ${e.stack || e}`))
} else {
const readStream = createReadStream(file)
readStream.on("error", reject)
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/codeSign/macCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export interface CreateKeychainOptions {
}

export function removeKeychain(keychainFile: string, printWarn = true): Promise<any> {
return exec("security", ["delete-keychain", keychainFile]).catch(e => {
return exec("security", ["delete-keychain", keychainFile]).catch((e: any) => {
if (printWarn) {
log.warn({ file: keychainFile, error: e.stack || e }, "cannot delete keychain")
}
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/codeSign/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function getCertInfo(file: string, password: string): Promise<Certi
const errorMessagePrefix = "Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: "
try {
result = await executeAppBuilderAsJson<any>(["certificate-info", "--input", file, "--password", password])
} catch (e) {
} catch (e: any) {
throw new Error(`${errorMessagePrefix}${e.stack || e}`)
}

Expand Down Expand Up @@ -165,7 +165,7 @@ export async function doSign(configuration: CustomWindowsSignTaskConfiguration,

try {
await vm.exec(tool, args, { timeout, env })
} catch (e) {
} catch (e: any) {
if (e.message.includes("The file is being used by another process") || e.message.includes("The specified timestamp server either could not be reached")) {
log.warn(`First attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`)
await new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/electron/electronVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function computeElectronVersion(projectDir: string, projectMetadata
const version = releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name
log.info({ version }, `resolve ${dependency.name}@${dependency.version}`)
return version
} catch (e) {
} catch (e: any) {
log.warn(e)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/fileTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function createTransformer(srcDir: string, configuration: Configuration,
isRemovePackageKeywords,
})
)
.catch(e => log.warn(e))
.catch((e: any) => log.warn(e))
} else if (extraTransformer != null) {
return extraTransformer(file)
} else {
Expand Down Expand Up @@ -99,7 +99,7 @@ function cleanupPackageJson(data: any, options: CleanupPackageFileOptions): any
if (changed) {
return JSON.stringify(data, null, 2)
}
} catch (e) {
} catch (e: any) {
debug(e)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/packager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class Packager {

try {
log.info({ version: PACKAGE_VERSION, os: getOsRelease() }, "electron-builder")
} catch (e) {
} catch (e: any) {
// error in dev mode without babel
if (!(e instanceof ReferenceError)) {
throw e
Expand Down Expand Up @@ -381,7 +381,7 @@ export class Packager {
const toDispose = this.toDispose.slice()
this.toDispose.length = 0
for (const disposer of toDispose) {
await disposer().catch(e => {
await disposer().catch((e: any) => {
log.warn({ error: e }, "cannot dispose")
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/platformPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ export function resolveFunction<T>(executor: T | string, name: string): T {

try {
p = require.resolve(p)
} catch (e) {
} catch (e: any) {
debug(e)
p = path.resolve(p)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/publish/KeygenPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ export class KeygenPublisher extends HttpPublisher {
try {
// First, we'll attempt to fetch the release.
return await this.getRelease()
} catch (e) {
} catch (e: any) {
if (e.statusCode !== 404) {
throw e
}

try {
// Next, if the release doesn't exist, we'll attempt to create it.
return await this.createRelease()
} catch (e) {
} catch (e: any) {
if (e.statusCode !== 409 && e.statusCode !== 422) {
throw e
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/publish/s3/s3Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class S3Publisher extends BaseS3Publisher {
// on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.
try {
options.region = await executeAppBuilder(["get-bucket-location", "--bucket", bucket])
} catch (e) {
} catch (e: any) {
if (errorIfCannot) {
throw e
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export async function archive(format: string, outFile: string, dirToArchive: str
},
debug7z.enabled
)
} catch (e) {
} catch (e: any) {
if (e.code === "ENOENT" && !(await exists(dirToArchive))) {
throw new Error(`Cannot create archive: "${dirToArchive}" doesn't exist`)
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ async function ensureNotBusy(outFile: string): Promise<void> {
} else {
fs.close(fd, () => resolve(true))
}
} catch (error) {
} catch (error: any) {
reject(error)
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/util/appBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function executeAppBuilderAsJson<T>(args: Array<string>): Promise<T> {

try {
return JSON.parse(rawResult) as T
} catch (e) {
} catch (e: any) {
throw new Error(`Cannot parse result: ${e.message}: "${rawResult}"`)
}
})
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/util/cacheManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class BuildCacheManager {
try {
await copyFile(this.cacheFile, this.executableFile, false)
return true
} catch (e) {
} catch (e: any) {
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
log.debug({ error: e.code }, "copy cached executable failed")
} else {
Expand All @@ -66,7 +66,7 @@ export class BuildCacheManager {
try {
await mkdir(this.cacheDir, { recursive: true })
await Promise.all([writeJson(this.cacheInfoFile, this.cacheInfo), copyFile(this.executableFile, this.cacheFile, false)])
} catch (e) {
} catch (e: any) {
log.warn({ error: e.stack || e }, `cannot save build cache`)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/util/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function mergeFilters(value: Filter, other: Filter): string[] {
}

function mergeFileSets(lists: FileSet[][]): FileSet[] {
const result = []
const result: FileSet[] = []

for (const list of lists) {
for (const item of list) {
Expand Down
8 changes: 4 additions & 4 deletions packages/app-builder-lib/src/winPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {
return this.vm.value
.then(vm => getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))
.catch(e => {
.catch((e: any) => {
// https://github.com/electron-userland/electron-builder/pull/2397
if (platformSpecificBuildOptions.sign == null) {
throw e
Expand Down Expand Up @@ -68,7 +68,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
return (
importCertificate(cscLink, this.info.tempDirManager, this.projectDir)
// before then
.catch(e => {
.catch((e: any) => {
if (e instanceof InvalidConfigurationError) {
throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)
} else {
Expand Down Expand Up @@ -170,7 +170,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
case "squirrel":
try {
return require("electron-builder-squirrel-windows").default
} catch (e) {
} catch (e: any) {
throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)
}

Expand Down Expand Up @@ -254,7 +254,7 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {
try {
await sign(options, this)
break
} catch (e) {
} catch (e: any) {
// https://github.com/electron-userland/electron-builder/issues/1414
const message = e.message
if (message != null && message.includes("Couldn't resolve host name")) {
Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util-runtime/src/CancellationToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class CancellationToken extends EventEmitter {
finallyHandler()
return it
})
.catch(e => {
.catch((e: any) => {
finallyHandler()
throw e
})
Expand Down
6 changes: 3 additions & 3 deletions packages/builder-util-runtime/src/httpExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Please double check that your authentication token is correct. Due to security r
} else {
resolve(data.length === 0 ? null : data)
}
} catch (e) {
} catch (e: any) {
reject(e)
}
})
Expand Down Expand Up @@ -349,7 +349,7 @@ Please double check that your authentication token is correct. Due to security r
for (let attemptNumber = 0; ; attemptNumber++) {
try {
return task()
} catch (e) {
} catch (e: any) {
if (attemptNumber < maxRetries && ((e instanceof HttpError && e.isServerError()) || e.code === "EPIPE")) {
continue
}
Expand Down Expand Up @@ -417,7 +417,7 @@ export class DigestTransform extends Transform {
if (this.isValidateOnEnd) {
try {
this.validate()
} catch (e) {
} catch (e: any) {
callback(e)
return
}
Expand Down
4 changes: 2 additions & 2 deletions packages/builder-util/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function exists(file: string): Promise<boolean> {
try {
await access(file)
return true
} catch (e) {
} catch (e: any) {
return false
}
}
Expand Down Expand Up @@ -185,7 +185,7 @@ export function copyOrLinkFile(src: string, dest: string, stats?: Stats | null,
}

if (isUseHardLink) {
return link(src, dest).catch(e => {
return link(src, dest).catch((e: any) => {
if (e.code === "EXDEV") {
const isLog = exDevErrorHandler == null ? true : exDevErrorHandler()
if (isLog && log.isDebugEnabled) {
Expand Down
6 changes: 3 additions & 3 deletions packages/builder-util/src/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export async function executeFinally<T>(promise: Promise<T>, task: (isErrorOccur
let result: T | null = null
try {
result = await promise
} catch (originalError) {
} catch (originalError: any) {
try {
await task(true)
} catch (taskError) {
} catch (taskError: any) {
throw new NestedError([originalError, taskError])
}

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

export function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T> {
return promise.catch(e => {
return promise.catch((e: any) => {
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
return fallbackValue
}
Expand Down
4 changes: 2 additions & 2 deletions packages/builder-util/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export function doSpawn(command: string, args: Array<string>, options?: SpawnOpt
logSpawn(command, args, options)
try {
return _spawn(command, args, options)
} catch (e) {
} catch (e: any) {
throw new Error(`Cannot spawn ${command}: ${e.stack || e}`)
}
}
Expand Down Expand Up @@ -399,7 +399,7 @@ export function executeAppBuilder(
export async function retry<T>(task: () => Promise<T>, retriesLeft: number, interval: number): Promise<T> {
try {
return await task()
} catch (error) {
} catch (error: any) {
log.info(`Above command failed, retrying ${retriesLeft} more times`)
if (retriesLeft > 0) {
await new Promise(resolve => setTimeout(resolve, interval))
Expand Down
2 changes: 1 addition & 1 deletion packages/dmg-builder/src/dmg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ async function customizeDmg(volumePath: string, specification: DmgOptions, packa
}
try {
await executePython("python3")
} catch (error) {
} catch (error: any) {
await executePython("python")
}
return packager.packagerOptions.effectiveOptionComputed == null || !(await packager.packagerOptions.effectiveOptionComputed({ volumePath, specification, packager }))
Expand Down
2 changes: 1 addition & 1 deletion packages/dmg-builder/src/dmgUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function attachAndExecute(dmgPath: string, readWrite: boolean, task
export async function detach(name: string) {
try {
await exec("hdiutil", ["detach", "-quiet", name])
} catch (e) {
} catch (e: any) {
await new Promise((resolve, reject) => {
setTimeout(() => {
exec("hdiutil", ["detach", "-force", name]).then(resolve).catch(reject)
Expand Down
Loading