Skip to content

Commit 20a99b7

Browse files
meili-bors[bot]flevi29Strift
authored
Merge #1373
1373: Bring repository in line with `meilisearch-js` maintenance-wise, and bump meilisearch from 0.47.0 to 0.48.2 r=Strift a=flevi29 # Pull Request There's simply too much here to properly describe. I've been at this for way too long, and I'm tired. If anything unwanted is spotted, do tell me, but I really don't wish to work on this for a while, so feel free to make changes. I am very sorry for the amount of changes, but it would've been too much work to gradually adapt all of these things. - Jest -> Vitest - Rollup & Parcel -> Vite - `"type": "module"` - update `meilisearch-js` to latest version - update everything else that caused a conflict to the latest version, for the most part, and adapt code - other minor things, like adapting `tsdoc` ESLint and Prettier plugin ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: F. Levi <[email protected]> Co-authored-by: Laurent Cazanove <[email protected]>
2 parents 8df981a + 17b666a commit 20a99b7

File tree

167 files changed

+3758
-8087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+3758
-8087
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ignore": [
1111
"@meilisearch/geo-playground",
1212
"@meilisearch/vanilla-playground",
13-
"@meilisearch/vue3-ts-playground",
13+
"@meilisearch/vue3-playground",
1414
"@meilisearch/react-playground",
1515
"@meilisearch/local-react-playground",
1616
"@meilisearch/node-playground",

.changeset/strong-dodos-carry.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/sweet-shrimps-hunt.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@meilisearch/autocomplete-client": minor
3+
"@meilisearch/instant-meilisearch": minor
4+
---
5+
6+
- Jest -> Vitest
7+
- Rollup -> Vite
8+
- `"type": "module"`
9+
- update `meilisearch-js` to latest version
10+
- update everything else that caused a conflict to the latest version, and adapt code

.github/workflows/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
project: ./playgrounds/autocomplete
4949
wait-on: 'http://localhost:7700'
5050
# Tests are only done on one playground to avoid long testing time
51+
# TODO: This is a flaky one, it is not awaited before cypress starts running tests
5152
start: yarn playground:autocomplete
5253
env: playground=local
5354
- uses: actions/upload-artifact@v4
@@ -164,7 +165,7 @@ jobs:
164165
- name: Install dependencies
165166
run: yarn install
166167
- name: Tests style
167-
run: yarn lint
168+
run: yarn style
168169
- name: Yaml Style
169170
uses: ibiqlik/action-yamllint@v3
170171
with:

.prettierrc.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// https://prettier.io/docs/en/options.html
2+
3+
export default {
4+
plugins: ['./node_modules/prettier-plugin-jsdoc/dist/index.js'],
5+
// https://github.com/hosseinmd/prettier-plugin-jsdoc#tsdoc
6+
tsdoc: true,
7+
// TODO: Remove everything underneath and remove .editorconfig!
8+
singleQuote: true,
9+
arrowParens: 'always',
10+
semi: false,
11+
bracketSpacing: true,
12+
trailingComma: 'es5',
13+
printWidth: 80,
14+
}

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ yarn --dev
3737
Each PR should pass the tests and the linter to be accepted.
3838

3939
```bash
40-
# Tests with Jest
40+
# Tests with Vitest
4141
docker pull getmeili/meilisearch:latest # Fetch the latest version of Meilisearch image from Docker Hub
4242
docker run -p 7700:7700 getmeili/meilisearch:latest meilisearch --master-key=masterKey --no-analytics
4343
# Integration tests
4444
yarn test
4545
# End-to-end tests
4646
yarn test:e2e
4747
# Linter
48-
yarn lint
48+
yarn style
4949
# Linter with fixing
50-
yarn lint:fix
50+
yarn style:fix
5151
# Build the project
5252
yarn build
5353
```

