Skip to content
Merged
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
Switch from yarn to pnpm, improve workflows
  • Loading branch information
flevi29 committed Dec 9, 2025
commit ecb99b1f0f669b1aef7e03c806bf7a10e13236c0
4 changes: 2 additions & 2 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ getting_started_add_documents: |-
// With npm:
// npm install meilisearch

// Or with yarn:
// yarn add meilisearch
// Or with pnpm:
// pnpm add meilisearch

// In your .js file:
// With the `require` syntax:
Expand Down
21 changes: 21 additions & 0 deletions .github/actions/set-up-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Set up Node.js and install dependencies"
description: "Install pnpm, configure Node.js, and install dependencies with pnpm"
inputs:
node-version:
default: "lts/*"
registry-url:
default: ""
runs:
using: "composite"
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
registry-url: ${{ inputs.registry-url }}
cache: "pnpm"
- name: Install dependencies
shell: bash
run: pnpm install
40 changes: 20 additions & 20 deletions .github/release-draft-template.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
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:
- 'dependencies'
- 'maintenance'
- 'documentation'
- "dependencies"
- "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 )?@meili-bot,?/g'
replace: ''
- search: "/(?:and )?@meili-bot,?/g"
replace: ""
10 changes: 3 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Install dependencies
run: yarn install
- uses: actions/checkout@v6
- uses: ./.github/actions/set-up-node

- name: Generate Documentation
run: yarn build:docs
run: pnpm build:docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/meilisearch-prototype-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ env:
on:
pull_request:
branches:
- 'prototype-beta/**'
- "prototype-beta/**"
push:
branches:
- 'prototype-beta/**'
- "prototype-beta/**"

jobs:
meilisearch-version:
Expand All @@ -35,37 +35,34 @@ 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-enterprise:${{ 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: ['20', '22']
name: integration-tests (Node.js ${{ matrix.node }})
node-version: ["20", "22"]
name: integration-tests (Node.js ${{ matrix.node-version }})
steps:
- uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
- uses: ./.github/actions/set-up-node
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: Install dependencies
run: yarn --dev
node-version: ${{ matrix.node-version }}

- name: Run tests
run: yarn test
run: pnpm test
- name: Build project
run: yarn build
run: pnpm build
- name: Run ESM env
run: yarn test:env:esm
run: pnpm test:env:esm
- name: Run Node.js env
run: yarn test:env:nodejs
run: pnpm test:env:nodejs
- name: Run node typescript env
run: yarn test:env:node-ts
run: pnpm test:env:node-ts
- name: Run Browser env
run: yarn test:env:browser
run: pnpm test:env:browser
41 changes: 19 additions & 22 deletions .github/workflows/pre-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ env:
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 @@ -32,37 +32,34 @@ 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-enterprise:${{ 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: ['20', '22']
name: integration-tests (Node.js ${{ matrix.node }})
node-version: ["20", "22"]
name: integration-tests (Node.js ${{ matrix.node-version }})
steps:
- uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
- uses: ./.github/actions/set-up-node
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: Install dependencies
run: yarn --dev
node-version: ${{ matrix.node-version }}

- name: Run tests
run: yarn test
run: pnpm test
- name: Build project
run: yarn build
run: pnpm build
- name: Run ESM env
run: yarn test:env:esm
run: pnpm test:env:esm
- name: Run Node.js env
run: yarn test:env:nodejs
run: pnpm test:env:nodejs
- name: Run node typescript env
run: yarn test:env:node-ts
run: pnpm test:env:node-ts
- name: Run Browser env
run: yarn test:env:browser
run: pnpm test:env:browser
22 changes: 10 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,24 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://registry.npmjs.org/
cache: 'yarn'
- name: Check release validity
run: sh .github/scripts/check-release.sh
- name: Check tag format
run: sh .github/scripts/check-tag-format.sh "${{ github.event.release.prerelease }}"
- name: Install dependencies
run: yarn install

- uses: ./.github/actions/set-up-node
with:
registry-url: https://registry.npmjs.org/

- name: Build meilisearch-js
run: yarn build
run: pnpm build
- name: Publish with latest tag
if: '!github.event.release.prerelease'
run: npm publish --provenance --access public
if: !github.event.release.prerelease
run: pnpm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish with beta tag
if: 'github.event.release.prerelease'
run: npm publish --provenance --access public --tag beta
if: github.event.release.prerelease
run: pnpm publish --provenance --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57 changes: 22 additions & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Tests

env:
HUSKY: 0
NODE_OPTIONS: '--trace-warnings'
NODE_OPTIONS: "--trace-warnings"

on:
pull_request:
Expand All @@ -29,36 +29,33 @@ jobs:
meilisearch:
image: getmeili/meilisearch-enterprise: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: ['20', '22']
name: integration-tests (Node.js ${{ matrix.node }})
node-version: ["20", "22"]
name: integration-tests (Node.js ${{ matrix.node-version }})
steps:
- uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
- uses: ./.github/actions/set-up-node
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --dev
node-version: ${{ matrix.node-version }}

- name: Run tests
run: yarn test
run: pnpm test
- name: Build project
run: yarn build
run: pnpm build
- name: Run ESM env
run: yarn test:env:esm
run: pnpm test:env:esm
- name: Run Node.js env
run: yarn test:env:nodejs
run: pnpm test:env:nodejs
- name: Run node typescript env
run: yarn test:env:node-ts
run: pnpm test:env:node-ts
- name: Run Browser env
run: yarn test:env:browser
run: pnpm test:env:browser
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
env:
Expand All @@ -68,15 +65,10 @@ jobs:
name: style-check
steps:
- uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 22
cache: 'yarn'
- name: Install dependencies
run: yarn --dev
- uses: ./.github/actions/set-up-node

- name: Run code style check
run: yarn style
run: pnpm style
- name: Run yaml style check
uses: ibiqlik/action-yamllint@v3
with:
Expand All @@ -86,14 +78,9 @@ jobs:
name: types-check
steps:
- uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 22
cache: 'yarn'
- name: Install dependencies
run: yarn --dev
- uses: ./.github/actions/set-up-node

- name: Build project
run: yarn build
run: pnpm build
- name: Run types check
run: yarn types
run: pnpm types
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,3 @@ package
.idea
dist_default_export_in_index
no_default_export_in_index
playgrounds/javascript/yarn.lock
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn lint-staged
pnpm lint-staged
Loading