eddev 2.3.17 → 2.3.19

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 (41) hide show
  1. package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +1 -1
  2. package/dist/app/lib/devtools/components/DevUI.d.ts +1 -1
  3. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +40 -40
  4. package/dist/app/lib/dynamic/dynamic.js +2 -2
  5. package/dist/app/lib/hooks/query-hooks.d.ts +7 -6
  6. package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -1
  7. package/dist/app/lib/hooks/query-hooks.js +25 -23
  8. package/dist/app/server/render-ssr-page.d.ts.map +1 -1
  9. package/dist/app/server/render-ssr-page.js +11 -7
  10. package/dist/app/utils/query-client.d.ts +1 -0
  11. package/dist/app/utils/query-client.d.ts.map +1 -1
  12. package/dist/app/utils/query-client.js +42 -9
  13. package/dist/app/utils/ssr-cache.d.ts +6 -0
  14. package/dist/app/utils/ssr-cache.d.ts.map +1 -0
  15. package/dist/app/utils/ssr-cache.js +5 -0
  16. package/dist/app/utils/ssr-response-data.d.ts +13 -0
  17. package/dist/app/utils/ssr-response-data.d.ts.map +1 -0
  18. package/dist/app/utils/ssr-response-data.js +14 -0
  19. package/dist/node/cli/cli-worker.d.ts +1 -1
  20. package/dist/node/cli/cli-worker.d.ts.map +1 -1
  21. package/dist/node/cli/cli-worker.js +4 -4
  22. package/dist/node/cli/cli.js +1 -1
  23. package/dist/node/cli/version.d.ts +1 -1
  24. package/dist/node/cli/version.js +1 -1
  25. package/dist/node/compiler/dev-server.d.ts.map +1 -1
  26. package/dist/node/compiler/dev-server.js +1 -10
  27. package/dist/node/compiler/get-vite-config.d.ts +1 -0
  28. package/dist/node/compiler/get-vite-config.d.ts.map +1 -1
  29. package/dist/node/compiler/get-vite-config.js +22 -12
  30. package/dist/node/compiler/vinxi-app.d.ts.map +1 -1
  31. package/dist/node/compiler/vinxi-app.js +1 -0
  32. package/dist/node/project/manifest/manifest.d.ts.map +1 -1
  33. package/dist/node/project/manifest/manifest.js +23 -8
  34. package/dist/node/utils/fs-codegen.d.ts +1 -0
  35. package/dist/node/utils/fs-codegen.d.ts.map +1 -1
  36. package/dist/node/utils/fs-codegen.js +12 -2
  37. package/dist/node/utils/stateful-log.d.ts +2 -0
  38. package/dist/node/utils/stateful-log.d.ts.map +1 -1
  39. package/dist/node/utils/stateful-log.js +17 -10
  40. package/package.json +1 -1
  41. package/types.env.d.ts +3 -1
@@ -1,5 +1,5 @@
1
1
  export declare const blockMetaDescriptors: Map<string, BlockMeta> & {
2
- $$valtioSnapshot: Omit<Map<string, BlockMeta>, "set" | "clear" | "delete">;
2
+ $$valtioSnapshot: Omit<Map<string, BlockMeta>, "set" | "delete" | "clear">;
3
3
  };
4
4
  export declare function whenEditorIsReady(): Promise<void>;
5
5
  export declare function installEDGutenbergHooks(): void;
@@ -10,7 +10,7 @@ export declare class ErrorBoundary extends Component<PropsWithChildren<{}>, Stat
10
10
  state: State;
11
11
  static getDerivedStateFromError(err: Error): State;
12
12
  componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
13
- render(): string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
13
+ render(): string | number | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | null | undefined;
14
14
  }
15
15
  export {};
16
16
  //# sourceMappingURL=DevUI.d.ts.map
@@ -85,12 +85,12 @@ export declare function useTailwindConfig(): {
85
85
  readonly max: string;
86
86
  })[];
87
87
  } | undefined;
88
- readonly supports?: {
88
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
89
89
  readonly [x: string]: string;
90
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
91
- readonly data?: {
90
+ } | undefined;
91
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
92
92
  readonly [x: string]: string;
93
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
93
+ } | undefined;
94
94
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
95
95
  readonly [x: string]: string | /*elided*/ any;
96
96
  } | undefined;
@@ -493,12 +493,12 @@ export declare function useTailwindConfig(): {
493
493
  readonly max: string;
494
494
  })[];
495
495
  } | undefined;
496
- readonly supports?: {
496
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
497
497
  readonly [x: string]: string;
498
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
499
- readonly data?: {
498
+ } | undefined;
499
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
500
500
  readonly [x: string]: string;
501
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
501
+ } | undefined;
502
502
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
503
503
  readonly [x: string]: string | /*elided*/ any;
504
504
  } | undefined;
@@ -1130,12 +1130,12 @@ export declare function useTailwindConfig(): {
1130
1130
  readonly max: string;
1131
1131
  })[];
1132
1132
  } | undefined;
1133
- readonly supports?: {
1133
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
1134
1134
  readonly [x: string]: string;
1135
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
1136
- readonly data?: {
1135
+ } | undefined;
1136
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
1137
1137
  readonly [x: string]: string;
1138
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
1138
+ } | undefined;
1139
1139
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
1140
1140
  readonly [x: string]: string | /*elided*/ any;
1141
1141
  } | undefined;
@@ -1538,12 +1538,12 @@ export declare function useTailwindConfig(): {
1538
1538
  readonly max: string;
1539
1539
  })[];
1540
1540
  } | undefined;
1541
- readonly supports?: {
1541
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
1542
1542
  readonly [x: string]: string;
1543
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
1544
- readonly data?: {
1543
+ } | undefined;
1544
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
1545
1545
  readonly [x: string]: string;
1546
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
1546
+ } | undefined;
1547
1547
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
1548
1548
  readonly [x: string]: string | /*elided*/ any;
1549
1549
  } | undefined;