eslint.config.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import eslint from '@eslint/js'
2+
import tseslint from 'typescript-eslint'
3+
import tsdoc from 'eslint-plugin-tsdoc'
4+
import vitest from '@vitest/eslint-plugin'
5+
import globals from 'globals'
6+
import prettier from 'eslint-config-prettier'
7+
import pluginCypress from 'eslint-plugin-cypress/flat'
8+
import pluginReact from 'eslint-plugin-react'
9+
import pluginVue from 'eslint-plugin-vue'
10+
11+
export default tseslint.config([
12+
{ ignores: ['{packages,playgrounds}/*/dist/'] },
13+
eslint.configs.recommended,
14+
{
15+
files: ['**/*.{js,cjs,mjs}'],
16+
languageOptions: { globals: globals.node },
17+
},
18+
// TSDoc
19+
{
20+
// TODO: Ignore test files between src files
21+
files: ['packages/*/src/**/*.ts'],
22+
plugins: { tsdoc },
23+
rules: { 'tsdoc/syntax': 'off' },
24+
},
25+
// Vue
26+
{
27+
files: ['playgrounds/vue3/src/*.{js,vue}'],
28+
extends: [pluginVue.configs['flat/recommended']],
29+
},
30+
// React
31+
{
32+
files: ['playgrounds/{local-react,react}/src/*.jsx'],
33+
extends: [
34+
pluginReact.configs.flat.recommended,
35+
pluginReact.configs.flat['jsx-runtime'],
36+
],
37+
settings: { react: { version: 'detect' } },
38+
languageOptions: { globals: globals.browser },
39+
// TODO: Remove rules
40+
rules: {
41+
'react/prop-types': 'off',
42+
},
43+
},
44+
// Cypress
45+
{
46+
files: [
47+
'playgrounds/{autocomplete,local-react}/cypress/integration/*.spec.js',
48+
],
49+
extends: [pluginCypress.configs.recommended],
50+
// TODO: Remove rules
51+
rules: {
52+
'cypress/no-unnecessary-waiting': 'off',
53+
'cypress/unsafe-to-chain-command': 'off',
54+
},
55+
},
56+
// TypeScript
57+
{
58+
files: ['**/*.ts'],
59+
extends: [tseslint.configs.recommendedTypeChecked],
60+
languageOptions: {
61+
parserOptions: {
62+
projectService: true,
63+
tsconfigRootDir: import.meta.dirname,
64+
},
65+
},
66+
rules: {
67+
// TODO: Remove the ones between "~~", adapt code
68+
// ~~
69+
'@typescript-eslint/ban-ts-comment': 'off',
70+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
71+
'@typescript-eslint/no-unsafe-call': 'off',
72+
'@typescript-eslint/no-unsafe-member-access': 'off',
73+
'@typescript-eslint/no-unsafe-return': 'off',
74+
'@typescript-eslint/no-unsafe-assignment': 'off',
75+
'@typescript-eslint/no-unsafe-argument': 'off',
76+
'@typescript-eslint/no-redundant-type-constituents': 'off',
77+
// ~~
78+
'@typescript-eslint/array-type': ['off', { default: 'array-simple' }],
79+
// TODO: Should be careful with this rule, should leave it be and disable
80+
// it within files where necessary with explanations
81+
'@typescript-eslint/no-explicit-any': 'off',
82+
'@typescript-eslint/no-unused-vars': [
83+
'error',
84+
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
85+
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
86+
{ args: 'all', argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
87+
],
88+
},
89+
},
90+
// Vitest
91+
{
92+
files: ['packages/*/{src,__tests__}/**/*.test.ts'],
93+
extends: [vitest.configs.recommended],
94+
// TODO: Remove rules
95+
rules: {
96+
'vitest/no-identical-title': 'off',
97+
'vitest/valid-title': 'off',
98+
},
99+
},
100+
// Disable any style linting, as prettier takes care of that separately
101+
prettier,
102+
])

package.json

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"name": "root",
32
"private": true,
43
"license": "MIT",
54
"repository": {
@@ -10,43 +9,58 @@
109
"packages/*",
1110
"playgrounds/*"
1211
],
12+
"type": "module",
1313
"scripts": {
14-
"playground:geosearch": "turbo run dev --filter=@meilisearch/geo-playground --parallel",
15-
"playground:vanilla": "turbo run dev --filter=@meilisearch/vanilla-playground --parallel",
16-
"playground:vue3": "turbo run dev --filter=@meilisearch/vue3-ts-playground --parallel",
17-
"playground:react": "turbo run dev --filter=@meilisearch/react-playground --parallel",
18-
"playground:local-react": "turbo run dev --filter=@meilisearch/local-react-playground --parallel",
19-
"playground:node": "turbo run dev --filter=@meilisearch/node-playground --parallel",
20-
"playground:autocomplete": "turbo run dev --filter=@meilisearch/autocomplete-playground --parallel",
21-
"test:e2e": "turbo run test:e2e",
22-
"test:e2e:watch": "turbo run test:e2e:watch",
23-
"lint": "turbo lint",
24-
"lint:fix": "turbo lint:fix",
25-
"build": "turbo run build",
26-
"test": "turbo test",
27-
"test:watch": "turbo run test:watch",
28-
"instant-meilisearch:test:watch": "yarn --cwd ./packages/instant-meilisearch test:watch",
29-
"autocomplete:test:watch": "yarn --cwd ./packages/autocomplete-client test:watch",
30-
"test:types": "turbo run test:types",
14+
"playground:geosearch": "turbo @meilisearch/geo-playground#dev",
15+
"playground:vanilla": "turbo @meilisearch/vanilla-playground#dev",
16+
"playground:vue3": "turbo @meilisearch/vue3-playground#dev",
17+
"playground:react": "turbo @meilisearch/react-playground#dev",
18+
"playground:local-react": "turbo @meilisearch/local-react-playground#dev",
19+
"playground:node": "turbo @meilisearch/node-playground#dev",
20+
"playground:autocomplete": "turbo @meilisearch/autocomplete-playground#dev",
21+
"test:e2e": "turbo test:e2e",
22+
"test:e2e:watch": "turbo test:e2e:watch",
23+
"fmt": "prettier -c ./**/*.{js,ts,cjs,mjs,jsx,vue}",
24+
"fmt:fix": "prettier -w ./**/*.{js,ts,cjs,mjs,jsx,vue}",
25+
"lint": "eslint",
26+
"lint:fix": "eslint --fix",
27+
"style": "yarn fmt && yarn lint",
28+
"style:fix": "yarn fmt:fix && yarn lint:fix",
29+
"build": "turbo build",
30+
"test": "yarn build && vitest run",
31+
"test:watch": "yarn build && vitest",
32+
"instant-meilisearch:test:watch": "vitest --project \"@meilisearch/instant-meilisearch\"",
33+
"autocomplete:test:watch": "vitest --project \"@meilisearch/autocomplete-client\"",
34+
"test:types": "yarn build && tsc --noEmit",
3135
"version-packages": "changeset version && turbo version",
3236
"release": "yarn build && changeset publish"
3337
},
3438
"devDependencies": {
35-
"@testing-library/dom": "^9.2.0",
36-
"@testing-library/jest-dom": "^5.16.5",
37-
"@types/jest": "^29.5.1",
38-
"@types/jest-diff": "^24.3.0",
39-
"parcel": "^2.12.0",
40-
"turbo": "^2.1.3"
41-
},
42-
"dependencies": {
39+
"vite": "^6.0.9",
40+
"concurrently": "^9.1.2",
41+
"vitest": "^3.0.2",
42+
"cypress": "^8.6.0",
43+
"turbo": "^2.3.3",
44+
"algoliasearch-helper": "^3.23.0",
4345
"@changesets/cli": "^2.26.1",
44-
"instantsearch.css": "^8.0.0"
45-
},
46-
"alias": {
47-
"node:crypto": false,
48-
"node:buffer": false,
49-
"node:process": false
46+
"@algolia/client-search": "^4.24.0",
47+
"typescript": "^5.7.3",
48+
"algoliasearch": "^5.19.0",
49+
"search-insights": "^2.17.3",
50+
"prettier": "^3.4.2",
51+
"prettier-plugin-jsdoc": "^1.3.0",
52+
"@eslint/js": "^9.16.0",
53+
"@types/eslint__js": "^8.42.3",
54+
"eslint": "^9.16.0",
55+
"eslint-plugin-tsdoc": "^0.4.0",
56+
"eslint-plugin-react": "^7.37.4",
57+
"@vitest/eslint-plugin": "^1.1.23",
58+
"eslint-config-prettier": "^9.1.0",
59+
"@typescript-eslint/utils": "^8.19.0",
60+
"globals": "^15.14.0",
61+
"eslint-plugin-vue": "^9.32.0",
62+
"typescript-eslint": "^8.19.0",
63+
"eslint-plugin-cypress": "^4.1.0"
5064
},
5165
"packageManager": "[email protected]"
5266
}

packages/autocomplete-client/.babelrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/autocomplete-client/.eslintrc.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/autocomplete-client/__tests__/test.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { meilisearchAutocompleteClient } from '../src'
1+
import { meilisearchAutocompleteClient } from '../src/index.js'
22
import { MeiliSearch } from 'meilisearch'
33

44
const dataset = [

packages/autocomplete-client/jest.config.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)