@easy-cms/nuxt 0.28.0 → 0.29.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/dist/module.js CHANGED
@@ -104,17 +104,20 @@ declare module '${SERVER}' {
104
104
  };
105
105
  const adminPackage = createRequire(import.meta.url).resolve("@easy-cms/admin/package.json");
106
106
  const adminAppDir = join(dirname(adminPackage), "dist/app");
107
- const shell = renderShell(readFileSync(join(adminAppDir, SHELL_FILE), "utf8"), {
107
+ const shellFile = join(adminAppDir, SHELL_FILE);
108
+ const shellOptions = {
108
109
  basePath: adminPath,
109
110
  apiPath,
110
111
  locale: rawConfig?.admin?.locale ?? "en",
111
112
  brand: rawConfig?.admin?.brand ?? {},
112
113
  // The site is this Nuxt app.
113
114
  siteUrl: rawConfig?.admin?.siteUrl ?? "/"
114
- });
115
+ };
116
+ const shell = renderShell(readFileSync(shellFile, "utf8"), shellOptions);
115
117
  nitro.virtual[ADMIN_SHELL] = `export const basePath = ${JSON.stringify(adminPath)}
116
118
  export const html = ${JSON.stringify(shell)}
117
119
  export const headers = ${JSON.stringify(SECURITY_HEADERS)}
120
+ export const reload = ${nuxt.options.dev ? JSON.stringify({ file: shellFile, options: shellOptions }) : "null"}
118
121
  `;
119
122
  nitro.publicAssets = [
120
123
  ...nitro.publicAssets ?? [],
@@ -1,5 +1,7 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { renderShell } from "@easy-cms/admin";
1
3
  import { defineEventHandler, getRequestURL, setResponseHeaders, setResponseStatus } from "h3";
2
- import { basePath, headers, html } from "#easy-cms-admin-shell";
4
+ import { basePath, headers, html, reload } from "#easy-cms-admin-shell";
3
5
  var admin_default = defineEventHandler((event) => {
4
6
  const url = getRequestURL(event);
5
7
  setResponseHeaders(event, headers);
@@ -21,7 +23,7 @@ var admin_default = defineEventHandler((event) => {
21
23
  "content-type": "text/html; charset=utf-8",
22
24
  "cache-control": "no-store"
23
25
  });
24
- return html;
26
+ return reload ? renderShell(readFileSync(reload.file, "utf8"), reload.options) : html;
25
27
  });
26
28
  export {
27
29
  admin_default as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/nuxt",
3
- "version": "0.28.0",
3
+ "version": "0.29.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.28.0"
23
+ "@easy-cms/admin": "^0.29.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "nuxt": "^4.0.0",
27
- "@easy-cms/core": "^0.28.0"
27
+ "@easy-cms/core": "^0.29.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.28.0",
35
- "@easy-cms/db-sqlite": "^0.28.0"
34
+ "@easy-cms/core": "^0.29.0",
35
+ "@easy-cms/db-sqlite": "^0.29.0"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"