Skip to content

Commit

Permalink
Remove unnecessary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqing committed Apr 5, 2024
1 parent 0b19b2c commit 39100b4
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions packages/build/src/utilities/build-manifest-async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import {
Config,
ConfigCommand,
ConfigMenuItemSeparator,
ConfigNetworkAccess,
ConfigParameter,
ConfigRelaunchButton,
constants,
Manifest,
ManifestMenuItem,
ManifestMenuItemSeparator,
ManifestNetworkAccess,
ManifestParameter,
ManifestRelaunchButton,
writeFileAsync
Expand Down Expand Up @@ -42,13 +40,6 @@ export async function buildManifestAsync(options: {
parameters,
parameterOnly,
relaunchButtons,
capabilities,
permissions,
documentAccess,
networkAccess,
enablePrivatePluginApi,
enableProposedApi,
build,
rest
} = config
const command = { commandId, name, main, ui, menu, parameters, parameterOnly }
Expand Down Expand Up @@ -82,16 +73,6 @@ export async function buildManifestAsync(options: {
relaunchButtons !== null
? createManifestRelaunchButtons(relaunchButtons)
: undefined,
capabilities: capabilities !== null ? capabilities : undefined,
permissions: permissions !== null ? permissions : undefined,
documentAccess: documentAccess !== null ? documentAccess : undefined,
networkAccess:
networkAccess !== null
? createManifestNetworkAccess(networkAccess)
: undefined,
enableProposedApi: enableProposedApi === true ? true : undefined,
enablePrivatePluginApi: enablePrivatePluginApi === true ? true : undefined,
build: build !== null ? build : undefined,
...(rest !== null ? rest : {})
}
const result = await overrideManifestAsync(manifest)
Expand Down Expand Up @@ -192,22 +173,6 @@ function createManifestRelaunchButtons(
})
}

function createManifestNetworkAccess(
networkAccess: ConfigNetworkAccess
): ManifestNetworkAccess {
const { allowedDomains, devAllowedDomains, reasoning } = networkAccess
const result: ManifestNetworkAccess = {
allowedDomains
}
if (devAllowedDomains !== null) {
result.devAllowedDomains = devAllowedDomains
}
if (reasoning !== null) {
result.reasoning = reasoning
}
return result
}

async function overrideManifestAsync(
manifest: Manifest
): Promise<Record<string, any>> {
Expand Down

0 comments on commit 39100b4

Please sign in to comment.