Skip to content

Commit

Permalink
Merge branch 'main' into improve-http-request
Browse files Browse the repository at this point in the history
  • Loading branch information
flevi29 authored Dec 27, 2024
2 parents 8f29bc2 + 896b5c0 commit edff9a9
Show file tree
Hide file tree
Showing 19 changed files with 400 additions and 223 deletions.
5 changes: 1 addition & 4 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,7 @@ tenant_token_guide_generate_sdk_1: |-
const apiKeyUid = '85c3c2f9-bdd6-41f1-abd8-11fcf80e0f76'
const expiresAt = new Date('2025-12-20') // optional
const token = await generateTenantToken(apiKeyUid, searchRules, {
apiKey: apiKey,
expiresAt: expiresAt,
})
const token = await generateTenantToken({ apiKey, apiKeyUid, searchRules, expiresAt })
tenant_token_guide_search_sdk_1: |-
const frontEndClient = new MeiliSearch({ host: 'http://localhost:7700', apiKey: token })
frontEndClient.index('patient_medical_records').search('blood test')
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume

To run this project, you will need:

- Node.js >= v16 and node <= 18
- Yarn
- vitest
- Node >= v18 and Node <= 20
- Yarn v1.x

### Setup

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ We recommend installing `meilisearch-js` in your project with your package manag
npm install meilisearch
```

`meilisearch-js` officially supports `node` versions >= 14 and <= 18.
`meilisearch-js` officially supports `node` versions 18 LTS and 20 LTS.

Instead of using a package manager, you may also import the library directly into your [HTML via a CDN](#include-script-tag).

Expand Down
50 changes: 23 additions & 27 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,31 @@ const vitest = require("@vitest/eslint-plugin");
const globals = require("globals");
const prettier = require("eslint-config-prettier");

/** @type {import("eslint").Linter.Config[]} */
module.exports = [
module.exports = tseslint.config([
{ ignores: ["dist/", "tests/env/", "coverage/", "playgrounds/", "docs/"] },
eslint.configs.recommended,
{
ignores: ["dist/", "tests/env/", "coverage/", "playgrounds/", "docs/"],
files: ["**/*.js"],
languageOptions: { sourceType: "commonjs", globals: globals.node },
},
// Standard linting for js files
// TSDoc
{
files: ["**/*.js"],
languageOptions: { sourceType: "script", globals: globals.node },
plugins: { eslint },
rules: eslint.configs.recommended.rules,
files: ["src/**/*.ts"],
plugins: { tsdoc },
rules: { "tsdoc/syntax": "error" },
},
// TypeScript linting for ts files
...tseslint.configs.recommendedTypeChecked.map((config) => ({
...config,
// TypeScript
{
files: ["**/*.ts"],
extends: [tseslint.configs.recommendedTypeChecked],
languageOptions: {
...config.languageOptions,
globals: { ...config.languageOptions?.globals, ...globals.node },
parserOptions: {
...config.languageOptions?.parserOptions,
project: "tsconfig.eslint.json",
projectService: true,
tsconfigRootDir: __dirname,
},
},
plugins: { ...config.plugins, tsdoc },
rules: {
...config.rules,
"tsdoc/syntax": "error",
// @TODO: Remove the ones between "~~", adapt code
// TODO: Remove the ones between "~~", adapt code
// ~~
"@typescript-eslint/prefer-as-const": "off",
"@typescript-eslint/ban-ts-comment": "off",
Expand All @@ -45,7 +41,7 @@ module.exports = [
"@typescript-eslint/no-floating-promises": "off",
// ~~
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
// @TODO: Should be careful with this rule, should leave it be and disable
// 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": [
Expand All @@ -54,16 +50,16 @@ module.exports = [
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
{ args: "all", argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
// @TODO: Not recommended to disable rule, should instead disable locally
// TODO: Not recommended to disable rule, should instead disable locally
// with explanation
"@typescript-eslint/ban-ts-ignore": "off",
},
})),
// Vitest linting for test files
},
// Vitest
{
files: ["tests/*.ts"],
plugins: { vitest },
rules: vitest.configs.recommended.rules,
files: ["tests/**/*.test.ts"],
extends: [vitest.configs.recommended],
},
// Disable any style linting, as prettier takes care of that separately
prettier,
];
]);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"style:fix": "yarn fmt:fix && yarn lint:fix",
"fmt": "prettier -c ./**/*.{js,ts}",
"fmt:fix": "prettier -w ./**/*.{js,ts}",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"lint": "eslint",
"lint:fix": "eslint --fix",
"typingsheader": "node scripts/build.js"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PLUGINS = [
typescript({
useTsconfigDeclarationDir: true,
tsconfigOverride: {
compilerOptions: { allowJs: false },
tsconfig: "tsconfig.build.json",
include: ["src"],
exclude: ["tests", "examples", "*.js", "scripts"],
},
Expand Down
Loading

0 comments on commit edff9a9

Please sign in to comment.