Skip to content
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

Simplify the way to get npm package version #61

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
3 changes: 1 addition & 2 deletions src/meilisearch_client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Config, MeiliSearch } from 'meilisearch'
import { PACKAGE_VERSION } from './package_version.js'

export function initMeilisearchClient({
host,
Expand All @@ -10,7 +9,7 @@
host,
apiKey,
clientAgents: [
`Meilisearch Crawler (v${PACKAGE_VERSION})`,
`Meilisearch Crawler (v${process.env.npm_package_version})`,

Check failure on line 12 in src/meilisearch_client.ts

View workflow job for this annotation

GitHub Actions / lint tests

Invalid type "string | undefined" of template literal expression

Check failure on line 12 in src/meilisearch_client.ts

View workflow job for this annotation

GitHub Actions / lint tests

Invalid type "string | undefined" of template literal expression
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the version added in the env variable npm_package_version ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's npm that is adding it by itself.

...clientAgents,
],
})
Expand Down
1 change: 0 additions & 1 deletion src/package_version.ts

This file was deleted.

Loading