unum-cloud / usearch

Fast Open-Source Search & Clustering engine × for Vectors & 🔜 Strings × in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.27k stars 142 forks source link

Bug: Not using npm correctly #329

Closed sroussey closed 10 months ago

sroussey commented 10 months ago

Describe the bug

So with npm there are a couple of ways to install dependencies. When you are developing, you tend to npm i --save xxxx etc. These actions create a lock file packages-lock.json which describes everything installed and their versions, etc.

If you have no lock file, or just npm i on a fresh checkout, each person may get different dependency versions (usually something newer that is not expected to change, but might actually break things). As a dev this is a good way to be forced to keep on top of some things.

For an install of dependencies that are pinned to the exact same versions (all the way down) you use npm ci instead. In that case you end us with a deterministic install.

Currently, you do something like this npm i && npm ci which might as well be npm i && npm i.

Steps to reproduce

just run as is

Expected behavior

I think you want deterministic installs so builds don't break for unknown reasons.

The way to do this is to remove packages-lock.json from .gitignore and commit it.

Then in the github actions just run npm ci which means npm install using the lock file. You will never have npm i in build system.

USearch version

2.8

Operating System

all

Hardware architecture

x86

Which interface are you using?

Other bindings

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

ashvardanian commented 10 months ago

Agreed, @sroussey! Would you be able to submit a PR?

sroussey commented 10 months ago

Working on it. 😁