-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1611: Add `package.json` `"exports"` field r=curquiza a=flevi29 # Pull Request I am aiming to slowly try to update and simplify this repository, and maybe learn a thing or two along the way. ## What does this PR do? - add `"exports"` field to `package.json` - It is the new way of defining your exported files, instead of just relying on one single [`"main"`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#main) export for Node.js - This way Node.js can conditionally determine which exported file to import based on the fact that `require` or `import` was used, previously Node.js even in ESM mode always imported the commonjs version of this package, but now it can import the ESM version - https://webpack.js.org/guides/package-exports/ - [subpath-exports](https://nodejs.org/docs/latest-v20.x/api/packages.html#subpath-exports) - [conditional-exports](https://nodejs.org/docs/latest-v20.x/api/packages.html#conditional-exports) - add `node:` specifiers to Node.js built-in module imports/requires - add missing ``@types/node`` type definitions development dependency - because older versions of `jest` test runner doesn't support `node:` specifiers, update `jest` (#1622) - ~~because newer versions of `jest` doesn't include anymore `"jest-environment-jsdom"`, add it as development dependency~~ - ~~because newer versions of `jest` simplified snapshots, update them accordingly~~ - ~~this means replacing `Object {` with `{` and `Array [` with `[`~~ > [!CAUTION] > This is a breaking change for anyone who was importing anything other than what we have in the `"exports"` package.json field. From now on only files from the `package.json` `"exports"` field can be imported. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: F. Levi <55688616+flevi29@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
41 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const path = require('path') | ||
const path = require('node:path') | ||
|
||
module.exports = { | ||
entry: './src/index.js', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const { spawn } = require('child_process') | ||
const { spawn } = require('node:child_process') | ||
|
||
let server | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters