fix pwa modular

This commit is contained in:
2026-02-01 21:53:26 +03:30
parent 5ae1b4c40a
commit f5928601fa
277 changed files with 2054 additions and 1853 deletions
@@ -1,4 +1,4 @@
import { e as defineSitemapEventHandler } from '../../../nitro/nitro.mjs';
import { i as defineSitemapEventHandler } from '../../../nitro/nitro.mjs';
import { createClient } from '@supabase/supabase-js';
import 'node:http';
import 'node:https';
@@ -1,4 +1,4 @@
import { d as defineEventHandler } from '../nitro/nitro.mjs';
import { d as defineEventHandler, b as getRequestHost, a as getCachedConfig, c as setResponseHeader } from '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
@@ -12,25 +12,41 @@ import 'consola';
import 'fast-xml-parser';
import 'ipx';
const manifest_webmanifest_get = defineEventHandler((event) => {
const name = useState("app-name").value.fa || "App";
return {
const manifest_webmanifest_get = defineEventHandler(async (event) => {
const host = getRequestHost(event);
const config = await getCachedConfig(host);
const name = (config == null ? void 0 : config.appNameEn) || "App Name";
const shortName = (config == null ? void 0 : config.appNameEn) || "App";
const description = (config == null ? void 0 : config.description) || "Best Shopping App";
const iconSrc = (config == null ? void 0 : config.storageLogo) ? `${config.storageLogo}/pwa-icon-192.png` : "/pwa-icon-192.png";
const manifest = {
name,
short_name: name,
short_name: shortName,
description,
id: "/",
start_url: "/",
display: "standalone",
orientation: "portrait",
scope: "/",
orientation: "portrait-primary",
background_color: "#ffffff",
theme_color: "#ffffff",
description: name,
icons: [
{ src: "/pwa-icon-192.png", sizes: "192x192", type: "image/png", purpose: "any maskable" },
{ src: "/pwa-icon-512.png", sizes: "512x512", type: "image/png", purpose: "any maskable" }
],
categories: ["business", "shopping"]
{
src: iconSrc,
sizes: "192x192",
type: "image/png",
purpose: "any maskable"
},
{
// اینجا فرض میکنیم فایل 512 هم کنار 192 هست
src: iconSrc.replace("192", "512"),
sizes: "512x512",
type: "image/png",
purpose: "any maskable"
}
]
};
setResponseHeader(event, "Content-Type", "application/manifest+json");
return manifest;
});
export { manifest_webmanifest_get as default };
+2 -2
View File
@@ -1,5 +1,5 @@
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
import { f as buildAssetsURL, u as useRuntimeConfig, i as getResponseStatusText, k as getResponseStatus, l as decodePath, m as defineRenderHandler, n as publicAssetsURL, o as getQuery, q as createError, r as destr, t as getRouteRules, j as joinURL, v as useNitroApp } from '../nitro/nitro.mjs';
import { k as buildAssetsURL, u as useRuntimeConfig, l as getResponseStatusText, m as getResponseStatus, n as decodePath, o as defineRenderHandler, q as publicAssetsURL, r as getQuery, t as createError, v as destr, x as getRouteRules, j as joinURL, y as useNitroApp } from '../nitro/nitro.mjs';
import { renderToString } from 'vue/server-renderer';
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
import { stringify, uneval } from 'devalue';
@@ -45,7 +45,7 @@ function createHead(options = {}) {
const NUXT_RUNTIME_PAYLOAD_EXTRACTION = false;
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"},{"name":"screen-orientation","content":"portrait"}],"link":[{"rel":"manifest","href":"/manifest.webmanifest"}],"style":[],"script":[],"noscript":[],"title":"loading"};
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"},{"name":"screen-orientation","content":"portrait"}],"link":[{"rel":"manifest","href":"/manifest.webmanifest"}],"style":[],"script":[],"noscript":[],"title":"Loading..."};
const appRootTag = "div";