Skip to content

Format everything with prettier #1862

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug Report 🐞
about: Create a report to help us improve.
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

<!-- This is not an exhaustive model but a help. No step is mandatory. -->
Expand All @@ -21,6 +21,7 @@ What happened.
If applicable, add screenshots or logs to help explain your problem.

**Environment (please complete the following information):**

- OS: [e.g. Debian GNU/Linux]
- Meilisearch version: [e.g. v.0.20.0]
- meilisearch-js version: [e.g v0.18.2]
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature Request & Enhancement 💡
about: Suggest a new idea for the project.
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

<!-- This is not an exhaustive model but a help. No step is mandatory. -->
Expand Down
16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: 'monthly'
interval: "monthly"
labels:
- 'skip-changelog'
- 'dependencies'
- "skip-changelog"
- "dependencies"
rebase-strategy: disabled

- package-ecosystem: npm
directory: '/'
directory: "/"

schedule:
interval: 'monthly'
time: '04:00'
interval: "monthly"
time: "04:00"
open-pull-requests-limit: 10
labels:
- skip-changelog
Expand Down
44 changes: 22 additions & 22 deletions .github/release-draft-template.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name-template: 'v$RESOLVED_VERSION 🌻'
tag-template: 'v$RESOLVED_VERSION'
name-template: "v$RESOLVED_VERSION 🌻"
tag-template: "v$RESOLVED_VERSION"
exclude-labels:
- 'skip-changelog'
- "skip-changelog"
version-resolver:
minor:
labels:
- 'breaking-change'
- "breaking-change"
default: patch
categories:
- title: '⚠️ Breaking changes'
label: 'breaking-change'
- title: '🚀 Enhancements'
label: 'enhancement'
- title: '🐛 Bug Fixes'
label: 'bug'
- title: '🔒 Security'
label: 'security'
- title: '⚙️ Maintenance/misc'
- title: "⚠️ Breaking changes"
label: "breaking-change"
- title: "🚀 Enhancements"
label: "enhancement"
- title: "🐛 Bug Fixes"
label: "bug"
- title: "🔒 Security"
label: "security"
- title: "⚙️ Maintenance/misc"
label:
- 'maintenance'
- 'documentation'
- "maintenance"
- "documentation"
template: |
$CHANGES

Thanks again to $CONTRIBUTORS! 🎉
no-changes-template: 'Changes are coming soon 😎'
sort-direction: 'ascending'
no-changes-template: "Changes are coming soon 😎"
sort-direction: "ascending"
replacers:
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
replace: ''
replace: ""
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
replace: ''
replace: ""
- search: '/(?:and )?@bors(?:\[bot\])?,?/g'
replace: ''
- search: '/(?:and )?@meili-bot,?/g'
replace: ''
replace: ""
- search: "/(?:and )?@meili-bot,?/g"
replace: ""
14 changes: 7 additions & 7 deletions .github/workflows/meilisearch-prototype-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: Meilisearch prototype tests
on:
pull_request:
branches:
- 'prototype-beta/**'
- "prototype-beta/**"
push:
branches:
- 'prototype-beta/**'
- "prototype-beta/**"

jobs:
meilisearch-version:
Expand All @@ -31,18 +31,18 @@ jobs:
echo "meilisearch_version=$MEILISEARCH_VERSION" >> $GITHUB_OUTPUT
integration_tests:
runs-on: ubuntu-latest
needs: ['meilisearch-version']
needs: ["meilisearch-version"]
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
MEILI_MASTER_KEY: "masterKey"
MEILI_NO_ANALYTICS: "true"
ports:
- '7700:7700'
- "7700:7700"
strategy:
matrix:
node: ['18', '20', '22']
node: ["18", "20", "22"]
name: integration-tests (Node.js ${{ matrix.node }})
steps:
- uses: actions/checkout@v4
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ name: Pre-Release Tests
on:
pull_request:
branches:
- 'bump-meilisearch-v**'
- 'pre-release-beta/**'
- "bump-meilisearch-v**"
- "pre-release-beta/**"
push:
branches:
- 'bump-meilisearch-v**'
- 'pre-release-beta/**'
- "bump-meilisearch-v**"
- "pre-release-beta/**"

