Skip to content

Commit

Permalink
move helper to builder-util instead of runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta committed Dec 7, 2023
1 parent dab0344 commit 9e20086
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/app-builder-lib/src/targets/FpmTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getLinuxToolsPath } from "./tools"
import { hashFile } from "../util/hash"
import { ArtifactCreated } from "../packagerApi"
import { getAppUpdatePublishConfiguration } from "../publish/PublishManager"
import { getPath7za } from "builder-util-runtime"
import { getPath7za } from "builder-util"

interface FpmOptions {
name: string
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 @@ -6,7 +6,7 @@ import { create, CreateOptions, FileOptions } from "tar"
import { TmpDir } from "temp-file"
import { CompressionLevel } from "../core"
import { getLinuxToolsPath } from "./tools"
import { getPath7za } from "builder-util-runtime"
import { getPath7za } from "builder-util"

/** @internal */
export async function tar(
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BluebirdPromise from "bluebird-lst"
import { Arch, asArray, AsyncTaskManager, exec, executeAppBuilder, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use } from "builder-util"
import { CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME, getPath7za, PackageFileInfo, UUID } from "builder-util-runtime"
import { Arch, asArray, AsyncTaskManager, exec, executeAppBuilder, getPlatformIconFileName, InvalidConfigurationError, log, spawnAndWrite, use, getPath7za } from "builder-util"
import { CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME, PackageFileInfo, UUID } from "builder-util-runtime"
import { exists, statOrNull, walk } from "builder-util/out/fs"
import _debug from "debug"
import * as fs from "fs"
Expand Down
3 changes: 0 additions & 3 deletions packages/builder-util-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
"node": ">=12.0.0"
},
"dependencies": {
"7zip-bin": "~5.2.0",
"debug": "^4.3.4",
"fs-extra": "^10.1.0",
"sax": "^1.2.4"
},
"devDependencies": {
"@types/fs-extra": "9.0.13",
"@types/debug": "4.1.7",
"@types/sax": "1.2.3"
},
Expand Down
1 change: 0 additions & 1 deletion packages/builder-util-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export { UUID } from "./uuid"
export { ProgressCallbackTransform, ProgressInfo } from "./ProgressCallbackTransform"
export { parseXml, XElement } from "./xml"
export { BlockMap } from "./blockMapApi"
export { getPath7za, getPath7x } from "./7za"

// nsis
export const CURRENT_APP_INSTALLER_FILE_NAME = "installer.exe"
Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"include": [
"src/**/*.ts"
]
}
}
1 change: 1 addition & 0 deletions packages/builder-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"out"
],
"dependencies": {
"7zip-bin": "~5.2.0",
"@types/debug": "^4.1.6",
"app-builder-bin": "4.0.0",
"bluebird-lst": "^1.0.9",
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion packages/builder-util/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { appBuilderPath } from "app-builder-bin"
import { getPath7za, safeStringifyJson } from "builder-util-runtime"
import { safeStringifyJson } from "builder-util-runtime"
import * as chalk from "chalk"
import { ChildProcess, execFile, ExecFileOptions, SpawnOptions } from "child_process"
import { spawn as _spawn } from "cross-spawn"
Expand All @@ -9,6 +9,7 @@ import { dump } from "js-yaml"
import * as path from "path"
import { debug, log } from "./log"
import { install as installSourceMap } from "source-map-support"
import { getPath7za } from "./7za"

if (process.env.JEST_WORKER_ID == null) {
installSourceMap()
Expand All @@ -26,6 +27,8 @@ export { asArray } from "builder-util-runtime"

export { deepAssign } from "./deepAssign"

export { getPath7za, getPath7x } from "./7za"

export const debug7z = _debug("electron-builder:7z")

export function serializeToYaml(object: any, skipInvalid = false, noRefs = false) {
Expand Down
1 change: 0 additions & 1 deletion packages/electron-builder-squirrel-windows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"app-builder-lib": "workspace:*",
"archiver": "^5.3.1",
"builder-util": "workspace:*",
"builder-util-runtime": "workspace:*",
"fs-extra": "^10.1.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Arch, debug, exec, log, spawn, isEmptyOrSpaces } from "builder-util"
import { Arch, debug, exec, log, spawn, isEmptyOrSpaces, getPath7za } from "builder-util"
import { copyFile, walk } from "builder-util/out/fs"
import { compute7zCompressArgs } from "app-builder-lib/out/targets/archive"
import { execWine, prepareWindowsExecutableArgs as prepareArgs } from "app-builder-lib/out/wine"
Expand All @@ -7,7 +7,6 @@ import { createWriteStream, stat, unlink, writeFile } from "fs-extra"
import * as path from "path"
import * as archiver from "archiver"
import * as fs from "fs/promises"
import { getPath7za } from "builder-util-runtime"

export function convertVersion(version: string): string {
const parts = version.split("-")
Expand Down
15 changes: 3 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/src/helpers/packTester.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addValue, deepAssign, exec, log, spawn } from "builder-util"
import { CancellationToken, UpdateFileInfo, getPath7x, getPath7za } from "builder-util-runtime"
import { addValue, deepAssign, exec, log, spawn, getPath7x, getPath7za } from "builder-util"
import { CancellationToken, UpdateFileInfo } from "builder-util-runtime"
import { copyDir, FileCopier, USE_HARD_LINKS, walk } from "builder-util/out/fs"
import { executeFinally } from "builder-util/out/promise"
import DecompressZip from "decompress-zip"
Expand Down

0 comments on commit 9e20086

Please sign in to comment.