Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring repository in line with meilisearch-js maintenance-wise, and bump meilisearch from 0.47.0 to 0.48.2 #1373

Merged
merged 35 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
df3ae9f
Switch tester to Vitest
flevi29 Jan 20, 2025
9a9544f
Add changeset, fix tests
flevi29 Jan 20, 2025
91c9b3b
Update TypeScript, adjust config, adjust package exports
flevi29 Jan 20, 2025
3cdeffc
Delete useless tsconfig
flevi29 Jan 20, 2025
2eaf3df
Moved from Rollup to Vite, and more
flevi29 Jan 20, 2025
1a5e7fa
Fix inter-dependency issues with main tests
flevi29 Jan 20, 2025
39b51e6
Adapt and fix one playground
flevi29 Jan 20, 2025
f4b1f90
Adapt and fix one playground
flevi29 Jan 20, 2025
5f734e7
Adapt and fix playgrounds
flevi29 Jan 21, 2025
07edb2b
Fix Node.js 18 incompat
flevi29 Jan 21, 2025
2879369
Fix Node.js playground
flevi29 Jan 21, 2025
ff01084
Try and fix tests
flevi29 Jan 21, 2025
011d1cc
Fix script
flevi29 Jan 21, 2025
19f8472
Try and fix tests
flevi29 Jan 21, 2025
b6d6c3d
Configure turbo, other
flevi29 Jan 21, 2025
eb69c0e
Configure turbo, scripts
flevi29 Jan 21, 2025
067e607
Fix types test
flevi29 Jan 21, 2025
5c174e9
Fix types test
flevi29 Jan 21, 2025
3d10392
Misc
flevi29 Jan 21, 2025
c368ae8
Update Prettier and ESLint, adapt code
flevi29 Jan 21, 2025
3d2d662
Reverse @algolia/client-search update
flevi29 Jan 21, 2025
b1f773e
Add React ESLint
flevi29 Jan 21, 2025
2c16e0d
Add Vue ESLint
flevi29 Jan 21, 2025
3381c50
Fix formatting
flevi29 Jan 21, 2025
fe45115
Add changeset
flevi29 Jan 21, 2025
2a51ed8
Misc
flevi29 Jan 21, 2025
c742d6c
Apply formatting to more files
flevi29 Jan 21, 2025
c517587
Delete unused ESLint config files
flevi29 Jan 21, 2025
533b161
Remove coverage, as there is no coverage tracking for this repository
flevi29 Jan 21, 2025
9d55ab6
Update packages/instant-meilisearch/src/adapter/search-request-adapte…
Strift Jan 22, 2025
e735abd
Run lint:fix
Strift Jan 22, 2025
055e2ea
Update jsdoc and run style:fix
Strift Jan 22, 2025
973a6f0
Remove external dependencies from bundle
Strift Jan 22, 2025
0e4d0d7
Clarify comment
Strift Jan 22, 2025
17b666a
Run style:fix
Strift Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ignore": [
"@meilisearch/geo-playground",
"@meilisearch/vanilla-playground",
"@meilisearch/vue3-ts-playground",
"@meilisearch/vue3-playground",
"@meilisearch/react-playground",
"@meilisearch/local-react-playground",
"@meilisearch/node-playground",
Expand Down
6 changes: 0 additions & 6 deletions .changeset/strong-dodos-carry.md

This file was deleted.

10 changes: 10 additions & 0 deletions .changeset/sweet-shrimps-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@meilisearch/autocomplete-client": minor
"@meilisearch/instant-meilisearch": minor
---

- Jest -> Vitest
- Rollup -> Vite
- `"type": "module"`
- update `meilisearch-js` to latest version
- update everything else that caused a conflict to the latest version, and adapt code
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
project: ./playgrounds/autocomplete
wait-on: 'http://localhost:7700'
# Tests are only done on one playground to avoid long testing time
# TODO: This is a flaky one, it is not awaited before cypress starts running tests
start: yarn playground:autocomplete
env: playground=local
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -164,7 +165,7 @@ jobs:
- name: Install dependencies
run: yarn install
- name: Tests style
run: yarn lint
run: yarn style
- name: Yaml Style
uses: ibiqlik/action-yamllint@v3
with:
Expand Down
14 changes: 14 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// https://prettier.io/docs/en/options.html

