frameshot-mcp 0.7.0 → 0.9.7

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 (67) hide show
  1. package/README.md +83 -69
  2. package/action.yml +114 -16
  3. package/dist/chunk-MEBQ7ZWA.js +1774 -0
  4. package/dist/chunk-VUYZHZBH.js +157 -0
  5. package/dist/cli.js +131 -133
  6. package/dist/index.js +519 -572
  7. package/dist/renderer.d.ts +17 -7
  8. package/dist/renderer.js +4 -6
  9. package/dist/stubs/gatsby.js +20 -0
  10. package/dist/stubs/next-font.js +9 -0
  11. package/dist/stubs/next-headers.js +20 -0
  12. package/dist/stubs/next-image.js +34 -0
  13. package/dist/stubs/next-link.js +25 -0
  14. package/dist/stubs/next-navigation.js +17 -0
  15. package/dist/stubs/next-router.js +19 -0
  16. package/dist/stubs/nuxt-app.js +37 -0
  17. package/dist/stubs/nuxt-imports.js +13 -0
  18. package/dist/stubs/qwik-city.js +33 -0
  19. package/dist/stubs/react-router.js +67 -0
  20. package/dist/stubs/server-only.js +2 -0
  21. package/dist/stubs/solid-router.js +27 -0
  22. package/dist/stubs/solid-start.js +18 -0
  23. package/dist/stubs/stubs/gatsby.js +20 -0
  24. package/dist/stubs/stubs/next-font.js +9 -0
  25. package/dist/stubs/stubs/next-headers.js +20 -0
  26. package/dist/stubs/stubs/next-image.js +34 -0
  27. package/dist/stubs/stubs/next-link.js +25 -0
  28. package/dist/stubs/stubs/next-navigation.js +17 -0
  29. package/dist/stubs/stubs/next-router.js +19 -0
  30. package/dist/stubs/stubs/nuxt-app.js +37 -0
  31. package/dist/stubs/stubs/nuxt-imports.js +13 -0
  32. package/dist/stubs/stubs/qwik-city.js +33 -0
  33. package/dist/stubs/stubs/react-router.js +67 -0
  34. package/dist/stubs/stubs/server-only.js +2 -0
  35. package/dist/stubs/stubs/solid-router.js +27 -0
  36. package/dist/stubs/stubs/solid-start.js +18 -0
  37. package/dist/stubs/stubs/sveltekit-environment.js +5 -0
  38. package/dist/stubs/stubs/sveltekit-navigation.js +11 -0
  39. package/dist/stubs/stubs/sveltekit-stores.js +15 -0
  40. package/dist/stubs/stubs/vike.js +11 -0
  41. package/dist/stubs/sveltekit-environment.js +5 -0
  42. package/dist/stubs/sveltekit-navigation.js +11 -0
  43. package/dist/stubs/sveltekit-stores.js +15 -0
  44. package/dist/stubs/vike.js +11 -0
  45. package/package.json +10 -4
  46. package/scripts/render-changed.mjs +140 -18
  47. package/dist/chunk-3LVWVDET.js +0 -849
  48. package/dist/chunk-47YJG5HR.js +0 -690
  49. package/dist/chunk-67JZQ6OI.js +0 -819
  50. package/dist/chunk-AZCGKIMU.js +0 -850
  51. package/dist/chunk-B3CLIGWU.js +0 -786
  52. package/dist/chunk-C6QSY4WR.js +0 -811
  53. package/dist/chunk-DX54PJKO.js +0 -603
  54. package/dist/chunk-EMCJGIMY.js +0 -984
  55. package/dist/chunk-FQNWGR62.js +0 -849
  56. package/dist/chunk-FTYTZW6D.js +0 -203
  57. package/dist/chunk-JGVKYXY2.js +0 -857
  58. package/dist/chunk-JYPEA4P2.js +0 -846
  59. package/dist/chunk-KHK35HDD.js +0 -855
  60. package/dist/chunk-Q7A3DLED.js +0 -848
  61. package/dist/chunk-SIA6XEHM.js +0 -811
  62. package/dist/chunk-ST35YDI6.js +0 -834
  63. package/dist/chunk-T5OBJK35.js +0 -855
  64. package/dist/chunk-U3GHS7KO.js +0 -837
  65. package/dist/chunk-WS2ASCD6.js +0 -683
  66. package/dist/chunk-WZMHVSUA.js +0 -847
  67. package/dist/chunk-ZZST6K7Y.js +0 -987