@@ -2150,12 +2150,12 @@ export declare function useTailwindConfig(): {
2150
2150
  readonly max: string;
2151
2151
  })[];
2152
2152
  } | undefined;
2153
- readonly supports?: {
2153
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
2154
2154
  readonly [x: string]: string;
2155
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
2156
- readonly data?: {
2155
+ } | undefined;
2156
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
2157
2157
  readonly [x: string]: string;
2158
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
2158
+ } | undefined;
2159
2159
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
2160
2160
  readonly [x: string]: string | /*elided*/ any;
2161
2161
  } | undefined;
@@ -2558,12 +2558,12 @@ export declare function useTailwindConfig(): {
2558
2558
  readonly max: string;
2559
2559
  })[];
2560
2560
  } | undefined;
2561
- readonly supports?: {
2561
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
2562
2562
  readonly [x: string]: string;
2563
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
2564
- readonly data?: {
2563
+ } | undefined;
2564
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
2565
2565
  readonly [x: string]: string;
2566
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
2566
+ } | undefined;
2567
2567
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
2568
2568
  readonly [x: string]: string | /*elided*/ any;
2569
2569
  } | undefined;
@@ -3221,12 +3221,12 @@ export declare function useTailwindConfig(): {
3221
3221
  readonly max: string;
3222
3222
  })[];
3223
3223
  } | undefined;
3224
- readonly supports?: {
3224
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
3225
3225
  readonly [x: string]: string;
3226
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
3227
- readonly data?: {
3226
+ } | undefined;
3227
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
3228
3228
  readonly [x: string]: string;
3229
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
3229
+ } | undefined;
3230
3230
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
3231
3231
  readonly [x: string]: string | /*elided*/ any;
3232
3232
  } | undefined;
@@ -3629,12 +3629,12 @@ export declare function useTailwindConfig(): {
3629
3629
  readonly max: string;
3630
3630
  })[];
3631
3631
  } | undefined;
3632
- readonly supports?: {
3632
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
3633
3633
  readonly [x: string]: string;
3634
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
3635
- readonly data?: {
3634
+ } | undefined;
3635
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
3636
3636
  readonly [x: string]: string;
3637
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
3637
+ } | undefined;
3638
3638
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
3639
3639
  readonly [x: string]: string | /*elided*/ any;
3640
3640
  } | undefined;
@@ -4239,12 +4239,12 @@ export declare function useTailwindConfig(): {
4239
4239
  readonly max: string;
4240
4240
  })[];
4241
4241
  } | undefined;
4242
- readonly supports?: {
4242
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
4243
4243
  readonly [x: string]: string;
4244
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
4245
- readonly data?: {
4244
+ } | undefined;
4245
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
4246
4246
  readonly [x: string]: string;
4247
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
4247
+ } | undefined;
4248
4248
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
4249
4249
  readonly [x: string]: string | /*elided*/ any;
4250
4250
  } | undefined;
@@ -4647,12 +4647,12 @@ export declare function useTailwindConfig(): {
4647
4647
  readonly max: string;
4648
4648
  })[];
4649
4649
  } | undefined;
4650
- readonly supports?: {
4650
+ readonly supports?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
4651
4651
  readonly [x: string]: string;
4652
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
4653
- readonly data?: {
4652
+ } | undefined;
4653
+ readonly data?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | {
4654
4654
  readonly [x: string]: string;
4655
- } | ((utils: import("tailwindcss/types/config.js").PluginUtils) => Record<string, string>) | undefined;
4655
+ } | undefined;
4656
4656
  readonly colors?: ((utils: import("tailwindcss/types/config.js").PluginUtils) => import("tailwindcss/types/config.js").RecursiveKeyValuePair<string, string>) | {
4657
4657
  readonly [x: string]: string | /*elided*/ any;
4658
4658
  } | undefined;
@@ -1,12 +1,12 @@
1
1
  import { createElement, forwardRef, lazy, memo, useRef } from "react";
