jsr icon indicating copy to clipboard operation
jsr copied to clipboard

Store licenses for packages

Open lucacasonato opened this issue 1 year ago • 6 comments

Each package / package version should have a license field. This field should be a SPDX ID of a license.

This license should be visible via the API and UI, and could be useful for auditing purposes.

We should sniff the LICENSE file (like GitHub does) to populate this field. There should be a fallback where you can explicitly set the license SPDX ID via either a field in the package settings, or via a directive in the license file.

lucacasonato avatar Feb 28 '24 18:02 lucacasonato

How about using the license info from the JSDoc @license tag in the same comment that contains the @module tag?

/* My module.
 *
 * @license MIT
 *
 * @module
 */

A "license" key in the deno/jsr.json file seems useful, too.

Alternatively, checking the first few lines of the module entry points for a // SPDX-License-Identifier: comment sounds viable, too.

MarkTiedemann avatar Mar 07 '24 12:03 MarkTiedemann

Its interesting to me why a license field is not something required. This is horrible for auditing and attributing / honoring dependency licenses. This is a big reason why companies might not want to use JSR when they can not ensure they are honoring every dependency license.

crates.io requires a license to publish a crate and seeing deno being heavily inspired by cargo I am not sure why this is not the same.

EdJoPaTo avatar Mar 16 '24 15:03 EdJoPaTo

What happens if you use a custom license?

vwkd avatar May 05 '24 11:05 vwkd

What happens if you use a custom license?

I would do it similar to crates.io. Either SPDX via license or license-file. Exactly one being required. Custom → file.

EdJoPaTo avatar May 05 '24 12:05 EdJoPaTo

Deno will start warning about missing license files in 1.45.3 (https://github.com/denoland/deno/pull/24677). In 1.46 it will start erroring https://github.com/denoland/deno/issues/24676

dsherret avatar Jul 22 '24 20:07 dsherret

Work on adding a license field in addition to auto-discovering LICENSE files: https://github.com/denoland/deno/pull/25056

dsherret avatar Aug 15 '24 19:08 dsherret