app-builder-lib 26.6.0 → 26.7.0
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/out/macPackager.js +0 -1
- package/out/macPackager.js.map +1 -1
- package/out/node-module-collector/nodeModulesCollector.d.ts +2 -18
- package/out/node-module-collector/nodeModulesCollector.js +36 -71
- package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/npmNodeModulesCollector.js +11 -7
- package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/out/options/AppXOptions.d.ts +8 -0
- package/out/options/AppXOptions.js.map +1 -1
- package/out/options/macOptions.d.ts +12 -0
- package/out/options/macOptions.js.map +1 -1
- package/out/targets/AppxCapabilities.d.ts +8 -0
- package/out/targets/AppxCapabilities.js +258 -0
- package/out/targets/AppxCapabilities.js.map +1 -0
- package/out/targets/AppxTarget.d.ts +1 -0
- package/out/targets/AppxTarget.js +24 -7
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +27 -1
- package/templates/appx/appxmanifest.xml +1 -3
- package/templates/linux/after-install.tpl +1 -1
|
@@ -12,7 +12,7 @@ class NpmNodeModulesCollector extends nodeModulesCollector_js_1.NodeModulesColle
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
getArgs() {
|
|
15
|
-
return ["list", "-a", "--include", "prod", "--include", "optional", "--omit", "dev", "--json", "--long", "--silent"];
|
|
15
|
+
return ["list", "-a", "--include", "prod", "--include", "optional", "--omit", "dev", "--json", "--long", "--silent", "--loglevel=error"];
|
|
16
16
|
}
|
|
17
17
|
async collectAllDependencies(tree) {
|
|
18
18
|
for (const [key, value] of Object.entries(tree.dependencies || {})) {
|
|
@@ -28,23 +28,27 @@ class NpmNodeModulesCollector extends nodeModulesCollector_js_1.NodeModulesColle
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
async extractProductionDependencyGraph(tree, dependencyId) {
|
|
31
|
-
var _a;
|
|
32
31
|
if (this.productionGraph[dependencyId]) {
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
const isDuplicateDep = this.isDuplicatedNpmDependency(tree);
|
|
36
|
-
const
|
|
35
|
+
const targetTree = isDuplicateDep ? this.allDependencies.get(dependencyId) : tree;
|
|
37
36
|
// Initialize with empty dependencies array first to mark this dependency as "in progress"
|
|
38
37
|
// After initialization, if there are libraries with the same name+version later, they will not be searched recursively again
|
|
39
38
|
// This will prevents infinite loops when circular dependencies are encountered.
|
|
40
39
|
this.productionGraph[dependencyId] = { dependencies: [] };
|
|
41
40
|
const collectedDependencies = [];
|
|
42
|
-
if (
|
|
43
|
-
for (const packageName in
|
|
44
|
-
|
|
41
|
+
if (targetTree === null || targetTree === void 0 ? void 0 : targetTree.dependencies) {
|
|
42
|
+
for (const packageName in targetTree.dependencies) {
|
|
43
|
+
// Check against matching _dependencies
|
|
44
|
+
if (!this.isProdDependency(packageName, targetTree)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const dependency = targetTree.dependencies[packageName];
|
|
48
|
+
// Match first version's empty check
|
|
49
|
+
if (Object.keys(dependency).length === 0) {
|
|
45
50
|
continue;
|
|
46
51
|
}
|
|
47
|
-
const dependency = resolvedDeps[packageName];
|
|
48
52
|
const childDependencyId = this.packageVersionString({ name: packageName, version: dependency.version });
|
|
49
53
|
await this.extractProductionDependencyGraph(dependency, childDependencyId);
|
|
50
54
|
collectedDependencies.push(childDependencyId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npmNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/npmNodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,uEAAgE;AAChE,2DAAwC;AAGxC,MAAa,u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/C,CAAC;QACH,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,EAAE,qBAAqB,EAAE,CAAA;IAC9E,CAAC;IAED,kFAAkF;IAClF,qFAAqF;IAC7E,yBAAyB,CAAC,IAAmB;QACnD,MAAM,EAAE,aAAa,GAAG,EAAE,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAA;QACtD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;QACtG,OAAO,cAAc,CAAA;IACvB,CAAC;IAED,6DAA6D;IACnD,gBAAgB,CAAC,WAAmB,EAAE,IAAmB;;QACjE,OAAO,CAAA,MAAA,IAAI,CAAC,aAAa,0CAAG,WAAW,CAAC,KAAI,IAAI,CAAA;IAClD,CAAC;CACF;AArED,0DAqEC","sourcesContent":["import { NodeModulesCollector } from \"./nodeModulesCollector.js\"\nimport { PM } from \"./packageManager.js\"\nimport { NpmDependency } from \"./types.js\"\n\nexport class NpmNodeModulesCollector extends NodeModulesCollector<NpmDependency, string> {\n public readonly installOptions = {\n manager: PM.NPM,\n lockfile: \"package-lock.json\",\n }\n\n protected getArgs(): string[] {\n return [\"list\", \"-a\", \"--include\", \"prod\", \"--include\", \"optional\", \"--omit\", \"dev\", \"--json\", \"--long\", \"--silent\", \"--loglevel=error\"]\n }\n\n protected async collectAllDependencies(tree: NpmDependency) {\n for (const [key, value] of Object.entries(tree.dependencies || {})) {\n if (this.isDuplicatedNpmDependency(value)) {\n continue\n }\n // Use the key (alias name) instead of value.name for npm aliased packages\n // e.g., { \"foo\": { name: \"@scope/bar\", ... } } should be stored as \"foo@version\"\n // This ensures aliased packages are copied to the correct location in node_modules\n const normalizedDep: NpmDependency = key !== value.name ? { ...value, name: key } : value\n this.allDependencies.set(this.packageVersionString(normalizedDep), normalizedDep)\n await this.collectAllDependencies(value)\n }\n }\n\n protected async extractProductionDependencyGraph(tree: NpmDependency, dependencyId: string): Promise<void> {\n if (this.productionGraph[dependencyId]) {\n return\n }\n\n const isDuplicateDep = this.isDuplicatedNpmDependency(tree)\n const targetTree = isDuplicateDep ? this.allDependencies.get(dependencyId) : tree\n\n // Initialize with empty dependencies array first to mark this dependency as \"in progress\"\n // After initialization, if there are libraries with the same name+version later, they will not be searched recursively again\n // This will prevents infinite loops when circular dependencies are encountered.\n this.productionGraph[dependencyId] = { dependencies: [] }\n\n const collectedDependencies: string[] = []\n if (targetTree?.dependencies) {\n for (const packageName in targetTree.dependencies) {\n // Check against matching _dependencies\n if (!this.isProdDependency(packageName, targetTree)) {\n continue\n }\n const dependency = targetTree.dependencies[packageName]\n // Match first version's empty check\n if (Object.keys(dependency).length === 0) {\n continue\n }\n const childDependencyId = this.packageVersionString({ name: packageName, version: dependency.version })\n await this.extractProductionDependencyGraph(dependency, childDependencyId)\n collectedDependencies.push(childDependencyId)\n }\n }\n this.productionGraph[dependencyId] = { dependencies: collectedDependencies }\n }\n\n // Check: is package already included as a prod dependency due to another package?\n // We need to check this to prevent infinite loops in case of duplicated dependencies\n private isDuplicatedNpmDependency(tree: NpmDependency): boolean {\n const { _dependencies = {}, dependencies = {} } = tree\n const isDuplicateDep = Object.keys(_dependencies).length > 0 && Object.keys(dependencies).length === 0\n return isDuplicateDep\n }\n\n // `npm list` provides explicit list of deps in _dependencies\n protected isProdDependency(packageName: string, tree: NpmDependency) {\n return tree._dependencies?.[packageName] != null\n }\n}\n"]}
|
|
@@ -13,7 +13,7 @@ class PnpmNodeModulesCollector extends nodeModulesCollector_1.NodeModulesCollect
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
getArgs() {
|
|
16
|
-
return ["list", "--prod", "--json", "--depth", "Infinity"];
|
|
16
|
+
return ["list", "--prod", "--json", "--depth", "Infinity", "--silent", "--loglevel=error"];
|
|
17
17
|
}
|
|
18
18
|
async extractProductionDependencyGraph(tree, dependencyId) {
|
|
19
19
|
if (this.productionGraph[dependencyId]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpmNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/pnpmNodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,+CAAkC;AAClC,iEAA6D;AAC7D,qDAAqC;AAGrC,MAAa,wBAAyB,SAAQ,2CAAoD;IAAlG;;QACkB,mBAAc,GAAG;YAC/B,OAAO,EAAE,mBAAE,CAAC,IAAI;YAChB,QAAQ,EAAE,gBAAgB;SAC3B,CAAA;IA2EH,CAAC;IAzEW,OAAO;QACf,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"pnpmNodeModulesCollector.js","sourceRoot":"","sources":["../../src/node-module-collector/pnpmNodeModulesCollector.ts"],"names":[],"mappings":";;;AAAA,+CAAkC;AAClC,iEAA6D;AAC7D,qDAAqC;AAGrC,MAAa,wBAAyB,SAAQ,2CAAoD;IAAlG;;QACkB,mBAAc,GAAG;YAC/B,OAAO,EAAE,mBAAE,CAAC,IAAI;YAChB,QAAQ,EAAE,gBAAgB;SAC3B,CAAA;IA2EH,CAAC;IAzEW,OAAO;QACf,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAA;IAC5F,CAAC;IAES,KAAK,CAAC,gCAAgC,CAAC,IAAoB,EAAE,YAAoB;QACzF,IAAI,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,OAAM;QACR,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;QAEzD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,I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nimport { NodeModulesCollector } from \"./nodeModulesCollector\"\nimport { PM } from \"./packageManager\"\nimport { PnpmDependency } from \"./types\"\n\nexport class PnpmNodeModulesCollector extends NodeModulesCollector<PnpmDependency, PnpmDependency> {\n public readonly installOptions = {\n manager: PM.PNPM,\n lockfile: \"pnpm-lock.yaml\",\n }\n\n protected getArgs(): string[] {\n return [\"list\", \"--prod\", \"--json\", \"--depth\", \"Infinity\", \"--silent\", \"--loglevel=error\"]\n }\n\n protected async extractProductionDependencyGraph(tree: PnpmDependency, dependencyId: string) {\n if (this.productionGraph[dependencyId]) {\n return\n }\n this.productionGraph[dependencyId] = { dependencies: [] }\n\n const packageName = tree.name || tree.from\n const { packageJson } = (await this.cache.locatePackageVersion({ pkgName: packageName, parentDir: this.rootDir, requiredRange: tree.version })) || {}\n\n const all = packageJson ? { ...packageJson.dependencies, ...packageJson.optionalDependencies } : { ...tree.dependencies, ...tree.optionalDependencies }\n const optional = packageJson ? { ...packageJson.optionalDependencies } : {}\n\n const deps = { ...(tree.dependencies || {}), ...(tree.optionalDependencies || {}) }\n this.productionGraph[dependencyId] = { dependencies: [] }\n const depPromises = Object.entries(deps).map(async ([packageName, dependency]) => {\n // First check if it's in production dependencies\n if (!all[packageName]) {\n return undefined\n }\n\n // Then check if optional dependency path exists (using actual resolved path)\n if (optional[packageName]) {\n const pkg = await this.cache.locatePackageVersion({ pkgName: packageName, parentDir: this.rootDir, requiredRange: dependency.version })\n if (!pkg) {\n log.debug({ name: packageName, version: dependency.version, path: dependency.path }, `optional dependency doesn't exist, skipping - likely not installed`)\n return undefined\n }\n }\n const childDependencyId = this.packageVersionString(dependency)\n await this.extractProductionDependencyGraph(dependency, childDependencyId)\n return childDependencyId\n })\n\n const collectedDependencies: string[] = []\n for (const dep of depPromises) {\n const result = await dep\n if (result !== undefined) {\n collectedDependencies.push(result)\n }\n }\n this.productionGraph[dependencyId] = { dependencies: collectedDependencies }\n }\n\n protected async collectAllDependencies(tree: PnpmDependency) {\n // Collect regular dependencies\n for (const [key, value] of Object.entries(tree.dependencies || {})) {\n const pkg = await this.cache.locatePackageVersion({ pkgName: key, parentDir: this.rootDir, requiredRange: value.version })\n this.allDependencies.set(`${key}@${value.version}`, { ...value, path: pkg?.packageDir ?? value.path })\n await this.collectAllDependencies(value)\n }\n\n // Collect optional dependencies if they exist\n for (const [key, value] of Object.entries(tree.optionalDependencies || {})) {\n const pkg = await this.cache.locatePackageVersion({ pkgName: key, parentDir: this.rootDir, requiredRange: value.version })\n this.allDependencies.set(`${key}@${value.version}`, { ...value, path: pkg?.packageDir ?? value.path })\n await this.collectAllDependencies(value)\n }\n }\n\n protected packageVersionString(pkg: PnpmDependency): string {\n // we use 'from' field because 'name' may be different in case of aliases\n return `${pkg.from}@${pkg.version}`\n }\n\n protected parseDependenciesTree(jsonBlob: string): PnpmDependency {\n // pnpm returns an array of dependency trees\n const dependencyTree: PnpmDependency[] = this.extractJsonFromPollutedOutput<PnpmDependency[]>(jsonBlob)\n return dependencyTree[0]\n }\n}\n"]}
|
|
@@ -41,6 +41,13 @@ export interface AppXOptions extends TargetSpecificOptions {
|
|
|
41
41
|
* Relative path to custom extensions xml to be included in an `appmanifest.xml`.
|
|
42
42
|
*/
|
|
43
43
|
readonly customExtensionsPath?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The list of [capabilities](https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations) to be added to an `appmanifest.xml`.
|
|
46
|
+
* The `runFullTrust` capability is obligatory for electron apps and will be auto added if not specified here.
|
|
47
|
+
* Defaults to `['runFullTrust']` if omitted
|
|
48
|
+
* Example: `['runFullTrust', 'privateNetworkClientServer', 'webcam']`
|
|
49
|
+
*/
|
|
50
|
+
readonly capabilities?: Array<string> | null;
|
|
44
51
|
/**
|
|
45
52
|
* (Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.
|
|
46
53
|
* Supports the following template macros:
|
|
@@ -62,6 +69,7 @@ export interface AppXOptions extends TargetSpecificOptions {
|
|
|
62
69
|
* - ${splashScreen}
|
|
63
70
|
* - ${arch}
|
|
64
71
|
* - ${resourceLanguages}
|
|
72
|
+
* - ${capabilities}
|
|
65
73
|
* - ${extensions}
|
|
66
74
|
* - ${minVersion}
|
|
67
75
|
* - ${maxVersionTested}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppXOptions.js","sourceRoot":"","sources":["../../src/options/AppXOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\nexport interface AppXOptions extends TargetSpecificOptions {\n /**\n * The application id. Defaults to `identityName`. This string contains alpha-numeric fields separated by periods. Each field must begin with an ASCII alphabetic character.\n */\n readonly applicationId?: string\n\n /**\n * The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).\n * @default #464646\n */\n readonly backgroundColor?: string | null\n\n /**\n * A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\n * Defaults to the application product name.\n */\n readonly displayName?: string | null\n\n /**\n * The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](./configuration.md#metadata).\n */\n readonly identityName?: string | null\n\n /**\n * The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.\n */\n readonly publisher?: string | null\n\n /**\n * A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).\n * Defaults to company name from the application metadata.\n */\n readonly publisherDisplayName?: string | null\n\n /**\n * The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.\n * The first entry (index 0) will be the default language.\n * Defaults to en-US if omitted.\n */\n readonly languages?: Array<string> | string | null\n\n /**\n * Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.\n */\n readonly addAutoLaunchExtension?: boolean\n\n /**\n * Relative path to custom extensions xml to be included in an `appmanifest.xml`.\n */\n readonly customExtensionsPath?: string\n\n /**\n * (Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.\n * Supports the following template macros:\n *\n * - ${publisher}\n * - ${publisherDisplayName}\n * - ${version}\n * - ${applicationId}\n * - ${identityName}\n * - ${executable}\n * - ${displayName}\n * - ${description}\n * - ${backgroundColor}\n * - ${logo}\n * - ${square150x150Logo}\n * - ${square44x44Logo}\n * - ${lockScreen}\n * - ${defaultTile}\n * - ${splashScreen}\n * - ${arch}\n * - ${resourceLanguages}\n * - ${extensions}\n * - ${minVersion}\n * - ${maxVersionTested}\n */\n readonly customManifestPath?: string\n\n /**\n * Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.\n * @default false\n */\n readonly showNameOnTiles?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly electronUpdaterAware?: boolean\n\n /**\n * Whether to set build number. See https://github.com/electron-userland/electron-builder/issues/3875\n * @default false\n */\n readonly setBuildNumber?: boolean\n\n /**\n * Set the MinVersion field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly minVersion?: string | null\n\n /**\n * Set the `MaxVersionTested` field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly maxVersionTested?: string | null\n\n /** @private */\n readonly makeappxArgs?: Array<string> | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AppXOptions.js","sourceRoot":"","sources":["../../src/options/AppXOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\nexport interface AppXOptions extends TargetSpecificOptions {\n /**\n * The application id. Defaults to `identityName`. This string contains alpha-numeric fields separated by periods. Each field must begin with an ASCII alphabetic character.\n */\n readonly applicationId?: string\n\n /**\n * The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).\n * @default #464646\n */\n readonly backgroundColor?: string | null\n\n /**\n * A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\n * Defaults to the application product name.\n */\n readonly displayName?: string | null\n\n /**\n * The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](./configuration.md#metadata).\n */\n readonly identityName?: string | null\n\n /**\n * The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.\n */\n readonly publisher?: string | null\n\n /**\n * A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).\n * Defaults to company name from the application metadata.\n */\n readonly publisherDisplayName?: string | null\n\n /**\n * The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.\n * The first entry (index 0) will be the default language.\n * Defaults to en-US if omitted.\n */\n readonly languages?: Array<string> | string | null\n\n /**\n * Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.\n */\n readonly addAutoLaunchExtension?: boolean\n\n /**\n * Relative path to custom extensions xml to be included in an `appmanifest.xml`.\n */\n readonly customExtensionsPath?: string\n\n /**\n * The list of [capabilities](https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations) to be added to an `appmanifest.xml`.\n * The `runFullTrust` capability is obligatory for electron apps and will be auto added if not specified here.\n * Defaults to `['runFullTrust']` if omitted\n * Example: `['runFullTrust', 'privateNetworkClientServer', 'webcam']`\n */\n readonly capabilities?: Array<string> | null\n\n /**\n * (Advanced Option) Relative path to custom `appmanifest.xml` (file name doesn't matter, it'll be renamed) located in build resources directory.\n * Supports the following template macros:\n *\n * - ${publisher}\n * - ${publisherDisplayName}\n * - ${version}\n * - ${applicationId}\n * - ${identityName}\n * - ${executable}\n * - ${displayName}\n * - ${description}\n * - ${backgroundColor}\n * - ${logo}\n * - ${square150x150Logo}\n * - ${square44x44Logo}\n * - ${lockScreen}\n * - ${defaultTile}\n * - ${splashScreen}\n * - ${arch}\n * - ${resourceLanguages}\n * - ${capabilities}\n * - ${extensions}\n * - ${minVersion}\n * - ${maxVersionTested}\n */\n readonly customManifestPath?: string\n\n /**\n * Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.\n * @default false\n */\n readonly showNameOnTiles?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly electronUpdaterAware?: boolean\n\n /**\n * Whether to set build number. See https://github.com/electron-userland/electron-builder/issues/3875\n * @default false\n */\n readonly setBuildNumber?: boolean\n\n /**\n * Set the MinVersion field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly minVersion?: string | null\n\n /**\n * Set the `MaxVersionTested` field in the appx manifest.xml\n * @default arch === Arch.arm64 ? \"10.0.16299.0\" : \"10.0.14316.0\"\n */\n readonly maxVersionTested?: string | null\n\n /** @private */\n readonly makeappxArgs?: Array<string> | null\n}\n"]}
|
|
@@ -246,6 +246,18 @@ export interface DmgOptions extends TargetSpecificOptions {
|
|
|
246
246
|
* @default UDZO
|
|
247
247
|
*/
|
|
248
248
|
format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
|
|
249
|
+
/**
|
|
250
|
+
* The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `"150m"`, `"4g"`.
|
|
251
|
+
* If not specified, the size is calculated automatically.
|
|
252
|
+
* Set this explicitly for large apps or apps with sparse files to avoid "No space left on device" errors.
|
|
253
|
+
*/
|
|
254
|
+
readonly size?: string | null;
|
|
255
|
+
/**
|
|
256
|
+
* Whether to shrink the DMG filesystem to the minimum size after copying files.
|
|
257
|
+
* Set to `false` to preserve the explicit `size` you specified.
|
|
258
|
+
* @default true
|
|
259
|
+
*/
|
|
260
|
+
readonly shrink?: boolean;
|
|
249
261
|
/**
|
|
250
262
|
* The DMG window position and size. With y co-ordinates running from bottom to top.
|
|
251
263
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
|
1
|
+
{"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (`dmg` and `zip` for Squirrel.Mac). Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](./code-signing.md) instead of specifying this option.\n * MAS installer identity is specified in the [mas](./mas.md).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](./mas.md).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Defaults to `#ffffff` (white) if no background image.\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](./contents.md#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `\"150m\"`, `\"4g\"`.\n * If not specified, the size is calculated automatically.\n * Set this explicitly for large apps or apps with sparse files to avoid \"No space left on device\" errors.\n */\n readonly size?: string | null\n\n /**\n * Whether to shrink the DMG filesystem to the minimum size after copying files.\n * Set to `false` to preserve the explicit `size` you specified.\n * @default true\n */\n readonly shrink?: boolean\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface Capability {
|
|
2
|
+
readonly nsAlias: string | null;
|
|
3
|
+
readonly nsURI: string | null;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
toXMLString(): string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CAPABILITIES: Capability[];
|
|
8
|
+
export declare function isValidCapabilityName(name: string | null | undefined): boolean;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CAPABILITIES = void 0;
|
|
4
|
+
exports.isValidCapabilityName = isValidCapabilityName;
|
|
5
|
+
class AppxCapability {
|
|
6
|
+
constructor(nsAlias, nsURI, declareNS, elementName, name) {
|
|
7
|
+
this.nsAlias = nsAlias;
|
|
8
|
+
this.nsURI = nsURI;
|
|
9
|
+
this.declareNS = declareNS;
|
|
10
|
+
this.elementName = elementName;
|
|
11
|
+
this.name = name;
|
|
12
|
+
if (!this.nsAlias && this.declareNS) {
|
|
13
|
+
throw new Error("local declaration of namespace without prefix is not supported");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
toXMLString() {
|
|
17
|
+
const tagName = this.nsAlias ? `${this.nsAlias}:${this.elementName}` : this.elementName;
|
|
18
|
+
if (this.declareNS) {
|
|
19
|
+
return `<${tagName} xmlns:${this.nsAlias}="${this.nsURI}" Name="${this.name}"/>`;
|
|
20
|
+
}
|
|
21
|
+
return `<${tagName} Name="${this.name}"/>`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Capability type configurations
|
|
25
|
+
const CAPABILITY_TYPES = {
|
|
26
|
+
common: {
|
|
27
|
+
nsAlias: null,
|
|
28
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/foundation/windows10",
|
|
29
|
+
declareNS: false,
|
|
30
|
+
elementName: "Capability",
|
|
31
|
+
},
|
|
32
|
+
uap: {
|
|
33
|
+
nsAlias: "uap",
|
|
34
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/uap/windows10",
|
|
35
|
+
declareNS: false, // ns already declared in template
|
|
36
|
+
elementName: "Capability",
|
|
37
|
+
},
|
|
38
|
+
device: {
|
|
39
|
+
nsAlias: null,
|
|
40
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/foundation/windows10",
|
|
41
|
+
declareNS: false,
|
|
42
|
+
elementName: "DeviceCapability",
|
|
43
|
+
},
|
|
44
|
+
uap6: {
|
|
45
|
+
nsAlias: "uap6",
|
|
46
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/uap/windows10/6",
|
|
47
|
+
declareNS: true,
|
|
48
|
+
elementName: "Capability",
|
|
49
|
+
},
|
|
50
|
+
uap7: {
|
|
51
|
+
nsAlias: "uap7",
|
|
52
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/uap/windows10/7",
|
|
53
|
+
declareNS: true,
|
|
54
|
+
elementName: "Capability",
|
|
55
|
+
},
|
|
56
|
+
mobile: {
|
|
57
|
+
nsAlias: "mobile",
|
|
58
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/mobile/windows10",
|
|
59
|
+
declareNS: true,
|
|
60
|
+
elementName: "Capability",
|
|
61
|
+
},
|
|
62
|
+
rescap: {
|
|
63
|
+
nsAlias: "rescap",
|
|
64
|
+
nsURI: "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities",
|
|
65
|
+
declareNS: false, // ns already declared in template
|
|
66
|
+
elementName: "Capability",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
// Map of capability types to their capability names (grouped by type)
|
|
70
|
+
const CAPABILITY_MAP = new Map([
|
|
71
|
+
// Common capabilities
|
|
72
|
+
[
|
|
73
|
+
"common",
|
|
74
|
+
[
|
|
75
|
+
"internetClient",
|
|
76
|
+
"internetClientServer",
|
|
77
|
+
"privateNetworkClientServer",
|
|
78
|
+
"codeGeneration",
|
|
79
|
+
"allJoyn",
|
|
80
|
+
"backgroundMediaPlayback",
|
|
81
|
+
"remoteSystem",
|
|
82
|
+
"spatialPerception",
|
|
83
|
+
"userDataTasks",
|
|
84
|
+
"userNotificationListener",
|
|
85
|
+
],
|
|
86
|
+
],
|
|
87
|
+
// UAP capabilities
|
|
88
|
+
[
|
|
89
|
+
"uap",
|
|
90
|
+
[
|
|
91
|
+
"musicLibrary",
|
|
92
|
+
"picturesLibrary",
|
|
93
|
+
"videosLibrary",
|
|
94
|
+
"removableStorage",
|
|
95
|
+
"appointments",
|
|
96
|
+
"contacts",
|
|
97
|
+
"phoneCall",
|
|
98
|
+
"phoneCallHistoryPublic",
|
|
99
|
+
"userAccountInformation",
|
|
100
|
+
"voipCall",
|
|
101
|
+
"objects3D",
|
|
102
|
+
"chat",
|
|
103
|
+
"blockedChatMessages",
|
|
104
|
+
"enterpriseAuthentication",
|
|
105
|
+
"sharedUserCertificates",
|
|
106
|
+
"documentsLibrary",
|
|
107
|
+
],
|
|
108
|
+
],
|
|
109
|
+
// Mobile capabilities
|
|
110
|
+
["mobile", ["recordedCallsFolder"]],
|
|
111
|
+
// Restricted capabilities
|
|
112
|
+
[
|
|
113
|
+
"rescap",
|
|
114
|
+
[
|
|
115
|
+
"enterpriseDataPolicy",
|
|
116
|
+
"appCaptureSettings",
|
|
117
|
+
"cellularDeviceControl",
|
|
118
|
+
"cellularDeviceIdentity",
|
|
119
|
+
"cellularMessaging",
|
|
120
|
+
"deviceUnlock",
|
|
121
|
+
"dualSimTiles",
|
|
122
|
+
"enterpriseDeviceLockdown",
|
|
123
|
+
"inputInjectionBrokered",
|
|
124
|
+
"inputObservation",
|
|
125
|
+
"inputSuppression",
|
|
126
|
+
"networkingVpnProvider",
|
|
127
|
+
"packageManagement",
|
|
128
|
+
"screenDuplication",
|
|
129
|
+
"userPrincipalName",
|
|
130
|
+
"walletSystem",
|
|
131
|
+
"locationHistory",
|
|
132
|
+
"confirmAppClose",
|
|
133
|
+
"phoneCallHistory",
|
|
134
|
+
"appointmentsSystem",
|
|
135
|
+
"chatSystem",
|
|
136
|
+
"contactsSystem",
|
|
137
|
+
"email",
|
|
138
|
+
"emailSystem",
|
|
139
|
+
"phoneCallHistorySystem",
|
|
140
|
+
"smsSend",
|
|
141
|
+
"userDataSystem",
|
|
142
|
+
"previewStore",
|
|
143
|
+
"firstSignInSettings",
|
|
144
|
+
"teamEditionExperience",
|
|
145
|
+
"remotePassportAuthentication",
|
|
146
|
+
"previewUiComposition",
|
|
147
|
+
"secureAssessment",
|
|
148
|
+
"networkConnectionManagerProvisioning",
|
|
149
|
+
"networkDataPlanProvisioning",
|
|
150
|
+
"slapiQueryLicenseValue",
|
|
151
|
+
"extendedBackgroundTaskTime",
|
|
152
|
+
"extendedExecutionBackgroundAudio",
|
|
153
|
+
"extendedExecutionCritical",
|
|
154
|
+
"extendedExecutionUnconstrained",
|
|
155
|
+
"deviceManagementDmAccount",
|
|
156
|
+
"deviceManagementFoundation",
|
|
157
|
+
"deviceManagementWapSecurityPolicies",
|
|
158
|
+
"deviceManagementEmailAccount",
|
|
159
|
+
"packagePolicySystem",
|
|
160
|
+
"gameList",
|
|
161
|
+
"xboxAccessoryManagement",
|
|
162
|
+
"cortanaSpeechAccessory",
|
|
163
|
+
"accessoryManager",
|
|
164
|
+
"interopServices",
|
|
165
|
+
"inputForegroundObservation",
|
|
166
|
+
"oemDeployment",
|
|
167
|
+
"oemPublicDirectory",
|
|
168
|
+
"appLicensing",
|
|
169
|
+
"locationSystem",
|
|
170
|
+
"userDataAccountsProvider",
|
|
171
|
+
"previewPenWorkspace",
|
|
172
|
+
"secondaryAuthenticationFactor",
|
|
173
|
+
"storeLicenseManagement",
|
|
174
|
+
"userSystemId",
|
|
175
|
+
"targetedContent",
|
|
176
|
+
"uiAutomation",
|
|
177
|
+
"gameBarServices",
|
|
178
|
+
"appCaptureServices",
|
|
179
|
+
"appBroadcastServices",
|
|
180
|
+
"audioDeviceConfiguration",
|
|
181
|
+
"backgroundMediaRecording",
|
|
182
|
+
"previewInkWorkspace",
|
|
183
|
+
"startScreenManagement",
|
|
184
|
+
"cortanaPermissions",
|
|
185
|
+
"allAppMods",
|
|
186
|
+
"expandedResources",
|
|
187
|
+
"protectedApp",
|
|
188
|
+
"gameMonitor",
|
|
189
|
+
"appDiagnostics",
|
|
190
|
+
"devicePortalProvider",
|
|
191
|
+
"enterpriseCloudSSO",
|
|
192
|
+
"backgroundVoIP",
|
|
193
|
+
"oneProcessVoIP",
|
|
194
|
+
"developmentModeNetwork",
|
|
195
|
+
"broadFileSystemAccess",
|
|
196
|
+
"smbios",
|
|
197
|
+
"runFullTrust",
|
|
198
|
+
"allowElevation",
|
|
199
|
+
"teamEditionDeviceCredential",
|
|
200
|
+
"teamEditionView",
|
|
201
|
+
"cameraProcessingExtension",
|
|
202
|
+
"networkDataUsageManagement",
|
|
203
|
+
"phoneLineTransportManagement",
|
|
204
|
+
"unvirtualizedResources",
|
|
205
|
+
"modifiableApp",
|
|
206
|
+
"packageWriteRedirectionCompatibilityShim",
|
|
207
|
+
"customInstallActions",
|
|
208
|
+
"packagedServices",
|
|
209
|
+
"localSystemServices",
|
|
210
|
+
"backgroundSpatialPerception",
|
|
211
|
+
"uiAccess",
|
|
212
|
+
],
|
|
213
|
+
],
|
|
214
|
+
// UAP6 capabilities
|
|
215
|
+
["uap6", ["graphicsCapture"]],
|
|
216
|
+
// UAP7 capabilities
|
|
217
|
+
["uap7", ["globalMediaControl"]],
|
|
218
|
+
// Device capabilities
|
|
219
|
+
[
|
|
220
|
+
"device",
|
|
221
|
+
[
|
|
222
|
+
"location",
|
|
223
|
+
"microphone",
|
|
224
|
+
"webcam",
|
|
225
|
+
"proximity",
|
|
226
|
+
"pointOfService",
|
|
227
|
+
"wiFiControl",
|
|
228
|
+
"radios",
|
|
229
|
+
"optical",
|
|
230
|
+
"activity",
|
|
231
|
+
"humanPresence",
|
|
232
|
+
"serialcommunication",
|
|
233
|
+
"gazeInput",
|
|
234
|
+
"lowLevel",
|
|
235
|
+
"packageQuery",
|
|
236
|
+
],
|
|
237
|
+
],
|
|
238
|
+
]);
|
|
239
|
+
// Factory function to create capabilities
|
|
240
|
+
function createCapability(type, name) {
|
|
241
|
+
const config = CAPABILITY_TYPES[type];
|
|
242
|
+
if (!config) {
|
|
243
|
+
throw new Error(`unknown capability type '${type}'`);
|
|
244
|
+
}
|
|
245
|
+
return new AppxCapability(config.nsAlias, config.nsURI, config.declareNS, config.elementName, name);
|
|
246
|
+
}
|
|
247
|
+
// Export ordered list of all capabilities (order matters per Microsoft docs)
|
|
248
|
+
// Schema: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/schema-root
|
|
249
|
+
// Packaging: https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
|
|
250
|
+
// !! the docs are not clear in which order is correct. the schema doc specifies an order that differs from the order described in packaging doc !!
|
|
251
|
+
// https://learn.microsoft.com/en-us/answers/questions/92754/why-does-the-order-of-items-in-(capabilities)-of-p
|
|
252
|
+
// as stated in the above post the packaging docs is the one to follow as MakeAppx.exe is following this specification when it checks the manifests validity
|
|
253
|
+
exports.CAPABILITIES = Array.from(CAPABILITY_MAP.entries()).flatMap(([type, names]) => names.map(name => createCapability(type, name)));
|
|
254
|
+
const CAPABILITY_NAMES = new Set(Array.from(CAPABILITY_MAP.values()).flat());
|
|
255
|
+
function isValidCapabilityName(name) {
|
|
256
|
+
return !!name && CAPABILITY_NAMES.has(name);
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=AppxCapabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppxCapabilities.js","sourceRoot":"","sources":["../../src/targets/AppxCapabilities.ts"],"names":[],"mappings":";;;AAyRA,sDAEC;AA5QD,MAAM,cAAc;IAClB,YACkB,OAAsB,EACtB,KAAoB,EACnB,SAAkB,EAClB,WAAmB,EACpB,IAAY;QAJZ,YAAO,GAAP,OAAO,CAAe;QACtB,UAAK,GAAL,KAAK,CAAe;QACnB,cAAS,GAAT,SAAS,CAAS;QAClB,gBAAW,GAAX,WAAW,CAAQ;QACpB,SAAI,GAAJ,IAAI,CAAQ;QAE5B,IAAI,C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U;YACV,eAAe;YACf,qBAAqB;YACrB,WAAW;YACX,UAAU;YACV,cAAc;SACf;KACF;CACF,CAAC,CAAA;AAEF,0CAA0C;AAC1C,SAAS,gBAAgB,CAAC,IAAoB,EAAE,IAAY;IAC1D,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,GAAG,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;AACrG,CAAC;AAED,6EAA6E;AAC7E,kGAAkG;AAClG,iGAAiG;AACjG,mJAAmJ;AACnJ,+GAA+G;AAC/G,4JAA4J;AAC/I,QAAA,YAAY,GAAiB,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AAE1J,MAAM,gBAAgB,GAAgB,IAAI,GAAG,CAAS,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAEjG,SAAgB,qBAAqB,CAAC,IAA+B;IACnE,OAAO,CAAC,CAAC,IAAI,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC7C,CAAC","sourcesContent":["export interface Capability {\n readonly nsAlias: string | null\n readonly nsURI: string | null\n readonly name: string\n\n toXMLString(): string\n}\n\ntype CapabilityConfig = {\n nsAlias: string | null\n nsURI: string | null\n declareNS: boolean\n elementName: string\n}\n\nclass AppxCapability implements Capability {\n constructor(\n public readonly nsAlias: string | null,\n public readonly nsURI: string | null,\n private readonly declareNS: boolean,\n private readonly elementName: string,\n public readonly name: string\n ) {\n if (!this.nsAlias && this.declareNS) {\n throw new Error(\"local declaration of namespace without prefix is not supported\")\n }\n }\n\n toXMLString(): string {\n const tagName = this.nsAlias ? `${this.nsAlias}:${this.elementName}` : this.elementName\n if (this.declareNS) {\n return `<${tagName} xmlns:${this.nsAlias}=\"${this.nsURI}\" Name=\"${this.name}\"/>`\n }\n return `<${tagName} Name=\"${this.name}\"/>`\n }\n}\n\n// Capability type configurations\nconst CAPABILITY_TYPES: Record<string, CapabilityConfig> = {\n common: {\n nsAlias: null,\n nsURI: \"http://schemas.microsoft.com/appx/manifest/foundation/windows10\",\n declareNS: false,\n elementName: \"Capability\",\n },\n uap: {\n nsAlias: \"uap\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/uap/windows10\",\n declareNS: false, // ns already declared in template\n elementName: \"Capability\",\n },\n device: {\n nsAlias: null,\n nsURI: \"http://schemas.microsoft.com/appx/manifest/foundation/windows10\",\n declareNS: false,\n elementName: \"DeviceCapability\",\n },\n uap6: {\n nsAlias: \"uap6\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/uap/windows10/6\",\n declareNS: true,\n elementName: \"Capability\",\n },\n uap7: {\n nsAlias: \"uap7\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/uap/windows10/7\",\n declareNS: true,\n elementName: \"Capability\",\n },\n mobile: {\n nsAlias: \"mobile\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/mobile/windows10\",\n declareNS: true,\n elementName: \"Capability\",\n },\n rescap: {\n nsAlias: \"rescap\",\n nsURI: \"http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities\",\n declareNS: false, // ns already declared in template\n elementName: \"Capability\",\n },\n} as const\n\ntype CapabilityType = keyof typeof CAPABILITY_TYPES\n\n// Map of capability types to their capability names (grouped by type)\nconst CAPABILITY_MAP = new Map<CapabilityType, string[]>([\n // Common capabilities\n [\n \"common\",\n [\n \"internetClient\",\n \"internetClientServer\",\n \"privateNetworkClientServer\",\n \"codeGeneration\",\n \"allJoyn\",\n \"backgroundMediaPlayback\",\n \"remoteSystem\",\n \"spatialPerception\",\n \"userDataTasks\",\n \"userNotificationListener\",\n ],\n ],\n\n // UAP capabilities\n [\n \"uap\",\n [\n \"musicLibrary\",\n \"picturesLibrary\",\n \"videosLibrary\",\n \"removableStorage\",\n \"appointments\",\n \"contacts\",\n \"phoneCall\",\n \"phoneCallHistoryPublic\",\n \"userAccountInformation\",\n \"voipCall\",\n \"objects3D\",\n \"chat\",\n \"blockedChatMessages\",\n \"enterpriseAuthentication\",\n \"sharedUserCertificates\",\n \"documentsLibrary\",\n ],\n ],\n\n // Mobile capabilities\n [\"mobile\", [\"recordedCallsFolder\"]],\n\n // Restricted capabilities\n [\n \"rescap\",\n [\n \"enterpriseDataPolicy\",\n \"appCaptureSettings\",\n \"cellularDeviceControl\",\n \"cellularDeviceIdentity\",\n \"cellularMessaging\",\n \"deviceUnlock\",\n \"dualSimTiles\",\n \"enterpriseDeviceLockdown\",\n \"inputInjectionBrokered\",\n \"inputObservation\",\n \"inputSuppression\",\n \"networkingVpnProvider\",\n \"packageManagement\",\n \"screenDuplication\",\n \"userPrincipalName\",\n \"walletSystem\",\n \"locationHistory\",\n \"confirmAppClose\",\n \"phoneCallHistory\",\n \"appointmentsSystem\",\n \"chatSystem\",\n \"contactsSystem\",\n \"email\",\n \"emailSystem\",\n \"phoneCallHistorySystem\",\n \"smsSend\",\n \"userDataSystem\",\n \"previewStore\",\n \"firstSignInSettings\",\n \"teamEditionExperience\",\n \"remotePassportAuthentication\",\n \"previewUiComposition\",\n \"secureAssessment\",\n \"networkConnectionManagerProvisioning\",\n \"networkDataPlanProvisioning\",\n \"slapiQueryLicenseValue\",\n \"extendedBackgroundTaskTime\",\n \"extendedExecutionBackgroundAudio\",\n \"extendedExecutionCritical\",\n \"extendedExecutionUnconstrained\",\n \"deviceManagementDmAccount\",\n \"deviceManagementFoundation\",\n \"deviceManagementWapSecurityPolicies\",\n \"deviceManagementEmailAccount\",\n \"packagePolicySystem\",\n \"gameList\",\n \"xboxAccessoryManagement\",\n \"cortanaSpeechAccessory\",\n \"accessoryManager\",\n \"interopServices\",\n \"inputForegroundObservation\",\n \"oemDeployment\",\n \"oemPublicDirectory\",\n \"appLicensing\",\n \"locationSystem\",\n \"userDataAccountsProvider\",\n \"previewPenWorkspace\",\n \"secondaryAuthenticationFactor\",\n \"storeLicenseManagement\",\n \"userSystemId\",\n \"targetedContent\",\n \"uiAutomation\",\n \"gameBarServices\",\n \"appCaptureServices\",\n \"appBroadcastServices\",\n \"audioDeviceConfiguration\",\n \"backgroundMediaRecording\",\n \"previewInkWorkspace\",\n \"startScreenManagement\",\n \"cortanaPermissions\",\n \"allAppMods\",\n \"expandedResources\",\n \"protectedApp\",\n \"gameMonitor\",\n \"appDiagnostics\",\n \"devicePortalProvider\",\n \"enterpriseCloudSSO\",\n \"backgroundVoIP\",\n \"oneProcessVoIP\",\n \"developmentModeNetwork\",\n \"broadFileSystemAccess\",\n \"smbios\",\n \"runFullTrust\",\n \"allowElevation\",\n \"teamEditionDeviceCredential\",\n \"teamEditionView\",\n \"cameraProcessingExtension\",\n \"networkDataUsageManagement\",\n \"phoneLineTransportManagement\",\n \"unvirtualizedResources\",\n \"modifiableApp\",\n \"packageWriteRedirectionCompatibilityShim\",\n \"customInstallActions\",\n \"packagedServices\",\n \"localSystemServices\",\n \"backgroundSpatialPerception\",\n \"uiAccess\",\n ],\n ],\n\n // UAP6 capabilities\n [\"uap6\", [\"graphicsCapture\"]],\n\n // UAP7 capabilities\n [\"uap7\", [\"globalMediaControl\"]],\n\n // Device capabilities\n [\n \"device\",\n [\n \"location\",\n \"microphone\",\n \"webcam\",\n \"proximity\",\n \"pointOfService\",\n \"wiFiControl\",\n \"radios\",\n \"optical\",\n \"activity\",\n \"humanPresence\",\n \"serialcommunication\",\n \"gazeInput\",\n \"lowLevel\",\n \"packageQuery\",\n ],\n ],\n])\n\n// Factory function to create capabilities\nfunction createCapability(type: CapabilityType, name: string): Capability {\n const config = CAPABILITY_TYPES[type]\n if (!config) {\n throw new Error(`unknown capability type '${type}'`)\n }\n return new AppxCapability(config.nsAlias, config.nsURI, config.declareNS, config.elementName, name)\n}\n\n// Export ordered list of all capabilities (order matters per Microsoft docs)\n// Schema: https://learn.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/schema-root\n// Packaging: https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations\n// !! the docs are not clear in which order is correct. the schema doc specifies an order that differs from the order described in packaging doc !!\n// https://learn.microsoft.com/en-us/answers/questions/92754/why-does-the-order-of-items-in-(capabilities)-of-p\n// as stated in the above post the packaging docs is the one to follow as MakeAppx.exe is following this specification when it checks the manifests validity\nexport const CAPABILITIES: Capability[] = Array.from(CAPABILITY_MAP.entries()).flatMap(([type, names]) => names.map(name => createCapability(type, name)))\n\nconst CAPABILITY_NAMES: Set<string> = new Set<string>(Array.from(CAPABILITY_MAP.values()).flat())\n\nexport function isValidCapabilityName(name: string | null | undefined): boolean {\n return !!name && CAPABILITY_NAMES.has(name)\n}\n"]}
|