@easy-cms/nuxt 0.11.0 → 0.13.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.
Files changed (2) hide show
  1. package/dist/module.js +15 -3
  2. package/package.json +5 -5
package/dist/module.js CHANGED
@@ -4,10 +4,12 @@ import { createRequire } from "module";
4
4
  import { dirname, isAbsolute, join, relative, resolve } from "path";
5
5
  import { renderShell, SECURITY_HEADERS, SHELL_FILE } from "@easy-cms/admin";
6
6
  import {
7
+ applyPlugins,
7
8
  CONFIG_FILE_NAMES,
8
9
  DEFAULT_ADMIN_PATH,
9
10
  DEFAULT_API_PATH,
10
- importConfig
11
+ importConfig,
12
+ resolveAdminModule
11
13
  } from "@easy-cms/core";
12
14
  import {
13
15
  addImports,
@@ -106,7 +108,9 @@ declare module '${SERVER}' {
106
108
  basePath: adminPath,
107
109
  apiPath,
108
110
  locale: rawConfig?.admin?.locale ?? "en",
109
- brand: rawConfig?.admin?.brand ?? {}
111
+ brand: rawConfig?.admin?.brand ?? {},
112
+ // The site is this Nuxt app.
113
+ siteUrl: rawConfig?.admin?.siteUrl ?? "/"
110
114
  });
111
115
  nitro.virtual[ADMIN_SHELL] = `export const basePath = ${JSON.stringify(adminPath)}
112
116
  export const html = ${JSON.stringify(shell)}
@@ -120,7 +124,15 @@ export const headers = ${JSON.stringify(SECURITY_HEADERS)}
120
124
  const adminHandler = resolveRuntime("./runtime/admin.js");
121
125
  addServerHandler({ route: adminPath, handler: adminHandler });
122
126
  addServerHandler({ route: `${adminPath}/**`, handler: adminHandler });
123
- const traceInclude = rawConfig?.db?.bundle?.traceInclude ?? [];
127
+ const traceInclude = [...rawConfig?.db?.bundle?.traceInclude ?? []];
128
+ if (rawConfig) {
129
+ const withPlugins = await applyPlugins(rawConfig).catch(() => rawConfig);
130
+ for (const specifier of withPlugins?.admin?.modules ?? []) {
131
+ const file = resolveAdminModule(specifier, rootDir);
132
+ if (file) traceInclude.push(file);
133
+ else logger.warn(`Admin module "${specifier}" not found from ${rootDir}.`);
134
+ }
135
+ }
124
136
  if (traceInclude.length > 0) {
125
137
  const externals = nitro.externals ?? {};
126
138
  nitro.externals = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/nuxt",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Nuxt module for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,19 +20,19 @@
20
20
  "dependencies": {
21
21
  "@nuxt/kit": "^4.5.2",
22
22
  "h3": "^1.15.11",
23
- "@easy-cms/admin": "^0.11.0"
23
+ "@easy-cms/admin": "^0.13.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "nuxt": "^4.0.0",
27
- "@easy-cms/core": "^0.11.0"
27
+ "@easy-cms/core": "^0.13.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@nuxt/schema": "^4.5.2",
31
31
  "@nuxt/test-utils": "^4.3.2",
32
32
  "nuxt": "^4.5.2",
33
33
  "vue": "^3.5.0",
34
- "@easy-cms/core": "^0.11.0",
35
- "@easy-cms/db-sqlite": "^0.11.0"
34
+ "@easy-cms/core": "^0.13.0",
35
+ "@easy-cms/db-sqlite": "^0.13.0"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"