app-builder-lib 27.0.0-alpha.10 → 27.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asar/asarAlign.d.ts +35 -0
- package/dist/asar/asarAlign.d.ts.map +1 -0
- package/dist/asar/asarAlign.js +149 -0
- package/dist/asar/asarAlign.js.map +1 -0
- package/dist/asar/asarUtil.d.ts +15 -1
- package/dist/asar/asarUtil.d.ts.map +1 -1
- package/dist/asar/asarUtil.js +111 -61
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/win/authenticodeSignature.d.ts +71 -0
- package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -0
- package/dist/codeSign/win/authenticodeSignature.js +241 -0
- package/dist/codeSign/win/authenticodeSignature.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +11 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +36 -16
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/codeSign/win/verifyUpdatePublisher.d.ts +25 -0
- package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -0
- package/dist/codeSign/win/verifyUpdatePublisher.js +98 -0
- package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -0
- package/dist/configuration.d.ts +16 -13
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +15 -0
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +33 -2
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/mac/asarIntegrityDigest.d.ts +10 -0
- package/dist/electron/mac/asarIntegrityDigest.d.ts.map +1 -0
- package/dist/electron/mac/asarIntegrityDigest.js +122 -0
- package/dist/electron/mac/asarIntegrityDigest.js.map +1 -0
- package/dist/electron/mac/electronMac.js +1 -28
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/mac/electronMacUtils.d.ts +8 -0
- package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
- package/dist/electron/mac/electronMacUtils.js +36 -0
- package/dist/electron/mac/electronMacUtils.js.map +1 -1
- package/dist/fileMatcher.d.ts +47 -12
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +150 -45
- package/dist/fileMatcher.js.map +1 -1
- package/dist/forge-maker.d.ts +64 -0
- package/dist/forge-maker.d.ts.map +1 -1
- package/dist/forge-maker.js +104 -2
- package/dist/forge-maker.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +5 -3
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +5 -3
- package/dist/indexInternal.js.map +1 -1
- package/dist/macPackager.d.ts +6 -0
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +48 -2
- package/dist/macPackager.js.map +1 -1
- package/dist/options/FuseOptionsV1.d.ts +4 -0
- package/dist/options/FuseOptionsV1.d.ts.map +1 -1
- package/dist/options/FuseOptionsV1.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +166 -8
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +36 -15
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +53 -18
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +15 -1
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +7 -4
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +2 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +6 -0
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +11 -4
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +53 -18
- package/dist/platformPackager.js.map +1 -1
- package/dist/presets/rectCra.js +3 -1
- package/dist/presets/rectCra.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +6 -1
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +80 -58
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +8 -10
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.d.ts.map +1 -1
- package/dist/targets/ArchiveTarget.js +7 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +12 -0
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +17 -3
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +3 -2
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +3 -2
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +4 -0
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +238 -48
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +10 -14
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -3
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +45 -20
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +5 -1
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +3 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +2 -2
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +13 -9
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/flatpakBundle.d.ts +43 -0
- package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
- package/dist/targets/linux/flatpakBundle.js +210 -0
- package/dist/targets/linux/flatpakBundle.js.map +1 -0
- package/dist/targets/linux/snap/core24.d.ts +0 -18
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +29 -100
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +7 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +25 -6
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
- package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapPlugs.js +242 -0
- package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
- package/dist/targets/mac/MacTargetHelper.d.ts +6 -0
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +47 -3
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +1 -0
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +1 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +8 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +36 -5
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +6 -4
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +7 -2
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/targets/win/winAppUtil.d.ts +2 -2
- package/dist/targets/win/winAppUtil.d.ts.map +1 -1
- package/dist/targets/win/winAppUtil.js +5 -3
- package/dist/targets/win/winAppUtil.js.map +1 -1
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +19 -19
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/nsis.js +1 -1
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/winCodeSign.d.ts +14 -1
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +14 -1
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/util/AppFileWalker.js +9 -1
- package/dist/util/AppFileWalker.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +15 -2
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +30 -20
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/config/config.d.ts +1 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +42 -19
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/fileOptions.d.ts +52 -0
- package/dist/util/config/fileOptions.d.ts.map +1 -0
- package/dist/util/config/fileOptions.js +210 -0
- package/dist/util/config/fileOptions.js.map +1 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
- package/dist/util/config/legacyConfigGuard.js +31 -4
- package/dist/util/config/legacyConfigGuard.js.map +1 -1
- package/dist/util/config/legacyOptions.d.ts +11 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -1
- package/dist/util/config/legacyOptions.js +36 -10
- package/dist/util/config/legacyOptions.js.map +1 -1
- package/dist/util/electronGet.d.ts +13 -0
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +40 -17
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/removedEnvVars.d.ts +25 -0
- package/dist/util/removedEnvVars.d.ts.map +1 -0
- package/dist/util/removedEnvVars.js +54 -0
- package/dist/util/removedEnvVars.js.map +1 -0
- package/dist/util/trustedSourceRoots.d.ts +59 -0
- package/dist/util/trustedSourceRoots.d.ts.map +1 -0
- package/dist/util/trustedSourceRoots.js +127 -0
- package/dist/util/trustedSourceRoots.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +18 -17
- package/scheme.json +421 -436
- package/templates/nsis/include/installer.nsh +11 -8
- package/templates/nsis/installSection.nsh +5 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { ALLOW_EXTERNAL_LINKS_OPTION, ExternalLinkPolicy, InvalidConfigurationError, isPathWithin, log, resolvePhysicalPath } from "builder-util";
|
|
2
|
+
import { readFile } from "fs/promises";
|
|
3
|
+
import { load } from "js-yaml";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
/** Where the rule for files reached through symlinks is documented. */
|
|
6
|
+
export const LINKED_FILES_DOCS_URL = "https://www.electron.build/docs/contents#linked-files-must-resolve-inside-the-workspace";
|
|
7
|
+
/**
|
|
8
|
+
* The effective `fileOptions.allowExternalLinks` value for a platform, read from the normalized `fileOptions` like `files`,
|
|
9
|
+
* `extraResources` and `extraFiles`: the platform-level value (`mac.fileOptions.allowExternalLinks`, ...) when it is set, `false`
|
|
10
|
+
* included, otherwise the root one. Unlike the file lists, the two are not combined: the platform value replaces the root one.
|
|
11
|
+
*
|
|
12
|
+
* `optionPath` names where the value came from, for the errors about a malformed value.
|
|
13
|
+
*/
|
|
14
|
+
export function resolveAllowExternalLinks(config, platformOptions, platformKey) {
|
|
15
|
+
const platformValue = platformOptions?.fileOptions?.allowExternalLinks;
|
|
16
|
+
if (platformValue != null) {
|
|
17
|
+
return { value: platformValue, optionPath: `${platformKey}.${ALLOW_EXTERNAL_LINKS_OPTION}` };
|
|
18
|
+
}
|
|
19
|
+
return { value: config.fileOptions?.allowExternalLinks, optionPath: ALLOW_EXTERNAL_LINKS_OPTION };
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The store directories of pnpm, read from the `node_modules/.modules.yaml` that pnpm writes: the content-addressable store and the
|
|
23
|
+
* virtual store, which `enableGlobalVirtualStore` puts outside the project. Other package managers keep everything they link to
|
|
24
|
+
* inside the workspace (`node_modules/.bun`, workspace packages), so they need nothing here.
|
|
25
|
+
*/
|
|
26
|
+
export async function readPackageManagerStoreDirs(nodeModulesDir) {
|
|
27
|
+
let content;
|
|
28
|
+
try {
|
|
29
|
+
content = await readFile(path.join(nodeModulesDir, ".modules.yaml"), "utf8");
|
|
30
|
+
}
|
|
31
|
+
catch (_e) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
let data;
|
|
35
|
+
try {
|
|
36
|
+
data = load(content);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
log.debug({ file: path.join(nodeModulesDir, ".modules.yaml"), error: e.message }, "cannot parse the pnpm modules file");
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
if (data == null || typeof data !== "object") {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
const result = [];
|
|
46
|
+
for (const key of ["storeDir", "virtualStoreDir"]) {
|
|
47
|
+
const value = data[key];
|
|
48
|
+
if (typeof value === "string" && value.length > 0) {
|
|
49
|
+
result.push(path.resolve(nodeModulesDir, value));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
const cache = new WeakMap();
|
|
55
|
+
/**
|
|
56
|
+
* The directories that files of the app may come from through a symlink, as real paths: the workspace root, the project and app
|
|
57
|
+
* directories (chosen by the build configuration) and the package-manager store. A file whose real path is anywhere else is refused.
|
|
58
|
+
* Computed once per `key` (the packager).
|
|
59
|
+
*/
|
|
60
|
+
export function getTrustedSourceRoots(info, key = info) {
|
|
61
|
+
let result = cache.get(key);
|
|
62
|
+
if (result == null) {
|
|
63
|
+
result = computeTrustedSourceRoots(info);
|
|
64
|
+
cache.set(key, result);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
async function computeTrustedSourceRoots(info) {
|
|
69
|
+
const workspaceRoot = await info.getWorkspaceRoot();
|
|
70
|
+
const dirs = Array.from(new Set([workspaceRoot, info.projectDir, info.appDir]));
|
|
71
|
+
const storeDirs = (await Promise.all(dirs.map(it => readPackageManagerStoreDirs(path.join(it, "node_modules"))))).flat();
|
|
72
|
+
const roots = await Promise.all([...dirs, ...storeDirs].map(it => resolvePhysicalPath(it)));
|
|
73
|
+
return Array.from(new Set(roots));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Refuses a file of the app (packed into the asar archive or copied with `asar: false`) whose real path, through symlinks, is outside
|
|
77
|
+
* every trusted source root ({@link getTrustedSourceRoots}), unless the `fileOptions.allowExternalLinks` build option (`externalLinks`) allows it.
|
|
78
|
+
*
|
|
79
|
+
* Only the workspace and the package-manager store are trusted: a file reached through a symlink that leads anywhere else on the build
|
|
80
|
+
* machine (the home or temp directory, a system directory) is refused.
|
|
81
|
+
*/
|
|
82
|
+
export async function assertSourceFileInTrustedRoots(file, trustedRoots, externalLinks = null) {
|
|
83
|
+
const resolved = await resolvePhysicalPath(file);
|
|
84
|
+
if (trustedRoots.some(root => isPathWithin(root, resolved))) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const policy = externalLinks ?? ExternalLinkPolicy.NONE;
|
|
88
|
+
if (policy.allows(file, resolved)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
log.error({ source: file, realPath: resolved }, "denied access to a file outside the workspace");
|
|
92
|
+
throw new InvalidConfigurationError(`Cannot copy file [${policy.displayPath(file)}] symlinked to file [${resolved}] outside the package: electron-builder only packages files whose real path ` +
|
|
93
|
+
`is inside the workspace root (${trustedRoots[0] ?? "unknown"}) or the package-manager store. Add the linked package to the workspace (or install it from a tarball or ` +
|
|
94
|
+
`the registry instead of linking it), or replace the symlink with a copy. ${await policy.hint([await outermostOutsideTrustedRoots(file, resolved, trustedRoots)])} ` +
|
|
95
|
+
`See ${LINKED_FILES_DOCS_URL}`, "ERR_ELECTRON_BUILDER_FILE_OUTSIDE_WORKSPACE");
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Where the linked tree that `file` (real path `resolved`) is part of starts: the real path of its highest ancestor that is still outside
|
|
99
|
+
* the trusted roots, e.g. the linked package `../lib` for `node_modules/lib/src/index.js`, so that a suggested `fileOptions.allowExternalLinks` entry
|
|
100
|
+
* covers the whole package rather than the one file that was checked first.
|
|
101
|
+
*/
|
|
102
|
+
async function outermostOutsideTrustedRoots(file, resolved, trustedRoots) {
|
|
103
|
+
let result = resolved;
|
|
104
|
+
let current = path.resolve(file);
|
|
105
|
+
for (;;) {
|
|
106
|
+
const parent = path.dirname(current);
|
|
107
|
+
if (parent === current) {
|
|
108
|
+
// not below a trusted root at all: only the file itself is known to be linked
|
|
109
|
+
return resolved;
|
|
110
|
+
}
|
|
111
|
+
const realParent = await resolvePhysicalPath(parent);
|
|
112
|
+
if (trustedRoots.some(root => isPathWithin(root, realParent))) {
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
result = realParent;
|
|
116
|
+
current = parent;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The `copyDir` options for copying the app output directory into a staging directory (snap, AppImage): a symlink that the
|
|
121
|
+
* `extraResources`/`extraFiles` copy kept, because it leads into the workspace or the store or `fileOptions.allowExternalLinks` allows it, is kept
|
|
122
|
+
* again rather than failing the staging copy.
|
|
123
|
+
*/
|
|
124
|
+
export async function getStagingCopyLinkOptions(packager) {
|
|
125
|
+
return { allowedSymlinkRoots: await getTrustedSourceRoots(packager), externalLinks: await packager.getExternalLinkPolicy() };
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=trustedSourceRoots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trustedSourceRoots.js","sourceRoot":"","sources":["../../src/util/trustedSourceRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAA2B,kBAAkB,EAAE,yBAAyB,EAAE,YAAY,EAAE,GAAG,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAE1K,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,yFAAyF,CAAA;AAc9H;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAyB,EACzB,eAA4C,EAC5C,WAAmB;IAEnB,MAAM,aAAa,GAAG,eAAe,EAAE,WAAW,EAAE,kBAAkB,CAAA;IACtE,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;QAC1B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EA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OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAA;QACpD,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;YAC9D,OAAO,MAAM,CAAA;QACf,CAAC;QACD,MAAM,GAAG,UAAU,CAAA;QACnB,OAAO,GAAG,MAAM,CAAA;IAClB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,QAAoF;IAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC,qBAAqB,EAAE,EAAE,CAAA;AAC9H,CAAC","sourcesContent":["import { ALLOW_EXTERNAL_LINKS_OPTION, AllowExternalLinksValue, ExternalLinkPolicy, InvalidConfigurationError, isPathWithin, log, resolvePhysicalPath } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { readFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport type { FilesBuildOptions } from \"../options/PlatformSpecificBuildOptions.js\"\n\n/** Where the rule for files reached through symlinks is documented. */\nexport const LINKED_FILES_DOCS_URL = \"https://www.electron.build/docs/contents#linked-files-must-resolve-inside-the-workspace\"\n\n/** What {@link getTrustedSourceRoots} needs to know about the build: `Packager` and `PlatformPackager` both have it. */\nexport interface SourceRootsInfo {\n readonly projectDir: string\n readonly appDir: string\n getWorkspaceRoot(): Promise<string>\n}\n\n/** The configuration root, or a platform section (`mac`, `win`, `linux`): both may set `fileOptions`. */\ninterface FileOptionsHolder {\n readonly fileOptions?: FilesBuildOptions | null\n}\n\n/**\n * The effective `fileOptions.allowExternalLinks` value for a platform, read from the normalized `fileOptions` like `files`,\n * `extraResources` and `extraFiles`: the platform-level value (`mac.fileOptions.allowExternalLinks`, ...) when it is set, `false`\n * included, otherwise the root one. Unlike the file lists, the two are not combined: the platform value replaces the root one.\n *\n * `optionPath` names where the value came from, for the errors about a malformed value.\n */\nexport function resolveAllowExternalLinks(\n config: FileOptionsHolder,\n platformOptions: FileOptionsHolder | Nullish,\n platformKey: string\n): { value: AllowExternalLinksValue; optionPath: string } {\n const platformValue = platformOptions?.fileOptions?.allowExternalLinks\n if (platformValue != null) {\n return { value: platformValue, optionPath: `${platformKey}.${ALLOW_EXTERNAL_LINKS_OPTION}` }\n }\n return { value: config.fileOptions?.allowExternalLinks, optionPath: ALLOW_EXTERNAL_LINKS_OPTION }\n}\n\n/**\n * The store directories of pnpm, read from the `node_modules/.modules.yaml` that pnpm writes: the content-addressable store and the\n * virtual store, which `enableGlobalVirtualStore` puts outside the project. Other package managers keep everything they link to\n * inside the workspace (`node_modules/.bun`, workspace packages), so they need nothing here.\n */\nexport async function readPackageManagerStoreDirs(nodeModulesDir: string): Promise<Array<string>> {\n let content: string\n try {\n content = await readFile(path.join(nodeModulesDir, \".modules.yaml\"), \"utf8\")\n } catch (_e: any) {\n return []\n }\n let data: unknown\n try {\n data = load(content)\n } catch (e: any) {\n log.debug({ file: path.join(nodeModulesDir, \".modules.yaml\"), error: e.message }, \"cannot parse the pnpm modules file\")\n return []\n }\n if (data == null || typeof data !== \"object\") {\n return []\n }\n const result: Array<string> = []\n for (const key of [\"storeDir\", \"virtualStoreDir\"]) {\n const value: unknown = (data as Record<string, unknown>)[key]\n if (typeof value === \"string\" && value.length > 0) {\n result.push(path.resolve(nodeModulesDir, value))\n }\n }\n return result\n}\n\nconst cache = new WeakMap<object, Promise<Array<string>>>()\n\n/**\n * The directories that files of the app may come from through a symlink, as real paths: the workspace root, the project and app\n * directories (chosen by the build configuration) and the package-manager store. A file whose real path is anywhere else is refused.\n * Computed once per `key` (the packager).\n */\nexport function getTrustedSourceRoots(info: SourceRootsInfo, key: object = info): Promise<Array<string>> {\n let result = cache.get(key)\n if (result == null) {\n result = computeTrustedSourceRoots(info)\n cache.set(key, result)\n }\n return result\n}\n\nasync function computeTrustedSourceRoots(info: SourceRootsInfo): Promise<Array<string>> {\n const workspaceRoot = await info.getWorkspaceRoot()\n const dirs = Array.from(new Set([workspaceRoot, info.projectDir, info.appDir]))\n const storeDirs = (await Promise.all(dirs.map(it => readPackageManagerStoreDirs(path.join(it, \"node_modules\"))))).flat()\n const roots = await Promise.all([...dirs, ...storeDirs].map(it => resolvePhysicalPath(it)))\n return Array.from(new Set(roots))\n}\n\n/**\n * Refuses a file of the app (packed into the asar archive or copied with `asar: false`) whose real path, through symlinks, is outside\n * every trusted source root ({@link getTrustedSourceRoots}), unless the `fileOptions.allowExternalLinks` build option (`externalLinks`) allows it.\n *\n * Only the workspace and the package-manager store are trusted: a file reached through a symlink that leads anywhere else on the build\n * machine (the home or temp directory, a system directory) is refused.\n */\nexport async function assertSourceFileInTrustedRoots(file: string, trustedRoots: ReadonlyArray<string>, externalLinks: ExternalLinkPolicy | null = null): Promise<void> {\n const resolved = await resolvePhysicalPath(file)\n if (trustedRoots.some(root => isPathWithin(root, resolved))) {\n return\n }\n const policy = externalLinks ?? ExternalLinkPolicy.NONE\n if (policy.allows(file, resolved)) {\n return\n }\n log.error({ source: file, realPath: resolved }, \"denied access to a file outside the workspace\")\n throw new InvalidConfigurationError(\n `Cannot copy file [${policy.displayPath(file)}] symlinked to file [${resolved}] outside the package: electron-builder only packages files whose real path ` +\n `is inside the workspace root (${trustedRoots[0] ?? \"unknown\"}) or the package-manager store. Add the linked package to the workspace (or install it from a tarball or ` +\n `the registry instead of linking it), or replace the symlink with a copy. ${await policy.hint([await outermostOutsideTrustedRoots(file, resolved, trustedRoots)])} ` +\n `See ${LINKED_FILES_DOCS_URL}`,\n \"ERR_ELECTRON_BUILDER_FILE_OUTSIDE_WORKSPACE\"\n )\n}\n\n/**\n * Where the linked tree that `file` (real path `resolved`) is part of starts: the real path of its highest ancestor that is still outside\n * the trusted roots, e.g. the linked package `../lib` for `node_modules/lib/src/index.js`, so that a suggested `fileOptions.allowExternalLinks` entry\n * covers the whole package rather than the one file that was checked first.\n */\nasync function outermostOutsideTrustedRoots(file: string, resolved: string, trustedRoots: ReadonlyArray<string>): Promise<string> {\n let result = resolved\n let current = path.resolve(file)\n for (;;) {\n const parent = path.dirname(current)\n if (parent === current) {\n // not below a trusted root at all: only the file itself is known to be linked\n return resolved\n }\n const realParent = await resolvePhysicalPath(parent)\n if (trustedRoots.some(root => isPathWithin(root, realParent))) {\n return result\n }\n result = realParent\n current = parent\n }\n}\n\n/**\n * The `copyDir` options for copying the app output directory into a staging directory (snap, AppImage): a symlink that the\n * `extraResources`/`extraFiles` copy kept, because it leads into the workspace or the store or `fileOptions.allowExternalLinks` allows it, is kept\n * again rather than failing the staging copy.\n */\nexport async function getStagingCopyLinkOptions(\n packager: SourceRootsInfo & { getExternalLinkPolicy(): Promise<ExternalLinkPolicy> }\n): Promise<{ allowedSymlinkRoots: ReadonlyArray<string>; externalLinks: ExternalLinkPolicy }> {\n return { allowedSymlinkRoots: await getTrustedSourceRoots(packager), externalLinks: await packager.getExternalLinkPolicy() }\n}\n"]}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "27.0.0-alpha.
|
|
1
|
+
export declare const PACKAGE_VERSION = "27.0.0-alpha.12";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = "27.0.0-alpha.
|
|
1
|
+
export const PACKAGE_VERSION = "27.0.0-alpha.12";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"27.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"27.0.0-alpha.12\"\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "app-builder-lib",
|
|
3
3
|
"description": "electron-builder lib",
|
|
4
|
-
"version": "27.0.0-alpha.
|
|
4
|
+
"version": "27.0.0-alpha.12",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -60,14 +60,13 @@
|
|
|
60
60
|
"bugs": "https://github.com/electron-userland/electron-builder/issues",
|
|
61
61
|
"homepage": "https://github.com/electron-userland/electron-builder",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@electron/asar": "4.
|
|
64
|
-
"@electron/fuses": "^2.1.
|
|
65
|
-
"@electron/get": "^5.
|
|
66
|
-
"@electron/notarize": "3.1.1",
|
|
67
|
-
"@electron/osx-sign": "2.
|
|
68
|
-
"@electron/rebuild": "^4.
|
|
69
|
-
"@electron/universal": "3.0.
|
|
70
|
-
"@malept/flatpak-bundler": "^0.4.0",
|
|
63
|
+
"@electron/asar": "^4.3.1",
|
|
64
|
+
"@electron/fuses": "^2.1.3",
|
|
65
|
+
"@electron/get": "^5.1.0",
|
|
66
|
+
"@electron/notarize": "^3.1.1",
|
|
67
|
+
"@electron/osx-sign": "^2.7.0",
|
|
68
|
+
"@electron/rebuild": "^4.2.1",
|
|
69
|
+
"@electron/universal": "^3.0.6",
|
|
71
70
|
"@noble/hashes": "^2.2.0",
|
|
72
71
|
"@peculiar/webcrypto": "^1.7.1",
|
|
73
72
|
"@types/fs-extra": "9.0.13",
|
|
@@ -98,12 +97,14 @@
|
|
|
98
97
|
"undici": "^7.29.1",
|
|
99
98
|
"unzipper": "^0.12.3",
|
|
100
99
|
"which": "^5.0.0",
|
|
101
|
-
"builder-util": "27.0.0-alpha.
|
|
102
|
-
"electron-publish": "27.0.0-alpha.
|
|
103
|
-
"builder-util-runtime": "10.0.0-alpha.
|
|
100
|
+
"builder-util": "27.0.0-alpha.12",
|
|
101
|
+
"electron-publish": "27.0.0-alpha.12",
|
|
102
|
+
"builder-util-runtime": "10.0.0-alpha.11"
|
|
104
103
|
},
|
|
105
104
|
"///": "babel in devDependencies for proton tests",
|
|
106
105
|
"devDependencies": {
|
|
106
|
+
"@electron-forge/maker-base": "8.0.1",
|
|
107
|
+
"@electron-forge/shared-types": "8.0.1",
|
|
107
108
|
"@types/debug": "4.1.7",
|
|
108
109
|
"@types/ejs": "3.1.0",
|
|
109
110
|
"@types/hosted-git-info": "3.0.2",
|
|
@@ -114,13 +115,13 @@
|
|
|
114
115
|
"@types/tiny-async-pool": "^1",
|
|
115
116
|
"@types/unzipper": "^0.10.11",
|
|
116
117
|
"@types/which": "^3.0.4",
|
|
117
|
-
"toml": "^
|
|
118
|
-
"dmg-builder": "27.0.0-alpha.
|
|
119
|
-
"electron-builder-squirrel-windows": "27.0.0-alpha.
|
|
118
|
+
"toml": "^5.0.1",
|
|
119
|
+
"dmg-builder": "27.0.0-alpha.12",
|
|
120
|
+
"electron-builder-squirrel-windows": "27.0.0-alpha.12"
|
|
120
121
|
},
|
|
121
122
|
"peerDependencies": {
|
|
122
|
-
"dmg-builder": "27.0.0-alpha.
|
|
123
|
-
"electron-builder-squirrel-windows": "27.0.0-alpha.
|
|
123
|
+
"dmg-builder": "27.0.0-alpha.12",
|
|
124
|
+
"electron-builder-squirrel-windows": "27.0.0-alpha.12"
|
|
124
125
|
},
|
|
125
126
|
"//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
|
|
126
127
|
"types": "./dist/index.d.ts",
|