espressif / esptool-js

Javascript implementation of flasher tool for Espressif chips, running in web browser using WebSerial.
https://espressif.github.io/esptool-js/
Apache License 2.0
276 stars 108 forks source link

Missing version in package.json #44

Closed dumbasPL closed 1 year ago

dumbasPL commented 2 years ago

The package.json file is very bare bones here and doesn't even have a version number.

version is a required field

Yarn refuses to install packages that do not have a version number specified and just throws a error Can't add "esptool-js": invalid package version undefined.

balloob commented 2 years ago

You should be able to add it based on a commit like this

dumbasPL commented 2 years ago

You should be able to add it based on a commit like this

well yes and no. This does work with npm, but yarn will refuse to install it

$ yarn init -y
yarn init v1.22.19
warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.
success Saved package.json
Done in 0.02s.
$ yarn add github:espressif/esptool-js#0c1b972a05d691c85da23fcc937d91dcf7e283eb
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
error Can't add "esptool-js": invalid package version undefined.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

and the only reason npm works is because it skips all checks for git repositories

$ npm i github:espressif/esptool-js#0c1b972a05d691c85da23fcc937d91dcf7e283eb
npm WARN skipping integrity check for git dependency ssh://git@github.com/espressif/esptool-js.git

added 3 packages, and audited 4 packages in 1s

The npm documentation specifies the name and version as required fields so the package.json is invalid either way.

A package.json file must contain "name" and "version" fields.

The "name" field contains your package's name, and must be lowercase and one word, and may contain hyphens and underscores.

The "version" field must be in the form x.x.x and follow the semantic versioning guidelines.

(source)

balloob commented 2 years ago

Want to open a PR and add version 0.1 to it?

CC @adwait-esp

dumbasPL commented 2 years ago

Want to open a PR and add version 0.1 to it?

done

Edit: On a side note, publishing this package to npmjs.com would also be welcome. This will drastically reduce download times(compared to using git) and will make version management easier

dumbasPL commented 1 year ago

bump