UNPKG

@gasket/plugin-intl

Version:
32 lines (31 loc) 962 B
/// <reference types="@gasket/plugin-nextjs" /> /** * Prompt lifecycle hook * * We do not actually prompt from here, but rather use this lifecycles to make * sure the ReduxReducers instances is available on context during the create * lifecycle. * @type {import('@gasket/core').HookHandler<'prompt'>} */ Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return promptHook; } }); async function promptHook(gasket, context, { prompt }) { if (!('hasGasketIntl' in context) && !context.useAppRouter) { const { useGasketIntl } = await prompt([ { name: 'useGasketIntl', message: 'Do you want internationalization support?', type: 'confirm', default: true } ]); context.hasGasketIntl = useGasketIntl; } return context; }