first build
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { u as useRuntimeConfig, c as defineSitemapEventHandler } from '../../../nitro/nitro.mjs';
|
||||
import { createClient } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@supabase/supabase-js/dist/main/index.js';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue/index.mjs';
|
||||
import 'node:url';
|
||||
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/consola/dist/index.mjs';
|
||||
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/ipx/dist/index.mjs';
|
||||
|
||||
let _client = null;
|
||||
function ensureClient() {
|
||||
if (_client) return _client;
|
||||
const cfg = useRuntimeConfig().public;
|
||||
if (!(cfg == null ? void 0 : cfg.SUPABASE_URL) || !(cfg == null ? void 0 : cfg.SUPABASE_KEY)) {
|
||||
console.warn("[supabase] Missing SUPABASE_URL/KEY in runtimeConfig.public");
|
||||
}
|
||||
_client = createClient(cfg.SUPABASE_URL, cfg.SUPABASE_KEY);
|
||||
return _client;
|
||||
}
|
||||
const supabase = new Proxy({}, {
|
||||
get(_t, prop, receiver) {
|
||||
const c = ensureClient();
|
||||
return Reflect.get(c, prop, receiver);
|
||||
},
|
||||
apply(_t, thisArg, argArray) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = ensureClient()) == null ? void 0 : _a.apply) == null ? void 0 : _b.call(_a, thisArg, argArray);
|
||||
}
|
||||
});
|
||||
|
||||
function resolveBaseURL() {
|
||||
var _a, _b;
|
||||
const envFallback = ((_b = (_a = globalThis._importMeta_) == null ? void 0 : _a.env) == null ? void 0 : _b.NUXT_PUBLIC_DOMAIN_URL) || process.env.NUXT_PUBLIC_DOMAIN_URL || "";
|
||||
const { public: pub } = useRuntimeConfig();
|
||||
return envFallback;
|
||||
}
|
||||
const urls = defineSitemapEventHandler(async () => {
|
||||
const urls = [];
|
||||
try {
|
||||
const { data: categorys, error } = await supabase.from("collections").select(`title`);
|
||||
if (categorys && categorys.length) {
|
||||
categorys.forEach((item) => {
|
||||
urls.push(`${resolveBaseURL()}/search/main?category=${item.title}`);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
try {
|
||||
const { data: brands, error } = await supabase.from("brands").select(`title`);
|
||||
if (brands && brands.length) {
|
||||
brands.forEach((item) => {
|
||||
urls.push(`${resolveBaseURL()}/search/main?brand=${item.title}`);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
try {
|
||||
const { data: products, error } = await supabase.from("products").select(`title`);
|
||||
if (products && products.length) {
|
||||
products.forEach((item) => {
|
||||
urls.push(`${resolveBaseURL()}/product_detail/${item.title}`);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
urls.push(`${resolveBaseURL()}/`);
|
||||
urls.push(`${resolveBaseURL()}/home`);
|
||||
urls.push(`${resolveBaseURL()}/search`);
|
||||
urls.push(`${resolveBaseURL()}/search/main`);
|
||||
urls.push(`${resolveBaseURL()}/user`);
|
||||
return urls;
|
||||
});
|
||||
|
||||
export { urls as default };
|
||||
@@ -1,35 +1 @@
|
||||
import { Server as Server$1 } from 'node:http';
|
||||
import { Server } from 'node:https';
|
||||
import { A as toNodeListener, l as destr, u as useRuntimeConfig, B as trapUnhandledNodeErrors, C as setupGracefulShutdown, n as useNitroApp } from '../../_/nitro.mjs';
|
||||
|
||||
const cert = process.env.NITRO_SSL_CERT;
|
||||
const key = process.env.NITRO_SSL_KEY;
|
||||
const nitroApp = useNitroApp();
|
||||
const server = cert && key ? new Server({ key, cert }, toNodeListener(nitroApp.h3App)) : new Server$1(toNodeListener(nitroApp.h3App));
|
||||
const port = destr(process.env.NITRO_PORT || process.env.PORT) || 3e3;
|
||||
const host = process.env.NITRO_HOST || process.env.HOST;
|
||||
const path = process.env.NITRO_UNIX_SOCKET;
|
||||
const listener = server.listen(path ? { path } : { port, host }, (err) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
const protocol = cert && key ? "https" : "http";
|
||||
const addressInfo = listener.address();
|
||||
if (typeof addressInfo === "string") {
|
||||
console.log(`Listening on unix socket ${addressInfo}`);
|
||||
return;
|
||||
}
|
||||
const baseURL = (useRuntimeConfig().app.baseURL || "").replace(/\/$/, "");
|
||||
const url = `${protocol}://${addressInfo.family === "IPv6" ? `[${addressInfo.address}]` : addressInfo.address}:${addressInfo.port}${baseURL}`;
|
||||
console.log(`Listening on ${url}`);
|
||||
});
|
||||
trapUnhandledNodeErrors();
|
||||
setupGracefulShutdown(listener, nitroApp);
|
||||
const nodeServer = {};
|
||||
|
||||
const stories = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
||||
__proto__: null
|
||||
}, Symbol.toStringTag, { value: 'Module' }));
|
||||
|
||||
export { nodeServer as n, stories as s };
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { d as defineEventHandler, u as useRuntimeConfig } from '../nitro/nitro.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue/index.mjs';
|
||||
import 'node:url';
|
||||
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/consola/dist/index.mjs';
|
||||
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/ipx/dist/index.mjs';
|
||||
|
||||
const manifest_webmanifest_get = defineEventHandler((event) => {
|
||||
const cfg = useRuntimeConfig(event);
|
||||
const name = cfg.public.APP_NAME_EN || "App";
|
||||
return {
|
||||
name,
|
||||
short_name: name,
|
||||
id: "/",
|
||||
start_url: "/",
|
||||
display: "standalone",
|
||||
orientation: "portrait",
|
||||
scope: "/",
|
||||
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"]
|
||||
};
|
||||
});
|
||||
|
||||
export { manifest_webmanifest_get as default };
|
||||
@@ -1,16 +1,17 @@
|
||||
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
|
||||
import { c as buildAssetsURL, u as useRuntimeConfig, g as getResponseStatusText, e as getResponseStatus, f as defineRenderHandler, p as publicAssetsURL, i as getQuery, k as createError, l as destr, m as getRouteRules, n as useNitroApp } from '../_/nitro.mjs';
|
||||
import { renderToString } from 'vue/server-renderer';
|
||||
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
|
||||
import { stringify, uneval } from 'devalue';
|
||||
import { walkResolver } from 'unhead/utils';
|
||||
import { toValue, isRef, hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
||||
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue-bundle-renderer/dist/runtime.mjs';
|
||||
import { e as buildAssetsURL, u as useRuntimeConfig, g as getResponseStatusText, f as getResponseStatus, i as defineRenderHandler, k as publicAssetsURL, l as getQuery, m as createError, n as destr, o as getRouteRules, q as useNitroApp } from '../nitro/nitro.mjs';
|
||||
import { renderToString } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@nuxt/nitro-server/node_modules/vue/server-renderer/index.mjs';
|
||||
import { createHead as createHead$1, propsToString, renderSSRHead } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/unhead/dist/server.mjs';
|
||||
import { stringify, uneval } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/devalue/index.js';
|
||||
import { walkResolver } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/unhead/dist/utils.mjs';
|
||||
import { toValue, isRef, hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@unhead/vue/node_modules/vue/index.mjs';
|
||||
|
||||
const VueResolver = (_, value) => {
|
||||
return isRef(value) ? toValue(value) : value;
|
||||
};
|
||||
|
||||
const headSymbol = "usehead";
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function vueInstall(head) {
|
||||
const plugin = {
|
||||
install(app) {
|
||||
@@ -22,6 +23,7 @@ function vueInstall(head) {
|
||||
return plugin.install;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function injectHead() {
|
||||
if (hasInjectionContext()) {
|
||||
const instance = inject(headSymbol);
|
||||
@@ -33,7 +35,7 @@ function injectHead() {
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
function useHead(input, options = {}) {
|
||||
const head = options.head || injectHead();
|
||||
const head = options.head || /* @__PURE__ */ injectHead();
|
||||
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
|
||||
}
|
||||
function clientUseHead(head, input, options = {}) {
|
||||
@@ -62,6 +64,7 @@ function clientUseHead(head, input, options = {}) {
|
||||
return entry;
|
||||
}
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHead(options = {}) {
|
||||
const head = createHead$1({
|
||||
...options,
|
||||
@@ -71,7 +74,7 @@ function createHead(options = {}) {
|
||||
return head;
|
||||
}
|
||||
|
||||
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"}],"link":[],"style":[],"script":[],"noscript":[],"title":"Montify"};
|
||||
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":"Goldali"};
|
||||
|
||||
const appRootTag = "div";
|
||||
|
||||
@@ -89,23 +92,20 @@ const appId = "nuxt-app";
|
||||
|
||||
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
||||
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
||||
const getServerEntry = () => import('../build/server.mjs').then(function (n) { return n.bI; }).then((r) => r.default || r);
|
||||
const getClientManifest = () => import('../build/client.manifest.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
||||
const getServerEntry = () => import('../build/server.mjs').then(function (n) { return n.bF; }).then((r) => r.default || r);
|
||||
const getPrecomputedDependencies = () => import('../build/client.precomputed.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
||||
const getSSRRenderer = lazyCachedFunction(async () => {
|
||||
const manifest = await getClientManifest();
|
||||
if (!manifest) {
|
||||
throw new Error("client.manifest is not available");
|
||||
}
|
||||
const createSSRApp = await getServerEntry();
|
||||
if (!createSSRApp) {
|
||||
throw new Error("Server bundle is not available");
|
||||
}
|
||||
const options = {
|
||||
manifest,
|
||||
const precomputed = await getPrecomputedDependencies();
|
||||
const renderer = createRenderer(createSSRApp, {
|
||||
precomputed,
|
||||
manifest: void 0,
|
||||
renderToString: renderToString$1,
|
||||
buildAssetsURL
|
||||
};
|
||||
const renderer = createRenderer(createSSRApp, options);
|
||||
});
|
||||
async function renderToString$1(input, context) {
|
||||
const html = await renderToString(input, context);
|
||||
return APP_ROOT_OPEN_TAG + html + APP_ROOT_CLOSE_TAG;
|
||||
@@ -113,7 +113,7 @@ const getSSRRenderer = lazyCachedFunction(async () => {
|
||||
return renderer;
|
||||
});
|
||||
const getSPARenderer = lazyCachedFunction(async () => {
|
||||
const manifest = await getClientManifest();
|
||||
const precomputed = await getPrecomputedDependencies();
|
||||
const spaTemplate = await import('../virtual/_virtual_spa-template.mjs').then((r) => r.template).catch(() => "").then((r) => {
|
||||
{
|
||||
const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>`;
|
||||
@@ -123,13 +123,13 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
return appTemplate + loaderTemplate;
|
||||
}
|
||||
});
|
||||
const options = {
|
||||
manifest,
|
||||
const renderer = createRenderer(() => () => {
|
||||
}, {
|
||||
precomputed,
|
||||
manifest: void 0,
|
||||
renderToString: () => spaTemplate,
|
||||
buildAssetsURL
|
||||
};
|
||||
const renderer = createRenderer(() => () => {
|
||||
}, options);
|
||||
});
|
||||
const result = await renderer.renderToString({});
|
||||
const renderToString = (ssrContext) => {
|
||||
const config = useRuntimeConfig(ssrContext.event);
|
||||
@@ -363,7 +363,14 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
};
|
||||
});
|
||||
function normalizeChunks(chunks) {
|
||||
return chunks.filter(Boolean).map((i) => i.trim());
|
||||
const result = [];
|
||||
for (const _chunk of chunks) {
|
||||
const chunk = _chunk?.trim();
|
||||
if (chunk) {
|
||||
result.push(chunk);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function joinTags(tags) {
|
||||
return tags.join("");
|
||||
|
||||
Reference in New Issue
Block a user