@jojomatik/nuxt-bundle 2.0.0-beta.20 → 2.0.0-beta.21

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/nuxt.config.ts CHANGED
@@ -87,7 +87,7 @@ export default defineNuxtConfig({
87
87
  "vuetify-nuxt-module",
88
88
  ],
89
89
  licenseModule: {
90
- allowedLicenses: ["MIT", "Apache-2.0", "ISC"],
90
+ allowedLicenses: ["MIT", "Apache-2.0", "ISC", "OFL-1.1"],
91
91
  },
92
92
  i18n: {
93
93
  locales: getLocales(),
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@jojomatik/nuxt-bundle",
3
- "version": "2.0.0-beta.20",
3
+ "version": "2.0.0-beta.21",
4
4
  "type": "module",
5
+ "packageManager": "yarn@1.22.22",
5
6
  "description": "A bundle of commonly used nuxt dependencies and configuration.",
6
7
  "keywords": [
7
8
  "nuxt",
@@ -11,11 +12,12 @@
11
12
  "configuration"
12
13
  ],
13
14
  "scripts": {
15
+ "prepare": "nuxi prepare",
14
16
  "dev": "nuxi dev",
15
17
  "build": "nuxi build",
16
18
  "start": "node .output/server/index.mjs",
17
19
  "lint": "eslint . --max-warnings 0",
18
- "test": "node --experimental-strip-types --test lib/__tests__/*.test.ts",
20
+ "test": "vitest run --coverage",
19
21
  "semantic-release": "semantic-release"
20
22
  },
21
23
  "files": [
@@ -62,8 +64,13 @@
62
64
  },
63
65
  "devDependencies": {
64
66
  "eslint": "10.13.0",
67
+ "happy-dom": "21.0.4",
65
68
  "nuxt": "4.6.2",
66
69
  "vite": "8.3.5",
70
+ "@vitejs/plugin-vue": "6.0.10",
71
+ "@vitest/coverage-v8": "5.0.5",
72
+ "@vue/test-utils": "2.5.1",
73
+ "vitest": "5.0.5",
67
74
  "vue": "3.5.44"
68
75
  },
69
76
  "peerDependencies": {
@@ -1,160 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { test } from "node:test";
3
- import { createLicensePluginOptions } from "../license-plugin-options.ts";
4
- import {
5
- applyLicenseOverrides,
6
- validateDependencyLicense,
7
- } from "../license-validation.ts";
8
-
9
- test("applies a package license override before validation", () => {
10
- assert.deepEqual(
11
- validateDependencyLicense(
12
- { name: "socket.io-client" },
13
- { "socket.io-client": "MIT" },
14
- ["MIT"],
15
- ),
16
- { license: "MIT", isAllowed: true },
17
- );
18
- });
19
-
20
- test("rejects missing license metadata without an override", () => {
21
- assert.deepEqual(
22
- validateDependencyLicense({ name: "unlicensed-package" }, {}, ["MIT"]),
23
- { license: undefined, isAllowed: false },
24
- );
25
- });
26
-
27
- test("still rejects an overridden license outside the allow-list", () => {
28
- assert.deepEqual(
29
- validateDependencyLicense(
30
- { name: "socket.io-client" },
31
- { "socket.io-client": "MIT" },
32
- ["Apache-2.0"],
33
- ),
34
- { license: "MIT", isAllowed: false },
35
- );
36
- });
37
-
38
- test("applies overrides to generated metadata without mutating dependencies", () => {
39
- const dependency = { name: "socket.io-client" };
40
-
41
- assert.deepEqual(
42
- applyLicenseOverrides([dependency], { "socket.io-client": "MIT" }),
43
- [{ name: "socket.io-client", license: "MIT" }],
44
- );
45
- assert.equal(dependency.license, undefined);
46
- });
47
-
48
- test("allows an override callback to supply a license only when missing", () => {
49
- const licenseOverrides = {
50
- "socket.io-client": (license: string | undefined) => license || "MIT",
51
- };
52
-
53
- assert.deepEqual(
54
- validateDependencyLicense({ name: "socket.io-client" }, licenseOverrides, [
55
- "MIT",
56
- ]),
57
- { license: "MIT", isAllowed: true },
58
- );
59
- assert.deepEqual(
60
- validateDependencyLicense(
61
- { name: "socket.io-client", license: "GPL-3.0" },
62
- licenseOverrides,
63
- ["MIT"],
64
- ),
65
- { license: "GPL-3.0", isAllowed: false },
66
- );
67
- assert.deepEqual(
68
- applyLicenseOverrides(
69
- [{ name: "socket.io-client", license: "GPL-3.0" }],
70
- licenseOverrides,
71
- ),
72
- [{ name: "socket.io-client", license: "GPL-3.0" }],
73
- );
74
- });
75
-
76
- test("normalizes null license metadata before invoking an override callback", () => {
77
- let callbackLicense: string | undefined = "not called";
78
- const licenseOverrides = {
79
- "socket.io-client": (license: string | undefined) => {
80
- callbackLicense = license;
81
- return license || "MIT";
82
- },
83
- };
84
-
85
- assert.deepEqual(
86
- validateDependencyLicense(
87
- { name: "socket.io-client", license: null },
88
- licenseOverrides,
89
- ["MIT"],
90
- ),
91
- { license: "MIT", isAllowed: true },
92
- );
93
- assert.equal(callbackLicense, undefined);
94
- });
95
-
96
- test("applies license overrides in configured plugin callbacks", () => {
97
- const pluginOptions = createLicensePluginOptions(
98
- {
99
- allowedLicenses: ["MIT"],
100
- licenseOverrides: {
101
- "socket.io-client": (license) => license ?? "MIT",
102
- },
103
- },
104
- {
105
- error: assert.fail,
106
- info: assert.fail,
107
- },
108
- );
109
- const dependency = { name: "socket.io-client", license: null };
110
-
111
- assert.equal(pluginOptions.thirdParty.allow.test(dependency), true);
112
- assert.deepEqual(
113
- JSON.parse(pluginOptions.thirdParty.output.template([dependency])),
114
- [{ name: "socket.io-client", license: "MIT" }],
115
- );
116
- });
117
-
118
- test("allows a license only for its configured dependencies", () => {
119
- const pluginOptions = createLicensePluginOptions(
120
- {
121
- allowedLicenses: [
122
- "MIT",
123
- { "SEE LICENSE IN LICENSE.md": ["apexcharts", "vue-apexcharts"] },
124
- ],
125
- },
126
- {
127
- error: () => {},
128
- info: () => {},
129
- },
130
- );
131
-
132
- const originalConsoleLog = console.log;
133
- console.log = () => {};
134
-
135
- try {
136
- assert.equal(
137
- pluginOptions.thirdParty.allow.test({
138
- name: "apexcharts",
139
- license: "SEE LICENSE IN LICENSE.md",
140
- }),
141
- true,
142
- );
143
- assert.equal(
144
- pluginOptions.thirdParty.allow.test({
145
- name: "vue-apexcharts",
146
- license: "SEE LICENSE IN LICENSE.md",
147
- }),
148
- true,
149
- );
150
- assert.equal(
151
- pluginOptions.thirdParty.allow.test({
152
- name: "another-package",
153
- license: "SEE LICENSE IN LICENSE.md",
154
- }),
155
- false,
156
- );
157
- } finally {
158
- console.log = originalConsoleLog;
159
- }
160
- });