Skip to content

Commit

Permalink
chore: upgrading connected dependencies (typescript 5.3.3 requires hi…
Browse files Browse the repository at this point in the history
…gher eslint version) (#8057)
  • Loading branch information
mmaietta authored Feb 17, 2024
1 parent 48603ba commit ccbb80d
Show file tree
Hide file tree
Showing 52 changed files with 434 additions and 234 deletions.
11 changes: 11 additions & 0 deletions .changeset/short-llamas-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"app-builder-lib": patch
"builder-util": patch
"builder-util-runtime": patch
"dmg-builder": patch
"electron-builder-squirrel-windows": patch
"electron-publish": patch
"electron-updater": patch
---

chore: upgrading connected dependencies (typescript requires higher eslint version)
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ module.exports = {
// "allowExpressions": false,
},
],
"@typescript-eslint/no-redundant-type-constituents": "off"
},
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
"@changesets/changelog-github": "0.4.7",
"@changesets/cli": "2.25.0",
"@types/node": "16.18.55",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"catharsis": "0.9.0",
"conventional-changelog-cli": "2.2.2",
"dmd": "6.1.0",
"eslint": "8.26.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.2.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"fs-extra": "10.1.0",
"globby": "11.1.0",
"husky": "7.0.4",
Expand All @@ -64,11 +64,11 @@
"lint-staged": "11.1.2",
"markdown2html-pro": "1.0.6",
"path-sort": "0.1.0",
"prettier": "2.8.0",
"prettier": "3.2.4",
"replace-in-file": "6.2.0",
"source-map-support": "0.5.21",
"ts-jsdoc": "3.2.2",
"typescript": "5.1.6",
"typescript": "5.3.3",
"typescript-json-schema": "0.51.0",
"v8-compile-cache": "2.3.0"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/app-builder-lib/src/asar/asar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export class Node {
export class AsarFilesystem {
private offset = 0

constructor(readonly src: string, readonly header = new Node(), readonly headerSize: number = -1) {
constructor(
readonly src: string,
readonly header = new Node(),
readonly headerSize: number = -1
) {
if (this.header.files == null) {
this.header.files = {}
}
Expand Down
7 changes: 6 additions & 1 deletion packages/app-builder-lib/src/asar/asarUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ export class AsarPackager {
private readonly outFile: string
private readonly unpackedDest: string

constructor(private readonly src: string, private readonly destination: string, private readonly options: AsarOptions, private readonly unpackPattern: Filter | null) {
constructor(
private readonly src: string,
private readonly destination: string,
private readonly options: AsarOptions,
private readonly unpackPattern: Filter | null
) {
this.outFile = path.join(destination, "app.asar")
this.unpackedDest = `${this.outFile}.unpacked`
}
Expand Down
11 changes: 9 additions & 2 deletions packages/app-builder-lib/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export class Platform {
static LINUX = new Platform("linux", "linux", "linux")
static WINDOWS = new Platform("windows", "win", "win32")

constructor(public name: string, public buildConfigurationKey: string, public nodeName: NodeJS.Platform) {}
constructor(
public name: string,
public buildConfigurationKey: string,
public nodeName: NodeJS.Platform
) {}

toString() {
return this.name
Expand Down Expand Up @@ -71,7 +75,10 @@ export abstract class Target {
abstract readonly outDir: string
abstract readonly options: TargetSpecificOptions | null | undefined

protected constructor(readonly name: string, readonly isAsyncSupported: boolean = true) {}
protected constructor(
readonly name: string,
readonly isAsyncSupported: boolean = true
) {}

async checkOptions(): Promise<any> {
// ignore
Expand Down
6 changes: 5 additions & 1 deletion packages/app-builder-lib/src/electron/ElectronFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ class ElectronFramework implements Framework {
// noinspection JSUnusedGlobalSymbols
readonly isNpmRebuildRequired = true

constructor(readonly name: string, readonly version: string, readonly distMacOsAppName: string) {}
constructor(
readonly name: string,
readonly version: string,
readonly distMacOsAppName: string
) {}

getDefaultIcon(platform: Platform) {
if (platform === Platform.LINUX) {
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 @@ -100,7 +100,7 @@ export async function computeElectronVersion(projectDir: string): Promise<string
)
}

return semver.coerce(version)!.toString()
return semver.coerce(version)!.format()
}

interface NameAndVersion {
Expand Down
7 changes: 6 additions & 1 deletion packages/app-builder-lib/src/fileMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ export class FileMatcher {

readonly isSpecifiedAsEmptyArray: boolean

constructor(from: string, to: string, readonly macroExpander: (pattern: string) => string, patterns?: Array<string> | string | null | undefined) {
constructor(
from: string,
to: string,
readonly macroExpander: (pattern: string) => string,
patterns?: Array<string> | string | null | undefined
) {
this.from = ensureNoEndSlash(macroExpander(from))
this.to = ensureNoEndSlash(macroExpander(to))
this.patterns = asArray(patterns).map(it => this.normalizePattern(it))
Expand Down
6 changes: 5 additions & 1 deletion packages/app-builder-lib/src/frameworks/LibUiFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export class LibUiFramework implements Framework {
// noinspection JSUnusedGlobalSymbols
readonly isNpmRebuildRequired = false

constructor(readonly version: string, readonly distMacOsAppName: string, protected readonly isUseLaunchUi: boolean) {}
constructor(
readonly version: string,
readonly distMacOsAppName: string,
protected readonly isUseLaunchUi: boolean
) {}

async prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {
await emptyDir(options.appOutDir)
Expand Down
5 changes: 4 additions & 1 deletion packages/app-builder-lib/src/packager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ export class Packager {
}

//noinspection JSUnusedGlobalSymbols
constructor(options: PackagerOptions, readonly cancellationToken = new CancellationToken()) {
constructor(
options: PackagerOptions,
readonly cancellationToken = new CancellationToken()
) {
if ("devMetadata" in options) {
throw new InvalidConfigurationError("devMetadata in the options is deprecated, please use config instead")
}
Expand Down
13 changes: 8 additions & 5 deletions packages/app-builder-lib/src/platformPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>

readonly appInfo: AppInfo

protected constructor(readonly info: Packager, readonly platform: Platform) {
protected constructor(
readonly info: Packager,
readonly platform: Platform
) {
this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions((this.config as any)[platform.buildConfigurationKey])
this.appInfo = this.prepareAppInfo(info.appInfo)
}
Expand Down Expand Up @@ -169,8 +172,8 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
const base = isResources
? this.getResourcesDir(appOutDir)
: this.platform === Platform.MAC
? path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents")
: appOutDir
? path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents")
: appOutDir
return getFileMatchers(this.config, isResources ? "extraResources" : "extraFiles", base, options)
}

Expand Down Expand Up @@ -272,8 +275,8 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
this.platform === Platform.MAC
? path.join(appOutDir, framework.distMacOsAppName, "Contents", "Resources")
: isElectronBased(framework)
? path.join(appOutDir, "resources")
: appOutDir
? path.join(appOutDir, "resources")
: appOutDir
const taskManager = new AsyncTaskManager(this.info.cancellationToken)
this.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, "app"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander)
await taskManager.awaitTasks()
Expand Down
6 changes: 5 additions & 1 deletion packages/app-builder-lib/src/publish/PublishManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export class PublishManager implements PublishContext {

private readonly updateFileWriteTask: Array<UpdateInfoFileTask> = []

constructor(private readonly packager: Packager, private readonly publishOptions: PublishOptions, readonly cancellationToken: CancellationToken = packager.cancellationToken) {
constructor(
private readonly packager: Packager,
private readonly publishOptions: PublishOptions,
readonly cancellationToken: CancellationToken = packager.cancellationToken
) {
checkOptions(publishOptions.publish)

this.taskManager = new AsyncTaskManager(cancellationToken)
Expand Down
5 changes: 4 additions & 1 deletion packages/app-builder-lib/src/publish/SnapStorePublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { SnapStoreOptions } from "builder-util-runtime/out/publishOptions"
export class SnapStorePublisher extends Publisher {
readonly providerName = "snapStore"

constructor(context: PublishContext, private options: SnapStoreOptions) {
constructor(
context: PublishContext,
private options: SnapStoreOptions
) {
super(context)
}

Expand Down
7 changes: 5 additions & 2 deletions packages/app-builder-lib/src/publish/s3/BaseS3Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { mkdir, symlink } from "fs/promises"
import * as path from "path"

export abstract class BaseS3Publisher extends Publisher {
protected constructor(context: PublishContext, private options: BaseS3Options) {
protected constructor(
context: PublishContext,
private options: BaseS3Options
) {
super(context)
}

Expand All @@ -29,7 +32,7 @@ export abstract class BaseS3Publisher extends Publisher {
this.configureS3Options(args)

if (process.env.__TEST_S3_PUBLISHER__ != null) {
const testFile = path.join(process.env.__TEST_S3_PUBLISHER__!, target)
const testFile = path.join(process.env.__TEST_S3_PUBLISHER__, target)
await mkdir(path.dirname(testFile), { recursive: true })
await symlink(task.file, testFile)
return
Expand Down
5 changes: 4 additions & 1 deletion packages/app-builder-lib/src/publish/s3/s3Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { BaseS3Publisher } from "./BaseS3Publisher"
export default class S3Publisher extends BaseS3Publisher {
readonly providerName = "s3"

constructor(context: PublishContext, private readonly info: S3Options) {
constructor(
context: PublishContext,
private readonly info: S3Options
) {
super(context, info)
}

Expand Down
5 changes: 4 additions & 1 deletion packages/app-builder-lib/src/publish/s3/spacesPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { BaseS3Publisher } from "./BaseS3Publisher"
export default class SpacesPublisher extends BaseS3Publisher {
readonly providerName = "spaces"

constructor(context: PublishContext, private readonly info: SpacesOptions) {
constructor(
context: PublishContext,
private readonly info: SpacesOptions
) {
super(context, info)
}

Expand Down
9 changes: 7 additions & 2 deletions packages/app-builder-lib/src/targets/AppImageTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export default class AppImageTarget extends Target {
readonly options: AppImageOptions = { ...this.packager.platformSpecificBuildOptions, ...(this.packager.config as any)[this.name] }
private readonly desktopEntry: Lazy<string>

constructor(ignored: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {
constructor(
ignored: string,
private readonly packager: LinuxPackager,
private readonly helper: LinuxTargetHelper,
readonly outDir: string
) {
super("appImage")

this.desktopEntry = new Lazy<string>(() => {
Expand Down Expand Up @@ -49,7 +54,7 @@ export default class AppImageTarget extends Target {
createStageDir(this, packager, arch),
])
const license = c[3]
const stageDir = c[4]!
const stageDir = c[4]

const publishConfig = c[2]
if (publishConfig != null) {
Expand Down
5 changes: 4 additions & 1 deletion packages/app-builder-lib/src/targets/AppxTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const DEFAULT_RESOURCE_LANG = "en-US"
export default class AppXTarget extends Target {
readonly options: AppXOptions = deepAssign({}, this.packager.platformSpecificBuildOptions, this.packager.config.appx)

constructor(private readonly packager: WinPackager, readonly outDir: string) {
constructor(
private readonly packager: WinPackager,
readonly outDir: string
) {
super("appx")

if (process.platform !== "darwin" && (process.platform !== "win32" || isOldWin6())) {
Expand Down
7 changes: 6 additions & 1 deletion packages/app-builder-lib/src/targets/ArchiveTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { appendBlockmap, createBlockmap } from "./differentialUpdateInfoBuilder"
export class ArchiveTarget extends Target {
readonly options: TargetSpecificOptions = (this.packager.config as any)[this.name]

constructor(name: string, readonly outDir: string, private readonly packager: PlatformPackager<any>, private readonly isWriteUpdateInfo = false) {
constructor(
name: string,
readonly outDir: string,
private readonly packager: PlatformPackager<any>,
private readonly isWriteUpdateInfo = false
) {
super(name)
}

Expand Down
7 changes: 6 additions & 1 deletion packages/app-builder-lib/src/targets/FlatpakTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export default class FlatpakTarget extends Target {
...(this.packager.config as any)[this.name],
}

constructor(name: string, private readonly packager: LinuxPackager, private helper: LinuxTargetHelper, readonly outDir: string) {
constructor(
name: string,
private readonly packager: LinuxPackager,
private helper: LinuxTargetHelper,
readonly outDir: string
) {
super(name)
}

Expand Down
9 changes: 7 additions & 2 deletions packages/app-builder-lib/src/targets/FpmTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export default class FpmTarget extends Target {

private readonly scriptFiles: Promise<Array<string>>

constructor(name: string, private readonly packager: LinuxPackager, private readonly helper: LinuxTargetHelper, readonly outDir: string) {
constructor(
name: string,
private readonly packager: LinuxPackager,
private readonly helper: LinuxTargetHelper,
readonly outDir: string
) {
super(name, false)

this.scriptFiles = this.createScripts()
Expand Down Expand Up @@ -150,7 +155,7 @@ export default class FpmTarget extends Target {
"--after-remove",
scripts[1],
"--description",
smarten(target === "rpm" ? this.helper.getDescription(options)! : `${synopsis || ""}\n ${this.helper.getDescription(options)}`),
smarten(target === "rpm" ? this.helper.getDescription(options) : `${synopsis || ""}\n ${this.helper.getDescription(options)}`),
"--version",
this.helper.getSanitizedVersion(target),
"--package",
Expand Down
7 changes: 6 additions & 1 deletion packages/app-builder-lib/src/targets/MsiTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ export default class MsiTarget extends Target {

readonly options: MsiOptions = deepAssign(this.packager.platformSpecificBuildOptions, this.packager.config.msi)

constructor(protected readonly packager: WinPackager, readonly outDir: string, name = "msi", isAsyncSupported = true) {
constructor(
protected readonly packager: WinPackager,
readonly outDir: string,
name = "msi",
isAsyncSupported = true
) {
super(name, isAsyncSupported)
}

Expand Down
5 changes: 4 additions & 1 deletion packages/app-builder-lib/src/targets/MsiWrappedTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export default class MsiWrappedTarget extends MsiTarget {
/** @private */
private readonly archs: Map<Arch, string> = new Map()

constructor(packager: WinPackager, readonly outDir: string) {
constructor(
packager: WinPackager,
readonly outDir: string
) {
// must be synchronous so it can run after nsis
super(packager, outDir, "msiWrapped", false)
}
Expand Down
9 changes: 1 addition & 8 deletions packages/app-builder-lib/src/targets/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ import { getLinuxToolsPath } from "./tools"
import { getPath7za } from "builder-util"

/** @internal */
export async function tar(
compression: CompressionLevel | any | any,
format: string,
outFile: string,
dirToArchive: string,
isMacApp: boolean,
tempDirManager: TmpDir
): Promise<void> {
export async function tar(compression: CompressionLevel | any, format: string, outFile: string, dirToArchive: string, isMacApp: boolean, tempDirManager: TmpDir): Promise<void> {
const tarFile = await tempDirManager.getTempFile({ suffix: ".tar" })
const tarArgs: CreateOptions & FileOptions = {
file: tarFile,
Expand Down
Loading

0 comments on commit ccbb80d

Please sign in to comment.