Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 6502feb

Browse files
feat(templates): Warn facets usage with React Native template (#56)
Since `attributesForFaceting` is not supported by the React Native template, warn the user about it.
1 parent c15426f commit 6502feb

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

templates/React InstantSearch Native/.template.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1+
const chalk = require('chalk');
12
const install = require('../../packages/tasks/node/install');
23
const teardown = require('../../packages/tasks/node/teardown');
34

45
module.exports = {
56
libraryName: 'react-instantsearch-native',
67
templateName: 'react-instantsearch-native',
78
appName: 'react-instantsearch-native-app',
8-
keywords: ['algolia', 'instantSearch', 'react', 'react-native', 'react-instantsearch-native'],
9+
keywords: [
10+
'algolia',
11+
'instantSearch',
12+
'react',
13+
'react-native',
14+
'react-instantsearch-native',
15+
],
916
tasks: {
17+
setup(config) {
18+
if (!config.silent && config.attributesForFaceting) {
19+
console.log();
20+
console.log(
21+
`⚠️ The ${chalk.cyan(
22+
'attributesForFaceting'
23+
)} option is not supported in this template.`
24+
);
25+
console.log();
26+
}
27+
28+
return Promise.resolve();
29+
},
1030
install,
1131
teardown,
1232
},

0 commit comments

Comments
 (0)