diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index d7c063aae8..f7e0483264 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -15,5 +15,5 @@ "packages/vue-instantsearch", "packages/instantsearch.css" ], - "node": "16" + "node": "20" } diff --git a/examples/vue/default-theme/README.md b/examples/vue/default-theme/README.md index 5211201b16..f3bccb0e42 100644 --- a/examples/vue/default-theme/README.md +++ b/examples/vue/default-theme/README.md @@ -11,7 +11,7 @@ yarn install ### Compiles and hot-reloads for development ``` -yarn run serve +yarn run dev ``` ### Compiles and minifies for production @@ -19,9 +19,3 @@ yarn run serve ``` yarn run build ``` - -### Lints and fixes files - -``` -yarn run lint -``` diff --git a/examples/vue/default-theme/index.html b/examples/vue/default-theme/index.html new file mode 100644 index 0000000000..a1301eae64 --- /dev/null +++ b/examples/vue/default-theme/index.html @@ -0,0 +1,23 @@ + + + + + + + default-theme + + + + +
+ + + diff --git a/examples/vue/default-theme/package.json b/examples/vue/default-theme/package.json index 3ac3cd492c..cb5f30f848 100644 --- a/examples/vue/default-theme/package.json +++ b/examples/vue/default-theme/package.json @@ -3,27 +3,23 @@ "version": "0.34.0", "private": true, "scripts": { - "serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", - "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", - "website:examples": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build --dest ../../../website/examples/vue/default-theme" + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "website:examples": "vite build --outDir ../../../website/examples/vue/default-theme --base /examples/vue/default-theme" }, "dependencies": { "algoliasearch": "4.14.3", - "core-js": "2", "instantsearch.js": "4.62.0", "vue": "2.7.14", "vue-instantsearch": "4.13.1" }, "devDependencies": { - "@vue/cli-plugin-babel": "3.12.1", - "@vue/cli-service": "3.12.1", + "vite": "5.0.7", + "vite-plugin-commonjs": "0.10.0", + "@vitejs/plugin-vue2": "2.3.1", "vue-template-compiler": "2.7.14" }, - "postcss": { - "plugins": { - "autoprefixer": {} - } - }, "browserslist": [ "> 1%", "last 2 versions", diff --git a/examples/vue/default-theme/public/index.html b/examples/vue/default-theme/public/index.html deleted file mode 100644 index d1d0966a28..0000000000 --- a/examples/vue/default-theme/public/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - default-theme - - - - - -
- - - diff --git a/examples/vue/default-theme/src/App.vue b/examples/vue/default-theme/src/App.vue index a77c1bd98e..e348079d4c 100644 --- a/examples/vue/default-theme/src/App.vue +++ b/examples/vue/default-theme/src/App.vue @@ -127,8 +127,6 @@ import algoliasearch from 'algoliasearch/lite'; import { history as historyRouter } from 'instantsearch.js/es/lib/routers'; import { simple as simpleMapping } from 'instantsearch.js/es/lib/stateMappings'; -import './App.css'; - export default { data() { return { diff --git a/examples/vue/default-theme/src/main.js b/examples/vue/default-theme/src/main.js index 6c0a207513..a4df97a182 100644 --- a/examples/vue/default-theme/src/main.js +++ b/examples/vue/default-theme/src/main.js @@ -1,6 +1,7 @@ import Vue from 'vue'; -import InstantSearch from 'vue-instantsearch'; +import InstantSearch from 'vue-instantsearch/vue2/es'; +import './App.css'; import App from './App.vue'; Vue.use(InstantSearch); diff --git a/examples/vue/default-theme/vite.config.mjs b/examples/vue/default-theme/vite.config.mjs new file mode 100644 index 0000000000..60569b9043 --- /dev/null +++ b/examples/vue/default-theme/vite.config.mjs @@ -0,0 +1,7 @@ +import vue from '@vitejs/plugin-vue2'; +import { defineConfig } from 'vite'; +import commonjs from 'vite-plugin-commonjs'; + +export default defineConfig({ + plugins: [commonjs(), vue()], +}); diff --git a/examples/vue/default-theme/vue.config.js b/examples/vue/default-theme/vue.config.js deleted file mode 100644 index e956a5b790..0000000000 --- a/examples/vue/default-theme/vue.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - publicPath: './', - devServer: { - disableHostCheck: true, - }, -}; diff --git a/examples/vue/e-commerce/README.md b/examples/vue/e-commerce/README.md index 1e6f445121..814258c492 100644 --- a/examples/vue/e-commerce/README.md +++ b/examples/vue/e-commerce/README.md @@ -11,7 +11,7 @@ yarn install ### Compiles and hot-reloads for development ``` -yarn run serve +yarn run dev ``` ### Compiles and minifies for production @@ -19,9 +19,3 @@ yarn run serve ``` yarn run build ``` - -### Lints and fixes files - -``` -yarn run lint -``` diff --git a/examples/vue/e-commerce/public/index.html b/examples/vue/e-commerce/index.html similarity index 83% rename from examples/vue/e-commerce/public/index.html rename to examples/vue/e-commerce/index.html index d850363344..29e4bb8ed9 100644 --- a/examples/vue/e-commerce/public/index.html +++ b/examples/vue/e-commerce/index.html @@ -8,8 +8,8 @@ /> - - + + You need to enable JavaScript to run this app.
+ diff --git a/examples/vue/e-commerce/package.json b/examples/vue/e-commerce/package.json index cca0c76dd9..ea84f3d3b6 100644 --- a/examples/vue/e-commerce/package.json +++ b/examples/vue/e-commerce/package.json @@ -3,28 +3,24 @@ "version": "0.34.0", "private": true, "scripts": { - "serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", - "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", - "website:examples": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build --dest ../../../website/examples/vue/e-commerce" + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "website:examples": "vite build --outDir ../../../website/examples/vue/e-commerce --base /examples/vue/e-commerce" }, "dependencies": { "algoliasearch": "4.14.3", - "core-js": "2", "instantsearch.js": "4.62.0", "vue": "2.7.14", "vue-instantsearch": "4.13.1", "vue-slider-component": "3.0.32" }, "devDependencies": { - "@vue/cli-plugin-babel": "3.12.1", - "@vue/cli-service": "3.12.1", + "vite": "5.0.7", + "vite-plugin-commonjs": "0.10.0", + "@vitejs/plugin-vue2": "2.3.1", "vue-template-compiler": "2.7.14" }, - "postcss": { - "plugins": { - "autoprefixer": {} - } - }, "browserslist": [ "> 1%", "last 2 versions", diff --git a/examples/vue/e-commerce/src/App.vue b/examples/vue/e-commerce/src/App.vue index f2cc367476..adfe749cea 100644 --- a/examples/vue/e-commerce/src/App.vue +++ b/examples/vue/e-commerce/src/App.vue @@ -497,11 +497,6 @@ import { formatNumber } from './utils'; import ClearRefinements from './widgets/ClearRefinements.vue'; import NoResults from './widgets/NoResults.vue'; -import './Theme.css'; -import './App.css'; -import './App.mobile.css'; -import './widgets/PriceSlider.css'; - export default { components: { VueSlider, diff --git a/examples/vue/e-commerce/src/main.js b/examples/vue/e-commerce/src/main.js index 6c0a207513..f8313f697e 100644 --- a/examples/vue/e-commerce/src/main.js +++ b/examples/vue/e-commerce/src/main.js @@ -1,6 +1,10 @@ import Vue from 'vue'; import InstantSearch from 'vue-instantsearch'; +import './Theme.css'; +import './App.css'; +import './App.mobile.css'; +import './widgets/PriceSlider.css'; import App from './App.vue'; Vue.use(InstantSearch); diff --git a/examples/vue/e-commerce/vite.config.mjs b/examples/vue/e-commerce/vite.config.mjs new file mode 100644 index 0000000000..60569b9043 --- /dev/null +++ b/examples/vue/e-commerce/vite.config.mjs @@ -0,0 +1,7 @@ +import vue from '@vitejs/plugin-vue2'; +import { defineConfig } from 'vite'; +import commonjs from 'vite-plugin-commonjs'; + +export default defineConfig({ + plugins: [commonjs(), vue()], +}); diff --git a/examples/vue/e-commerce/vue.config.js b/examples/vue/e-commerce/vue.config.js deleted file mode 100644 index 9714eb69ad..0000000000 --- a/examples/vue/e-commerce/vue.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - publicPath: '/examples/vue/e-commerce', - devServer: { - disableHostCheck: true, - }, -}; diff --git a/examples/vue/getting-started/README.md b/examples/vue/getting-started/README.md index db39630746..db18a97795 100644 --- a/examples/vue/getting-started/README.md +++ b/examples/vue/getting-started/README.md @@ -4,20 +4,20 @@ _This project was generated with [create-instantsearch-app](https://github.com/algolia/instantsearch/tree/master/packages/create-instantsearch-app) by [Algolia](https://algolia.com)._ -## Get started +## Project setup -To run this project locally, install the dependencies and run the local server: - -```sh -npm install -npm start +``` +yarn install ``` -Alternatively, you may use [Yarn](https://http://yarnpkg.com/): +### Compiles and hot-reloads for development -```sh -yarn -yarn start +``` +yarn run dev ``` -Open http://localhost:3000 to see your app. +### Compiles and minifies for production + +``` +yarn run build +``` diff --git a/examples/vue/getting-started/public/index.html b/examples/vue/getting-started/index.html similarity index 89% rename from examples/vue/getting-started/public/index.html rename to examples/vue/getting-started/index.html index 09f24212a0..e44e3bf2e2 100644 --- a/examples/vue/getting-started/public/index.html +++ b/examples/vue/getting-started/index.html @@ -4,7 +4,7 @@ - + + diff --git a/examples/vue/getting-started/package.json b/examples/vue/getting-started/package.json index 4e07bdaffe..fcc1d8185b 100644 --- a/examples/vue/getting-started/package.json +++ b/examples/vue/getting-started/package.json @@ -3,26 +3,22 @@ "version": "1.0.20", "private": true, "scripts": { - "start": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve --port 3000", - "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build" + "dev": "vite", + "build": "vite build", + "preview": "vite preview" }, "dependencies": { "algoliasearch": "4.14.3", - "core-js": "2", "instantsearch.js": "4.62.0", "vue": "2.7.14", "vue-instantsearch": "4.13.1" }, "devDependencies": { - "@vue/cli-plugin-babel": "3.12.1", - "@vue/cli-service": "3.12.1", + "vite": "5.0.7", + "vite-plugin-commonjs": "0.10.0", + "@vitejs/plugin-vue2": "2.3.1", "vue-template-compiler": "2.7.14" }, - "postcss": { - "plugins": { - "autoprefixer": {} - } - }, "browserslist": [ "> 1%", "last 2 versions", diff --git a/examples/vue/getting-started/vite.config.mjs b/examples/vue/getting-started/vite.config.mjs new file mode 100644 index 0000000000..60569b9043 --- /dev/null +++ b/examples/vue/getting-started/vite.config.mjs @@ -0,0 +1,7 @@ +import vue from '@vitejs/plugin-vue2'; +import { defineConfig } from 'vite'; +import commonjs from 'vite-plugin-commonjs'; + +export default defineConfig({ + plugins: [commonjs(), vue()], +}); diff --git a/examples/vue/getting-started/vue.config.js b/examples/vue/getting-started/vue.config.js deleted file mode 100644 index dfb359974a..0000000000 --- a/examples/vue/getting-started/vue.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - devServer: { - disableHostCheck: true, - }, -}; diff --git a/examples/vue/media/README.md b/examples/vue/media/README.md index 80a6ead75c..7ae1e6dfd1 100644 --- a/examples/vue/media/README.md +++ b/examples/vue/media/README.md @@ -11,7 +11,7 @@ yarn install ### Compiles and hot-reloads for development ``` -yarn run serve +yarn run dev ``` ### Compiles and minifies for production @@ -19,9 +19,3 @@ yarn run serve ``` yarn run build ``` - -### Lints and fixes files - -``` -yarn run lint -``` diff --git a/examples/vue/media/public/index.html b/examples/vue/media/index.html similarity index 88% rename from examples/vue/media/public/index.html rename to examples/vue/media/index.html index 5b3c53d619..96d30c497b 100644 --- a/examples/vue/media/public/index.html +++ b/examples/vue/media/index.html @@ -16,7 +16,7 @@ rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@7.1.0/themes/algolia-min.css" /> - + media @@ -28,6 +28,6 @@ >
- + diff --git a/examples/vue/media/package.json b/examples/vue/media/package.json index 1832887770..0534d940b7 100644 --- a/examples/vue/media/package.json +++ b/examples/vue/media/package.json @@ -3,27 +3,23 @@ "version": "0.34.0", "private": true, "scripts": { - "serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", - "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", - "website:examples": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build --dest ../../../website/examples/vue/media" + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "website:examples": "vite build --outDir ../../../website/examples/vue/media --base /examples/vue/media" }, "dependencies": { "algoliasearch": "4.14.3", - "core-js": "2", "instantsearch.js": "4.62.0", "vue": "2.7.14", "vue-instantsearch": "4.13.1" }, "devDependencies": { - "@vue/cli-plugin-babel": "3.12.1", - "@vue/cli-service": "3.12.1", + "vite": "5.0.7", + "vite-plugin-commonjs": "0.10.0", + "@vitejs/plugin-vue2": "2.3.1", "vue-template-compiler": "2.7.14" }, - "postcss": { - "plugins": { - "autoprefixer": {} - } - }, "browserslist": [ "> 1%", "last 2 versions", diff --git a/examples/vue/media/src/App.vue b/examples/vue/media/src/App.vue index 6a32d6a2b5..c4293840ab 100644 --- a/examples/vue/media/src/App.vue +++ b/examples/vue/media/src/App.vue @@ -116,8 +116,6 @@ import algoliasearch from 'algoliasearch/lite'; import { history as historyRouter } from 'instantsearch.js/es/lib/routers'; import { simple as simpleMapping } from 'instantsearch.js/es/lib/stateMappings'; -import './App.css'; - export default { data() { return { diff --git a/examples/vue/media/src/main.js b/examples/vue/media/src/main.js index 6c0a207513..7389d703e2 100644 --- a/examples/vue/media/src/main.js +++ b/examples/vue/media/src/main.js @@ -1,6 +1,7 @@ import Vue from 'vue'; import InstantSearch from 'vue-instantsearch'; +import './App.css'; import App from './App.vue'; Vue.use(InstantSearch); diff --git a/examples/vue/media/vite.config.mjs b/examples/vue/media/vite.config.mjs new file mode 100644 index 0000000000..60569b9043 --- /dev/null +++ b/examples/vue/media/vite.config.mjs @@ -0,0 +1,7 @@ +import vue from '@vitejs/plugin-vue2'; +import { defineConfig } from 'vite'; +import commonjs from 'vite-plugin-commonjs'; + +export default defineConfig({ + plugins: [commonjs(), vue()], +}); diff --git a/examples/vue/media/vue.config.js b/examples/vue/media/vue.config.js deleted file mode 100644 index e956a5b790..0000000000 --- a/examples/vue/media/vue.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - publicPath: './', - devServer: { - disableHostCheck: true, - }, -}; diff --git a/specs/package.json b/specs/package.json index b3f4562fd3..d9f6afe1b5 100644 --- a/specs/package.json +++ b/specs/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@types/node": "18.11.13", - "astro": "1.6.14", + "astro": "4.0.4", "instantsearch.css": "8.1.0", "sass": "1.56.2" } diff --git a/specs/src/components/Header.astro b/specs/src/components/Header.astro index ee2b844a72..7c3f3c8f63 100644 --- a/specs/src/components/Header.astro +++ b/specs/src/components/Header.astro @@ -10,9 +10,9 @@ const { BASE_URL } = import.meta.env;