Conversation
🦋 Changeset detectedLatest commit: 2b61af9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors packaging and build: updates Node version, moves to TypeScript-first publishing (exports point to ./src), removes UMD/CJS bundles and version-generation scripts, makes Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/instant-meilisearch/README.md (1)
551-554:⚠️ Potential issue | 🟡 MinorUpdate stale Node/NPM compatibility info.
This section still states
NodeJS >= 12.10 <= 18andNPM >= 6.x, but the package now requires^20.19.0 || >=22.12.0perpackages/instant-meilisearch/package.json'sengines. Given this PR drops CJS/UMD and targets modern Node + ESM, please update these lines (or remove the section) to avoid misleading consumers.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/instant-meilisearch/README.md` around lines 551 - 554, The README's "Node / NPM versions" block is stale; update or remove it so it matches the package's engines field. Replace the lines "NodeJS >= 12.10 <= 18" and "NPM >= 6.x" with the current engine requirement from packages/instant-meilisearch/package.json (engines: "^20.19.0 || >=22.12.0") or remove the entire compatibility section if you prefer to rely on package.json for authoritative info; ensure the README references the same engines string or an equivalent modern-Node statement and mention ESM-only / dropped CJS/UMD if relevant.
🧹 Nitpick comments (1)
packages/autocomplete-client/__tests__/test.utils.ts (1)
2-18: Exercise autocomplete-client’s own subpath in its tests.This currently imports the SDK through
instant-meilisearch, so@meilisearch/autocomplete-client/meilisearchcould regress without this test utility noticing. ReuseHOST/API_KEYwhile you’re touching the constructor.Proposed test utility cleanup
-import { MeiliSearch } from '@meilisearch/instant-meilisearch/meilisearch' +import { MeiliSearch } from '@meilisearch/autocomplete-client/meilisearch' @@ const meilisearchClient = new MeiliSearch({ - host: 'http://localhost:7700', - apiKey: 'masterKey', + host: HOST, + apiKey: API_KEY, })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/autocomplete-client/__tests__/test.utils.ts` around lines 2 - 18, The test utility imports MeiliSearch from the wrong package: replace the import from '@meilisearch/instant-meilisearch/meilisearch' with the package's own subpath '@meilisearch/autocomplete-client/meilisearch' so tests exercise the library's export; also reuse the existing HOST and API_KEY constants when constructing both searchClient (meilisearchAutocompleteClient) and meilisearchClient (new MeiliSearch) so they share the same config instead of hardcoding values—update references to MeiliSearch, meilisearchAutocompleteClient, HOST, API_KEY, searchClient, and meilisearchClient accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/autocomplete-client/package.json`:
- Around line 10-13: The exports map in the package.json is missing an entry for
"./package.json", causing workspace consumers to be blocked from resolving the
package metadata; update the "exports" object in packages' package.json (the
object containing "." and "./meilisearch") to include the "./package.json":
"./package.json" export so the package.json subpath is allowed (apply the same
change to the instant-meilisearch package.json exports block).
- Line 18: The exported "./meilisearch" entry re-exports from the external
"meilisearch" package but that package isn’t declared or marked external,
causing consumers to fail; fix by either adding "meilisearch" as a
peerDependency in packages/autocomplete-client/package.json (so the consumer
must install it) or marking "meilisearch" as external in the Vite/Rollup build
config that produces ./meilisearch (and also add "meilisearch" as a
peerDependency in `@meilisearch/instant-meilisearch` package.json if it re-exports
it), and update packages/autocomplete-client/src/meilisearch.ts usage
accordingly so the built "./meilisearch" export does not bundle or omit the
unresolved module.
In `@packages/instant-meilisearch/package.json`:
- Around line 27-30: The workspace exports object is missing the
"./package.json" entry that exists in publishConfig.exports; update the exports
block (the "exports" property) to include an entry mapping "./package.json" to
"./package.json" so that consumers can import
`@meilisearch/instant-meilisearch/package.json` in local dev as they can after
publish, ensuring parity with publishConfig.exports.
In `@packages/instant-meilisearch/src/meilisearch.ts`:
- Line 1: The package currently re-exports the external module via
src/meilisearch.ts (export * from 'meilisearch') but
packages/instant-meilisearch/package.json does not declare "meilisearch" as a
dependency, and vite.config.ts has no rollupOptions.external/noExternal setting;
to fix, add "meilisearch" as a peerDependency (preferred for re-exporting a
public API) in package.json or alternatively update vite.config.ts to explicitly
externalize "meilisearch" via rollupOptions.external (or add it to noExternal to
force bundling) so consumers won't get duplicate copies or build failures;
locate the export in src/meilisearch.ts and the packaging config in
vite.config.ts/package.json to implement the chosen change.
In `@playgrounds/local-react/package.json`:
- Around line 7-9: The package.json scripts "predev" and "setup" reference the
old filename setup.mjs which was renamed to setup.mts; update both script
entries ("predev" and "setup") to call "tsx setup.mts" so they point to the new
module name and the commands will run correctly.
---
Outside diff comments:
In `@packages/instant-meilisearch/README.md`:
- Around line 551-554: The README's "Node / NPM versions" block is stale; update
or remove it so it matches the package's engines field. Replace the lines
"NodeJS >= 12.10 <= 18" and "NPM >= 6.x" with the current engine requirement
from packages/instant-meilisearch/package.json (engines: "^20.19.0 ||
>=22.12.0") or remove the entire compatibility section if you prefer to rely on
package.json for authoritative info; ensure the README references the same
engines string or an equivalent modern-Node statement and mention ESM-only /
dropped CJS/UMD if relevant.
---
Nitpick comments:
In `@packages/autocomplete-client/__tests__/test.utils.ts`:
- Around line 2-18: The test utility imports MeiliSearch from the wrong package:
replace the import from '@meilisearch/instant-meilisearch/meilisearch' with the
package's own subpath '@meilisearch/autocomplete-client/meilisearch' so tests
exercise the library's export; also reuse the existing HOST and API_KEY
constants when constructing both searchClient (meilisearchAutocompleteClient)
and meilisearchClient (new MeiliSearch) so they share the same config instead of
hardcoding values—update references to MeiliSearch,
meilisearchAutocompleteClient, HOST, API_KEY, searchClient, and
meilisearchClient accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2c63cc16-130f-405c-9d29-d4c610db3c9a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (35)
.nvmrcpackage.jsonpackages/autocomplete-client/__tests__/test.utils.tspackages/autocomplete-client/package.jsonpackages/autocomplete-client/scripts/update_version.cjspackages/autocomplete-client/src/client/autocompleteSearchClient.tspackages/autocomplete-client/src/meilisearch.tspackages/autocomplete-client/src/package-version.tspackages/autocomplete-client/tsconfig.jsonpackages/autocomplete-client/vite.config.tspackages/instant-meilisearch/README.mdpackages/instant-meilisearch/__tests__/configure.attributes-to-retrieve.test.tspackages/instant-meilisearch/__tests__/search-resolver.test.tspackages/instant-meilisearch/package.jsonpackages/instant-meilisearch/scripts/update_version.cjspackages/instant-meilisearch/src/adapter/search-request-adapter/search-params-adapter.tspackages/instant-meilisearch/src/client/agents.tspackages/instant-meilisearch/src/index.tspackages/instant-meilisearch/src/meilisearch.tspackages/instant-meilisearch/src/package-version.tspackages/instant-meilisearch/tsconfig.jsonpackages/instant-meilisearch/vite.config.tsplaygrounds/autocomplete/package.jsonplaygrounds/autocomplete/setup.mtsplaygrounds/autocomplete/vite.config.mtsplaygrounds/autocomplete/vite.config.tsplaygrounds/local-react/package.jsonplaygrounds/local-react/setup.mtsplaygrounds/local-react/vite.config.mtsplaygrounds/local-react/vite.config.tsplaygrounds/node-env/index.tsplaygrounds/node-env/package.jsontsconfig.jsonturbo.jsonvite.config.ts
💤 Files with no reviewable changes (7)
- packages/autocomplete-client/src/package-version.ts
- packages/instant-meilisearch/scripts/update_version.cjs
- playgrounds/autocomplete/vite.config.ts
- packages/autocomplete-client/scripts/update_version.cjs
- packages/instant-meilisearch/src/index.ts
- playgrounds/local-react/vite.config.ts
- packages/instant-meilisearch/src/package-version.ts
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/instant-meilisearch/README.md (1)
559-562:⚠️ Potential issue | 🟡 MinorUpdate the compatibility section for the new engine floor.
The README advertises NodeJS
>= 12.10 <= 18, butpackage.jsonspecifies^20.19.0 || >=22.12.0. Update the compatibility section to match the actual supported versions:**Node / NPM versions**: -- NodeJS >= 12.10 <= 18 -- NPM >= 6.x +- Node.js ^20.19.0 || >=22.12.0 +- npm version compatible with the supported Node.js releases🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/instant-meilisearch/README.md` around lines 559 - 562, The README's "Node / NPM versions" compatibility text is out of date; update the NodeJS constraint to match package.json's engine field (^20.19.0 || >=22.12.0) by replacing "NodeJS >= 12.10 <= 18" with the equivalent supported range, and verify the NPM line if package.json specifies an NPM constraint—ensure the README's Node and NPM version lines reflect the exact engine string from package.json.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/crisp-wasps-flow.md:
- Line 13: Update the Node.js version note in .changeset/crisp-wasps-flow.md so
it matches the package engines; replace the phrase "Node.js ^20" with wording
that reflects the configured engines (for example "Node.js >=20.19.0 (or
>=22.12.0)" or similar text that matches "engines: ^20.19.0 || >=22.12.0") so
the note no longer claims support for versions below the declared minimum.
In `@packages/instant-meilisearch/README.md`:
- Around line 496-528: The example currently imports InstantSearch as a UMD
side-effect and then expects a global instantsearch; instead replace the UMD
side-effect import with explicit ESM imports and use the widget exports
directly: import the instantsearch factory (instantsearch) and the widget
constructors (searchBox, hits) from an ESM-compatible CDN, keep the existing
instantMeiliSearch call to obtain searchClient, then instantiate search with
instantsearch({ indexName, searchClient }) and add widgets using the imported
searchBox and hits functions (instead of instantsearch.widgets.searchBox /
instantsearch.widgets.hits) before calling search.start(); this ensures the
example works in type="module" contexts.
---
Outside diff comments:
In `@packages/instant-meilisearch/README.md`:
- Around line 559-562: The README's "Node / NPM versions" compatibility text is
out of date; update the NodeJS constraint to match package.json's engine field
(^20.19.0 || >=22.12.0) by replacing "NodeJS >= 12.10 <= 18" with the equivalent
supported range, and verify the NPM line if package.json specifies an NPM
constraint—ensure the README's Node and NPM version lines reflect the exact
engine string from package.json.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e54d2a85-3d44-4b9a-a173-c171e6523d8a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (22)
.changeset/crisp-wasps-flow.mdpackage.jsonpackages/autocomplete-client/__tests__/test.utils.tspackages/autocomplete-client/package.jsonpackages/autocomplete-client/tsconfig.jsonpackages/autocomplete-client/vite.config.tspackages/instant-meilisearch/README.mdpackages/instant-meilisearch/__tests__/assets/utils.tspackages/instant-meilisearch/__tests__/search-resolver.test.tspackages/instant-meilisearch/package.jsonpackages/instant-meilisearch/src/adapter/search-request-adapter/search-resolver.tspackages/instant-meilisearch/src/client/instant-meilisearch-client.tspackages/instant-meilisearch/src/types/types.tspackages/instant-meilisearch/tsconfig.jsonpackages/instant-meilisearch/vite.config.tsplaygrounds/autocomplete/setup.mtsplaygrounds/local-react/package.jsonplaygrounds/local-react/setup.mtsplaygrounds/node-env/index.tsplaygrounds/vue3/src/App.vuepnpm-workspace.yamltsconfig.json
✅ Files skipped from review due to trivial changes (7)
- pnpm-workspace.yaml
- packages/instant-meilisearch/src/client/instant-meilisearch-client.ts
- playgrounds/vue3/src/App.vue
- playgrounds/autocomplete/setup.mts
- playgrounds/local-react/setup.mts
- playgrounds/local-react/package.json
- packages/autocomplete-client/tests/test.utils.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- packages/instant-meilisearch/tests/search-resolver.test.ts
- packages/instant-meilisearch/tsconfig.json
- playgrounds/node-env/index.ts
- tsconfig.json
- packages/instant-meilisearch/vite.config.ts
- packages/instant-meilisearch/package.json
|
@Strift I think I've done it. |
Strift
left a comment
There was a problem hiding this comment.
Awesome stuff 🙌
Much welcome cleanup of the dev workflow and build pipeline.
Pull Request
What does this PR do?
MeiliSearchto lower caseMeilisearchto eliminate some possible issues arising from JSPM and maybe other CDNs/package resolvers (instant-meilisearch@0.30.0 broken against meilisearch@0.57.0 — MeiliSearch named export removed #1472, Compatibility broken with meilisearch due to renaming of exported name 'MeiliSearch' #1468)meilisearchis marked as a peer dependencyimportmap*.tsfiles directly; for now executing them withtsxrequire(esm), so there's no point in bundling to commonjs anymoretype="module"scripts for almost a decade now, even Node.js supports requiring ESM as stated above"exports"field, all supported Node.js versions support "exports" field, as do all modern bundlers and CDNspublishConfig, so we can export to other workspace packages the TypeScript source filespackage.jsoninto exports, mainly so bundlers can read it via directly importing it, and it seems to be the industry normMigration
package.json"main"and"types"fields aren't available anymoreIf you relied on any of these outdated features, you will have to bundle for any target environment that requires them, or update the environment if that's possible.
meilisearchis a peer dependency (if the package manager used doesn't automatically install it, add it to the list of dependencies manually):PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!
Summary by CodeRabbit
Breaking Changes
Chores
Documentation