jobs:
meilisearch-version:
Expand All @@ -28,18 +28,18 @@ jobs:
integration_tests:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || startsWith(github.base_ref, 'bump-meilisearch-v') || startsWith(github.base_ref, 'pre-release-beta')
needs: ['meilisearch-version']
needs: ["meilisearch-version"]
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
MEILI_MASTER_KEY: "masterKey"
MEILI_NO_ANALYTICS: "true"
ports:
- '7700:7700'
- "7700:7700"
strategy:
matrix:
node: ['18', '20', '22']
node: ["18", "20", "22"]
name: integration-tests (Node.js ${{ matrix.node }})
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
with:
node-version: 22
registry-url: https://registry.npmjs.org/
cache: 'yarn'
cache: "yarn"
- name: Check release validity
run: sh .github/scripts/check-release.sh
- name: Check tag format
Expand All @@ -22,12 +22,12 @@ jobs:
- name: Build meilisearch-js
run: yarn build
- name: Publish with latest tag
if: '!github.event.release.prerelease'
if: !github.event.release.prerelease
run: npm publish .
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish with beta tag
if: 'github.event.release.prerelease'
if: github.event.release.prerelease
run: npm publish . --tag beta
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ jobs:
meilisearch:
image: getmeili/meilisearch:latest
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
MEILI_MASTER_KEY: "masterKey"
MEILI_NO_ANALYTICS: "true"
ports:
- '7700:7700'
- "7700:7700"
strategy:
fail-fast: false
matrix:
node: ['18', '20', '22']
node: ["18", "20", "22"]
name: integration-tests (Node.js ${{ matrix.node }})
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "yarn"
- name: Install dependencies
run: yarn --dev
- name: Run tests
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
cache: "yarn"
- name: Install dependencies
run: yarn --dev
- name: Run code style check
Expand All @@ -88,7 +88,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
cache: "yarn"
- name: Install dependencies
run: yarn --dev
- name: Build project
Expand Down
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
node_modules
dist
/tests/env
/coverage
*.md
tests/env/browser/meilisearch.umd.js
45 changes: 26 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ First of all, thank you for contributing to Meilisearch! The goal of this docume
4. Review the [Development Workflow](#development-workflow) section that describes the steps to maintain the repository.
5. Make the changes on your branch.
6. [Submit the branch as a PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) pointing to the `main` branch of the main meilisearch-js repository. A maintainer should comment and/or review your Pull Request within a few days. Although depending on the circumstances, it may take longer.<br>
We do not enforce a naming convention for the PRs, but **please use something descriptive of your changes**, having in mind that the title of your PR will be automatically added to the next [release changelog](https://github.com/meilisearch/meilisearch-js/releases/).
We do not enforce a naming convention for the PRs, but **please use something descriptive of your changes**, having in mind that the title of your PR will be automatically added to the next [release changelog](https://github.com/meilisearch/meilisearch-js/releases/).

## Development Workflow

Expand All @@ -42,6 +42,7 @@ To run this project, you will need:
You can set up your local environment natively or using `docker`, check out the [`docker-compose.yml`](/docker-compose.yml).

Example of running all the checks with docker:

```bash
docker-compose run --rm package bash -c "yarn install && yarn test && yarn lint"
```
Expand Down Expand Up @@ -79,6 +80,7 @@ We do not enforce any branch naming style, but please use something descriptive
### Git Commits

As minimal requirements, your commit message should:

- be capitalized
- not finish by a dot or any other punctuation character (!,?)
- start with a verb so that we can read your commit message this way: "This commit will ...", where "..." is the commit message.
Expand Down Expand Up @@ -119,13 +121,15 @@ _[Read more about this](https://github.com/meilisearch/integration-guides/blob/m
Make a PR modifying the following files with the right version:

[`package.json`](/package.json):

```javascript
"version": "X.X.X",
```

[`src/package-version`](/src/package-version.ts)

```javascript
export const PACKAGE_VERSION = 'X.X.X'
export const PACKAGE_VERSION = "X.X.X";
```

#### Github publish
Expand All @@ -137,38 +141,41 @@ GitHub Actions will be triggered and push the package to [npm](https://www.npmjs
#### Release a `beta` Version

This package is able to create multiple types of betas:

- A standard package beta, working on the latest version of Meilisearch.
- A beta implementing the changes of a rc version of Meilisearch.
- A beta implementing a specific feature `prototype` of Meilisearch.

Here are the steps to release a beta version of this package depending on its type:

1. Create a new branch containing the changes with the correct name format following these rules:
- `package beta`: create a branch `beta/xx-xx` with the context of your beta.
Example: `beta/refactor`.
- Meilisearch `pre-release beta`: create a branch originating from `bump-meilisearch-v*.*.*` named `pre-release-beta/v*.*.*`. <br>
Example: `pre-release-beta/v0.30.0`
- Meilisearch `prototype beta`: create a branch `prototype-beta/xx-xx`. Where `xxx` has the same name as the docker image containing the prototype.
Example: If the [docker image](https://hub.docker.com/r/getmeili/meilisearch/tags) is named: `prototype-multi-search-0`, the branch should be named: `prototype-beta/prototype-multi-search`

- `package beta`: create a branch `beta/xx-xx` with the context of your beta.
Example: `beta/refactor`.
- Meilisearch `pre-release beta`: create a branch originating from `bump-meilisearch-v*.*.*` named `pre-release-beta/v*.*.*`. <br>
Example: `pre-release-beta/v0.30.0`
- Meilisearch `prototype beta`: create a branch `prototype-beta/xx-xx`. Where `xxx` has the same name as the docker image containing the prototype.
Example: If the [docker image](https://hub.docker.com/r/getmeili/meilisearch/tags) is named: `prototype-multi-search-0`, the branch should be named: `prototype-beta/prototype-multi-search`

2. [Update the version](#version-update) following the correct format (X are numbers):
- package and prototype beta: `X.X.X-***.X`
example: `0.2.0-new-feature.0`
- pre-release beta: `X.X.X-vX.X.X-pre-release.X`
example: `0.2.0-v0.30.0-pre-release.0`

3. Commit and push your code to the newly created branch (step 1).
- package and prototype beta: `X.X.X-***.X`
example: `0.2.0-new-feature.0`
- pre-release beta: `X.X.X-vX.X.X-pre-release.X`
example: `0.2.0-v0.30.0-pre-release.0`

3. Commit and push your code to the newly created branch (step 1).

4. Go to the [GitHub interface for releasing](https://github.com/meilisearch/meilisearch-js/releases): on this page, click on `Draft a new release`.

5. Create a GitHub pre-release:
- Fill the description with the detailed changelogs
- Fill the title with `vX.X.X-beta.0`
- Fill the tag with `vX.X.X-beta.0`
- ⚠️ Select the `vX.X.X-beta.0` branch and NOT `main`
- ⚠️ Click on the "This is a pre-release" checkbox
- Click on "Publish release"

- Fill the description with the detailed changelogs
- Fill the title with `vX.X.X-beta.0`
- Fill the tag with `vX.X.X-beta.0`
- ⚠️ Select the `vX.X.X-beta.0` branch and NOT `main`
- ⚠️ Click on the "This is a pre-release" checkbox
- Click on "Publish release"

<hr>

Expand Down
Loading