Skip to content

Remove the version field from the package.json file #13664

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

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

According to https://docs.npmjs.com/cli/v7/configuring-npm/package-json#version, the "version" field is not required[1]:

If you don't plan to publish your package, the name and version fields are optional.

Hence it shouldn't be necessary to have a "dummy" version field in the package.json file, and it seems quite unfortunate to have an essentially meaningless entry in that file.[2]
Furthermore, I'd even go as far as suggesting that it's actually doing more harm than good in practice, since it's not uncommon for people to open issues where they simply quote the package.json-entry when filling out the ISSUE_TEMPLATE thus causing confusion as to which exact version is actually used.

Unless I'm misremembering, I believe that the only reason for adding the version field was that is was necessary in order for things to work back when testing was run on Travis.
Now we're using GitHub Actions instead, where things seem to work just find even without a version field; hence why I think it makes sense to remove this.


[1] Please note that this patch doesn't affect the pdfjs-dist package, since the package.json file used there is created in gulpfile.js during building.

[2] Trying to, automatically, update the version field on every commit really doesn't seem worth it to me.

According to https://docs.npmjs.com/cli/v7/configuring-npm/package-json#version, the "version" field is not required[1]:
> If you don't plan to publish your package, the name and version fields are optional.

Hence it shouldn't be necessary to have a "dummy" `version` field in the `package.json` file, and it seems quite unfortunate to have an essentially meaningless entry in that file.[2]
Furthermore, I'd even go as far as suggesting that it's actually doing more harm than good in practice, since it's not uncommon for people to open issues where they simply quote the `package.json`-entry when filling out the ISSUE_TEMPLATE thus causing confusion as to which *exact* version is actually used.

Unless I'm misremembering, I believe that the only reason for adding the `version` field was that is was necessary in order for things to work back when testing was run on Travis.
Now we're using GitHub Actions instead, where things seem to work just find even without a `version` field; hence why I think it makes sense to remove this.

---
[1] Please note that this patch doesn't affect the `pdfjs-dist` package, since the `package.json` file used there is created in `gulpfile.js` during building.

[2] Trying to, automatically, update the `version` field on *every* commit really doesn't seem worth it to me.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Jul 3, 2021

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/7d1f97ef9cd2718/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 3, 2021

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://3.101.106.178:8877/f9b6ba5ced07eb5/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Jul 3, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/7d1f97ef9cd2718/output.txt

Total script time: 3.83 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Jul 3, 2021

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/f9b6ba5ced07eb5/output.txt

Total script time: 6.69 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit f979aae into mozilla:master Jul 3, 2021
@timvandermeij
Copy link
Contributor

Seems like a good idea to me!

@Snuffleupagus Snuffleupagus deleted the rm-package-version branch July 4, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants