create-instantsearch-app 6.2.1 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -10
- package/package.json +6 -20
- package/src/api/__tests__/__snapshots__/index.test.js.snap +1 -1
- package/src/api/check-config.js +1 -1
- package/src/cli/__tests__/getConfiguration.test.js +1 -1
- package/src/cli/__tests__/isQuestionAsked.test.js +2 -2
- package/src/cli/__tests__/postProcessAnswers.js +1 -1
- package/src/cli/getAttributesFromIndex.js +2 -1
- package/src/cli/index.js +13 -15
- package/src/cli/postProcessAnswers.js +4 -3
- package/src/tasks/common/build.js +1 -1
- package/src/templates/Angular InstantSearch/README.md +1 -1
- package/src/templates/Autocomplete/README.md +1 -1
- package/src/templates/Autocomplete.js 0/README.md +1 -1
- package/src/templates/InstantSearch.js/README.md +1 -1
- package/src/templates/InstantSearch.js 2/README.md +1 -1
- package/src/templates/InstantSearch.js widget/README.md +1 -1
- package/src/templates/JavaScript Client/README.md +1 -1
- package/src/templates/JavaScript Helper/README.md +1 -1
- package/src/templates/JavaScript Helper 2/README.md +1 -1
- package/src/templates/React InstantSearch/README.md +1 -1
- package/src/templates/React InstantSearch Hooks/README.md +1 -1
- package/src/templates/React InstantSearch Hooks Native/README.md +1 -1
- package/src/templates/React InstantSearch Native/README.md +1 -1
- package/src/templates/React InstantSearch widget/README.md +1 -1
- package/src/templates/Vue InstantSearch/README.md +1 -1
- package/src/templates/Vue InstantSearch 1/README.md +1 -1
- package/src/templates/Vue InstantSearch 2/README.md +1 -1
- package/src/templates/Vue InstantSearch with Vue 3/README.md +1 -1
- package/src/utils/__tests__/__snapshots__/index.test.js.snap +1 -1
- package/src/utils/__tests__/index.test.js +2 -2
- package/src/utils/index.js +9 -9
package/README.md
CHANGED
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
17
17
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
- [Get started](#get-started)
|
|
20
21
|
- [Usage](#usage)
|
|
21
22
|
- [API](#api)
|
|
22
23
|
- [Tutorials](#tutorials)
|
|
23
24
|
- [Previews](#previews)
|
|
25
|
+
- [Contributing](#contributing)
|
|
24
26
|
- [License](#license)
|
|
25
27
|
|
|
26
28
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
@@ -145,14 +147,30 @@ app.create().then(() => console.log('App generated!'));
|
|
|
145
147
|
|
|
146
148
|
You can use the web templates on CodeSandbox:
|
|
147
149
|
|
|
148
|
-
- [InstantSearch.js 3](https://codesandbox.io/s/github/algolia/
|
|
149
|
-
- [InstantSearch.js 2](https://codesandbox.io/s/github/algolia/
|
|
150
|
-
- [React InstantSearch](https://codesandbox.io/s/github/algolia/
|
|
151
|
-
- [Vue InstantSearch](https://codesandbox.io/s/github/algolia/
|
|
152
|
-
- [Angular InstantSearch](https://codesandbox.io/s/github/algolia/
|
|
153
|
-
- [Autocomplete.js](https://codesandbox.io/s/github/algolia/
|
|
154
|
-
- [JavaScript Client](https://codesandbox.io/s/github/algolia/
|
|
155
|
-
- [JavaScript Helper](https://codesandbox.io/s/github/algolia/
|
|
150
|
+
- [InstantSearch.js 3](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/instantsearch.js)
|
|
151
|
+
- [InstantSearch.js 2](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/instantsearch.js-2.x)
|
|
152
|
+
- [React InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/react-instantsearch)
|
|
153
|
+
- [Vue InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/vue-instantsearch)
|
|
154
|
+
- [Angular InstantSearch](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/angular-instantsearch)
|
|
155
|
+
- [Autocomplete.js](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/autocomplete.js)
|
|
156
|
+
- [JavaScript Client](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/javascript-client)
|
|
157
|
+
- [JavaScript Helper](https://codesandbox.io/s/github/algolia/instantsearch.js/tree/templates/javascript-helper)
|
|
158
|
+
|
|
159
|
+
## Contributing
|
|
160
|
+
|
|
161
|
+
We welcome all contributors, from casual to regular 💙
|
|
162
|
+
|
|
163
|
+
- **Bug report**. Is something not working as expected? [Send a bug report][contributing-bugreport].
|
|
164
|
+
- **Feature request**. Would you like to add something to the library? [Send a feature request][contributing-featurerequest].
|
|
165
|
+
- **Development**. If you don't know where to start, you can check the open issues that are [tagged easy][contributing-label-easy], the [bugs][contributing-label-bug] or [chores][contributing-label-chore].
|
|
166
|
+
|
|
167
|
+
To start contributing to the code, you need to:
|
|
168
|
+
|
|
169
|
+
1. [Fork the project](https://help.github.com/articles/fork-a-repo/)
|
|
170
|
+
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/)
|
|
171
|
+
1. Install the dependencies: `yarn`
|
|
172
|
+
|
|
173
|
+
Please read [our contribution process](https://github.com/algolia/instantsearch.js/blob/master/CONTRIBUTING.md) to learn more.
|
|
156
174
|
|
|
157
175
|
## License
|
|
158
176
|
|
|
@@ -163,7 +181,7 @@ Create InstantSearch App is [MIT licensed](LICENSE).
|
|
|
163
181
|
[version-svg]: https://img.shields.io/npm/v/create-instantsearch-app.svg?style=flat-square
|
|
164
182
|
[package-url]: https://npmjs.org/package/create-instantsearch-app
|
|
165
183
|
[ci-svg]: https://img.shields.io/circleci/project/github/algolia/create-instantsearch-app.svg?style=flat-square
|
|
166
|
-
[ci-url]: https://circleci.com/gh/algolia/
|
|
184
|
+
[ci-url]: https://circleci.com/gh/algolia/instantsearch.js
|
|
167
185
|
[license-image]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
|
|
168
186
|
[license-url]: LICENSE
|
|
169
187
|
|
|
@@ -171,8 +189,13 @@ Create InstantSearch App is [MIT licensed](LICENSE).
|
|
|
171
189
|
|
|
172
190
|
[algolia-website]: https://www.algolia.com/?utm_medium=social-owned&utm_source=GitHub&utm_campaign=create-instantsearch-app%20repository
|
|
173
191
|
[instantsearchjs-github]: https://github.com/algolia/instantsearch.js
|
|
174
|
-
[react-instantsearch-github]: https://github.com/algolia/
|
|
192
|
+
[react-instantsearch-github]: https://github.com/algolia/instantsearch.js
|
|
175
193
|
[vue-instantsearch-github]: https://github.com/algolia/vue-instantsearch
|
|
176
194
|
[angular-instantsearch-github]: https://github.com/algolia/angular-instantsearch
|
|
177
195
|
[instantsearch-ios-github]: https://github.com/algolia/instantsearch-ios
|
|
178
196
|
[instantsearch-android-github]: https://github.com/algolia/instantsearch-android
|
|
197
|
+
[contributing-bugreport]: https://github.com/algolia/instantsearch.js/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20Create+InstantSearch+App
|
|
198
|
+
[contributing-featurerequest]: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage,Library%3A%20Create+InstantSearch+App&title=Feature%20request%3A%20
|
|
199
|
+
[contributing-label-easy]: https://github.com/algolia/instantsearch.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22+label%3A%22Library%3A%20Create+InstantSearch+App%22
|
|
200
|
+
[contributing-label-bug]: https://github.com/algolia/instantsearch.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug%22+label%3A%22Library%3A%20Create+InstantSearch+App%22
|
|
201
|
+
[contributing-label-chore]: https://github.com/algolia/instantsearch.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Chore%22+label%3A%22Library%3A%20Create+InstantSearch+App%22
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-instantsearch-app",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "⚡️ Build InstantSearch apps at the speed of thought",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"algolia",
|
|
8
8
|
"instantsearch"
|
|
9
9
|
],
|
|
10
|
-
"repository": "algolia/
|
|
10
|
+
"repository": "algolia/instantsearch.js",
|
|
11
11
|
"author": "Algolia <support@algolia.com>",
|
|
12
12
|
"main": "index.js",
|
|
13
13
|
"bin": {
|
|
@@ -15,14 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"start": "node src/cli/index.js",
|
|
18
|
-
"test": "jest --no-color src",
|
|
18
|
+
"test": "jest --no-color src && yarn run test:e2e",
|
|
19
19
|
"test:e2e:templates": "jest e2e/templates.test.js",
|
|
20
20
|
"test:e2e:installs": "jest e2e/installs.test.js",
|
|
21
21
|
"test:e2e": "yarn run test:e2e:templates && yarn run test:e2e:installs",
|
|
22
|
-
"lint": "eslint .",
|
|
23
|
-
"lint:fix": "yarn run lint --fix",
|
|
24
22
|
"format": "prettier --write *.{js,md,json}",
|
|
25
|
-
"doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md docs/",
|
|
26
23
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
27
24
|
"release-templates": "node ./scripts/release-templates",
|
|
28
25
|
"release": "shipjs prepare"
|
|
@@ -53,20 +50,9 @@
|
|
|
53
50
|
"validate-npm-package-name": "3.0.0"
|
|
54
51
|
},
|
|
55
52
|
"devDependencies": {
|
|
56
|
-
"babel-eslint": "10.0.3",
|
|
57
|
-
"conventional-changelog-cli": "2.0.31",
|
|
58
|
-
"doctoc": "1.4.0",
|
|
59
|
-
"eslint": "6.7.2",
|
|
60
|
-
"eslint-config-algolia": "15.0.0",
|
|
61
|
-
"eslint-config-prettier": "6.7.0",
|
|
62
|
-
"eslint-plugin-eslint-comments": "3.1.2",
|
|
63
|
-
"eslint-plugin-html": "6.0.0",
|
|
64
|
-
"eslint-plugin-import": "2.19.1",
|
|
65
|
-
"eslint-plugin-jest": "23.1.1",
|
|
66
|
-
"eslint-plugin-prettier": "3.1.2",
|
|
67
|
-
"jest": "25.1.0",
|
|
68
53
|
"jest-image-snapshot": "2.12.0",
|
|
69
|
-
"shipjs": "0.
|
|
54
|
+
"shipjs": "0.25.0",
|
|
70
55
|
"walk-sync": "2.0.2"
|
|
71
|
-
}
|
|
56
|
+
},
|
|
57
|
+
"gitHead": "54e18a6e7cfebc2c7c7326676c56c71ee39eb1c2"
|
|
72
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`Options with invalid name throws 1`] = `
|
|
4
|
-
"Could not create a project called \\"./WrongNpmName\\" because of npm naming restrictions.
|
|
4
|
+
"Could not create a project called \\"[31m./WrongNpmName[39m\\" because of npm naming restrictions.
|
|
5
5
|
- name cannot start with a period
|
|
6
6
|
- name can only contain URL-friendly characters"
|
|
7
7
|
`;
|
package/src/api/check-config.js
CHANGED
|
@@ -37,7 +37,7 @@ function getOptions({ supportedTemplates }) {
|
|
|
37
37
|
module.exports = function checkConfig(config, { supportedTemplates }) {
|
|
38
38
|
const options = getOptions({ supportedTemplates });
|
|
39
39
|
|
|
40
|
-
Object.keys(options).forEach(optionName => {
|
|
40
|
+
Object.keys(options).forEach((optionName) => {
|
|
41
41
|
const isOptionValid = options[optionName].validate(config[optionName]);
|
|
42
42
|
|
|
43
43
|
if (!isOptionValid) {
|
|
@@ -31,7 +31,7 @@ test('with options from arguments and prompt merge', async () => {
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
test('with config file overrides all options', async () => {
|
|
34
|
-
loadJsonFile.mockImplementationOnce(x => Promise.resolve(x));
|
|
34
|
+
loadJsonFile.mockImplementationOnce((x) => Promise.resolve(x));
|
|
35
35
|
const ignoredOptions = {
|
|
36
36
|
libraryVersion: '3.0.0',
|
|
37
37
|
};
|
|
@@ -3,7 +3,7 @@ const isQuestionAsked = require('../isQuestionAsked');
|
|
|
3
3
|
test('with appId undefined should ask', () => {
|
|
4
4
|
expect(
|
|
5
5
|
isQuestionAsked({
|
|
6
|
-
question: { name: 'appId', validate: input => Boolean(input) },
|
|
6
|
+
question: { name: 'appId', validate: (input) => Boolean(input) },
|
|
7
7
|
args: { appId: undefined, interactive: true },
|
|
8
8
|
})
|
|
9
9
|
).toBe(false);
|
|
@@ -12,7 +12,7 @@ test('with appId undefined should ask', () => {
|
|
|
12
12
|
test('with appId defined should not ask', () => {
|
|
13
13
|
expect(
|
|
14
14
|
isQuestionAsked({
|
|
15
|
-
question: { name: 'appId', validate: input => Boolean(input) },
|
|
15
|
+
question: { name: 'appId', validate: (input) => Boolean(input) },
|
|
16
16
|
args: { appId: 'APP_ID', interactive: true },
|
|
17
17
|
})
|
|
18
18
|
).toBe(true);
|
|
@@ -2,7 +2,7 @@ const postProcessAnswers = require('../postProcessAnswers');
|
|
|
2
2
|
const utils = require('../../utils');
|
|
3
3
|
|
|
4
4
|
jest.mock('../../utils', () => ({
|
|
5
|
-
...
|
|
5
|
+
...jest.requireActual('../../utils'),
|
|
6
6
|
fetchLibraryVersions: jest.fn(() => Promise.resolve(['1.0.0'])),
|
|
7
7
|
}));
|
|
8
8
|
|
|
@@ -20,7 +20,8 @@ module.exports = async function getAttributesFromIndex({
|
|
|
20
20
|
...new Set([
|
|
21
21
|
...defaultAttributes
|
|
22
22
|
.map(
|
|
23
|
-
|
|
23
|
+
(attribute) =>
|
|
24
|
+
highlightedAttributes.includes(attribute) && attribute
|
|
24
25
|
)
|
|
25
26
|
.filter(Boolean),
|
|
26
27
|
...highlightedAttributes,
|
package/src/cli/index.js
CHANGED
|
@@ -53,24 +53,22 @@ program
|
|
|
53
53
|
.option('--config <config>', 'The configuration file to get the options from')
|
|
54
54
|
.option('--no-installation', 'Ignore dependency installation')
|
|
55
55
|
.option('--no-interactive', 'Ask no interactive questions')
|
|
56
|
-
.action(dest => {
|
|
56
|
+
.action((dest) => {
|
|
57
57
|
appPathFromArgument = dest;
|
|
58
58
|
})
|
|
59
59
|
.parse(process.argv);
|
|
60
60
|
|
|
61
61
|
const optionsFromArguments = program.opts();
|
|
62
|
-
const {
|
|
63
|
-
|
|
64
|
-
attributesForFaceting = [],
|
|
65
|
-
} = optionsFromArguments;
|
|
62
|
+
const { attributesToDisplay = [], attributesForFaceting = [] } =
|
|
63
|
+
optionsFromArguments;
|
|
66
64
|
|
|
67
65
|
const getQuestions = ({ appName }) => ({
|
|
68
66
|
application: [
|
|
69
67
|
{
|
|
70
68
|
type: 'list',
|
|
71
69
|
name: 'libraryVersion',
|
|
72
|
-
message: answers => `${answers.template} version`,
|
|
73
|
-
choices: async answers => {
|
|
70
|
+
message: (answers) => `${answers.template} version`,
|
|
71
|
+
choices: async (answers) => {
|
|
74
72
|
const templatePath = getTemplatePath(answers.template);
|
|
75
73
|
const templateConfig = getAppTemplateConfig(templatePath);
|
|
76
74
|
const { libraryName } = templateConfig;
|
|
@@ -112,7 +110,7 @@ const getQuestions = ({ appName }) => ({
|
|
|
112
110
|
];
|
|
113
111
|
}
|
|
114
112
|
},
|
|
115
|
-
when: answers => {
|
|
113
|
+
when: (answers) => {
|
|
116
114
|
const templatePath = getTemplatePath(answers.template);
|
|
117
115
|
const templateConfig = getAppTemplateConfig(templatePath);
|
|
118
116
|
|
|
@@ -145,7 +143,7 @@ const getQuestions = ({ appName }) => ({
|
|
|
145
143
|
'Used to generate the default result template'
|
|
146
144
|
)}`,
|
|
147
145
|
pageSize: 10,
|
|
148
|
-
choices: async answers => [
|
|
146
|
+
choices: async (answers) => [
|
|
149
147
|
{
|
|
150
148
|
name: 'None',
|
|
151
149
|
value: undefined,
|
|
@@ -154,7 +152,7 @@ const getQuestions = ({ appName }) => ({
|
|
|
154
152
|
new inquirer.Separator('From your index'),
|
|
155
153
|
...(await getAttributesFromIndex(answers)),
|
|
156
154
|
],
|
|
157
|
-
filter: attributes => attributes.filter(Boolean),
|
|
155
|
+
filter: (attributes) => attributes.filter(Boolean),
|
|
158
156
|
when: ({ appId, apiKey, indexName }) =>
|
|
159
157
|
attributesToDisplay.length === 0 && appId && apiKey && indexName,
|
|
160
158
|
},
|
|
@@ -164,7 +162,7 @@ const getQuestions = ({ appName }) => ({
|
|
|
164
162
|
message: 'Attributes to display',
|
|
165
163
|
suffix: `\n ${chalk.gray('Used to filter the search interface')}`,
|
|
166
164
|
pageSize: 10,
|
|
167
|
-
choices: async answers => {
|
|
165
|
+
choices: async (answers) => {
|
|
168
166
|
const templatePath = getTemplatePath(answers.template);
|
|
169
167
|
const templateConfig = getAppTemplateConfig(templatePath);
|
|
170
168
|
|
|
@@ -196,7 +194,7 @@ const getQuestions = ({ appName }) => ({
|
|
|
196
194
|
new inquirer.Separator(),
|
|
197
195
|
];
|
|
198
196
|
},
|
|
199
|
-
filter: attributes => attributes.filter(Boolean),
|
|
197
|
+
filter: (attributes) => attributes.filter(Boolean),
|
|
200
198
|
when: ({ appId, apiKey, indexName }) =>
|
|
201
199
|
attributesForFaceting.length === 0 && appId && apiKey && indexName,
|
|
202
200
|
},
|
|
@@ -329,7 +327,7 @@ async function run() {
|
|
|
329
327
|
...(await inquirer.prompt(initialQuestions, args)),
|
|
330
328
|
};
|
|
331
329
|
|
|
332
|
-
initialQuestions.forEach(question => {
|
|
330
|
+
initialQuestions.forEach((question) => {
|
|
333
331
|
// .default doesn't get executed when "when" returns false
|
|
334
332
|
if (!initialAnswers[question.name] && question.default) {
|
|
335
333
|
const defaultValue = question.default(initialAnswers);
|
|
@@ -369,7 +367,7 @@ async function run() {
|
|
|
369
367
|
|
|
370
368
|
const answers = await inquirer.prompt(
|
|
371
369
|
getQuestions({ appName })[implementationType].filter(
|
|
372
|
-
question => !isQuestionAsked({ question, args: optionsFromArguments })
|
|
370
|
+
(question) => !isQuestionAsked({ question, args: optionsFromArguments })
|
|
373
371
|
),
|
|
374
372
|
getAnswersDefaultValues(optionsFromArguments, configuration, template)
|
|
375
373
|
);
|
|
@@ -389,7 +387,7 @@ async function run() {
|
|
|
389
387
|
await app.create();
|
|
390
388
|
}
|
|
391
389
|
|
|
392
|
-
run().catch(err => {
|
|
390
|
+
run().catch((err) => {
|
|
393
391
|
console.error(err.message);
|
|
394
392
|
console.log();
|
|
395
393
|
|
|
@@ -9,8 +9,9 @@ function capitalize(str) {
|
|
|
9
9
|
|
|
10
10
|
function createNameAlternatives({ organization, name, templateConfig }) {
|
|
11
11
|
return {
|
|
12
|
-
packageName: `@${organization}/${
|
|
13
|
-
''
|
|
12
|
+
packageName: `@${organization}/${
|
|
13
|
+
templateConfig.packageNamePrefix || ''
|
|
14
|
+
}${name}`,
|
|
14
15
|
widgetType: `${organization}.${name}`,
|
|
15
16
|
camelCaseName: camelCase(name),
|
|
16
17
|
pascalCaseName: capitalize(camelCase(name)),
|
|
@@ -64,7 +65,7 @@ async function postProcessAnswers({
|
|
|
64
65
|
attributesForFaceting:
|
|
65
66
|
Array.isArray(combinedAnswers.attributesForFaceting) &&
|
|
66
67
|
combinedAnswers.attributesForFaceting.filter(
|
|
67
|
-
attribute => attribute !== 'ais.dynamicWidgets'
|
|
68
|
+
(attribute) => attribute !== 'ais.dynamicWidgets'
|
|
68
69
|
),
|
|
69
70
|
flags: {
|
|
70
71
|
dynamicWidgets:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -169,4 +169,4 @@ Please read [our contribution process](./CONTRIBUTING.md) to learn more.
|
|
|
169
169
|
|
|
170
170
|
---
|
|
171
171
|
|
|
172
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
172
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -82,4 +82,4 @@ Please read [our contribution process](./CONTRIBUTING.md) to learn more.
|
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
85
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
85
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{name}}
|
|
2
2
|
|
|
3
|
-
_This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
3
|
+
_This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._
|
|
4
4
|
|
|
5
5
|
## Get started
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`checkAppName throws with correct error message 1`] = `
|
|
4
|
-
"Could not create a project called \\"./project-name\\" because of npm naming restrictions.
|
|
4
|
+
"Could not create a project called \\"[31m./project-name[39m\\" because of npm naming restrictions.
|
|
5
5
|
- name cannot start with a period
|
|
6
6
|
- name can only contain URL-friendly characters"
|
|
7
7
|
`;
|
|
@@ -48,7 +48,7 @@ describe('checkAppPath', () => {
|
|
|
48
48
|
expect(() =>
|
|
49
49
|
utils.checkAppPath('path')
|
|
50
50
|
).toThrowErrorMatchingInlineSnapshot(
|
|
51
|
-
`"Could not create project in destination folder \\"
|
|
51
|
+
`"Could not create project in destination folder \\"[31mpath[39m\\" because it is not empty."`
|
|
52
52
|
);
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -71,7 +71,7 @@ describe('checkAppPath', () => {
|
|
|
71
71
|
expect(() =>
|
|
72
72
|
utils.checkAppPath('path')
|
|
73
73
|
).toThrowErrorMatchingInlineSnapshot(
|
|
74
|
-
`"Could not create project at path
|
|
74
|
+
`"Could not create project at path [31mpath[39m because a file of the same name already exists."`
|
|
75
75
|
);
|
|
76
76
|
});
|
|
77
77
|
|
package/src/utils/index.js
CHANGED
|
@@ -25,7 +25,7 @@ function checkAppName(appName) {
|
|
|
25
25
|
appName
|
|
26
26
|
)}" because of npm naming restrictions.`;
|
|
27
27
|
|
|
28
|
-
(validationResult.errors || []).forEach(error => {
|
|
28
|
+
(validationResult.errors || []).forEach((error) => {
|
|
29
29
|
errorMessage += `\n - ${error}`;
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -86,9 +86,9 @@ function isYarnAvailable() {
|
|
|
86
86
|
function getAllTemplates() {
|
|
87
87
|
const templates = fs
|
|
88
88
|
.readdirSync(TEMPLATES_FOLDER)
|
|
89
|
-
.map(name => path.join(TEMPLATES_FOLDER, name))
|
|
90
|
-
.filter(source => fs.lstatSync(source).isDirectory())
|
|
91
|
-
.map(source => path.basename(source));
|
|
89
|
+
.map((name) => path.join(TEMPLATES_FOLDER, name))
|
|
90
|
+
.filter((source) => fs.lstatSync(source).isDirectory())
|
|
91
|
+
.map((source) => path.basename(source));
|
|
92
92
|
|
|
93
93
|
return templates;
|
|
94
94
|
}
|
|
@@ -96,8 +96,8 @@ function getAllTemplates() {
|
|
|
96
96
|
function getTemplatesByCategory() {
|
|
97
97
|
const templatePaths = fs
|
|
98
98
|
.readdirSync(TEMPLATES_FOLDER)
|
|
99
|
-
.map(name => path.join(TEMPLATES_FOLDER, name))
|
|
100
|
-
.filter(source => fs.lstatSync(source).isDirectory());
|
|
99
|
+
.map((name) => path.join(TEMPLATES_FOLDER, name))
|
|
100
|
+
.filter((source) => fs.lstatSync(source).isDirectory());
|
|
101
101
|
|
|
102
102
|
const templates = templatePaths.reduce((allTemplates, source) => {
|
|
103
103
|
const name = path.basename(source);
|
|
@@ -138,7 +138,7 @@ async function fetchLibraryVersions(libraryName) {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
function getLibraryVersion({ libraryName, supportedVersion = '' }) {
|
|
141
|
-
return async getVersion => {
|
|
141
|
+
return async (getVersion) => {
|
|
142
142
|
const versions = await fetchLibraryVersions(libraryName);
|
|
143
143
|
|
|
144
144
|
return getVersion(versions, supportedVersion);
|
|
@@ -153,11 +153,11 @@ async function getEarliestLibraryVersion(...args) {
|
|
|
153
153
|
return await getLibraryVersion(...args)(semver.minSatisfying);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
const splitArray = string =>
|
|
156
|
+
const splitArray = (string) =>
|
|
157
157
|
string
|
|
158
158
|
.split(',')
|
|
159
159
|
.filter(Boolean)
|
|
160
|
-
.map(x => x.trim());
|
|
160
|
+
.map((x) => x.trim());
|
|
161
161
|
|
|
162
162
|
module.exports = {
|
|
163
163
|
checkAppName,
|