2
- import { useAssetCapture } from "../../utils/asset-capture.js";
2
+ import { useSSRResponse } from "../../utils/ssr-response-data.js";
3
3
  export function dynamic(factory, name) {
4
4
  const ReactLazyComponent = lazy(factory);
5
5
  let PreloadedComponent;
6
6
  let factoryPromise;
7
7
  const Component = memo(forwardRef(function LazyWithPreload(props, ref) {
8
8
  if (env.serverless && !env.client && name) {
9
- useAssetCapture()?.add(name);
9
+ useSSRResponse()?.addPreload(name);
10
10
  }
11
11
  // Once one of these is chosen, we must ensure that it continues to be
12
12
  // used for all subsequent renders, otherwise it can cause the
@@ -1,4 +1,4 @@
1
- import { FetchQueryOptions, UndefinedInitialDataInfiniteOptions, UndefinedInitialDataOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
1
+ import { type FetchQueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialDataOptions, type UseInfiniteQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryResult } from "@tanstack/react-query";
2
2
  import { TRPCClientError, TRPCRequestOptions } from "@trpc/client";
3
3
  type OptionalMaybes<T> = T extends any[] ? T : T extends {
4
4
  [key: string]: any;
@@ -37,14 +37,15 @@ type CreateUseInfiniteQueryOptions = {
37
37
  defaultLimit: number;
38
38
  paths: Record<"nodesPath" | "pageInfoPath" | "endCursorPath" | "hasNextPagePath", string[]>;
39
39
  };
40
+ export type InfiniteQueryResult<TData = any, TVars = any> = UseInfiniteQueryResult<{
41
+ nodes: TData;
42
+ total?: number | null;
43
+ }, QueryError>;
40
44
  export type UseInfiniteQueryFunction<TData, TVars> = (args: OptionalMaybes<Omit<TVars, "cursor">>, options?: Omit<UndefinedInitialDataInfiniteOptions<TData, QueryError, TData, any[]>, "queryKey" | "queryFn" | "initialData" | "initialPageParam" | "getNextPageParam" | "select"> & {
41
45
  headers?: Record<string, string>;
42
46
  /** Initial data can be passed in, but should match the original GraphQL query in structure (including nodes/hasNextPage/endCursor) */
43
47
  initialData?: any;
44
- }) => UseInfiniteQueryResult<{
45
- nodes: TData;
46
- total?: number | null;
47
- }, QueryError>;
48
+ }) => InfiniteQueryResult<TData, TVars>;
48
49
  export declare function createUseInfiniteQuery<TData extends any, TVars extends MaybeVars>(init: CreateUseInfiniteQueryOptions): UseInfiniteQueryFunction<TData, TVars>;
49
50
  export type UseMutationFunction<TData, TArgs> = ((options?: Omit<UseMutationOptions<TData, QueryError, TArgs>, "mutationFn"> & {
50
51
  headers?: Record<string, string>;
@@ -86,5 +87,5 @@ export declare const rpcClient: {
86
87
  mutation<TName extends RPCMutationName>(name: TName, input: RPCMutationInput<TName>, opts?: TRPCRequestOptions): Promise<RPCMutationResult<TName>>;
87
88
  };
88
89
  export declare function getQueryClient(): import("@tanstack/react-query").QueryClient;
89
- export type { QueryError, UseQueryResult, UseMutationResult };
90
+ export type { QueryError, UseMutationResult, UseQueryResult };
90
91
  //# sourceMappingURL=query-hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-hooks.d.ts","sourceRoot":"","sources":["../../../../src/app/lib/hooks/query-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mCAAmC,EACnC,2BAA2B,EAE3B,sBAAsB,EAEtB,kBAAkB,EAClB,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,iBAAiB,CAAC,KAAK,CAAC,CAAC;CAGrC,CAAA;AAED,wBAAgB,cAAc,gDAE7B;AAED,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAA"}
@@ -1,7 +1,7 @@
1
- import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from "@tanstack/react-query";
2
- import { startTransition, useEffect, useState } from "react";
1
+ import { useInfiniteQuery, useMutation, useQuery, useQueryClient, useSuspenseQuery, useSuspenseInfiniteQuery } from "@tanstack/react-query";
2
+ import { useMemo } from "react";
3
3
  import { joinURL } from "ufo";
4
- import { getQueryClient as utilGetQueryClient } from "../../utils/query-client.js";
4
+ import { getHydratedSSRQuery, getQueryClient as utilGetQueryClient } from "../../utils/query-client.js";
5
5
  import { getRPCClient } from "../../utils/trpc-client.js";
6
6
  import { apiConfig } from "../runtime/apiConfig.js";
7
7
  class QueryError extends Error {
@@ -73,11 +73,13 @@ const fetchQuery = async (name, params, opts) => {
73
73
  export function createUseQuery(init) {
74
74
  const hook = (args, options) => {
75
75
  const customKey = apiConfig.customQueryKey;
76
- return useQuery({
77
- queryKey: ["query", init.name, args, options?.headers, customKey],
76
+ const queryKey = ["query", init.name, args, options?.headers, customKey];
77
+ return (env.server ? useSuspenseQuery : useQuery)({
78
+ queryKey: queryKey,
78
79
  queryFn: (args) => fetchQuery(init.name, args.queryKey[2] ? JSON.stringify(args.queryKey[2]) : "", {
79
80
  headers: options?.headers,
80
81
  }),
82
+ initialData: env.client ? getHydratedSSRQuery(queryKey) : undefined,
81
83
  ...options,
82
84
  }, useFallbackClient());
83
85
  };
@@ -99,31 +101,31 @@ function selectByPath(data, path) {
99
101
  export function createUseInfiniteQuery(init) {
100
102
  const hook = (args, options) => {
101
103
  const customKey = apiConfig.customQueryKey;
102
- const [initial, setInitial] = useState(() => {
103
- if (options?.initialData) {
104
- const data = options?.initialData;
104
+ const queryKey = ["query", init.name, args, init.defaultLimit, options?.headers, customKey];
105
+ const initial = useMemo(() => {
106
+ let data = options?.initialData;
107
+ if (data) {
105
108
  const endCursor = selectByPath(data, init.paths.endCursorPath);
106
109
  const hasNextPage = selectByPath(data, init.paths.hasNextPagePath);
107
110
  const nodes = selectByPath(data, init.paths.nodesPath);
108
- if (!nodes)
109
- return {};
111
+ if (nodes) {
112
+ return {
113
+ initialData: {
114
+ pages: [{ nodes, endCursor, hasNextPage }],
115
+ pageParams: [],
116
+ },
117
+ };
118
+ }
119
+ }
120
+ data = getHydratedSSRQuery(queryKey);
121
+ if (data) {
110
122
  return {
111
- initialData: {
112
- pages: [{ nodes, endCursor, hasNextPage }],
113
- pageParams: [],
114
- },
123
+ initialData: data,
115
124
  };
116
125
  }
117
- });
118
- useEffect(() => {
119
- startTransition(() => {
120
- setInitial({
121
- initialData: undefined,
122
- });
123
- });
124
126
  }, []);
125
- return useInfiniteQuery({
126
- queryKey: ["query", init.name, args, init.defaultLimit, options?.headers, customKey],
127
+ return (env.server ? useSuspenseInfiniteQuery : useInfiniteQuery)({
128
+ queryKey,
127
129
  queryFn: async (args) => {
128
130
  const finalArgs = {
129
131
  limit: args.queryKey[3],
@@ -1 +1 @@
1
- {"version":3,"file":"render-ssr-page.d.ts","sourceRoot":"","sources":["../../../src/app/server/render-ssr-page.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAKrF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,OAAO,wDAyH/C;AAED,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,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,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6GpE;AAED,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,GAAG,CAAA;CAChB,GAAG,eAAe,CAAA;AAEnB,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiBlF;AAED,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAA;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,UA8B1D"}
@@ -5,14 +5,17 @@ import { Writable } from "stream";
5
5
  import { MetaTags } from "../entry/MetaTags.js";
6
6
  import { SSRRoot } from "../entry/ssr-root.js";
7
7
  import { RouteLoader } from "../lib/routing/loader.js";
8
- import { AssetCaptureContext } from "../utils/asset-capture.js";
8
+ import { ServerRenderResponseContext } from "../utils/ssr-response-data.js";
9
9
  import { ServerContext } from "./server-context.js";
10
10
  import { SecureHeaderBuilder } from "./utils/content-security.js";
11
11
  export async function getSsrStream(args) {
12
12
  const clientManifest = ServerContext.main.runtime.getManifest("client");
13
- const preloadAssets = new Set([clientManifest.handler]);
14
- const includedAssets = new Set();
15
- const jsx = (_jsx(Suspense, { children: _jsx(AssetCaptureContext.Provider, { value: preloadAssets, children: _jsx(SSRRoot, { metaTags: args.initialData?.meta?.head || [], pathname: args.pathname, hostname: args.hostname, initialData: args.initialData, loader: new RouteLoader() }) }) }));
13
+ const ssrResponse = {
14
+ preloadAssets: new Set([clientManifest.handler]),
15
+ includedAssets: new Set(),
16
+ queryCache: new Map(),
17
+ };
18
+ const jsx = (_jsx(Suspense, { children: _jsx(ServerRenderResponseContext.Provider, { value: ssrResponse, children: _jsx(SSRRoot, { metaTags: args.initialData?.meta?.head || [], pathname: args.pathname, hostname: args.hostname, initialData: args.initialData, loader: new RouteLoader() }) }) }));
16
19
  const stream = await new Promise(async (resolve, reject) => {
17
20
  // console.log("Rendering to pipable")
18
21
  const stream = renderToPipeableStream(jsx, {
@@ -63,7 +66,7 @@ export async function getSsrStream(args) {
63
66
  });
64
67
  stream.pipe(writableStream);
65
68
  });
66
- for (const input of preloadAssets) {
69
+ for (const input of ssrResponse.preloadAssets) {
67
70
  const assets = await clientManifest.inputs[input].assets();
68
71
  // controller.enqueue(new TextEncoder().encode(`\n<!-- for ${input} -->`))
69
72
  for (const _asset of assets) {
@@ -75,9 +78,9 @@ export async function getSsrStream(args) {
75
78
  if (!key) {
76
79
  throw new Error("Asset must have a key: " + JSON.stringify(asset));
77
80
  }
78
- if (includedAssets.has(key))
81
+ if (ssrResponse.includedAssets.has(key))
79
82
  continue;
80
- includedAssets.add(key);
83
+ ssrResponse.includedAssets.add(key);
81
84
  // Render the asset
82
85
  try {
83
86
  const tag = renderAsset(asset);
@@ -88,6 +91,7 @@ export async function getSsrStream(args) {
88
91
  }
89
92
  }
90
93
  }
94
+ controller.enqueue(new TextEncoder().encode(`<script type="text/javascript">window._SSR_CACHE=${JSON.stringify([...ssrResponse.queryCache.entries()])}</script>`));
91
95
  // console.log("ASSETS", await clientManifest)
92
96
  controller.enqueue(new TextEncoder().encode(middle));
93
97
  for (const chunk of inner) {
@@ -1,5 +1,6 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
2
  import { PropsWithChildren } from "react";
3
3
  export declare function getQueryClient(): QueryClient;
4
+ export declare function getHydratedSSRQuery(queryKey: any): any;
4
5
  export declare function QueryProvider(props: PropsWithChildren<{}>): import("react").JSX.Element;
5
6
  //# sourceMappingURL=query-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../../src/app/utils/query-client.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGzC,wBAAgB,cAAc,gBAc7B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,+BAEzD"}
1
+ {"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../../src/app/utils/query-client.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,WAAW,EAAuB,MAAM,uBAAuB,CAAA;AACpG,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAA;AAelD,wBAAgB,cAAc,gBAO7B;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,GAAG,OAMhD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,+BAyBzD"}
@@ -1,20 +1,53 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
2
+ import { QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
+ import { useMemo } from "react";
4
+ import { useSSRResponse } from "./ssr-response-data.js";
5
+ function getQueryClientOptions() {
6
+ if (env.serverless && env.dev && !env.client) {
7
+ return {
8
+ queries: {
9
+ staleTime: 1,
10
+ },
11
+ };
12
+ }
13
+ return {};
14
+ }
3
15
  let queryClient = null;
4
16
  export function getQueryClient() {
5
17
  if (!queryClient) {
6
18
  queryClient = new QueryClient({
7
- defaultOptions: env.serverless && env.dev && !env.client
8
- ? {
9
- queries: {
10
- staleTime: 1,
11
- },
12
- }
13
- : {},
19
+ defaultOptions: getQueryClientOptions(),
14
20
  });
15
21
  }
16
22
  return queryClient;
17
23
  }
24
+ export function getHydratedSSRQuery(queryKey) {
25
+ const queryHash = JSON.stringify(queryKey);
26
+ if (env.client && env.frontend && typeof window !== "undefined" && "_SSR_CACHE" in window) {
27
+ const cache = window._SSR_CACHE;
28
+ return cache.find(([hash]) => hash === queryHash)?.[1];
29
+ }
30
+ }
18
31
  export function QueryProvider(props) {
19
- return _jsx(QueryClientProvider, { client: getQueryClient(), children: props.children });
32
+ const ssrResponse = useSSRResponse();
33
+ const queryClient = useMemo(() => {
34
+ let queryCache;
35
+ /**
36
+ * In SSR server mode, save query cache values to the SSR Response metadata.
37
+ * The client will try to get these from getHydratedSSRQuery()
38
+ */
39
+ if (env.server) {
40
+ queryCache = new QueryCache({
41
+ onSuccess(data, query) {
42
+ ssrResponse?.queryCache.set(JSON.stringify(query.queryKey), data);
43
+ },
44
+ });
45
+ return new QueryClient({
46
+ queryCache: queryCache,
47
+ defaultOptions: getQueryClientOptions(),
48
+ });
49
+ }
50
+ return getQueryClient();
51
+ }, []);
52
+ return _jsx(QueryClientProvider, { client: queryClient, children: props.children });
20
53
  }
@@ -0,0 +1,6 @@
1
+ export type SSRResponseData = {
2
+ assets: Set<string>;
3
+ };
4
+ export declare const SSRResponseContext: import("react").Context<SSRResponseData>;
5
+ export declare const useSSRResponse: () => SSRResponseData;
6
+ //# sourceMappingURL=ssr-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssr-cache.d.ts","sourceRoot":"","sources":["../../../src/app/utils/ssr-cache.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,kBAAkB,0CAA6C,CAAA;AAE5E,eAAO,MAAM,cAAc,uBAE1B,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { createContext, useContext } from "react";
2
+ export const SSRResponseContext = createContext(undefined);
3
+ export const useSSRResponse = () => {
4
+ return useContext(SSRResponseContext);
5
+ };
@@ -0,0 +1,13 @@
1
+ export type ServerRenderResponseData = {
2
+ preloadAssets: Set<string>;
3
+ includedAssets: Set<string>;
4
+ queryCache: Map<string, any>;
5
+ };
6
+ export declare const ServerRenderResponseContext: import("react").Context<ServerRenderResponseData | undefined>;
7
+ export declare function useSSRResponse(): {
8
+ addPreload(name: string): void;
9
+ preloadAssets: Set<string>;
10
+ includedAssets: Set<string>;
11
+ queryCache: Map<string, any>;
12
+ } | null;
13
+ //# sourceMappingURL=ssr-response-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssr-response-data.d.ts","sourceRoot":"","sources":["../../../src/app/utils/ssr-response-data.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,2BAA2B,+DAAiE,CAAA;AAEzG,wBAAgB,cAAc;qBAMP,MAAM;mBAbZ,GAAG,CAAC,MAAM,CAAC;oBACV,GAAG,CAAC,MAAM,CAAC;gBACf,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;SAiB7B"}
@@ -0,0 +1,14 @@
1
+ import { createContext, useContext } from "react";
2
+ export const ServerRenderResponseContext = createContext(undefined);
3
+ export function useSSRResponse() {
4
+ const data = useContext(ServerRenderResponseContext);
5
+ if (data) {
6
+ return {
7
+ ...data,
8
+ addPreload(name) {
9
+ data.preloadAssets.add(name);
10
+ }
11
+ };
12
+ }
13
+ return null;
14
+ }
@@ -1,5 +1,5 @@
1
1
  import { Worker } from "node:worker_threads";
2
- import { StatefulLog } from "../utils/stateful-log.js";
2
+ import type { StatefulLog } from "../utils/stateful-log.js";
3
3
  type WorkerMode = "admin" | "frontend" | "graphql" | "serverless";
4
4
  export declare class CLIWorker {
5
5
  worker: Worker;
@@ -1 +1 @@
1
- {"version":3,"file":"cli-worker.d.ts","sourceRoot":"","sources":["../../../src/node/cli/cli-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwC,MAAM,qBAAqB,CAAA;AAKlF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAAA;AAEjE,qBAAa,SAAS;IACpB,MAAM,EAAE,MAAM,CAAA;gBACF,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAkC3F,QAAQ;CAGf"}
1
+ {"version":3,"file":"cli-worker.d.ts","sourceRoot":"","sources":["../../../src/node/cli/cli-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwC,MAAM,qBAAqB,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAG3D,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAAA;AAEjE,qBAAa,SAAS;IACpB,MAAM,EAAE,MAAM,CAAA;gBACF,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAkC3F,QAAQ;CAGf"}
@@ -1,8 +1,4 @@
1
1
  import { Worker, isMainThread, parentPort, workerData } from "node:worker_threads";
2
- import { AdminBundler, adminLog } from "../compiler/bundler.admin.js";
3
- import { FrontendBundler, frontendLog } from "../compiler/bundler.frontend.js";
4
- import { GraphQLGenerator, graphqlLog } from "../graphql/graphql-codegen.js";
5
- import { Project } from "../project/project.js";
6
2
  import { configureCliMode } from "./cli-mode.js";
7
3
  export class CLIWorker {
8
4
  worker;
@@ -58,6 +54,7 @@ if (!isMainThread) {
58
54
  rootDir: process.cwd(),
59
55
  });
60
56
  // Load the project info
57
+ const { Project } = await import("../project/project.js");
61
58
  const project = await Project.create({
62
59
  rootDir: process.cwd(),
63
60
  reportPluginCompatibility: false,
@@ -90,6 +87,7 @@ if (!isMainThread) {
90
87
  });
91
88
  }
92
89
  if (mode === "admin") {
90
+ const { AdminBundler, adminLog } = await import("../compiler/bundler.admin.js");
93
91
  const bundler = new AdminBundler(project, {
94
92
  mode: "development",
95
93
  watch: true,
@@ -98,6 +96,7 @@ if (!isMainThread) {
98
96
  pipeLog(adminLog);
99
97
  }
100
98
  else if (mode === "frontend") {
99
+ const { FrontendBundler, frontendLog } = await import("../compiler/bundler.frontend.js");
101
100
  const bundler = new FrontendBundler(project, {
102
101
  mode: "development",
103
102
  watch: true,
@@ -106,6 +105,7 @@ if (!isMainThread) {
106
105
  pipeLog(frontendLog);
107
106
  }
108
107
  else if (mode === "graphql") {
108
+ const { GraphQLGenerator, graphqlLog } = await import("../graphql/graphql-codegen.js");
109
109
  const codegen = new GraphQLGenerator(project, {
110
110
  generate: true,
111
111
  optimize: true,
@@ -126,7 +126,7 @@ program
126
126
  serverless: false,
127
127
  endpoint: "",
128
128
  });
129
- spaStaging.runAndWatch();
129
+ await spaStaging.runAndWatch();
130
130
  }
131
131
  // Boot up admin in a worker
132
132
  if (tasks.admin) {
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.3.17";
1
+ export declare const VERSION = "2.3.18";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- export const VERSION = "2.3.17";
1
+ export const VERSION = "2.3.18";
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/dev-server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAO/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAID,eAAO,MAAM,aAAa,qEAAU,CAAA;AAEpC,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,SAAS;IAOX,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IAPtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,SAAO;gBAGF,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO;IAUhB,KAAK;CAyGZ"}
1
+ {"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/dev-server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAM/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAID,eAAO,MAAM,aAAa,qEAAU,CAAA;AAEpC,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,SAAS;IAOX,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IAPtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,SAAO;gBAGF,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,OAAO;IAUhB,KAAK;CA+FZ"}
@@ -4,7 +4,6 @@ import { ProjectEnvUtils } from "../project/env.js";
4
4
  import { ensureSelfSignedCert, isCertificateTrusted } from "../utils/self-signed-cert.js";
5
5
  import { createConsole } from "../utils/stateful-log.js";
6
6
  import { createVinxiApp } from "./vinxi-app.js";
7
- import { createVinxiCodegen } from "./vinxi-codegen.js";
8
7
  import chalk from "chalk";
9
8
  const console = createConsole("Dev Server", "dev");
10
9
  export const serverlessLog = console;
@@ -18,22 +17,14 @@ export class DevServer {
18
17
  constructor(project, opts) {
19
18
  this.project = project;
20
19
  this.opts = opts;
21
- this.start();
22
20
  this.origin = ProjectEnvUtils.get("SITE_URL");
23
21
  const parsedSiteURL = parseURL(this.origin);
24
22
  this.hostname = !!parsedSiteURL.host ? parsedSiteURL.host : "localhost";
25
23
  this.hostOrigin = (opts.https ? "https" : "http") + "://" + this.hostname + ":" + this.port;
24
+ this.start();
26
25
  }
27
26
  async start() {
28
27
  console.setWorking(true);
29
- // console.log("Setting up vinxi codegen")
30
- const codegen = createVinxiCodegen({
31
- mode: "development",
32
- project: this.project,
33
- serverless: true,
34
- });
35
- await codegen.runAndWatch();
36
- // console.log("Has run once")
37
28
  const app = createVinxiApp({
38
29
  mode: "development",
39
30
  origin: this.origin,
@@ -25,6 +25,7 @@ export declare function storybookVitePlugins(args: Args): PluginOption[];
25
25
  export declare function ignoreRollupErrorsPlugin(): PluginOption;
26
26
  export declare function loggerPlugin(args: {
27
27
  console: StatefulLog<any>;
28
+ completeOnError?: boolean;
28
29
  }): PluginOption;
29
30
  export declare function getViteConfig(args: Args): InlineConfig;
30
31
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"get-vite-config.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/get-vite-config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,aAAa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,EAAE,UAAU,GAAG,KAAK,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAuDlD;AAED,KAAK,eAAe,GAAG;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,wBAAgB,WAAW,CAAC,IAAI,GAAE,eAAoB,kBA4FrD;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,YAAY,CA6CxC;AA4BD,wBAAgB,aAAa,IAAI,YAAY,CAW5C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,EAAE,CAatD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,EAAE,CAE/D;AAED,wBAAgB,wBAAwB,IAAI,YAAY,CA8BvD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CA6BzG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAkEtD"}
@@ -11,8 +11,10 @@ export function envPlugin(args) {
11
11
  const envDefines = {
12
12
  client: args.client ? "true" : "false",
13
13
  serverless: args.serverless ? "true" : "false",
14
+ server: !args.client && args.serverless ? "true" : "false",
14
15
  dev: args.mode === "development" ? "true" : "false",
15
16
  admin: args.target === "cms" ? "true" : "false",
17
+ frontend: args.target === "frontend" ? "true" : "false",
16
18
  themePath: JSON.stringify(args.publicUrl),
17
19
  devUI: args.mode === "development" ? "true" : "false",
18
20
  serverlessOrigin: JSON.stringify("http://serverleress-endpoint"),
@@ -185,23 +187,29 @@ export function ssrPlugin() {
185
187
  };
186
188
  }
187
189
  function buildStatusPlugin(console) {
188
- let timer = 0;
190
+ let hasStarted = false;
189
191
  return {
190
192
  name: "eddev:logging",
191
193
  enforce: "post",
192
- watchChange() {
193
- console.resetLog();
194
- clearTimeout(timer);
195
- },
196
194
  buildStart() {
197
- clearTimeout(timer);
195
+ if (hasStarted) {
196
+ console.resetLog();
197
+ }
198
+ else {
199
+ hasStarted = true;
200
+ console.startTimer();
201
+ }
198
202
  console.setWorking(true);
199
203
  },
200
- buildEnd() {
201
- clearTimeout(timer);
202
- timer = setTimeout(() => {
203
- console.setWorking(false);
204
- }, 0);
204
+ buildEnd(error) {
205
+ if (error)
206
+ console.setWorking(false, "error");
207
+ },
208
+ renderError() {
209
+ console.setWorking(false, "error");
210
+ },
211
+ writeBundle() {
212
+ console.setWorking(false);
205
213
  },
206
214
  };
207
215
  }
@@ -283,6 +291,8 @@ export function loggerPlugin(args) {
283
291
  };
284
292
  logger.error = (msg) => {
285
293
  args.console.fail(msg.replace(/\n/, ""));
294
+ if (args.completeOnError)
295
+ args.console.setWorking(false, "error");
286
296
  };
287
297
  logger.warnOnce = (msg) => {
288
298
  args.console.warn(msg.replace(/\n/, ""));
@@ -320,7 +330,7 @@ export function getViteConfig(args) {
320
330
  }),
321
331
  buildStatusPlugin(console),
322
332
  ignoreRollupErrorsPlugin(),
323
- loggerPlugin({ console }),
333
+ loggerPlugin({ console, completeOnError: true }),
324
334
  workersPlugin(),
325
335
  ],
326
336
  build: {
@@ -1 +1 @@
1
- {"version":3,"file":"vinxi-app.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-app.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAKtD,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,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B,MAAM,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,KAAK,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAA;AAC7D,KAAK,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,QAAQ,CAAA;AACrD,KAAK,iBAAiB,GAAG,MAAM,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA;AAEhE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;CAC1C,CAAA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,OA4P3C"}
@@ -1,4 +1,5 @@
1
1
  import { joinURL } from "ufo";
2
+ // @ts-ignore
2
3
  import { createApp } from "vinxi";
3
4
  import tsconfigPaths from "vite-tsconfig-paths";
4
5
  import { StatefulLog } from "../utils/stateful-log.js";
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/node/project/manifest/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA8B,MAAM,gCAAgC,CAAA;AAGtF,KAAK,aAAa,CAAC,UAAU,IAAI;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED,KAAK,qBAAqB,CAAC,UAAU,EAAE,SAAS,IAAI;IAClD,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7D,MAAM,EAAE,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16,8 +16,9 @@ export function createManifestGenerator(args) {
16
16
  return new Promise(async (resolve) => {
17
17
  files = [];
18
18
  let events = [];
19
- const update = async () => {
20
- value = await generate(files);
19
+ let updateQueue = Promise.resolve();
20
+ const runUpdate = async () => {
21
+ value = await generate([...files]);
21
22
  clearTimeout(debouncer);
22
23
  debouncer = setTimeout(() => {
23
24
  if (!disposed)
@@ -30,19 +31,29 @@ export function createManifestGenerator(args) {
30
31
  events = [];
31
32
  }
32
33
  };
34
+ const update = () => {
35
+ updateQueue = updateQueue.then(runUpdate, runUpdate);
36
+ return updateQueue;
37
+ };
33
38
  if (args.watch) {
34
39
  const disposer = await watchFileTree({
35
40
  pattern: args.pattern,
36
41
  ignore: args.ignore,
37
42
  callback: (fileList, event) => {
38
43
  files = fileList;
39
- cache = new Map();
40
- if (args.onFileChange)
41
- fileList.forEach(args.onFileChange);
42
- update();
44
+ if (event) {
45
+ cache.delete(event.file);
46
+ args.onFileChange?.(event.file);
47
+ }
48
+ else {
49
+ cache.clear();
50
+ if (args.onFileChange)
51
+ fileList.forEach(args.onFileChange);
52
+ }
43
53
  if (event) {
44
54
  events.push(event);
45
55
  }
56
+ void update();
46
57
  },
47
58
  });
48
59
  disposers.push(disposer);
@@ -59,12 +70,16 @@ export function createManifestGenerator(args) {
59
70
  const key = args.getKey(file);
60
71
  if (key === null)
61
72
  return;
62
- const value = await args.loadValue(file, key);
73
+ let value = cache.get(file);
74
+ if (!cache.has(file)) {
75
+ value = await args.loadValue(file, key);
76
+ cache.set(file, value);
77
+ }
63
78
  entries[key] = {
64
79
  key,
65
80
  relativePath: relative(args.baseDir, file),
66
81
  fullPath: file,
67
- value,
82
+ value: value,
68
83
  };
69
84
  }));
70
85
  return args.generateManifest(entries);
@@ -23,6 +23,7 @@ export declare class FSCodegen {
23
23
  private unsubscribers;
24
24
  private writtenContent;
25
25
  private flushScheduled;
26
+ private flushTimer?;
26
27
  constructor(project: Project, opts: {
27
28
  outDir: string;
28
29
  onWritten?: (opts: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CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;KACxC;IAKH,QAAQ,CAAC,SAAS,EAAE,aAAa;IAIjC,YAAY,CAAC,EACX,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,EAAE;QACD,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,EAAE,CAAC,MAAM,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;QACxE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;KACjD;YAaa,YAAY;IAM1B,aAAa;IAYP,WAAW;IA2BX,GAAG;YAKK,KAAK;IA+BnB,IAAI;CAOL"}
@@ -14,6 +14,7 @@ export class FSCodegen {
14
14
  unsubscribers = new Set();
15
15
  writtenContent = new Map();
16
16
  flushScheduled = false;
17
+ flushTimer;
17
18
  constructor(project, opts) {
18
19
  this.project = project;
19
20
  this.opts = opts;
@@ -43,9 +44,10 @@ export class FSCodegen {
43
44
  return;
44
45
  }
45
46
  this.flushScheduled = true;
46
- setTimeout(() => {
47
+ this.flushTimer = setTimeout(() => {
47
48
  this.flushScheduled = false;
48
- this.flush();
49
+ this.flushTimer = undefined;
50
+ void this.flush();
49
51
  }, 100);
50
52
  }
51
53
  async runAndWatch() {
@@ -77,6 +79,10 @@ export class FSCodegen {
77
79
  await this.flush();
78
80
  }
79
81
  async flush() {
82
+ if (this.flushTimer)
83
+ clearTimeout(this.flushTimer);
84
+ this.flushTimer = undefined;
85
+ this.flushScheduled = false;
80
86
  const files = Array.from(this.generatorFiles.values()).flat();
81
87
  const existing = (await globby(join(this.outDir, "/**/*"))).map((path) => resolve(this.project.rootDir, path));
82
88
  const written = new Set();
@@ -99,6 +105,10 @@ export class FSCodegen {
99
105
  this.opts.onWritten?.(written);
100
106
  }
101
107
  stop() {
108
+ if (this.flushTimer)
109
+ clearTimeout(this.flushTimer);
110
+ this.flushTimer = undefined;
111
+ this.flushScheduled = false;
102
112
  this.unsubscribers.forEach((unsub) => unsub());
103
113
  this.unsubscribers.clear();
104
114
  }
@@ -24,6 +24,7 @@ export declare class StatefulLog<TState> {
24
24
  hasWarnings: boolean;
25
25
  hasErrors: boolean;
26
26
  startTime: number;
27
+ endTime?: number;
27
28
  label: string;
28
29
  shortName: string;
29
30
  status: LogStatus;
@@ -39,6 +40,7 @@ export declare class StatefulLog<TState> {
39
40
  copy(log: StatefulLog<any>): void;
40
41
  flush(): void;
41
42
  getDuration(): number;
43
+ startTimer(): void;
42
44
  captureLog(): LogGroupOrEntry[];
43
45
  subscribe(fn: (self: StatefulLog<TState>) => void): () => void;
44
46
  setState(state: TState): void;
@@ -1 +1 @@
1
- {"version":3,"file":"stateful-log.d.ts","sourceRoot":"","sources":["../../../src/node/utils/stateful-log.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAInC,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AAErG,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,WAAW,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,GAAG,EAAE,CAAA;CACb,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,eAAe,EAAE,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CA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,EAAE,GAAG,EAAE;IAMxB,QAAQ,CAAC,GAAG,EAAE,QAAQ;IAItB,IAAI,CAAC,GAAG,QAAQ,EAAE,GAAG,EAAE;IAMvB,OAAO,CAAC,GAAG,QAAQ,EAAE,GAAG,EAAE;IAK1B,IAAI,CAAC,GAAG,QAAQ,EAAE,GAAG,EAAE;IAKvB,OAAO,CAAC,MAAM;IAsFd,OAAO,CAAC,WAAW;IAkCnB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,WAAmB;IA4BnD,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,YAAQ,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,GAAG,EAAE,CAAA;KAAE,EAAE;IAuBxG,QAAQ;CAQT;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,uBAKtE"}
@@ -10,6 +10,7 @@ export class StatefulLog {
10
10
  hasWarnings = false;
11
11
  hasErrors = false;
12
12
  startTime = Date.now();
13
+ endTime;
13
14
  label;
14
15
  shortName;
15
16
  status = "working";
@@ -27,6 +28,7 @@ export class StatefulLog {
27
28
  this.hasErrors = false;
28
29
  this.hasWarnings = false;
29
30
  this.startTime = Date.now();
31
+ this.endTime = undefined;
30
32
  this.notifySubscribers();
31
33
  }
32
34
  clear() {
@@ -35,6 +37,7 @@ export class StatefulLog {
35
37
  this.currentGroup = undefined;
36
38
  this.hasErrors = false;
37
39
  this.hasWarnings = false;
40
+ this.endTime = undefined;
38
41
  this.notifySubscribers();
39
42
  }
40
43
  copy(log) {
@@ -44,6 +47,7 @@ export class StatefulLog {
44
47
  this.hasErrors = log.hasErrors;
45
48
  this.hasWarnings = log.hasWarnings;
46
49
  this.startTime = log.startTime;
50
+ this.endTime = log.endTime;
47
51
  this.status = log.status;
48
52
  this.state = log.state;
49
53
  this.notifySubscribers();
@@ -53,11 +57,17 @@ export class StatefulLog {
53
57
  this.notifySubscribers();
54
58
  }
55
59
  getDuration() {
60
+ if (this.endTime !== undefined)
61
+ return this.endTime - this.startTime;
56
62
  const last = this.entries[this.entries.length - 1];
57
63
  if (!last)
58
64
  return 0;
59
65
  return last.time - this.startTime;
60
66
  }
67
+ startTimer() {
68
+ this.startTime = Date.now();
69
+ this.endTime = undefined;
70
+ }
61
71
  captureLog() {
62
72
  const entries = this.entries;
63
73
  return [...entries];
@@ -73,15 +83,13 @@ export class StatefulLog {
73
83
  this.notifySubscribers();
74
84
  }
75
85
  setWorking(working, status) {
76
- if (status) {
77
- this.setStatus(status);
78
- }
79
86
  if (working) {
80
- this.setStatus("working");
87
+ this.endTime = undefined;
81
88
  }
82
89
  else {
83
- this.setStatus(this.hasErrors ? "error" : this.hasWarnings ? "warn" : "success");
90
+ this.endTime = Date.now();
84
91
  }
92
+ this.setStatus(working ? "working" : (status ?? (this.hasErrors ? "error" : this.hasWarnings ? "warn" : "success")));
85
93
  }
86
94
  setStatus(status) {
87
95
  this.status = status;
@@ -95,9 +103,9 @@ export class StatefulLog {
95
103
  this.notifySubscribers();
96
104
  }
97
105
  verbose(...messages) {
98
- if (cliMode.verbose) {
99
- this.addLogEntry("verbose", ...messages);
100
- }
106
+ if (!cliMode.verbose)
107
+ return;
108
+ this.addLogEntry("verbose", ...messages);
101
109
  this.notifySubscribers();
102
110
  }
103
111
  info(...messages) {
@@ -119,7 +127,7 @@ export class StatefulLog {
119
127
  }
120
128
  fail(...messages) {
121
129
  this.addLogEntry("fail", ...messages);
122
- this.hasWarnings = true;
130
+ this.hasErrors = true;
123
131
  this.notifySubscribers();
124
132
  }
125
133
  success(...messages) {
@@ -255,7 +263,6 @@ export class StatefulLog {
255
263
  else {
256
264
  this.entries.push(entry);
257
265
  }
258
- this.notifySubscribers();
259
266
  }
260
267
  else {
261
268
  console.log(chalk.grey(`[${this.shortName}]`), ...messages);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.3.17",
3
+ "version": "2.3.19",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/types.env.d.ts CHANGED
@@ -2,7 +2,9 @@ declare global {
2
2
  interface EDEnv {
3
3
  client: boolean
4
4
  serverless: boolean
5
+ server: boolean
5
6
  admin: boolean
7
+ frontend: boolean,
6
8
  dev: boolean
7
9
  devUI: boolean
8
10
  rpcEnabled: boolean
@@ -17,4 +19,4 @@ declare global {
17
19
  }
18
20
  }
19
21
 
20
- export {}
22
+ export { }