eddev 2.0.0-beta.9 → 2.0.0-beta.91
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/app/entry/HydrationOverlay.d.ts +1 -0
- package/dist/app/entry/HydrationOverlay.js +2 -0
- package/dist/app/entry/MetaTags.d.ts +7 -0
- package/dist/app/entry/MetaTags.js +17 -0
- package/dist/app/entry/boot-admin.js +11 -6
- package/dist/app/entry/hydration-script.d.ts +1 -0
- package/dist/app/entry/hydration-script.js +18 -0
- package/dist/app/entry/spa-root.js +4 -5
- package/dist/app/entry/ssr-root-client.d.ts +3 -1
- package/dist/app/entry/ssr-root-client.js +24 -8
- package/dist/app/entry/ssr-root.d.ts +5 -4
- package/dist/app/entry/ssr-root.js +21 -20
- package/dist/app/lib/admin/index.d.ts +2 -2
- package/dist/app/lib/admin/index.js +2 -2
- package/dist/app/lib/admin/installFieldTypes.js +1 -1
- package/dist/app/lib/admin/runWidgets.js +1 -1
- package/dist/app/lib/blocks/ContentBlocks.d.ts +1 -1
- package/dist/app/lib/blocks/ContentBlocks.js +5 -5
- package/dist/app/lib/blocks/EditableText.d.ts +1 -1
- package/dist/app/lib/blocks/EditableText.js +3 -3
- package/dist/app/lib/blocks/InnerBlocks.d.ts +13 -3
- package/dist/app/lib/blocks/InnerBlocks.js +13 -5
- package/dist/app/lib/blocks/block-utils.d.ts +2 -2
- package/dist/app/lib/blocks/block-utils.js +2 -2
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +7 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.js +130 -0
- package/dist/app/lib/blocks/editor/EditorSupport.js +4 -5
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -1
- package/dist/app/lib/blocks/editor/editor-config.d.ts +17 -4
- package/dist/app/lib/blocks/editor/editor-config.js +21 -9
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +20 -14
- package/dist/app/lib/blocks/editor/root-blocks.d.ts +6 -0
- package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts +1 -1
- package/dist/app/lib/blocks/index.d.ts +9 -9
- package/dist/app/lib/blocks/index.js +9 -9
- package/dist/app/lib/blocks/inline-editing.d.ts +1 -1
- package/dist/app/lib/blocks/inline-editing.js +7 -5
- package/dist/app/lib/devtools/components/BreakpointIndicator.js +1 -1
- package/dist/app/lib/devtools/components/DevUI.js +4 -3
- package/dist/app/lib/devtools/components/GridIndicator.d.ts +1 -0
- package/dist/app/lib/devtools/components/GridIndicator.js +29 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts +1 -1
- package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +1014 -1014
- package/dist/app/lib/devtools/hooks/useTailwind.js +1 -1
- package/dist/app/lib/devtools/index.d.ts +1 -1
- package/dist/app/lib/devtools/index.js +1 -1
- package/dist/app/lib/devtools/loader.js +8 -7
- package/dist/app/lib/devtools/useQueryDebug.d.ts +7 -1
- package/dist/app/lib/devtools/useQueryDebug.js +5 -8
- package/dist/app/lib/dynamic/dynamic.d.ts +1 -1
- package/dist/app/lib/dynamic/dynamic.js +5 -1
- package/dist/app/lib/dynamic/index.d.ts +1 -1
- package/dist/app/lib/dynamic/index.js +1 -1
- package/dist/app/lib/hooks/index.d.ts +4 -5
- package/dist/app/lib/hooks/index.js +4 -5
- package/dist/app/lib/hooks/queryUtils.d.ts +37 -3
- package/dist/app/lib/hooks/queryUtils.js +66 -26
- package/dist/app/lib/hooks/useAppData.js +1 -1
- package/dist/app/lib/hooks/useRPC.d.ts +0 -4
- package/dist/app/lib/hooks/useRPC.js +1 -8
- package/dist/app/lib/internal/finalize-rpc.d.ts +17 -0
- package/dist/app/lib/internal/finalize-rpc.js +3 -0
- package/dist/app/lib/internal/index.d.ts +5 -4
- package/dist/app/lib/internal/index.js +5 -4
- package/dist/app/lib/internal/read-admin-manifest.d.ts +1 -1
- package/dist/app/lib/legacy-stitches/createStitches.d.ts +21 -21
- package/dist/app/lib/legacy-stitches/createStitches.js +1 -1
- package/dist/app/lib/legacy-stitches/index.d.ts +1 -1
- package/dist/app/lib/legacy-stitches/index.js +1 -1
- package/dist/app/lib/routing/components/BackButton.d.ts +49 -0
- package/dist/app/lib/routing/components/BackButton.js +47 -0
- package/dist/app/lib/routing/components/BrowserRouter.d.ts +4 -1
- package/dist/app/lib/routing/components/BrowserRouter.js +95 -19
- package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -1
- package/dist/app/lib/routing/components/ClientOnly.js +1 -1
- package/dist/app/lib/routing/components/Link.d.ts +1 -0
- package/dist/app/lib/routing/components/Link.js +11 -12
- package/dist/app/lib/routing/components/RouteRenderer.d.ts +1 -1
- package/dist/app/lib/routing/components/RouteRenderer.js +7 -6
- package/dist/app/lib/routing/components/SSRRouter.d.ts +2 -2
- package/dist/app/lib/routing/components/SSRRouter.js +5 -6
- package/dist/app/lib/routing/components/ScrollRestoration.js +5 -2
- package/dist/app/lib/routing/context.d.ts +8 -5
- package/dist/app/lib/routing/context.js +13 -96
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts +2 -1
- package/dist/app/lib/routing/hooks/useRestorableState.js +2 -1
- package/dist/app/lib/routing/hooks/useRoute.d.ts +16 -1
- package/dist/app/lib/routing/hooks/useRoute.js +22 -1
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +5 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +1 -1
- package/dist/app/lib/routing/hooks/useRouteTransition.js +1 -1
- package/dist/app/lib/routing/hooks/useRouter.d.ts +1 -1
- package/dist/app/lib/routing/hooks/useRouter.js +1 -1
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +1 -1
- package/dist/app/lib/routing/hooks/useRouterEvents.js +1 -1
- package/dist/app/lib/routing/hooks/useRouterState.d.ts +1 -1
- package/dist/app/lib/routing/hooks/useRouterState.js +1 -1
- package/dist/app/lib/routing/hooks/useSearchParams.js +2 -2
- package/dist/app/lib/routing/index.d.ts +14 -13
- package/dist/app/lib/routing/index.js +14 -13
- package/dist/app/lib/routing/loader.d.ts +2 -2
- package/dist/app/lib/routing/loader.js +20 -11
- package/dist/app/lib/routing/types.d.ts +36 -10
- package/dist/app/lib/routing/utils.d.ts +5 -2
- package/dist/app/lib/routing/utils.js +37 -4
- package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +6 -2
- package/dist/app/lib/runtime/apiConfig.js +6 -0
- package/dist/app/lib/runtime/errorHandling.d.ts +39 -0
- package/dist/app/lib/runtime/errorHandling.js +6 -0
- package/dist/app/lib/runtime/index.d.ts +2 -0
- package/dist/app/lib/runtime/index.js +2 -0
- package/dist/app/lib/views/index.d.ts +1 -1
- package/dist/app/lib/views/index.js +1 -1
- package/dist/app/server/defineRouter.d.ts +2 -0
- package/dist/app/server/defineRouter.js +4 -0
- package/dist/app/server/index.d.ts +5 -3
- package/dist/app/server/index.js +5 -3
- package/dist/app/server/proxy-wp-admin.d.ts +1 -2
- package/dist/app/server/proxy-wp-admin.js +32 -14
- package/dist/app/server/render-ssr-page.d.ts +21 -2
- package/dist/app/server/render-ssr-page.js +143 -11
- package/dist/app/server/rpc.d.ts +56 -0
- package/dist/app/server/rpc.js +18 -0
- package/dist/app/server/server-context.d.ts +42 -4
- package/dist/app/server/server-context.js +196 -30
- package/dist/app/server/utils/replace-host.d.ts +1 -1
- package/dist/app/server/utils/replace-host.js +10 -2
- package/dist/app/server/utils/swr-cache.d.ts +4 -0
- package/dist/app/server/utils/swr-cache.js +31 -0
- package/dist/app/utils/APIProvider.d.ts +2 -0
- package/dist/app/utils/APIProvider.js +5 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts +19 -0
- package/dist/app/utils/BlockErrorBoundary.js +38 -0
- package/dist/app/utils/ErrorMessage.d.ts +5 -0
- package/dist/app/utils/ErrorMessage.js +14 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts +18 -0
- package/dist/app/utils/RouteErrorBoundary.js +38 -0
- package/dist/app/utils/asset-capture.d.ts +2 -0
- package/dist/app/utils/asset-capture.js +5 -0
- package/dist/app/utils/hydration-debugger.d.ts +13 -0
- package/dist/app/utils/hydration-debugger.js +11 -0
- package/dist/app/utils/query-client.d.ts +2 -0
- package/dist/app/utils/query-client.js +5 -1
- package/dist/app/utils/trpc-client.d.ts +2 -0
- package/dist/app/utils/trpc-client.js +39 -0
- package/dist/node/cli/cli-worker.js +10 -5
- package/dist/node/cli/cli.js +79 -11
- package/dist/node/cli/display/CLIApp.js +3 -6
- package/dist/node/cli/display/boot-cli-app.js +1 -1
- package/dist/node/cli/display/tools/CreateBlock.d.ts +1 -1
- package/dist/node/cli/display/tools/cli-tools.d.ts +1 -11
- package/dist/node/cli/display/tools/cli-tools.js +9 -9
- package/dist/node/cli/version.d.ts +1 -1
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/build-vinxi.js +3 -1
- package/dist/node/compiler/bundler.admin.d.ts +1 -1
- package/dist/node/compiler/bundler.admin.js +1 -1
- package/dist/node/compiler/bundler.frontend.js +1 -1
- package/dist/node/compiler/dev-server.js +10 -0
- package/dist/node/compiler/get-vite-config.d.ts +1 -0
- package/dist/node/compiler/get-vite-config.js +34 -11
- package/dist/node/compiler/vinxi-app.d.ts +12 -0
- package/dist/node/compiler/vinxi-app.js +139 -32
- package/dist/node/compiler/vinxi-codegen.js +321 -108
- package/dist/node/graphql/graphql-codegen.d.ts +11 -1
- package/dist/node/graphql/graphql-codegen.js +210 -33
- package/dist/node/graphql/graphql-schema-loader.d.ts +2 -1
- package/dist/node/graphql/graphql-schema-loader.js +5 -16
- package/dist/node/graphql/plugins/gql-plugin-queries.js +1 -1
- package/dist/node/graphql/query-files-loader.d.ts +3 -0
- package/dist/node/graphql/query-files-loader.js +5 -0
- package/dist/node/project/config.d.ts +159 -73
- package/dist/node/project/config.js +69 -20
- package/dist/node/project/env.d.ts +4 -0
- package/dist/node/project/env.js +1 -0
- package/dist/node/project/manifest/block-manifest.js +1 -0
- package/dist/node/project/manifest/manifest.d.ts +1 -0
- package/dist/node/project/manifest/manifest.js +14 -10
- package/dist/node/project/manifest/routes-manifest.d.ts +20 -0
- package/dist/node/project/manifest/routes-manifest.js +74 -0
- package/dist/node/project/manifest/view-manifest.js +1 -1
- package/dist/node/project/project.d.ts +9 -1
- package/dist/node/project/project.js +37 -6
- package/dist/node/project/wp-info.d.ts +1 -0
- package/dist/node/project/wp-info.js +13 -1
- package/dist/node/types/block-type.d.ts +25 -20
- package/dist/node/types/block-type.js +1 -0
- package/dist/node/types/view-type.d.ts +7 -7
- package/dist/node/utils/fetch-wp.d.ts +1 -0
- package/dist/node/utils/fetch-wp.js +27 -0
- package/dist/node/utils/fs-codegen.d.ts +2 -0
- package/dist/node/utils/fs-codegen.js +2 -1
- package/dist/node/utils/is-deploying.js +1 -1
- package/dist/node/utils/stateful-log.js +2 -0
- package/dist/node/utils/watch-file-tree.d.ts +17 -3
- package/dist/node/utils/watch-file-tree.js +12 -5
- package/package.json +17 -13
- package/types.app.d.ts +4 -2
- package/types.app.internal.d.ts +2 -2
- package/types.node.d.ts +3 -3
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
- package/dist/app/lib/hooks/apiConfig.js +0 -4
- package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
- package/dist/app/lib/hooks/usePageLoad.js +0 -5
- package/dist/app/server/utils/index.html.d.ts +0 -2
- package/dist/app/server/utils/index.html.js +0 -14
|
@@ -5,124 +5,210 @@ export declare const EDConfigSchema: z.ZodObject<{
|
|
|
5
5
|
version: z.ZodEffects<z.ZodEnum<["1", "2"]>, "2", "1" | "2">;
|
|
6
6
|
legacyMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
7
|
legacyStitches: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
trackingID: z.ZodOptional<z.ZodString>;
|
|
12
|
-
version: z.ZodEnum<["3", "4"]>;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
version: "3" | "4";
|
|
15
|
-
trackingID?: string | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
version: "3" | "4";
|
|
18
|
-
trackingID?: string | undefined;
|
|
19
|
-
}>>;
|
|
8
|
+
trackers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
9
|
+
provider: z.ZodLiteral<"ga4">;
|
|
10
|
+
id: z.ZodString;
|
|
20
11
|
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
version: "3" | "4";
|
|
24
|
-
trackingID?: string | undefined;
|
|
25
|
-
} | undefined;
|
|
12
|
+
id: string;
|
|
13
|
+
provider: "ga4";
|
|
26
14
|
}, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
15
|
+
id: string;
|
|
16
|
+
provider: "ga4";
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
provider: z.ZodLiteral<"gtm">;
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
id: string;
|
|
22
|
+
provider: "gtm";
|
|
23
|
+
}, {
|
|
24
|
+
id: string;
|
|
25
|
+
provider: "gtm";
|
|
26
|
+
}>]>, "many">>;
|
|
33
27
|
serverless: z.ZodObject<{
|
|
34
28
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
35
29
|
uploads: z.ZodEnum<["proxy", "remote"]>;
|
|
36
30
|
plugins: z.ZodDefault<z.ZodEnum<["proxy", "remote"]>>;
|
|
31
|
+
admin: z.ZodDefault<z.ZodEnum<["proxy", "hide"]>>;
|
|
32
|
+
originProtection: z.ZodDefault<z.ZodObject<{
|
|
33
|
+
requireLogin: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
requireLogin: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
requireLogin?: boolean | undefined;
|
|
38
|
+
}>>;
|
|
37
39
|
themeAssets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
38
|
-
apiOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
39
40
|
endpoints: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
cors: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
origins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
origins?: string[] | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
origins?: string[] | undefined;
|
|
47
|
+
}>>;
|
|
42
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
plugins: "proxy" | "remote";
|
|
43
50
|
enabled: boolean;
|
|
44
51
|
uploads: "proxy" | "remote";
|
|
45
|
-
|
|
52
|
+
admin: "hide" | "proxy";
|
|
53
|
+
originProtection: {
|
|
54
|
+
requireLogin: boolean;
|
|
55
|
+
};
|
|
46
56
|
themeAssets: string[];
|
|
47
|
-
apiOnly: boolean;
|
|
48
57
|
endpoints: Record<string, string>;
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
cors?: {
|
|
59
|
+
origins?: string[] | undefined;
|
|
60
|
+
} | undefined;
|
|
51
61
|
}, {
|
|
52
62
|
uploads: "proxy" | "remote";
|
|
53
63
|
endpoints: Record<string, string>;
|
|
54
|
-
enabled?: boolean | undefined;
|
|
55
64
|
plugins?: "proxy" | "remote" | undefined;
|
|
65
|
+
enabled?: boolean | undefined;
|
|
66
|
+
admin?: "hide" | "proxy" | undefined;
|
|
67
|
+
originProtection?: {
|
|
68
|
+
requireLogin?: boolean | undefined;
|
|
69
|
+
} | undefined;
|
|
56
70
|
themeAssets?: string[] | undefined;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
cors?: {
|
|
72
|
+
origins?: string[] | undefined;
|
|
73
|
+
} | undefined;
|
|
60
74
|
}>;
|
|
61
|
-
cache: z.
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
cache: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
76
|
+
wordpress: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
77
|
+
strategy: z.ZodEnum<["always", "ssr-always-fresh"]>;
|
|
78
|
+
cacheHeaders: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
transients: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
strategy: "always" | "ssr-always-fresh";
|
|
82
|
+
cacheHeaders: boolean;
|
|
83
|
+
transients: boolean;
|
|
84
|
+
}, {
|
|
85
|
+
strategy: "always" | "ssr-always-fresh";
|
|
86
|
+
cacheHeaders?: boolean | undefined;
|
|
87
|
+
transients?: boolean | undefined;
|
|
88
|
+
}>>>;
|
|
89
|
+
serverless: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
90
|
+
isr: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
91
|
+
dataCache: z.ZodDefault<z.ZodEnum<["in-memory", "kv", "none"]>>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
isr: boolean;
|
|
94
|
+
dataCache: "none" | "in-memory" | "kv";
|
|
95
|
+
}, {
|
|
96
|
+
isr?: boolean | undefined;
|
|
97
|
+
dataCache?: "none" | "in-memory" | "kv" | undefined;
|
|
98
|
+
}>>>;
|
|
99
|
+
pageDataTTL: z.ZodDefault<z.ZodNumber>;
|
|
100
|
+
appDataTTL: z.ZodDefault<z.ZodNumber>;
|
|
101
|
+
queryHooksTTL: z.ZodDefault<z.ZodNumber>;
|
|
64
102
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
|
|
66
|
-
|
|
103
|
+
wordpress: {
|
|
104
|
+
strategy: "always" | "ssr-always-fresh";
|
|
105
|
+
cacheHeaders: boolean;
|
|
106
|
+
transients: boolean;
|
|
107
|
+
};
|
|
108
|
+
serverless: {
|
|
109
|
+
isr: boolean;
|
|
110
|
+
dataCache: "none" | "in-memory" | "kv";
|
|
111
|
+
};
|
|
112
|
+
pageDataTTL: number;
|
|
113
|
+
appDataTTL: number;
|
|
114
|
+
queryHooksTTL: number;
|
|
67
115
|
}, {
|
|
68
|
-
|
|
69
|
-
|
|
116
|
+
wordpress?: {
|
|
117
|
+
strategy: "always" | "ssr-always-fresh";
|
|
118
|
+
cacheHeaders?: boolean | undefined;
|
|
119
|
+
transients?: boolean | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
serverless?: {
|
|
122
|
+
isr?: boolean | undefined;
|
|
123
|
+
dataCache?: "none" | "in-memory" | "kv" | undefined;
|
|
124
|
+
} | undefined;
|
|
125
|
+
pageDataTTL?: number | undefined;
|
|
126
|
+
appDataTTL?: number | undefined;
|
|
127
|
+
queryHooksTTL?: number | undefined;
|
|
70
128
|
}>>>;
|
|
71
129
|
devUI: z.ZodDefault<z.ZodEnum<["disabled", "enabled"]>>;
|
|
72
130
|
}, "strip", z.ZodTypeAny, {
|
|
73
131
|
version: "2";
|
|
132
|
+
cache: Record<string, {
|
|
133
|
+
wordpress: {
|
|
134
|
+
strategy: "always" | "ssr-always-fresh";
|
|
135
|
+
cacheHeaders: boolean;
|
|
136
|
+
transients: boolean;
|
|
137
|
+
};
|
|
138
|
+
serverless: {
|
|
139
|
+
isr: boolean;
|
|
140
|
+
dataCache: "none" | "in-memory" | "kv";
|
|
141
|
+
};
|
|
142
|
+
pageDataTTL: number;
|
|
143
|
+
appDataTTL: number;
|
|
144
|
+
queryHooksTTL: number;
|
|
145
|
+
}>;
|
|
74
146
|
legacyMetadata: boolean;
|
|
75
147
|
legacyStitches: boolean;
|
|
76
148
|
serverless: {
|
|
149
|
+
plugins: "proxy" | "remote";
|
|
77
150
|
enabled: boolean;
|
|
78
151
|
uploads: "proxy" | "remote";
|
|
79
|
-
|
|
152
|
+
admin: "hide" | "proxy";
|
|
153
|
+
originProtection: {
|
|
154
|
+
requireLogin: boolean;
|
|
155
|
+
};
|
|
80
156
|
themeAssets: string[];
|
|
81
|
-
apiOnly: boolean;
|
|
82
157
|
endpoints: Record<string, string>;
|
|
83
|
-
|
|
84
|
-
|
|
158
|
+
cors?: {
|
|
159
|
+
origins?: string[] | undefined;
|
|
160
|
+
} | undefined;
|
|
85
161
|
};
|
|
86
|
-
devUI: "
|
|
162
|
+
devUI: "disabled" | "enabled";
|
|
87
163
|
$schema?: string | undefined;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} | undefined;
|
|
95
|
-
cache?: Record<string, {
|
|
96
|
-
props: number;
|
|
97
|
-
queries: number;
|
|
98
|
-
}> | undefined;
|
|
164
|
+
trackers?: ({
|
|
165
|
+
id: string;
|
|
166
|
+
provider: "ga4";
|
|
167
|
+
} | {
|
|
168
|
+
id: string;
|
|
169
|
+
provider: "gtm";
|
|
170
|
+
})[] | undefined;
|
|
99
171
|
}, {
|
|
100
172
|
version: "1" | "2";
|
|
101
173
|
serverless: {
|
|
102
174
|
uploads: "proxy" | "remote";
|
|
103
175
|
endpoints: Record<string, string>;
|
|
104
|
-
enabled?: boolean | undefined;
|
|
105
176
|
plugins?: "proxy" | "remote" | undefined;
|
|
177
|
+
enabled?: boolean | undefined;
|
|
178
|
+
admin?: "hide" | "proxy" | undefined;
|
|
179
|
+
originProtection?: {
|
|
180
|
+
requireLogin?: boolean | undefined;
|
|
181
|
+
} | undefined;
|
|
106
182
|
themeAssets?: string[] | undefined;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
183
|
+
cors?: {
|
|
184
|
+
origins?: string[] | undefined;
|
|
185
|
+
} | undefined;
|
|
110
186
|
};
|
|
187
|
+
cache?: Record<string, {
|
|
188
|
+
wordpress?: {
|
|
189
|
+
strategy: "always" | "ssr-always-fresh";
|
|
190
|
+
cacheHeaders?: boolean | undefined;
|
|
191
|
+
transients?: boolean | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
serverless?: {
|
|
194
|
+
isr?: boolean | undefined;
|
|
195
|
+
dataCache?: "none" | "in-memory" | "kv" | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
pageDataTTL?: number | undefined;
|
|
198
|
+
appDataTTL?: number | undefined;
|
|
199
|
+
queryHooksTTL?: number | undefined;
|
|
200
|
+
}> | undefined;
|
|
111
201
|
$schema?: string | undefined;
|
|
112
202
|
legacyMetadata?: boolean | undefined;
|
|
113
203
|
legacyStitches?: boolean | undefined;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
} | undefined;
|
|
121
|
-
|
|
122
|
-
props: number;
|
|
123
|
-
queries: number;
|
|
124
|
-
}> | undefined;
|
|
125
|
-
devUI?: "enabled" | "disabled" | undefined;
|
|
204
|
+
trackers?: ({
|
|
205
|
+
id: string;
|
|
206
|
+
provider: "ga4";
|
|
207
|
+
} | {
|
|
208
|
+
id: string;
|
|
209
|
+
provider: "gtm";
|
|
210
|
+
})[] | undefined;
|
|
211
|
+
devUI?: "disabled" | "enabled" | undefined;
|
|
126
212
|
}>;
|
|
127
213
|
export type EDConfig = z.infer<typeof EDConfigSchema>;
|
|
128
214
|
export declare class Configurator {
|
|
@@ -15,16 +15,18 @@ export const EDConfigSchema = z.object({
|
|
|
15
15
|
.default(false)
|
|
16
16
|
.describe("Whether to use legacy comments or exported JSON for block and view metadata"),
|
|
17
17
|
legacyStitches: z.boolean().optional().default(true).describe("Whether this site is using Stitches"),
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
18
|
+
trackers: z
|
|
19
|
+
.array(z.discriminatedUnion("provider", [
|
|
20
|
+
z.object({
|
|
21
|
+
provider: z.literal("ga4"),
|
|
22
|
+
id: z.string().describe("The Google Analytics 4 tracking ID"),
|
|
23
|
+
}),
|
|
24
|
+
z.object({
|
|
25
|
+
provider: z.literal("gtm"),
|
|
26
|
+
id: z.string().describe("The Google Tag Manager project ID (eg. GTM-XXXXXXX)"),
|
|
27
|
+
}),
|
|
28
|
+
]))
|
|
29
|
+
.describe("An array of standard tracking codes to embed")
|
|
28
30
|
.optional(),
|
|
29
31
|
serverless: z.object({
|
|
30
32
|
enabled: z.boolean().default(true).describe("Whether to deploy the site as a serverless app"),
|
|
@@ -35,25 +37,72 @@ export const EDConfigSchema = z.object({
|
|
|
35
37
|
.enum(["proxy", "remote"])
|
|
36
38
|
.default("remote")
|
|
37
39
|
.describe("Whether to proxy plugin assets or serve them from the serverless endpoint.\nDefault is `remote`, but `proxy` can be used to hide the CMS origin."),
|
|
38
|
-
|
|
40
|
+
admin: z
|
|
41
|
+
.enum(["proxy", "hide"])
|
|
42
|
+
.default("proxy")
|
|
43
|
+
.describe("How to handle the WordPress admin URLs.\nDefault is `proxy`, which will proxy the admin URLs to the CMS origin. When set to `hide`, all /wp-admin, /wp-json and /wp-login.php URLs will show a 404 page.\nHas no effect in dev mode."),
|
|
44
|
+
originProtection: z
|
|
45
|
+
.object({
|
|
46
|
+
requireLogin: z
|
|
47
|
+
.boolean()
|
|
48
|
+
.optional()
|
|
49
|
+
.default(false)
|
|
50
|
+
.describe("Enabling this will prevent access to the frontend for non-logged-in users on the CMS origin (eg. Flywheel, WPEngine), but allow access to the serverless frontend (eg. Vercel)."),
|
|
51
|
+
})
|
|
52
|
+
.default({}),
|
|
39
53
|
themeAssets: z
|
|
40
54
|
.array(z.string())
|
|
41
55
|
.optional()
|
|
42
56
|
.default(["assets"])
|
|
43
|
-
.describe('
|
|
44
|
-
apiOnly: z.boolean().optional().default(false).describe("Whether to deploy only the API, not the frontend"),
|
|
57
|
+
.describe('Asset folders to include in a serverless deployment.\nDefault is `["assets"]`'),
|
|
45
58
|
endpoints: z
|
|
46
59
|
.record(z.string(), z.string())
|
|
47
60
|
.describe("A map of WordPress hostnames -> serverless hostnames. You can use `*` as a wildcard for the key.\n\nFor example, `{'cms.ed.studio': 'ed.studio'}` tells the WordPress frontend where it can find any serverless API endpoints."),
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
cors: z
|
|
62
|
+
.object({
|
|
63
|
+
origins: z
|
|
64
|
+
.array(z.string())
|
|
65
|
+
.optional()
|
|
66
|
+
.describe("A list of allowed origins for CORS. Set to ['*'] to allow all. All WordPress hosts are also allowed."),
|
|
67
|
+
})
|
|
68
|
+
.optional(),
|
|
50
69
|
}),
|
|
51
70
|
cache: z
|
|
52
|
-
.record(z.
|
|
53
|
-
|
|
54
|
-
|
|
71
|
+
.record(z.object({
|
|
72
|
+
wordpress: z
|
|
73
|
+
.object({
|
|
74
|
+
strategy: z.enum(["always", "ssr-always-fresh"]),
|
|
75
|
+
cacheHeaders: z.boolean().default(true).describe("Whether to add caching headers to data requests."),
|
|
76
|
+
transients: z.boolean().default(true).describe("Whether to cache within transients."),
|
|
77
|
+
})
|
|
78
|
+
.optional()
|
|
79
|
+
.default({ strategy: "always", cacheHeaders: true, transients: true }),
|
|
80
|
+
serverless: z
|
|
81
|
+
.object({
|
|
82
|
+
isr: z
|
|
83
|
+
.boolean()
|
|
84
|
+
.optional()
|
|
85
|
+
.default(true)
|
|
86
|
+
.describe("Whether to use Incremental Static Regeneration for this origin."),
|
|
87
|
+
dataCache: z
|
|
88
|
+
.enum(["in-memory", "kv", "none"])
|
|
89
|
+
.default("in-memory")
|
|
90
|
+
.describe("The cache strategy to use for page data."),
|
|
91
|
+
})
|
|
92
|
+
.optional()
|
|
93
|
+
.default({ isr: true, dataCache: "in-memory" }),
|
|
94
|
+
pageDataTTL: z.number().default(300).describe("The number of seconds to cache page data."),
|
|
95
|
+
appDataTTL: z.number().default(300).describe("The number of seconds to cache global app data."),
|
|
96
|
+
queryHooksTTL: z.number().default(300).describe("The number of seconds to cache named GraphQL queries."),
|
|
55
97
|
}))
|
|
56
|
-
.
|
|
98
|
+
.default({
|
|
99
|
+
"*": {
|
|
100
|
+
pageDataTTL: 300,
|
|
101
|
+
appDataTTL: 300,
|
|
102
|
+
queryHooksTTL: 300,
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
.describe("A map of WordPress origin hostnames -> cache settings. Wildcards can be used for each domain."),
|
|
57
106
|
devUI: z.enum(["disabled", "enabled"]).default("enabled"),
|
|
58
107
|
});
|
|
59
108
|
export class Configurator {
|
|
@@ -115,7 +164,7 @@ export class Configurator {
|
|
|
115
164
|
this.config = undefined;
|
|
116
165
|
if (exitOnError) {
|
|
117
166
|
console.flush();
|
|
118
|
-
process.exit(
|
|
167
|
+
process.exit(1);
|
|
119
168
|
}
|
|
120
169
|
}
|
|
121
170
|
}
|
|
@@ -5,22 +5,26 @@ export declare const fields: {
|
|
|
5
5
|
readonly SITE_URL: z.ZodString;
|
|
6
6
|
readonly DEV_HOT_PORT: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, string | number, string | undefined>, number, string | undefined>;
|
|
7
7
|
readonly DEV_SERVERLESS_PORT: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, string | number, string | undefined>, number, string | undefined>;
|
|
8
|
+
readonly SITE_API_KEY: z.ZodOptional<z.ZodString>;
|
|
8
9
|
};
|
|
9
10
|
export declare const ProjectEnvSchema: z.ZodObject<{
|
|
10
11
|
readonly DEBUG_GRAPHQL_URL: z.ZodOptional<z.ZodString>;
|
|
11
12
|
readonly SITE_URL: z.ZodOptional<z.ZodString>;
|
|
12
13
|
readonly DEV_HOT_PORT: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, string | number, string | undefined>, number, string | undefined>>;
|
|
13
14
|
readonly DEV_SERVERLESS_PORT: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, string | number, string | undefined>, number, string | undefined>>;
|
|
15
|
+
readonly SITE_API_KEY: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
14
16
|
}, "strip", z.ZodTypeAny, {
|
|
15
17
|
DEBUG_GRAPHQL_URL?: string | undefined;
|
|
16
18
|
SITE_URL?: string | undefined;
|
|
17
19
|
DEV_HOT_PORT?: number | undefined;
|
|
18
20
|
DEV_SERVERLESS_PORT?: number | undefined;
|
|
21
|
+
SITE_API_KEY?: string | undefined;
|
|
19
22
|
}, {
|
|
20
23
|
DEBUG_GRAPHQL_URL?: string | undefined;
|
|
21
24
|
SITE_URL?: string | undefined;
|
|
22
25
|
DEV_HOT_PORT?: string | undefined;
|
|
23
26
|
DEV_SERVERLESS_PORT?: string | undefined;
|
|
27
|
+
SITE_API_KEY?: string | undefined;
|
|
24
28
|
}>;
|
|
25
29
|
export type ProjectEnvKey = keyof typeof fields;
|
|
26
30
|
export declare const ProjectEnvUtils: {
|
package/dist/node/project/env.js
CHANGED
|
@@ -15,6 +15,7 @@ export const fields = {
|
|
|
15
15
|
SITE_URL: z.string().url().describe("The URL of the site"),
|
|
16
16
|
DEV_HOT_PORT: portNumber,
|
|
17
17
|
DEV_SERVERLESS_PORT: portNumber,
|
|
18
|
+
SITE_API_KEY: z.string().optional().describe("The API key for the site, when origin protection is enabled"),
|
|
18
19
|
};
|
|
19
20
|
export const ProjectEnvSchema = z.object(fields).partial();
|
|
20
21
|
export const ProjectEnvUtils = {
|
|
@@ -134,6 +134,7 @@ function readBlockDataAsJSONExport(file, contents) {
|
|
|
134
134
|
result.frontendMode = userData.frontendMode;
|
|
135
135
|
if (userData.postMetaBlock) {
|
|
136
136
|
result.postMetaBlock = {
|
|
137
|
+
postTypes: userData.postMetaBlock.postTypes,
|
|
137
138
|
fieldName: userData.postMetaBlock.fieldName,
|
|
138
139
|
};
|
|
139
140
|
result.types = userData.postMetaBlock.postTypes;
|
|
@@ -8,6 +8,7 @@ type ManifestEntry<TEntryData> = {
|
|
|
8
8
|
type ManifestGeneratorArgs<TEntryData, TManifest> = {
|
|
9
9
|
baseDir: string;
|
|
10
10
|
pattern: string | string[];
|
|
11
|
+
ignore?: string[];
|
|
11
12
|
watch: boolean;
|
|
12
13
|
loadValue: (path: string, key: string) => Promise<TEntryData>;
|
|
13
14
|
getKey: (path: string) => string | null;
|
|
@@ -31,20 +31,24 @@ export function createManifestGenerator(args) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
if (args.watch) {
|
|
34
|
-
const disposer = await watchFileTree(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
fileList
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
const disposer = await watchFileTree({
|
|
35
|
+
pattern: args.pattern,
|
|
36
|
+
ignore: args.ignore,
|
|
37
|
+
callback: (fileList, event) => {
|
|
38
|
+
files = fileList;
|
|
39
|
+
cache = new Map();
|
|
40
|
+
if (args.onFileChange)
|
|
41
|
+
fileList.forEach(args.onFileChange);
|
|
42
|
+
update();
|
|
43
|
+
if (event) {
|
|
44
|
+
events.push(event);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
43
47
|
});
|
|
44
48
|
disposers.push(disposer);
|
|
45
49
|
}
|
|
46
50
|
else {
|
|
47
|
-
files = await getFileTree(args.pattern);
|
|
51
|
+
files = await getFileTree({ pattern: args.pattern, ignore: args.ignore });
|
|
48
52
|
update();
|
|
49
53
|
}
|
|
50
54
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Project } from "../project.js";
|
|
2
|
+
export type RouteManifest = {
|
|
3
|
+
routes: Record<string, RouteInfo>;
|
|
4
|
+
contextFileName: string | null;
|
|
5
|
+
validationMessages: {
|
|
6
|
+
fieldKey: string;
|
|
7
|
+
message: string;
|
|
8
|
+
severity: "error" | "warning";
|
|
9
|
+
}[];
|
|
10
|
+
bases: string[];
|
|
11
|
+
};
|
|
12
|
+
type RouteInfo = {
|
|
13
|
+
kind: "context" | "route";
|
|
14
|
+
fileName: string;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
18
|
+
export type RouteManifestGenerator = ReturnType<typeof loadRouteManifest>;
|
|
19
|
+
export declare function loadRouteManifest(project: Project): import("./manifest.js").ManifestGenerator<RouteInfo, RouteManifest>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { cliMode } from "../../cli/cli-mode.js";
|
|
2
|
+
import { createManifestGenerator } from "./manifest.js";
|
|
3
|
+
export function loadRouteManifest(project) {
|
|
4
|
+
return createManifestGenerator({
|
|
5
|
+
baseDir: project.rootDir,
|
|
6
|
+
pattern: ["server/routes/**/*.{ts,tsx}", "server/_context.{ts,tsx}"],
|
|
7
|
+
watch: cliMode.watch,
|
|
8
|
+
async generateManifest(entries) {
|
|
9
|
+
let result = {
|
|
10
|
+
routes: {},
|
|
11
|
+
contextFileName: null,
|
|
12
|
+
validationMessages: [],
|
|
13
|
+
bases: [],
|
|
14
|
+
};
|
|
15
|
+
const bases = new Set();
|
|
16
|
+
Object.entries(entries)
|
|
17
|
+
.sort(([b1], [b2]) => {
|
|
18
|
+
return b1.localeCompare(b2);
|
|
19
|
+
})
|
|
20
|
+
.forEach(([key, entry]) => {
|
|
21
|
+
if (entry.value.kind === "context") {
|
|
22
|
+
result.contextFileName = entry.value.fileName;
|
|
23
|
+
}
|
|
24
|
+
else if (entry.value.kind === "route") {
|
|
25
|
+
const { error: initialError } = entry.value;
|
|
26
|
+
const prefix = entry.value.prefix;
|
|
27
|
+
result.routes[key] = entry.value;
|
|
28
|
+
if (prefix) {
|
|
29
|
+
let shouldAdd = true;
|
|
30
|
+
bases.forEach((base) => {
|
|
31
|
+
if (base.startsWith(prefix)) {
|
|
32
|
+
bases.delete(base);
|
|
33
|
+
}
|
|
34
|
+
else if (prefix.startsWith(base)) {
|
|
35
|
+
shouldAdd = false;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (shouldAdd) {
|
|
40
|
+
bases.add(entry.value.prefix);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (initialError) {
|
|
44
|
+
result.validationMessages.push({
|
|
45
|
+
fieldKey: key,
|
|
46
|
+
message: initialError,
|
|
47
|
+
severity: "error",
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
result.bases = [...bases].sort().map((base) => "/" + base.replace(/\./g, "/"));
|
|
54
|
+
return result;
|
|
55
|
+
},
|
|
56
|
+
getKey(path) {
|
|
57
|
+
// Strip the views folder name + extension
|
|
58
|
+
return path.replace(/\.tsx?$/, "").replace(/^server\/routes\//, "");
|
|
59
|
+
},
|
|
60
|
+
async loadValue(fileName, key) {
|
|
61
|
+
if (fileName.startsWith("server/_context.")) {
|
|
62
|
+
return {
|
|
63
|
+
kind: "context",
|
|
64
|
+
fileName,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
kind: "route",
|
|
69
|
+
prefix: key.replace("/index", "").replace(/\//, "."),
|
|
70
|
+
fileName,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
2
|
import { cliMode } from "../../cli/cli-mode.js";
|
|
3
3
|
import { ViewMetaSchema } from "../../types/view-type.js";
|
|
4
|
-
import { metaExtractor } from "../../utils/ts-export-extractor.js";
|
|
5
4
|
import { formatZodError } from "../../utils/format-zod-error.js";
|
|
6
5
|
import { fs } from "../../utils/fs.js";
|
|
6
|
+
import { metaExtractor } from "../../utils/ts-export-extractor.js";
|
|
7
7
|
import { createManifestGenerator } from "./manifest.js";
|
|
8
8
|
export function loadViewManifest(project) {
|
|
9
9
|
return createManifestGenerator({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EDConfig } from "./config.js";
|
|
2
2
|
import { BlockManifestGenerator } from "./manifest/block-manifest.js";
|
|
3
|
-
import { ViewManifestGenerator } from "./manifest/view-manifest.js";
|
|
4
3
|
import { FieldManifestGenerator } from "./manifest/field-manifest.js";
|
|
4
|
+
import { RouteManifestGenerator } from "./manifest/routes-manifest.js";
|
|
5
|
+
import { ViewManifestGenerator } from "./manifest/view-manifest.js";
|
|
5
6
|
import { WidgetManifestGenerator } from "./manifest/widget-manifest.js";
|
|
6
7
|
export declare const projectLog: import("../utils/stateful-log.js").StatefulLog<Project>;
|
|
7
8
|
type ProjectArgs = {
|
|
@@ -24,9 +25,16 @@ export declare class Project {
|
|
|
24
25
|
views: ViewManifestGenerator;
|
|
25
26
|
fields: FieldManifestGenerator;
|
|
26
27
|
widgets: WidgetManifestGenerator;
|
|
28
|
+
serverRoutes: RouteManifestGenerator;
|
|
27
29
|
private wp;
|
|
28
30
|
reportPluginCompatibility: boolean;
|
|
29
31
|
private constructor();
|
|
32
|
+
verifyOriginAccess(): Promise<{
|
|
33
|
+
success: true;
|
|
34
|
+
} | {
|
|
35
|
+
success: false;
|
|
36
|
+
message: string;
|
|
37
|
+
}>;
|
|
30
38
|
private load;
|
|
31
39
|
reportProjectInfo(): string;
|
|
32
40
|
getWordpressInfo(): Promise<{
|