@velastack/patterns 0.1.7 → 0.1.9
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/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var de = Object.create, fe = Object.defineProperty, pe = Object.getOwnPropertyDe
|
|
|
28
28
|
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
29
29
|
}), xe = {
|
|
30
30
|
name: "@velastack/patterns",
|
|
31
|
-
version: "0.1.
|
|
31
|
+
version: "0.1.9",
|
|
32
32
|
description: "Registry of VelaStack patterns: generators and modifications applied to SvelteKit projects by the VelaStack CLI.",
|
|
33
33
|
type: "module",
|
|
34
34
|
private: !1,
|
|
@@ -4828,9 +4828,9 @@ var tl = {
|
|
|
4828
4828
|
baseline: "velastack",
|
|
4829
4829
|
generate: el
|
|
4830
4830
|
}, nl = /* #__PURE__ */ Object.assign({
|
|
4831
|
-
"./preview-modifies/src/routes/+layout.server.ts": "import { loadFlash } from 'sveltekit-flash-message/server';\nimport { defineBaseMetaTags } from 'svelte-meta-tags';\nimport { error, redirect } from '@sveltejs/kit';\nimport { loadCms } from '$lib/cms';\n\nexport const load = loadFlash(async (event) => {\n const { locals, url } = event;\n const canonical = new URL(url.pathname, url.origin).href;\n\n const baseTags = defineBaseMetaTags({\n title: '',\n titleTemplate: `%s | ${locals.meta.appName}`,\n description: '',\n canonical,\n openGraph: {\n type: 'website',\n url: canonical,\n images: [\n {\n url: `${locals.meta.appURL}/og.jpg`,\n alt: locals.meta.appName,\n width: 1200,\n height: 630\n }\n ]\n }\n });\n\n const { cms, notFound, gone, redirectTo } = await loadCms(event, {
|
|
4832
|
-
"./preview-modifies/src/routes/+layout.svelte": "<script lang=\"ts\">\n import '../app.css';\n\n import favicon from '$lib/assets/favicon.svg';\n\n import { ModeWatcher } from 'mode-watcher';\n import { getFlash } from 'sveltekit-flash-message';\n import { toast } from 'svelte-sonner';\n import { page } from '$app/state';\n import { Toaster } from '$lib/components/ui/sonner';\n import { MetaTags, deepMerge } from 'svelte-meta-tags';\n import { AdminBar } from '@velastack/cms';\n\n let { data, children } = $props();\n const flash = getFlash(page);\n\n $effect(() => {\n if (!$flash || $flash.type !== 'toast') {\n return;\n }\n\n toast.message($flash.message);\n\n $flash = undefined;\n });\n\n let metaTags = $derived(deepMerge(data.baseMetaTags, page.data.pageMetaTags));\n<\/script>\n\n<svelte:head>\n <title>{data.meta.appName}</title>\n <link rel=\"icon\" href={favicon} />\n</svelte:head>\n\n<MetaTags {...metaTags} />\n<ModeWatcher />\n<Toaster />\n\n{@render children?.()}\n\n<AdminBar />\n",
|
|
4833
|
-
"./preview-modifies/vite.config.ts": "
|
|
4831
|
+
"./preview-modifies/src/routes/+layout.server.ts": "import { loadFlash } from 'sveltekit-flash-message/server';\nimport { defineBaseMetaTags } from 'svelte-meta-tags';\nimport { error, redirect } from '@sveltejs/kit';\nimport { loadCms } from '$lib/cms';\n\nexport const load = loadFlash(async (event) => {\n const { locals, url } = event;\n const canonical = new URL(url.pathname, url.origin).href;\n\n const baseTags = defineBaseMetaTags({\n title: '',\n titleTemplate: `%s | ${locals.meta.appName}`,\n description: '',\n canonical,\n openGraph: {\n type: 'website',\n url: canonical,\n images: [\n {\n url: `${locals.meta.appURL}/og.jpg`,\n alt: locals.meta.appName,\n width: 1200,\n height: 630\n }\n ]\n }\n });\n\n // [!code highlight:6]\n const { cms, notFound, gone, redirectTo } = await loadCms(event, {\n locale: 'en'\n });\n if (redirectTo) redirect(308, redirectTo);\n if (gone) error(410, 'Gone');\n if (notFound) error(404, 'Not found');\n\n return {\n meta: locals.meta,\n cms,\n ...baseTags\n };\n});\n",
|
|
4832
|
+
"./preview-modifies/src/routes/+layout.svelte": "<script lang=\"ts\">\n import '../app.css';\n\n import favicon from '$lib/assets/favicon.svg';\n\n import { ModeWatcher } from 'mode-watcher';\n import { getFlash } from 'sveltekit-flash-message';\n import { toast } from 'svelte-sonner';\n import { page } from '$app/state';\n import { Toaster } from '$lib/components/ui/sonner';\n import { MetaTags, deepMerge } from 'svelte-meta-tags';\n import { AdminBar } from '@velastack/cms';\n\n let { data, children } = $props();\n const flash = getFlash(page);\n\n $effect(() => {\n if (!$flash || $flash.type !== 'toast') {\n return;\n }\n\n toast.message($flash.message);\n\n $flash = undefined;\n });\n\n let metaTags = $derived(deepMerge(data.baseMetaTags, page.data.pageMetaTags));\n<\/script>\n\n<svelte:head>\n <title>{data.meta.appName}</title>\n <link rel=\"icon\" href={favicon} />\n</svelte:head>\n\n<MetaTags {...metaTags} />\n<ModeWatcher />\n<Toaster />\n\n{@render children?.()}\n\n<!-- [!code highlight:1] -->\n<AdminBar />\n",
|
|
4833
|
+
"./preview-modifies/vite.config.ts": "// [!code highlight:1]\nimport { cms } from '@velastack/cms/vite';\nimport { defineConfig } from 'vite';\nimport tailwindcss from '@tailwindcss/vite';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport adapter from '@sveltejs/adapter-auto';\n\nexport default defineConfig({\n plugins: [\n tailwindcss(),\n // [!code highlight:1]\n cms(),\n sveltekit({\n compilerOptions: {\n runes: ({ filename }) =>\n filename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n },\n adapter: adapter(),\n // Prerendering has no request to take an origin from, so without this\n // every canonical link and `og:url` on a prerendered page would be built\n // from SvelteKit's placeholder host. `vela build` sets it from the domain\n // the target is deployed on; unset, SvelteKit's default stands.\n ...(process.env.VELA_ORIGIN\n ? { prerender: { origin: process.env.VELA_ORIGIN } }\n : {})\n })\n ]\n});\n"
|
|
4834
4834
|
}), rl = "./preview-modifies/";
|
|
4835
4835
|
async function il(e) {
|
|
4836
4836
|
return {
|