diff --git a/packages/cli/src/lib/cmds/init.ts b/packages/cli/src/lib/cmds/init.ts index 0a485cee..df8b41e1 100644 --- a/packages/cli/src/lib/cmds/init.ts +++ b/packages/cli/src/lib/cmds/init.ts @@ -17,7 +17,7 @@ import * as fs from 'fs'; import Color = require('color'); import * as inquirer from 'inquirer'; -import {Config, DISPLAY_MODES, JdkHelper, KeyTool, Log, TwaGenerator, TwaManifest, +import {Config, DisplayModes, JdkHelper, KeyTool, Log, TwaGenerator, TwaManifest, util} from '@bubblewrap/core'; import {validateColor, validateKeyPassword, validateUrl, notEmpty} from '../inputHelpers'; import {ParsedArgs} from 'minimist'; @@ -55,7 +55,7 @@ async function confirmTwaConfig(twaManifest: TwaManifest): Promise type: 'list', message: 'Display mode to be used:', default: twaManifest.display, - choices: DISPLAY_MODES, + choices: DisplayModes, }, { name: 'themeColor', type: 'input', diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 71757007..3042e66b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -20,7 +20,7 @@ import {GradleWrapper} from './lib/GradleWrapper'; import Log from './lib/Log'; import {JdkHelper} from './lib/jdk/JdkHelper'; import {KeyTool} from './lib/jdk/KeyTool'; -import {TwaManifest, DISPLAY_MODES} from './lib/TwaManifest'; +import {TwaManifest, DisplayModes} from './lib/TwaManifest'; import {TwaGenerator} from './lib/TwaGenerator'; import {DigitalAssetLinks} from './lib/DigitalAssetLinks'; import * as util from './lib/util'; @@ -34,6 +34,6 @@ export {AndroidSdkTools, Log, TwaGenerator, TwaManifest, - DISPLAY_MODES, + DisplayModes, util, }; diff --git a/packages/core/src/lib/TwaManifest.ts b/packages/core/src/lib/TwaManifest.ts index bf047493..d4c60310 100644 --- a/packages/core/src/lib/TwaManifest.ts +++ b/packages/core/src/lib/TwaManifest.ts @@ -36,11 +36,12 @@ const MIN_SHORTCUT_ICON_SIZE = 96; const MIN_NOTIFICATION_ICON_SIZE = 48; // Supported display modes for TWA -export const DISPLAY_MODES = ['standalone', 'fullscreen']; -type DisplayMode = typeof DISPLAY_MODES[number]; +const DISPLAY_MODE_VALUES = ['standalone', 'fullscreen']; +type DisplayMode = typeof DISPLAY_MODE_VALUES[number]; +export const DisplayModes: DisplayMode[] = [...DISPLAY_MODE_VALUES]; export function asDisplayMode(input: string): DisplayMode | null { - return DISPLAY_MODES.includes(input) ? input as DisplayMode : null; + return DISPLAY_MODE_VALUES.includes(input) ? input as DisplayMode : null; } // Default values used on the Twa Manifest