@@ -1,7 +1,7 @@
1
1
  import { Page } from 'playwright';
2
2
 
3
3
  type Engine = "chromium" | "firefox" | "webkit";
4
- type Framework = "html" | "react" | "vue" | "svelte";
4
+ type Framework = "html" | "react" | "vue" | "svelte" | "solid" | "preact";
5
5
  type Theme = "light" | "dark";
6
6
  interface Viewport {
7
7
  width: number;
@@ -90,6 +90,7 @@ interface CatalogEntry {
90
90
  width: number;
91
91
  height: number;
92
92
  consoleErrors: string[];
93
+ error?: string;
93
94
  }
94
95
  declare const DEVICE_PRESETS: Record<string, Viewport>;
95
96
  declare const EXT_TO_FRAMEWORK: Record<string, Framework>;
@@ -102,15 +103,24 @@ interface ProjectConfig {
102
103
  viteConfigPath?: string;
103
104
  framework: Framework;
104
105
  hasVite: boolean;
106
+ isNextJs: boolean;
107
+ pathAliases: Record<string, string>;
105
108
  }
106
109
 
107
110
  declare class BrowserPool {
108
111
  private pool;
112
+ private waiters;
113
+ private totalPages;
114
+ private readonly maxPages;
115
+ constructor(maxConcurrentPages?: number);
109
116
  warmup(engines: Engine[]): Promise<void>;
110
117
  getPage(engine: Engine): Promise<Page>;
111
- setViewport(engine: Engine, viewport: Viewport): Promise<void>;
118
+ releasePage(engine: Engine, page: Page): void;
119
+ private acquireSlot;
120
+ private releaseSlot;
112
121
  shutdown(): Promise<void>;
113
122
  private getSlot;
123
+ private createPage;
114
124
  }
115
125
 
116
126
  declare class HtmlBuilder {
@@ -129,7 +139,7 @@ interface DiffComparison {
129
139
  }
130
140
  declare class ImageComparator {
131
141
  diff(imageA: string, imageB: string, threshold?: number): DiffComparison;
132
- composite(images: Buffer[], columns: number, labelHeight?: number): {
142
+ composite(images: Buffer[], columns: number): {
133
143
  image: string;
134
144
  width: number;
135
145
  height: number;
@@ -142,6 +152,8 @@ declare class ProjectDetector {
142
152
  private findViteConfig;
143
153
  private detectFramework;
144
154
  private checkViteAvailable;
155
+ private checkIsNextJs;
156
+ private readTsconfigAliases;
145
157
  }
146
158
 
147
159
  declare class SnapshotStore {
@@ -166,12 +178,12 @@ declare class ViteBundler {
166
178
  project: ProjectConfig;
167
179
  }>;
168
180
  shutdown(): Promise<void>;
181
+ generateEntry(componentPath: string, framework: Framework, props?: Record<string, unknown>, projectRoot?: string): string;
169
182
  private ensureServer;
183
+ private importFrameshotVite;
170
184
  private importVite;
171
185
  private hasPackage;
172
- private generateEntry;
173
186
  private findGlobalCss;
174
- private getOptimizeDepsInclude;
175
187
  }
176
188
 
177
189
  declare class AuditUseCase {
@@ -226,8 +238,6 @@ declare class RenderUseCase {
226
238
  private renderUrl;
227
239
  private navigateAndWait;
228
240
  private resolveAutoFitViewport;
229
- private attachConsoleCapture;
230
- private takeScreenshot;
231
241
  private resolveOptions;
232
242
  }
233
243
 
package/dist/renderer.js CHANGED
@@ -1,10 +1,5 @@
1
1
  import {
2
2
  AuditUseCase,
3
- ScreenshotUseCase,
4
- SnapshotStore,
5
- SnapshotUseCase
6
- } from "./chunk-FTYTZW6D.js";
7
- import {
8
3
  BrowserPool,
9
4
  CatalogUseCase,
10
5
  DEVICE_PRESETS,
@@ -14,8 +9,11 @@ import {
14
9
  ImageComparator,
15
10
  ProjectDetector,
16
11
  RenderUseCase,
12
+ ScreenshotUseCase,
13
+ SnapshotStore,
14
+ SnapshotUseCase,
17
15
  ViteBundler
18
- } from "./chunk-Q7A3DLED.js";
16
+ } from "./chunk-MEBQ7ZWA.js";
19
17
  export {
20
18
  AuditUseCase,
21
19
  BrowserPool,
@@ -0,0 +1,20 @@
1
+ // Stub for "gatsby" module
2
+ import { createElement } from "react";
3
+
4
+ export const Link = ({ children, to, ...rest }) =>
5
+ createElement(
6
+ "a",
7
+ { ...rest, href: typeof to === "string" ? to : "#" },
8
+ children,
9
+ );
10
+ export const navigate = () => Promise.resolve();
11
+ export const withPrefix = (path) => path;
12
+ export const Slice = ({ children }) => children ?? null;
13
+ export const Script = (props) => createElement("script", props);
14
+ export const graphql = (strings) => strings;
15
+ export const useStaticQuery = () => ({});
16
+ export const StaticQuery = ({ render }) =>
17
+ typeof render === "function" ? render({}) : null;
18
+ export const PageRenderer = () => null;
19
+
20
+ export default {};
@@ -0,0 +1,9 @@
1
+ // Stub for next/font/google, next/font/local
2
+ // Returns empty className so layout isn't broken
3
+ const fontStub = () => () => ({ className: "", style: {} });
4
+ export const Inter = fontStub();
5
+ export const Roboto = fontStub();
6
+ export const Open_Sans = fontStub();
7
+ export const Lato = fontStub();
8
+ export const Montserrat = fontStub();
9
+ export default fontStub();
@@ -0,0 +1,20 @@
1
+ // Stub for next/headers — server-only APIs that must not crash during component preview
2
+ const emptyMap = {
3
+ get: () => undefined,
4
+ getAll: () => [],
5
+ has: () => false,
6
+ forEach: () => {},
7
+ entries: () => [][Symbol.iterator](),
8
+ keys: () => [][Symbol.iterator](),
9
+ values: () => [][Symbol.iterator](),
10
+ set: () => {},
11
+ delete: () => {},
12
+ toString: () => "",
13
+ };
14
+ export const headers = () => emptyMap;
15
+ export const cookies = () => emptyMap;
16
+ export const draftMode = () => ({
17
+ isEnabled: false,
18
+ enable: () => {},
19
+ disable: () => {},
20
+ });
@@ -0,0 +1,34 @@
1
+ import { createElement } from "react";
2
+
3
+ export default function Image({
4
+ src,
5
+ alt = "",
6
+ width,
7
+ height,
8
+ fill,
9
+ priority,
10
+ quality,
11
+ placeholder,
12
+ blurDataURL,
13
+ sizes,
14
+ style,
15
+ className,
16
+ onLoad,
17
+ onError,
18
+ ...rest
19
+ }) {
20
+ const imgStyle = fill
21
+ ? { position: "absolute", inset: 0, width: "100%", height: "100%" }
22
+ : {};
23
+ return createElement("img", {
24
+ src: typeof src === "object" ? src.src : src,
25
+ alt,
26
+ width: fill ? undefined : width,
27
+ height: fill ? undefined : height,
28
+ style: { ...imgStyle, ...style },
29
+ className,
30
+ onLoad,
31
+ onError,
32
+ ...rest,
33
+ });
34
+ }
@@ -0,0 +1,25 @@
1
+ import { createElement } from "react";
2
+
3
+ export default function Link({
4
+ href,
5
+ children,
6
+ className,
7
+ style,
8
+ onClick,
9
+ prefetch,
10
+ replace,
11
+ scroll,
12
+ shallow,
13
+ passHref,
14
+ locale,
15
+ legacyBehavior,
16
+ ...rest
17
+ }) {
18
+ const finalHref =
19
+ typeof href === "object" ? (href.pathname ?? "/") : (href ?? "/");
20
+ return createElement(
21
+ "a",
22
+ { href: finalHref, className, style, onClick, ...rest },
23
+ children,
24
+ );
25
+ }
@@ -0,0 +1,17 @@
1
+ export const useRouter = () => ({
2
+ push: () => {},
3
+ replace: () => {},
4
+ back: () => {},
5
+ forward: () => {},
6
+ prefetch: () => {},
7
+ refresh: () => {},
8
+ pathname: "/",
9
+ query: {},
10
+ });
11
+ export const usePathname = () => "/";
12
+ export const useSearchParams = () => new URLSearchParams();
13
+ export const useParams = () => ({});
14
+ export const redirect = () => {};
15
+ export const notFound = () => {};
16
+ export const useSelectedLayoutSegment = () => null;
17
+ export const useSelectedLayoutSegments = () => [];
@@ -0,0 +1,19 @@
1
+ export const useRouter = () => ({
2
+ push: () => {},
3
+ replace: () => {},
4
+ back: () => {},
5
+ forward: () => {},
6
+ prefetch: () => {},
7
+ reload: () => {},
8
+ query: {},
9
+ pathname: "/",
10
+ asPath: "/",
11
+ basePath: "",
12
+ locale: undefined,
13
+ locales: [],
14
+ defaultLocale: undefined,
15
+ isReady: true,
16
+ isPreview: false,
17
+ events: { on: () => {}, off: () => {}, emit: () => {} },
18
+ });
19
+ export const withRouter = (Component) => Component;
@@ -0,0 +1,37 @@
1
+ // Stub for Nuxt #app
2
+ export const useNuxtApp = () => ({
3
+ $config: { public: {}, app: {} },
4
+ $router: { push: () => {}, replace: () => {}, back: () => {} },
5
+ $route: { path: "/", params: {}, query: {}, hash: "" },
6
+ provide: () => {},
7
+ hook: () => {},
8
+ callHook: () => {},
9
+ runWithContext: (fn) => fn(),
10
+ });
11
+ export const useRuntimeConfig = () => ({ public: {}, app: {} });
12
+ export const useRouter = () => ({
13
+ push: () => {},
14
+ replace: () => {},
15
+ back: () => {},
16
+ forward: () => {},
17
+ go: () => {},
18
+ });
19
+ export const useRoute = () => ({ path: "/", params: {}, query: {}, hash: "" });
20
+ export const navigateTo = () => {};
21
+ export const useHead = () => {};
22
+ export const useSeoMeta = () => {};
23
+ export const useState = (_, init) => ({
24
+ value: typeof init === "function" ? init() : init,
25
+ });
26
+ export const useFetch = () => ({
27
+ data: { value: null },
28
+ error: { value: null },
29
+ pending: { value: false },
30
+ });
31
+ export const useAsyncData = () => ({
32
+ data: { value: null },
33
+ error: { value: null },
34
+ pending: { value: false },
35
+ });
36
+ export const defineNuxtComponent = (c) => c;
37
+ export const defineNuxtPlugin = () => {};
@@ -0,0 +1,13 @@
1
+ // Stub for Nuxt auto-imports (#imports)
2
+
3
+ export {
4
+ computed,
5
+ nextTick,
6
+ onMounted,
7
+ onUnmounted,
8
+ reactive,
9
+ ref,
10
+ watch,
11
+ watchEffect,
12
+ } from "vue";
13
+ export * from "./nuxt-app.js";
@@ -0,0 +1,33 @@
1
+ // Stub for @builder.io/qwik-city
2
+ // Server-only loaders/actions become no-ops; client APIs return safe defaults.
3
+ export const routeLoader$ = (fn) => () => ({ value: fn?.() });
4
+ export const routeAction$ = () => ({ submit: () => Promise.resolve() });
5
+ export const server$ = (fn) => fn;
6
+ export const useLocation = () => ({
7
+ url: new URL("http://localhost/"),
8
+ params: {},
9
+ query: new URLSearchParams(),
10
+ });
11
+ export const useNavigate = () => () => Promise.resolve();
12
+ export const useContent = () => ({
13
+ headings: [],
14
+ menu: undefined,
15
+ });
16
+ export const useDocumentHead = () => ({
17
+ title: "",
18
+ meta: [],
19
+ links: [],
20
+ styles: [],
21
+ });
22
+ export const Link = ({ children, href, ...rest }) => ({
23
+ tag: "a",
24
+ props: { ...rest, href },
25
+ children,
26
+ });
27
+ export const Form = ({ children, ...rest }) => ({
28
+ tag: "form",
29
+ props: rest,
30
+ children,
31
+ });
32
+
33
+ export default {};
@@ -0,0 +1,67 @@
1
+ // Stub for react-router / react-router-dom / @remix-run/react
2
+ import { createElement, Fragment } from "react";
3
+
4
+ // Hooks
5
+ export const useLoaderData = () => ({});
6
+ export const useActionData = () => undefined;
7
+ export const useRouteLoaderData = () => ({});
8
+ export const useNavigation = () => ({
9
+ state: "idle",
10
+ location: undefined,
11
+ formData: undefined,
12
+ formAction: undefined,
13
+ formMethod: undefined,
14
+ });
15
+ export const useParams = () => ({});
16
+ export const useSearchParams = () => [new URLSearchParams(), () => {}];
17
+ export const useNavigate = () => () => {};
18
+ export const useSubmit = () => () => {};
19
+ export const useRevalidator = () => ({ revalidate: () => {}, state: "idle" });
20
+ export const useFetcher = () => ({
21
+ Form: ({ children, ...rest }) => createElement("form", rest, children),
22
+ submit: () => {},
23
+ load: () => {},
24
+ data: undefined,
25
+ state: "idle",
26
+ });
27
+ export const useMatches = () => [];
28
+ export const useRouteError = () => undefined;
29
+ export const useLocation = () => ({
30
+ pathname: "/",
31
+ search: "",
32
+ hash: "",
33
+ state: null,
34
+ key: "default",
35
+ });
36
+ export const isRouteErrorResponse = () => false;
37
+
38
+ // Components
39
+ export const Form = ({ children, ...rest }) =>
40
+ createElement("form", rest, children);
41
+ export const Link = ({ children, to, ...rest }) =>
42
+ createElement(
43
+ "a",
44
+ { ...rest, href: typeof to === "string" ? to : "#" },
45
+ children,
46
+ );
47
+ export const NavLink = Link;
48
+ export const Outlet = () => null;
49
+ export const Await = ({ children }) =>
50
+ typeof children === "function" ? children(undefined) : children;
51
+ export const Meta = () => null;
52
+ export const Links = () => null;
53
+ export const Scripts = () => null;
54
+ export const ScrollRestoration = () => null;
55
+ export const Route = ({ children }) => createElement(Fragment, null, children);
56
+ export const Routes = ({ children }) => createElement(Fragment, null, children);
57
+ export const MemoryRouter = ({ children }) =>
58
+ createElement(Fragment, null, children);
59
+ export const BrowserRouter = MemoryRouter;
60
+ export const Navigate = () => null;
61
+
62
+ // Server-only helpers — return identity-ish values
63
+ export const json = (data) => data;
64
+ export const redirect = () => ({ status: 302 });
65
+ export const defer = (data) => data;
66
+
67
+ export default {};
@@ -0,0 +1,2 @@
1
+ // Stub for 'server-only' package — allows client components to be rendered in browser context
2
+ export default {};
@@ -0,0 +1,27 @@
1
+ // Stub for @solidjs/router (compatible with SolidStart's router re-exports)
2
+ export const useNavigate = () => () => {};
3
+ export const useLocation = () => ({
4
+ pathname: "/",
5
+ search: "",
6
+ hash: "",
7
+ query: {},
8
+ state: null,
9
+ });
10
+ export const useParams = () => ({});
11
+ export const useSearchParams = () => [{}, () => {}];
12
+ export const useMatch = () => null;
13
+ export const useResolvedPath = (path) => path;
14
+ export const useIsRouting = () => () => false;
15
+ export const A = (props) => {
16
+ // Solid uses JSX without runtime; we just return a plain object that
17
+ // happens to look like a Solid element. In Solid, components are functions
18
+ // that return DOM. For stubs, we return an h() call equivalent.
19
+ return props;
20
+ };
21
+ export const Navigate = () => null;
22
+ export const Route = (props) => props;
23
+ export const Router = (props) => props?.children ?? null;
24
+ export const Routes = (props) => props?.children ?? null;
25
+ export const Outlet = () => null;
26
+
27
+ export default {};
@@ -0,0 +1,18 @@
1
+ // Stub for @solidjs/start
2
+ // SolidStart server APIs become no-ops/identity for component preview.
3
+ export const createAsync = (fn) => fn;
4
+ export const query = (fn) => fn;
5
+ export const action = (fn) => fn;
6
+ export const cache = (fn) => fn;
7
+ export const revalidate = () => {};
8
+ export const json = (data) => data;
9
+ export const redirect = () => ({ status: 302 });
10
+ export const useRequest = () => ({});
11
+ export const useServerContext = () => ({});
12
+ export const HttpHeader = () => null;
13
+ export const HttpStatusCode = () => null;
14
+ export const FileRoutes = () => null;
15
+
16
+ export * from "./solid-router.js";
17
+
18
+ export default {};
@@ -0,0 +1,20 @@
1
+ // Stub for "gatsby" module
2
+ import { createElement } from "react";
3
+
4
+ export const Link = ({ children, to, ...rest }) =>
5
+ createElement(
6
+ "a",
7
+ { ...rest, href: typeof to === "string" ? to : "#" },
8
+ children,
9
+ );
10
+ export const navigate = () => Promise.resolve();
11
+ export const withPrefix = (path) => path;
12
+ export const Slice = ({ children }) => children ?? null;
13
+ export const Script = (props) => createElement("script", props);
14
+ export const graphql = (strings) => strings;
15
+ export const useStaticQuery = () => ({});
16
+ export const StaticQuery = ({ render }) =>
17
+ typeof render === "function" ? render({}) : null;
18
+ export const PageRenderer = () => null;
19
+
20
+ export default {};
@@ -0,0 +1,9 @@
1
+ // Stub for next/font/google, next/font/local
2
+ // Returns empty className so layout isn't broken
3
+ const fontStub = () => () => ({ className: "", style: {} });
4
+ export const Inter = fontStub();
5
+ export const Roboto = fontStub();
6
+ export const Open_Sans = fontStub();
7
+ export const Lato = fontStub();
8
+ export const Montserrat = fontStub();
9
+ export default fontStub();
@@ -0,0 +1,20 @@
1
+ // Stub for next/headers — server-only APIs that must not crash during component preview
2
+ const emptyMap = {
3
+ get: () => undefined,
4
+ getAll: () => [],
5
+ has: () => false,
6
+ forEach: () => {},
7
+ entries: () => [][Symbol.iterator](),
8
+ keys: () => [][Symbol.iterator](),
9
+ values: () => [][Symbol.iterator](),
10
+ set: () => {},
11
+ delete: () => {},
12
+ toString: () => "",
13
+ };
14
+ export const headers = () => emptyMap;
15
+ export const cookies = () => emptyMap;
16
+ export const draftMode = () => ({
17
+ isEnabled: false,
18
+ enable: () => {},
19
+ disable: () => {},
20
+ });
@@ -0,0 +1,34 @@
1
+ import { createElement } from "react";
2
+
3
+ export default function Image({
4
+ src,
5
+ alt = "",
6
+ width,
7
+ height,
8
+ fill,
9
+ priority,
10
+ quality,
11
+ placeholder,
12
+ blurDataURL,
13
+ sizes,
14
+ style,
15
+ className,
16
+ onLoad,
17
+ onError,
18
+ ...rest
19
+ }) {
20
+ const imgStyle = fill
21
+ ? { position: "absolute", inset: 0, width: "100%", height: "100%" }
22
+ : {};
23
+ return createElement("img", {
24
+ src: typeof src === "object" ? src.src : src,
25
+ alt,
26
+ width: fill ? undefined : width,
27
+ height: fill ? undefined : height,
28
+ style: { ...imgStyle, ...style },
29
+ className,
30
+ onLoad,
31
+ onError,
32
+ ...rest,
33
+ });
34
+ }
@@ -0,0 +1,25 @@
1
+ import { createElement } from "react";
2
+
3
+ export default function Link({
4
+ href,
5
+ children,
6
+ className,
7
+ style,
8
+ onClick,
9
+ prefetch,
10
+ replace,
11
+ scroll,
12
+ shallow,
13
+ passHref,
14
+ locale,
15
+ legacyBehavior,
16
+ ...rest
17
+ }) {
18
+ const finalHref =
19
+ typeof href === "object" ? (href.pathname ?? "/") : (href ?? "/");
20
+ return createElement(
21
+ "a",
22
+ { href: finalHref, className, style, onClick, ...rest },
23
+ children,
24
+ );
25
+ }
@@ -0,0 +1,17 @@
1
+ export const useRouter = () => ({
2
+ push: () => {},
3
+ replace: () => {},
4
+ back: () => {},
5
+ forward: () => {},
6
+ prefetch: () => {},
7
+ refresh: () => {},
8
+ pathname: "/",
9
+ query: {},
10
+ });
11
+ export const usePathname = () => "/";
12
+ export const useSearchParams = () => new URLSearchParams();
13
+ export const useParams = () => ({});
14
+ export const redirect = () => {};
15
+ export const notFound = () => {};
16
+ export const useSelectedLayoutSegment = () => null;
17
+ export const useSelectedLayoutSegments = () => [];
@@ -0,0 +1,19 @@
1
+ export const useRouter = () => ({
2
+ push: () => {},
3
+ replace: () => {},
4
+ back: () => {},
5
+ forward: () => {},
6
+ prefetch: () => {},
7
+ reload: () => {},
8
+ query: {},
9
+ pathname: "/",
10
+ asPath: "/",
11
+ basePath: "",
12
+ locale: undefined,
13
+ locales: [],
14
+ defaultLocale: undefined,
15
+ isReady: true,
16
+ isPreview: false,
17
+ events: { on: () => {}, off: () => {}, emit: () => {} },
18
+ });
19
+ export const withRouter = (Component) => Component;
@@ -0,0 +1,37 @@
1
+ // Stub for Nuxt #app
2
+ export const useNuxtApp = () => ({
3
+ $config: { public: {}, app: {} },
4
+ $router: { push: () => {}, replace: () => {}, back: () => {} },
5
+ $route: { path: "/", params: {}, query: {}, hash: "" },
6
+ provide: () => {},
7
+ hook: () => {},
8
+ callHook: () => {},
9
+ runWithContext: (fn) => fn(),
10
+ });
11
+ export const useRuntimeConfig = () => ({ public: {}, app: {} });
12
+ export const useRouter = () => ({
13
+ push: () => {},
14
+ replace: () => {},
15
+ back: () => {},
16
+ forward: () => {},
17
+ go: () => {},
18
+ });
19
+ export const useRoute = () => ({ path: "/", params: {}, query: {}, hash: "" });
20
+ export const navigateTo = () => {};
21
+ export const useHead = () => {};
22
+ export const useSeoMeta = () => {};
23
+ export const useState = (_, init) => ({
24
+ value: typeof init === "function" ? init() : init,
25
+ });
26
+ export const useFetch = () => ({
27
+ data: { value: null },
28
+ error: { value: null },
29
+ pending: { value: false },
30
+ });
31
+ export const useAsyncData = () => ({
32
+ data: { value: null },
33
+ error: { value: null },
34
+ pending: { value: false },
35
+ });
36
+ export const defineNuxtComponent = (c) => c;
37
+ export const defineNuxtPlugin = () => {};
@@ -0,0 +1,13 @@
1
+ // Stub for Nuxt auto-imports (#imports)
2
+
3
+ export {
4
+ computed,
5
+ nextTick,
6
+ onMounted,
7
+ onUnmounted,
8
+ reactive,
9
+ ref,
10
+ watch,
11
+ watchEffect,
12
+ } from "vue";
13
+ export * from "./nuxt-app.js";