@gesslar/licensed 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/cli.js +4 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gesslar/licensed",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Simple CLI to produce license copy for README.md",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"major": "npm version major"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@gesslar/toolkit": "^
|
|
31
|
+
"@gesslar/toolkit": "^4.4.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@gesslar/uglier": "^2.
|
|
35
|
-
"eslint": "^10.0.
|
|
34
|
+
"@gesslar/uglier": "^2.2.0",
|
|
35
|
+
"eslint": "^10.0.3"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=v24.13.0"
|
package/src/cli.js
CHANGED
|
@@ -15,20 +15,18 @@ import {promisify} from "node:util"
|
|
|
15
15
|
// Detect license file in project root
|
|
16
16
|
const licenseFile = (await cwd.glob("{LICEN[CS]E,UNLICEN[CS]E}{,.txt,.md}"))?.files[0]
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
const name = pkg.name?.replace(/^@[^/]+\//, "") ?? "this project"
|
|
18
|
+
const name = pkg.name ?? "this project"
|
|
20
19
|
const license = pkg.license ?? "Unknown"
|
|
21
20
|
|
|
22
21
|
const publicDomain = ["Unlicense", "0BSD", "CC0-1.0"]
|
|
23
22
|
const phrase = publicDomain.includes(license)
|
|
24
|
-
?
|
|
25
|
-
:
|
|
23
|
+
? `\`${name}\` is released into the public domain under the`
|
|
24
|
+
: `\`${name}\` is released under the`
|
|
26
25
|
|
|
27
26
|
const lines = [
|
|
28
27
|
"## License",
|
|
29
28
|
"",
|
|
30
|
-
phrase
|
|
31
|
-
`[${license}](${licenseFile?.name ?? "LICENSE"}).`,
|
|
29
|
+
`${phrase} [${license}](${licenseFile?.name ?? "LICENSE"}).`,
|
|
32
30
|
]
|
|
33
31
|
|
|
34
32
|
const deps = Object.keys(pkg.dependencies ?? {}).sort()
|