@jojomatik/nuxt-bundle 1.2.1-beta.1 → 2.0.0-beta.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.
@@ -1,3 +1,4 @@
1
+ <!-- eslint-disable vue/multi-word-component-names -->
1
2
  <template>
2
3
  <v-app>
3
4
  <v-sheet class="ma-auto pa-5" border rounded="xl">
@@ -33,7 +33,7 @@
33
33
  </template>
34
34
 
35
35
  <script setup lang="ts">
36
- import { type Composer } from "vue-i18n";
36
+ import type { Composer } from "vue-i18n";
37
37
  const i18n: Composer = useI18n();
38
38
 
39
39
  // As nuxt can't fetch data from the public dir during SSR, the request can only be made on client side (see also nuxt/nuxt#13857).
@@ -1,6 +1,5 @@
1
- import { defineNuxtModule, useLogger } from "nuxt/kit";
1
+ import { addVitePlugin, defineNuxtModule, useLogger } from "nuxt/kit";
2
2
  import license from "rollup-plugin-license";
3
- import { type PluginOption } from "vite";
4
3
 
5
4
  const moduleKey = "@jojomatik/nuxt-bundle/license-module";
6
5
  const envKey = "ALLOWED_LICENCES";
@@ -10,75 +9,80 @@ const logger = useLogger(moduleKey);
10
9
  export default defineNuxtModule({
11
10
  meta: {
12
11
  name: moduleKey,
13
- configKey: "licenseModule"
12
+ configKey: "licenseModule",
14
13
  },
15
- setup(options, nuxt) {
16
- nuxt.hook("vite:extendConfig", (viteConfig) => {
17
- viteConfig.plugins = viteConfig.plugins || [];
18
- viteConfig.plugins.push(
19
- license({
20
- thirdParty: {
21
- includePrivate: false,
22
- allow: {
23
- test: (dependency) => {
24
- // Return false for unlicensed dependencies.
25
- if (!dependency.license) return false;
14
+ setup(options) {
15
+ addVitePlugin(
16
+ license({
17
+ thirdParty: {
18
+ includePrivate: false,
19
+ allow: {
20
+ test: (dependency) => {
21
+ // Return false for unlicensed dependencies.
22
+ if (!dependency.license) return false;
26
23
 
27
- // Load allowed licenses from environment-variable
28
- const allowedLicensesFromEnv =
29
- process.env[envKey]?.split(",").map((license) =>
30
- license.trim()
31
- );
24
+ // Load allowed licenses from environment-variable
25
+ const allowedLicensesFromEnv = process.env[envKey]
26
+ ?.split(",")
27
+ .map((license) => license.trim());
32
28
 
33
- // Load allowed licenses from module options
34
- // Allow MIT and Apache-2.0 licenses by default
35
- const allowedLicenses = allowedLicensesFromEnv ?? options.allowedLicenses;
29
+ // Load allowed licenses from module options
30
+ // Allow MIT and Apache-2.0 licenses by default
31
+ const allowedLicenses =
32
+ allowedLicensesFromEnv ?? options.allowedLicenses;
36
33
 
37
- const isLicenseAllowed = allowedLicenses.includes(
38
- dependency.license
39
- );
34
+ const isLicenseAllowed = allowedLicenses.includes(
35
+ dependency.license,
36
+ );
40
37
 
41
- if (!isLicenseAllowed) {
42
- logger.error(
43
- `Dependency "${dependency.name}" has a license (${dependency.license}) that is not the list of allowed licenses (${allowedLicenses.join(", ")}).`
44
- );
38
+ if (!isLicenseAllowed) {
39
+ logger.error(
40
+ `Dependency "${dependency.name}" has a license (${dependency.license}) that is not the list of allowed licenses (${allowedLicenses.join(", ")}).`,
41
+ );
45
42
 
46
- const requiredLicenses = [...allowedLicenses, dependency.license];
43
+ const requiredLicenses = [
44
+ ...allowedLicenses,
45
+ dependency.license,
46
+ ];
47
47
 
48
- const configContent = JSON.stringify({
48
+ const configContent = JSON.stringify(
49
+ {
49
50
  extends: "@jojomatik/nuxt-bundle",
50
- licenseModule:
51
- {
52
- allowedLicenses: requiredLicenses
53
- }
54
- }, undefined, 2);
51
+ licenseModule: {
52
+ allowedLicenses: requiredLicenses,
53
+ },
54
+ },
55
+ undefined,
56
+ 2,
57
+ );
55
58
 
56
- const configExample = "export default defineNuxtConfig(" + configContent + ");\n";
59
+ const configExample =
60
+ "export default defineNuxtConfig(" + configContent + ");\n";
57
61
 
58
- logger.info(
59
- `You can specify allowed licenses in "nuxt.config.ts" environment variable:`
60
- );
61
- console.log(configExample);
62
+ logger.info(
63
+ `You can specify allowed licenses in "nuxt.config.ts" environment variable:`,
64
+ );
65
+ console.log(configExample);
62
66
 
63
- logger.info(
64
- `You can also specify allowed licenses via "${envKey}" environment variable (ALLOWED_LICENCES=${requiredLicenses.join(",")}).`
65
- );
66
- }
67
+ logger.info(
68
+ `You can also specify allowed licenses via "${envKey}" environment variable (ALLOWED_LICENCES=${requiredLicenses.join(",")}).`,
69
+ );
70
+ }
67
71
 
68
- return isLicenseAllowed;
69
- },
70
- failOnUnlicensed: true,
71
- failOnViolation: true
72
+ return isLicenseAllowed;
72
73
  },
73
- output: {
74
- // Output file into public directory which is included in the build output.
75
- file: "public/dependencies.json",
76
- template(dependencies) {
77
- return JSON.stringify(dependencies);
78
- }
79
- }
80
- }
81
- }) as PluginOption);
82
- });
83
- }
74
+ failOnUnlicensed: true,
75
+ failOnViolation: true,
76
+ },
77
+ output: {
78
+ // Output file into public directory which is included in the build output.
79
+ file: "public/dependencies.json",
80
+ template(dependencies) {
81
+ return JSON.stringify(dependencies);
82
+ },
83
+ },
84
+ },
85
+ }),
86
+ );
87
+ },
84
88
  });
package/nuxt.config.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  import * as fs from "fs";
2
2
  import chalk from "chalk";
3
3
  import vuetify from "vite-plugin-vuetify";
4
+ import type { LocaleObject } from "@nuxtjs/i18n";
4
5
 
5
6
  /**
6
7
  * Returns all locales with their corresponding file names from `./locales`.
7
8
  */
8
- export function getLocales(): { code: string; file: string }[] {
9
+ export function getLocales(): LocaleObject<string>[] {
9
10
  const files = fs.readdirSync("./locales");
10
11
 
11
12
  return files.map((file) => {
12
- const code = file.split(".")[0];
13
+ const code = file.split(".")[0] as string;
13
14
 
14
15
  return {
15
16
  code,
@@ -69,18 +70,19 @@ export default defineNuxtConfig({
69
70
  modules: [
70
71
  "@crystal-creations/crystal-components/nuxt",
71
72
  "@nuxt/image",
72
- [
73
- "@nuxtjs/i18n",
74
- {
75
- locales: getLocales(),
76
- langDir: "locales",
77
- },
78
- ],
73
+ "@nuxtjs/i18n",
79
74
  "@nuxtjs/seo",
75
+ "@nuxt/eslint",
80
76
  ],
81
77
  licenseModule: {
82
78
  allowedLicenses: ["MIT", "Apache-2.0"],
83
79
  },
80
+ i18n: {
81
+ locales: getLocales(),
82
+ defaultLocale: "en",
83
+ restructureDir: ".",
84
+ langDir: "locales",
85
+ },
84
86
  hooks: {
85
87
  "nitro:build:before": () => {
86
88
  const fontsDir = "public/assets/fonts/";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jojomatik/nuxt-bundle",
3
- "version": "1.2.1-beta.1",
3
+ "version": "2.0.0-beta.1",
4
4
  "type": "module",
5
5
  "description": "A bundle of commonly used nuxt dependencies and configuration.",
6
6
  "keywords": [
@@ -18,72 +18,65 @@
18
18
  "semantic-release": "semantic-release"
19
19
  },
20
20
  "files": [
21
- "assets",
21
+ "app",
22
22
  "locales",
23
23
  "modules",
24
- "pages",
25
- "error.vue",
26
24
  "nuxt.config.ts",
27
25
  "package.json",
28
26
  "README.md"
29
27
  ],
30
28
  "main": "nuxt.config.ts",
31
29
  "dependencies": {
32
- "@crystal-creations/crystal-components": "1.0.0-beta.22",
33
- "@fontsource/roboto": "5.0.12",
30
+ "@crystal-creations/crystal-components": "1.0.0-beta.43",
31
+ "@fontsource/roboto": "5.2.9",
34
32
  "@mdi/js": "7.4.47",
35
- "@nuxt/image": "1.5.0",
36
- "@nuxtjs/eslint-config-typescript": "12.1.0",
37
- "@nuxtjs/i18n": "8.3.0",
38
- "@nuxtjs/robots": "3.0.0",
39
- "@nuxtjs/seo": "2.2.0",
33
+ "@nuxt/eslint": "^1.12.1",
34
+ "@nuxt/image": "2.0.0",
35
+ "@nuxtjs/i18n": "10.2.1",
36
+ "@nuxtjs/seo": "3.3.0",
40
37
  "@semantic-release/exec": "7.1.0",
41
38
  "@semantic-release/git": "10.0.1",
42
- "@storybook/addon-essentials": "8.0.5",
43
- "@storybook/addon-interactions": "8.0.5",
44
- "@storybook/addon-links": "8.0.5",
45
- "@storybook/blocks": "8.0.5",
46
- "@storybook/components": "8.0.5",
47
- "@storybook/manager-api": "8.0.5",
48
- "@storybook/preview-api": "8.0.5",
49
- "@storybook/testing-library": "0.2.2",
50
- "@storybook/types": "8.0.5",
51
- "@storybook/vue3": "8.0.5",
52
- "@storybook/vue3-vite": "8.0.5",
53
- "@types/node": "18.19.29",
54
- "@vitejs/plugin-vue": "^5.0.4",
55
- "chromatic": "11.3.0",
39
+ "@storybook/addon-essentials": "8.6.14",
40
+ "@storybook/addon-interactions": "8.6.14",
41
+ "@storybook/addon-links": "8.6.14",
42
+ "@storybook/blocks": "8.6.14",
43
+ "@storybook/components": "8.6.14",
44
+ "@storybook/manager-api": "8.6.14",
45
+ "@storybook/preview-api": "8.6.14",
46
+ "@storybook/test": "8.6.14",
47
+ "@storybook/types": "8.6.14",
48
+ "@storybook/vue3": "8.6.14",
49
+ "@storybook/vue3-vite": "8.6.14",
50
+ "@types/node": "24.10.4",
51
+ "chromatic": "13.3.4",
56
52
  "conventional-changelog-conventionalcommits": "9.1.0",
57
- "eslint-config-prettier": "9.1.0",
58
- "eslint-plugin-prettier": "5.1.3",
59
- "eslint-plugin-storybook": "0.8.0",
60
- "eslint-plugin-vue": "9.24.0",
61
- "prettier": "3.2.5",
62
- "rollup": "4.14.0",
63
- "rollup-plugin-license": "3.3.1",
64
- "sass": "1.72.0",
53
+ "eslint-config-prettier": "10.1.8",
54
+ "eslint-plugin-prettier": "5.5.4",
55
+ "eslint-plugin-storybook": "0.12.0",
56
+ "eslint-plugin-vue": "10.6.2",
57
+ "prettier": "3.7.4",
58
+ "rollup": "4.54.0",
59
+ "rollup-plugin-license": "3.6.0",
60
+ "sass": "1.97.1",
65
61
  "semantic-release": "25.0.2",
66
- "storybook": "8.0.5",
67
- "storybook-i18n": "^3.0.1",
68
- "typescript": "5.4.3",
69
- "unplugin-auto-import": "0.17.5",
70
- "unplugin-vue-components": "0.26.0",
71
- "vite-plugin-vuetify": "2.0.3",
72
- "vue-i18n": "9.10.2",
73
- "vue-router": "4.3.0",
74
- "vuetify": "3.5.14"
62
+ "storybook": "8.6.14",
63
+ "storybook-i18n": "3.1.1",
64
+ "typescript": "5.9.3",
65
+ "vite-plugin-vuetify": "2.1.2",
66
+ "vue-router": "4.6.4",
67
+ "vuetify": "3.11.6"
75
68
  },
76
69
  "devDependencies": {
77
- "eslint": "8.57.0",
78
- "nuxt": "3.11.1",
79
- "vite": "5.2.8",
80
- "vue": "3.4.21"
70
+ "eslint": "9.39.2",
71
+ "nuxt": "4.2.2",
72
+ "vite": "7.3.0",
73
+ "vue": "3.5.26"
81
74
  },
82
75
  "peerDependencies": {
83
- "eslint": "^8.56.0",
84
- "nuxt": "^3.7.4",
85
- "vite": "^5.0.11",
86
- "vue": "^3.4.8"
76
+ "eslint": "^9.39.2",
77
+ "nuxt": "^4.2.2",
78
+ "vite": "^7.3.0",
79
+ "vue": "^3.5.26"
87
80
  },
88
81
  "author": {
89
82
  "name": "jojomatik",
File without changes