joshuacc / ahkpm

The AutoHotkey Package Manager
https://ahkpm.dev
MIT License
59 stars 8 forks source link

Prompt suggests "UNLICENSED" but says it's invalid when entered #181

Open jasonsparc opened 1 year ago

jasonsparc commented 1 year ago

Hi! My work is currently licensed under “The Unlicense” license. Now, running ahkpm init, the prompt said something like,

…a valid SPDX license identifier or "UNLICENSED"

Emphasis mine, especially the 'D' character at the end.

And so, naturally, I typed UNLICENSED, but it nagged to me that it was invalid. Then I noticed that, “The Unlicense” doesn't end in 'D'. So, I typed UNLICENSE, but it nagged again. So in the end, it really only accepts case-sensitive SPDX identifiers. (Note that, I had to google what “SPDX license identifier” mean, just to get pass that prompt :P)

Conclusion: It's the prompt's fault :P

Proof of my little trials and tribulations:

Capture

P.S. Thanks for considering my little DSV library as one of the first few packages available via ahkpm. Also, a package manager for AHK is indeed a really cool idea btw! Something like that would definitely simplify my current AHK setup.

joshuacc commented 1 year ago

Thanks for the bug report, and sorry for the time you wasted fighting it!

Should have a fix for it in the next couple of days that:

  1. Allows "UNLICENSED"
  2. Clarifies that "UNLICENSED" is if you don't want others to use it.
  3. Provides a link to the SPDX license list to help find the correct identifier.
  4. Compares identifiers case insensitively, and automatically converts it to the correct casing in ahkpm.json.
joshuacc commented 1 year ago

@jasonsparc I've merged a fix for 1, 2, and 3 above. See #187. I expect to publish a 0.7.0 with the fixes this evening or tomorrow morning.

Number 4 from above will take a bit longer, but I can probably have that done sometime next week.

jasonsparc commented 1 year ago

Is "UNLICENSED" equivalent to having no license? If so, how about "NO LICENSE" instead? This avoids confusion with "The Unlicense" (i.e., https://choosealicense.com/licenses/unlicense), which is actually a valid license as a dedication to the public domain (while also covering legal stuffs).

Also, I think my suggestion ("NO LICENSE") plays nicely with GitHub's warning (and labeling) about what may happen if you don't choose a license whatsoever for your repo (i.e., https://choosealicense.com/no-permission).

joshuacc commented 1 year ago

@jasonsparc Yes, it is equivalent. I initially chose "UNLICENSED" because that is the value npm uses. However, doing a bit of searching, it seems that a lot of npm users have been confused by the ambiguity of "UNLICENSED" versus The Unlicense.

(I must say that I really dislike the name for The Unlicense precisely because it sounds like there is no license granted. But since I can't actually fix that...)

I will change ahkpm to use "NO LICENSE" rather than "UNLICENSED" to avoid this ambiguity. Should have another fix merged later this morning, and release 0.7.0 with the fix sometime later in the day.

joshuacc commented 1 year ago

0.7.0 with the bugfixes mentioned above has been released: https://github.com/joshuacc/ahkpm/releases/tag/0.7.0

jasonsparc commented 1 year ago

Looks good 👍

I'll keep this open just in case you still want to implement number 4. Although, even if you don't implement the case-insensitive lookup, I think people would just go to the provided link and look up their license identifier there, in case the program doesn't accept their incorrectly cased input. Feel free to close this issue once that's implemented.

jasonsparc commented 1 year ago

I just tried it too:

Capture

P.S. I could see the new "scripts": {} line too. I might try it for my test script when I find the time :)