export default {
plugins: ['./node_modules/prettier-plugin-jsdoc/dist/index.js'],
// https://github.com/hosseinmd/prettier-plugin-jsdoc#tsdoc
tsdoc: true,
// TODO: Remove everything underneath and remove .editorconfig!
singleQuote: true,
arrowParens: 'always',
semi: false,
bracketSpacing: true,
trailingComma: 'es5',
printWidth: 80,
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ yarn --dev
Each PR should pass the tests and the linter to be accepted.

```bash
# Tests with Jest
# Tests with Vitest
docker pull getmeili/meilisearch:latest # Fetch the latest version of Meilisearch image from Docker Hub
docker run -p 7700:7700 getmeili/meilisearch:latest meilisearch --master-key=masterKey --no-analytics
# Integration tests
yarn test
# End-to-end tests
yarn test:e2e
# Linter
yarn lint
yarn style
# Linter with fixing
yarn lint:fix
yarn style:fix
# Build the project
yarn build
```
Expand Down
102 changes: 102 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import tsdoc from 'eslint-plugin-tsdoc'
import vitest from '@vitest/eslint-plugin'
import globals from 'globals'
import prettier from 'eslint-config-prettier'
import pluginCypress from 'eslint-plugin-cypress/flat'
import pluginReact from 'eslint-plugin-react'
import pluginVue from 'eslint-plugin-vue'

export default tseslint.config([
{ ignores: ['{packages,playgrounds}/*/dist/'] },
eslint.configs.recommended,
{
files: ['**/*.{js,cjs,mjs}'],
languageOptions: { globals: globals.node },
},
// TSDoc
{
// TODO: Ignore test files between src files
files: ['packages/*/src/**/*.ts'],
plugins: { tsdoc },
rules: { 'tsdoc/syntax': 'off' },
},
// Vue
{
files: ['playgrounds/vue3/src/*.{js,vue}'],
extends: [pluginVue.configs['flat/recommended']],
},
// React
{
files: ['playgrounds/{local-react,react}/src/*.jsx'],
extends: [
pluginReact.configs.flat.recommended,
pluginReact.configs.flat['jsx-runtime'],
],
settings: { react: { version: 'detect' } },
languageOptions: { globals: globals.browser },
// TODO: Remove rules
rules: {
'react/prop-types': 'off',
},
},
// Cypress
{
files: [
'playgrounds/{autocomplete,local-react}/cypress/integration/*.spec.js',
],
extends: [pluginCypress.configs.recommended],
// TODO: Remove rules
rules: {
'cypress/no-unnecessary-waiting': 'off',
'cypress/unsafe-to-chain-command': 'off',
},
},
// TypeScript
{
files: ['**/*.ts'],
extends: [tseslint.configs.recommendedTypeChecked],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// TODO: Remove the ones between "~~", adapt code
// ~~
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
// ~~
'@typescript-eslint/array-type': ['off', { default: 'array-simple' }],
// TODO: Should be careful with this rule, should leave it be and disable
// it within files where necessary with explanations
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
{ args: 'all', argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},
// Vitest
{
files: ['packages/*/{src,__tests__}/**/*.test.ts'],
extends: [vitest.configs.recommended],
// TODO: Remove rules
rules: {
'vitest/no-identical-title': 'off',
'vitest/valid-title': 'off',
},
},
// Disable any style linting, as prettier takes care of that separately
prettier,
])
78 changes: 46 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"name": "root",
"private": true,
"license": "MIT",
"repository": {
Expand All @@ -10,43 +9,58 @@
"packages/*",
"playgrounds/*"
],
"type": "module",
"scripts": {
"playground:geosearch": "turbo run dev --filter=@meilisearch/geo-playground --parallel",
"playground:vanilla": "turbo run dev --filter=@meilisearch/vanilla-playground --parallel",
"playground:vue3": "turbo run dev --filter=@meilisearch/vue3-ts-playground --parallel",
"playground:react": "turbo run dev --filter=@meilisearch/react-playground --parallel",
"playground:local-react": "turbo run dev --filter=@meilisearch/local-react-playground --parallel",
"playground:node": "turbo run dev --filter=@meilisearch/node-playground --parallel",
"playground:autocomplete": "turbo run dev --filter=@meilisearch/autocomplete-playground --parallel",
"test:e2e": "turbo run test:e2e",
"test:e2e:watch": "turbo run test:e2e:watch",
"lint": "turbo lint",
"lint:fix": "turbo lint:fix",
"build": "turbo run build",
"test": "turbo test",
"test:watch": "turbo run test:watch",
"instant-meilisearch:test:watch": "yarn --cwd ./packages/instant-meilisearch test:watch",
"autocomplete:test:watch": "yarn --cwd ./packages/autocomplete-client test:watch",
"test:types": "turbo run test:types",
"playground:geosearch": "turbo @meilisearch/geo-playground#dev",
"playground:vanilla": "turbo @meilisearch/vanilla-playground#dev",
"playground:vue3": "turbo @meilisearch/vue3-playground#dev",
"playground:react": "turbo @meilisearch/react-playground#dev",
"playground:local-react": "turbo @meilisearch/local-react-playground#dev",
"playground:node": "turbo @meilisearch/node-playground#dev",
"playground:autocomplete": "turbo @meilisearch/autocomplete-playground#dev",
"test:e2e": "turbo test:e2e",
"test:e2e:watch": "turbo test:e2e:watch",
"fmt": "prettier -c ./**/*.{js,ts,cjs,mjs,jsx,vue}",
"fmt:fix": "prettier -w ./**/*.{js,ts,cjs,mjs,jsx,vue}",
"lint": "eslint",
"lint:fix": "eslint --fix",
"style": "yarn fmt && yarn lint",
"style:fix": "yarn fmt:fix && yarn lint:fix",
"build": "turbo build",
"test": "yarn build && vitest run",
"test:watch": "yarn build && vitest",
"instant-meilisearch:test:watch": "vitest --project \"@meilisearch/instant-meilisearch\"",
"autocomplete:test:watch": "vitest --project \"@meilisearch/autocomplete-client\"",
"test:types": "yarn build && tsc --noEmit",
"version-packages": "changeset version && turbo version",
"release": "yarn build && changeset publish"
},
"devDependencies": {
"@testing-library/dom": "^9.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@types/jest": "^29.5.1",
"@types/jest-diff": "^24.3.0",
"parcel": "^2.12.0",
"turbo": "^2.1.3"
},
"dependencies": {
"vite": "^6.0.9",
"concurrently": "^9.1.2",
"vitest": "^3.0.2",
"cypress": "^8.6.0",
"turbo": "^2.3.3",
"algoliasearch-helper": "^3.23.0",
"@changesets/cli": "^2.26.1",
"instantsearch.css": "^8.0.0"
},
"alias": {
"node:crypto": false,
"node:buffer": false,
"node:process": false
"@algolia/client-search": "^4.24.0",
"typescript": "^5.7.3",
"algoliasearch": "^5.19.0",
"search-insights": "^2.17.3",
"prettier": "^3.4.2",
"prettier-plugin-jsdoc": "^1.3.0",
"@eslint/js": "^9.16.0",
"@types/eslint__js": "^8.42.3",
"eslint": "^9.16.0",
"eslint-plugin-tsdoc": "^0.4.0",
"eslint-plugin-react": "^7.37.4",
"@vitest/eslint-plugin": "^1.1.23",
"eslint-config-prettier": "^9.1.0",
"@typescript-eslint/utils": "^8.19.0",
"globals": "^15.14.0",
"eslint-plugin-vue": "^9.32.0",
"typescript-eslint": "^8.19.0",
"eslint-plugin-cypress": "^4.1.0"
},
"packageManager": "[email protected]"
}
12 changes: 0 additions & 12 deletions packages/autocomplete-client/.babelrc

This file was deleted.

5 changes: 0 additions & 5 deletions packages/autocomplete-client/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/autocomplete-client/__tests__/test.utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { meilisearchAutocompleteClient } from '../src'
import { meilisearchAutocompleteClient } from '../src/index.js'
import { MeiliSearch } from 'meilisearch'

const dataset = [
Expand Down
34 changes: 0 additions & 34 deletions packages/autocomplete-client/jest.config.js

This file was deleted.

Loading
Loading