From 413b10172b9ab5ed5239ed6c29ffc9836f80331f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Chalifour?= Date: Thu, 14 Jun 2018 17:43:06 +0200 Subject: [PATCH] feat(templates): Warn facets usage with React Native template --- .../React InstantSearch Native/.template.js | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/templates/React InstantSearch Native/.template.js b/templates/React InstantSearch Native/.template.js index c0decc17e..376d8e696 100644 --- a/templates/React InstantSearch Native/.template.js +++ b/templates/React InstantSearch Native/.template.js @@ -1,3 +1,4 @@ +const chalk = require('chalk'); const install = require('../../packages/tasks/node/install'); const teardown = require('../../packages/tasks/node/teardown'); @@ -5,8 +6,27 @@ module.exports = { libraryName: 'react-instantsearch-native', templateName: 'react-instantsearch-native', appName: 'react-instantsearch-native-app', - keywords: ['algolia', 'instantSearch', 'react', 'react-native', 'react-instantsearch-native'], + keywords: [ + 'algolia', + 'instantSearch', + 'react', + 'react-native', + 'react-instantsearch-native', + ], tasks: { + setup(config) { + if (!config.silent && config.attributesForFaceting) { + console.log(); + console.log( + `⚠️ The ${chalk.cyan( + 'attributesForFaceting' + )} option is not supported in this template.` + ); + console.log(); + } + + return Promise.resolve(); + }, install, teardown, },