rolldown-license-plugin 1.4.0 → 2.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/README.md +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ import {licensePlugin} from "rolldown-license-plugin";
|
|
|
12
12
|
export default {
|
|
13
13
|
plugins: [
|
|
14
14
|
licensePlugin({
|
|
15
|
-
|
|
15
|
+
done(licenses) {
|
|
16
16
|
console.info(licenses);
|
|
17
17
|
// => [{name, version, license, licenseText}]
|
|
18
18
|
},
|
|
@@ -27,11 +27,11 @@ export default {
|
|
|
27
27
|
|
|
28
28
|
Returns the plugin.
|
|
29
29
|
|
|
30
|
-
#### `opts.
|
|
30
|
+
#### `opts.done`
|
|
31
31
|
|
|
32
|
-
Type: `(licenses: LicenseInfo[]) => void
|
|
32
|
+
Type: `(licenses: LicenseInfo[], context: PluginContext) => void | Promise<void>`
|
|
33
33
|
|
|
34
|
-
Callback invoked during `generateBundle` with the collected license data.
|
|
34
|
+
Callback invoked during `generateBundle` with the collected license data. The `context` parameter provides access to rolldown's plugin context, including `emitFile`.
|
|
35
35
|
|
|
36
36
|
#### `opts.match`
|
|
37
37
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5739,7 +5739,7 @@ type LicenseInfo = {
|
|
|
5739
5739
|
};
|
|
5740
5740
|
/** Options for {@link licensePlugin} */
|
|
5741
5741
|
type RolldownLicensePluginOpts = {
|
|
5742
|
-
/** Called during `generateBundle` with the collected license data, sorted by name */
|
|
5742
|
+
/** Called during `generateBundle` with the collected license data, sorted by name */done: (licenses: LicenseInfo[], context: PluginContext) => void | Promise<void>; /** Regex to match license filenames. Default: `/^((UN)?LICEN(S|C)E|COPYING).*$/i` */
|
|
5743
5743
|
match?: RegExp; /** When set, word-wrap `licenseText` to this column width */
|
|
5744
5744
|
wrapText?: number; /** Validate each dependency's license. Return `false` to throw a build error */
|
|
5745
5745
|
allow?: (license: LicenseInfo) => boolean;
|
|
@@ -5748,7 +5748,7 @@ type RolldownLicensePluginOpts = {
|
|
|
5748
5748
|
declare function wrap(text: string, width: number): string;
|
|
5749
5749
|
/** Rolldown plugin that extracts license information from bundled dependencies */
|
|
5750
5750
|
declare const licensePlugin: ({
|
|
5751
|
-
|
|
5751
|
+
done,
|
|
5752
5752
|
match,
|
|
5753
5753
|
wrapText,
|
|
5754
5754
|
allow
|
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function parseLicense(pkgJson) {
|
|
|
40
40
|
return "";
|
|
41
41
|
}
|
|
42
42
|
/** Rolldown plugin that extracts license information from bundled dependencies */
|
|
43
|
-
const licensePlugin = ({
|
|
43
|
+
const licensePlugin = ({ done, match = defaultMatch, wrapText, allow }) => ({
|
|
44
44
|
name: "rolldown-license-plugin",
|
|
45
45
|
async generateBundle(_opts, bundle) {
|
|
46
46
|
const pkgJsonCache = /* @__PURE__ */ new Map();
|
|
@@ -110,7 +110,7 @@ const licensePlugin = ({ onDone, match = defaultMatch, wrapText, allow }) => ({
|
|
|
110
110
|
const violations = licenses.filter((entry) => !allow(entry));
|
|
111
111
|
if (violations.length) throw new Error(`License violation in: ${violations.map((entry) => `${entry.name}@${entry.version} (${entry.license || "unlicensed"})`).join(", ")}`);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
await done(licenses, this);
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-license-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Rolldown plugin to extract dependency licenses",
|
|
5
5
|
"author": "silverwind <me@silverwind.io>",
|
|
6
6
|
"repository": "silverwind/rolldown-license-plugin",
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "25.5.
|
|
20
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
19
|
+
"@types/node": "25.5.2",
|
|
20
|
+
"@typescript/native-preview": "7.0.0-dev.20260407.1",
|
|
21
21
|
"eslint": "10.1.0",
|
|
22
22
|
"eslint-config-silverwind": "127.1.4",
|
|
23
23
|
"jest-extended": "7.0.0",
|
|
24
24
|
"rolldown": "1.0.0-rc.13",
|
|
25
|
-
"tsdown": "0.21.
|
|
26
|
-
"tsdown-config-silverwind": "2.0.
|
|
25
|
+
"tsdown": "0.21.7",
|
|
26
|
+
"tsdown-config-silverwind": "2.0.5",
|
|
27
27
|
"typescript": "5.9.3",
|
|
28
|
-
"typescript-config-silverwind": "
|
|
29
|
-
"updates": "17.
|
|
28
|
+
"typescript-config-silverwind": "17.0.0",
|
|
29
|
+
"updates": "17.13.5",
|
|
30
30
|
"updates-config-silverwind": "2.0.1",
|
|
31
|
-
"versions": "14.2.
|
|
32
|
-
"vitest": "4.1.
|
|
33
|
-
"vitest-config-silverwind": "11.
|
|
31
|
+
"versions": "14.2.6",
|
|
32
|
+
"vitest": "4.1.3",
|
|
33
|
+
"vitest-config-silverwind": "11.1.4"
|
|
34
34
|
}
|
|
35
35
|
}
|