@myooken/license-output 0.2.1 → 0.3.1
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/README.md +30 -8
- package/package.json +2 -2
- package/src/constants.js +8 -3
package/README.md
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Deprecated
|
|
2
|
+
|
|
3
|
+
⚠️ **This package is deprecated.**
|
|
4
|
+
Please use **[`node-module-license-output`](https://www.npmjs.com/package/node-module-license-output)** instead.
|
|
5
|
+
|
|
6
|
+
> This package has been renamed from `@myooken/license-output` to
|
|
7
|
+
> **`node-module-license-output`** to provide a non-scoped, easier-to-discover name.
|
|
8
|
+
> All new development and maintenance continue in the new package.
|
|
9
|
+
|
|
10
|
+
## Migration
|
|
11
|
+
|
|
12
|
+
### Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install node-module-license-output
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Replace
|
|
2
19
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
20
|
+
* Before: `npm install @myooken/license-output`
|
|
21
|
+
* After : `npm install node-module-license-output`
|
|
22
|
+
|
|
23
|
+
> Note: Update the package name in your CLI usage and imports from
|
|
24
|
+
> `@myooken/license-output` → `node-module-license-output`.
|
|
25
|
+
|
|
26
|
+
# Third-Party License Output for node_modules
|
|
6
27
|
|
|
7
|
-
https://www.npmjs.com/package
|
|
28
|
+
https://www.npmjs.com/package/node-module-license-output
|
|
8
29
|
|
|
9
30
|
### What is this?
|
|
10
31
|
|
|
@@ -14,7 +35,7 @@ It generates two files: `THIRD-PARTY-LICENSE.md` (main content) and `THIRD-PARTY
|
|
|
14
35
|
### Highlights
|
|
15
36
|
|
|
16
37
|
- **ESM / Node.js 18+**, zero dependencies
|
|
17
|
-
- **Outputs full license texts** from LICENSE/NOTICE/THIRD-PARTY-NOTICES/COPYING files
|
|
38
|
+
- **Outputs full license texts** from LICENSE/NOTICE/COPYRIGHT/THIRD-PARTY-NOTICES/THIRD-PARTY-LICENSES/ThirdPartyNoticeText/ThirdPartyText/COPYING files
|
|
18
39
|
- **Review file** flags missing Source / license / license files
|
|
19
40
|
- `--fail-on-missing` supports CI enforcement
|
|
20
41
|
|
|
@@ -50,7 +71,7 @@ third-party-license
|
|
|
50
71
|
| `--license [file]` | Write main file only; optional filename | `THIRD-PARTY-LICENSE.md` |
|
|
51
72
|
| `--recreate` | Regenerate files from current `node_modules` only (drops removed packages) | `true` (default) |
|
|
52
73
|
| `--update` | Merge with existing outputs, keep removed packages, and mark their presence | `false` |
|
|
53
|
-
| `--fail-on-missing` | Exit with code 1 if LICENSE/NOTICE/THIRD-PARTY-NOTICES/COPYING are missing | `false` |
|
|
74
|
+
| `--fail-on-missing` | Exit with code 1 if LICENSE/NOTICE/COPYRIGHT/THIRD-PARTY-NOTICES/THIRD-PARTY-LICENSES/ThirdPartyNoticeText/ThirdPartyText/COPYING are missing | `false` |
|
|
54
75
|
| `-h`, `--help` | Show help | - |
|
|
55
76
|
|
|
56
77
|
> If neither `--review` nor `--license` is specified, **both files are generated**.
|
|
@@ -104,7 +125,7 @@ Outputs are sorted by package key. Use `mode: "update"` to merge with existing f
|
|
|
104
125
|
- **THIRD-PARTY-LICENSE.md**
|
|
105
126
|
- List of packages
|
|
106
127
|
- Source / License info
|
|
107
|
-
- Full LICENSE/NOTICE/THIRD-PARTY-NOTICES/COPYING texts
|
|
128
|
+
- Full LICENSE/NOTICE/COPYRIGHT/THIRD-PARTY-NOTICES/THIRD-PARTY-LICENSES/ThirdPartyNoticeText/ThirdPartyText/COPYING texts
|
|
108
129
|
- Usage line shows whether the package is present in the current `node_modules`
|
|
109
130
|
- **THIRD-PARTY-LICENSE-REVIEW.md**
|
|
110
131
|
- Review-oriented checklist
|
|
@@ -125,6 +146,7 @@ Outputs are sorted by package key. Use `mode: "update"` to merge with existing f
|
|
|
125
146
|
### Notes
|
|
126
147
|
|
|
127
148
|
- Scans all packages under `node_modules` (including nested dependencies); license files are searched only in each package root directory.
|
|
149
|
+
- Recognizes LICENSE, NOTICE, COPYRIGHT, THIRD-PARTY-NOTICES, THIRD-PARTY-LICENSES, ThirdPartyNoticeText/ThirdPartyText, and COPYING files (e.g., TypeScript's `ThirdPartyNoticeText.txt`).
|
|
128
150
|
- Exit code 0: success.
|
|
129
151
|
- Exit code 1: missing license files when `--fail-on-missing` is set, or `node_modules` not found.
|
|
130
152
|
- Throws an error if `node_modules` does not exist.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myooken/license-output",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Generate third-party-license markdown by scanning licenses in node_modules.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
".": "./src/core.js"
|
|
26
26
|
},
|
|
27
27
|
"bin": {
|
|
28
|
-
"third-party-license": "
|
|
28
|
+
"third-party-license": "src/cli.js"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
|
31
31
|
"src",
|
package/src/constants.js
CHANGED
|
@@ -8,8 +8,13 @@ export const DEFAULT_OPTIONS = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// ライセンスらしいファイル名を検出する正規表現
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const LICENSE_LIKE_BASE =
|
|
12
|
+
"(LICEN[CS]E|COPYING|COPYRIGHT|NOTICE|THIRD[-_. ]?PARTY[-_. ]?(?:NOTICES?|NOTICE[-_. ]?TEXTS?|TEXTS?|LICENSES?))";
|
|
13
|
+
|
|
14
|
+
export const LICENSE_LIKE_RE = new RegExp(
|
|
15
|
+
`^${LICENSE_LIKE_BASE}(\\..*)?$|^${LICENSE_LIKE_BASE}-`,
|
|
16
|
+
"i"
|
|
17
|
+
);
|
|
13
18
|
|
|
14
19
|
export const LICENSE_FILES_LABEL =
|
|
15
|
-
"LICENSE/NOTICE/THIRD-PARTY-NOTICES/COPYING";
|
|
20
|
+
"LICENSE/NOTICE/COPYRIGHT/THIRD-PARTY-NOTICES/THIRD-PARTY-LICENSES/ThirdPartyNoticeText/ThirdPartyText/COPYING";
|