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

Commit

Permalink
feat: check for compatibility with current LTS versions of node (#569)
Browse files Browse the repository at this point in the history
* feat: check for compatibility with current LTS versions of node

BREAKING CHANGE: compatibility with versions that are EOL (up to 12) is not guaranteed

* remove terminal colors from unit test snapshots
  • Loading branch information
dhayab authored May 17, 2022
1 parent 9efba7c commit 781642b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 28 deletions.
44 changes: 25 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ aliases:
defaults: &defaults
working_directory: ~/create-instantsearch-app
docker:
- image: cimg/node:12.22
- image: cimg/node:16.15

executors:
node10:
node14:
docker:
- image: cimg/node:10.24
node12:
- image: cimg/node:14.19
node16:
docker:
- image: cimg/node:12.22
- image: cimg/node:16.15

commands:
build_app:
Expand Down Expand Up @@ -88,17 +88,20 @@ jobs:
name: End-to-end tests
command: yarn run test:e2e --maxWorkers=4

test_apps_node_10:
executor: node10
test_apps_node_14:
executor: node14
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- build_app:
template: 'Autocomplete.js 0'
app: 'autocomplete.js'
template: 'Angular InstantSearch'
app: 'angular-instantsearch'
- build_app:
template: 'Autocomplete'
app: 'autocomplete'
- build_app:
template: 'InstantSearch.js'
app: 'instantsearch.js'
Expand All @@ -108,15 +111,18 @@ jobs:
- build_app:
template: 'JavaScript Helper'
app: 'javascript-helper'
# - build_app:
# template: 'React InstantSearch'
# app: 'react-instantsearch'
- build_app:
template: 'React InstantSearch'
app: 'react-instantsearch'
- build_app:
template: 'Vue InstantSearch'
app: 'vue-instantsearch'
- build_app:
template: 'Vue InstantSearch with Vue 3'
app: 'vue-instantsearch-vue3'

test_apps_node_12:
executor: node12
test_apps_node_16:
executor: node16
steps:
- checkout
- run: *install_yarn_version
Expand All @@ -126,9 +132,6 @@ jobs:
- build_app:
template: 'Angular InstantSearch'
app: 'angular-instantsearch'
- build_app:
template: 'Autocomplete.js 0'
app: 'autocomplete.js'
- build_app:
template: 'Autocomplete'
app: 'autocomplete'
Expand All @@ -147,6 +150,9 @@ jobs:
- build_app:
template: 'Vue InstantSearch'
app: 'vue-instantsearch'
- build_app:
template: 'Vue InstantSearch with Vue 3'
app: 'vue-instantsearch-vue3'

workflows:
version: 2.1
Expand All @@ -155,5 +161,5 @@ workflows:
- test_lint
- test_unit
- test_e2e
- test_apps_node_10
- test_apps_node_12
- test_apps_node_14
- test_apps_node_16
8 changes: 4 additions & 4 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Your app can be deployed in a single command, assuming you're located in its fol

- [CodeSandbox](#codesandbox)
- [Surge](#surge)
- [Now](#now)
- [Vercel](#vercel)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand All @@ -35,10 +35,10 @@ npx surge

[Learn more about Surge →](https://surge.sh)

## Now
## Vercel

```
npx now .
npx vercel
```

[Learn more about Now](https://zeit.co/now)
[Learn more about Vercel](https://vercel.com)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"scripts": {
"start": "node src/cli/index.js",
"test": "jest src",
"test": "jest --no-color src",
"test:e2e:templates": "jest e2e/templates.test.js",
"test:e2e:installs": "jest e2e/installs.test.js",
"test:e2e": "yarn run test:e2e:templates && yarn run test:e2e:installs",
Expand Down
2 changes: 1 addition & 1 deletion src/api/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Options with invalid name throws 1`] = `
"Could not create a project called \\"[31m./WrongNpmName[39m\\" because of npm naming restrictions.
"Could not create a project called \\"./WrongNpmName\\" because of npm naming restrictions.
- name cannot start with a period
- name can only contain URL-friendly characters"
`;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`checkAppName throws with correct error message 1`] = `
"Could not create a project called \\"[31m./project-name[39m\\" because of npm naming restrictions.
"Could not create a project called \\"./project-name\\" because of npm naming restrictions.
- name cannot start with a period
- name can only contain URL-friendly characters"
`;
4 changes: 2 additions & 2 deletions src/utils/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('checkAppPath', () => {
expect(() =>
utils.checkAppPath('path')
).toThrowErrorMatchingInlineSnapshot(
`"Could not create project in destination folder \\"[31mpath[39m\\" because it is not empty."`
`"Could not create project in destination folder \\"path\\" because it is not empty."`
);
});

Expand All @@ -71,7 +71,7 @@ describe('checkAppPath', () => {
expect(() =>
utils.checkAppPath('path')
).toThrowErrorMatchingInlineSnapshot(
`"Could not create project at path [31mpath[39m because a file of the same name already exists."`
`"Could not create project at path path because a file of the same name already exists."`
);
});

Expand Down

0 comments on commit 781642b

Please sign in to comment.