eddev 2.3.12 → 2.3.14
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/MetaTags.d.ts +1 -1
- package/dist/app/entry/MetaTags.d.ts.map +1 -1
- package/dist/app/entry/MetaTags.js +2 -0
- package/dist/app/entry/spa-root.d.ts +1 -1
- package/dist/app/entry/spa-root.d.ts.map +1 -1
- package/dist/app/entry/ssr-root-client.d.ts +1 -1
- package/dist/app/entry/ssr-root-client.d.ts.map +1 -1
- package/dist/app/entry/ssr-root.d.ts +1 -1
- package/dist/app/entry/ssr-root.d.ts.map +1 -1
- package/dist/app/lib/blocks/BlockPropMutator.d.ts +1 -1
- package/dist/app/lib/blocks/BlockPropMutator.d.ts.map +1 -1
- package/dist/app/lib/blocks/ContentBlocks.d.ts +2 -2
- package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -1
- package/dist/app/lib/blocks/EditableText.d.ts +1 -1
- package/dist/app/lib/blocks/EditableText.d.ts.map +1 -1
- package/dist/app/lib/blocks/InnerBlocks.d.ts +1 -1
- package/dist/app/lib/blocks/InnerBlocks.d.ts.map +1 -1
- package/dist/app/lib/blocks/SlotBlocks.d.ts +1 -1
- package/dist/app/lib/blocks/SlotBlocks.d.ts.map +1 -1
- package/dist/app/lib/blocks/block-debugger.d.ts +3 -3
- package/dist/app/lib/blocks/block-debugger.d.ts.map +1 -1
- package/dist/app/lib/blocks/block-utils.d.ts +2 -2
- package/dist/app/lib/blocks/block-utils.d.ts.map +1 -1
- package/dist/app/lib/blocks/block-utils.js +10 -3
- package/dist/app/lib/blocks/editor/EditableBlock.d.ts +1 -1
- package/dist/app/lib/blocks/editor/EditableBlock.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +1 -1
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -1
- package/dist/app/lib/blocks/editor/controls.d.ts +2 -2
- package/dist/app/lib/blocks/editor/controls.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +8 -4
- package/dist/app/lib/blocks/editor/root-blocks.d.ts.map +1 -1
- package/dist/app/lib/blocks/editor/root-blocks.js +2 -2
- package/dist/app/lib/blocks/inline-editing.d.ts +2 -2
- package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts +1 -1
- package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/DevMenu.d.ts +1 -1
- package/dist/app/lib/devtools/components/DevMenu.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/DevUI.d.ts +2 -2
- package/dist/app/lib/devtools/components/DevUI.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts +2 -2
- package/dist/app/lib/devtools/components/panels/AppDataPanel.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/panels/QueriesPanel.d.ts +1 -1
- package/dist/app/lib/devtools/components/panels/QueriesPanel.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts +2 -2
- package/dist/app/lib/devtools/components/panels/RoutePanel.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/panels/StructurePanel.d.ts +1 -1
- package/dist/app/lib/devtools/components/panels/StructurePanel.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/Button.d.ts +1 -1
- package/dist/app/lib/devtools/components/ui/Button.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/Chip.d.ts +2 -2
- package/dist/app/lib/devtools/components/ui/Chip.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/Expander.d.ts +1 -1
- package/dist/app/lib/devtools/components/ui/Expander.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/JSONInspector.d.ts +1 -1
- package/dist/app/lib/devtools/components/ui/JSONInspector.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/Panel.d.ts +1 -1
- package/dist/app/lib/devtools/components/ui/Panel.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/QueryMonitorDisplay.d.ts +1 -1
- package/dist/app/lib/devtools/components/ui/QueryMonitorDisplay.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/TabBar.d.ts +2 -2
- package/dist/app/lib/devtools/components/ui/TabBar.d.ts.map +1 -1
- package/dist/app/lib/devtools/components/ui/Tabs.d.ts +1 -1
- package/dist/app/lib/devtools/components/ui/Tabs.d.ts.map +1 -1
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +45 -45
- package/dist/app/lib/devtools/icons.d.ts +24 -24
- package/dist/app/lib/devtools/icons.d.ts.map +1 -1
- package/dist/app/lib/hooks/query-hooks.d.ts +8 -8
- package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -1
- package/dist/app/lib/hooks/query-hooks.js +2 -1
- package/dist/app/lib/integrations/gravityforms/createGravityFormComponent.d.ts +15 -15
- package/dist/app/lib/routing/components/BrowserRouter.d.ts +1 -1
- package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -1
- package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -1
- package/dist/app/lib/routing/components/ClientOnly.d.ts.map +1 -1
- package/dist/app/lib/routing/components/NativeLinkHandler.d.ts +1 -1
- package/dist/app/lib/routing/components/NativeLinkHandler.d.ts.map +1 -1
- package/dist/app/lib/routing/components/RouteRenderer.d.ts +3 -3
- package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +1 -1
- package/dist/app/lib/routing/components/SSRRouter.d.ts +1 -1
- package/dist/app/lib/routing/components/SSRRouter.d.ts.map +1 -1
- package/dist/app/lib/runtime/apiConfig.d.ts +15 -0
- package/dist/app/lib/runtime/apiConfig.d.ts.map +1 -1
- package/dist/app/server/proxy-wp-admin.d.ts.map +1 -1
- package/dist/app/server/proxy-wp-admin.js +1 -0
- package/dist/app/server/server-context.d.ts +2 -2
- package/dist/app/server/server-context.d.ts.map +1 -1
- package/dist/app/utils/APIProvider.d.ts +1 -1
- package/dist/app/utils/APIProvider.d.ts.map +1 -1
- package/dist/app/utils/ErrorMessage.d.ts +1 -1
- package/dist/app/utils/ErrorMessage.d.ts.map +1 -1
- package/dist/app/utils/query-client.d.ts +1 -1
- package/dist/app/utils/query-client.d.ts.map +1 -1
- package/dist/app/utils/trpc-client.d.ts.map +1 -1
- package/dist/app/utils/trpc-client.js +19 -3
- package/dist/node/cli/display/CLIApp.d.ts +1 -1
- package/dist/node/cli/display/CLIApp.d.ts.map +1 -1
- package/dist/node/cli/display/components/Fullscreen.d.ts +1 -1
- package/dist/node/cli/display/components/Fullscreen.d.ts.map +1 -1
- package/dist/node/cli/display/components/LogEntries.d.ts +4 -4
- package/dist/node/cli/display/components/LogEntries.d.ts.map +1 -1
- package/dist/node/cli/display/components/MenuItem.d.ts +1 -1
- package/dist/node/cli/display/components/MenuItem.d.ts.map +1 -1
- package/dist/node/cli/display/components/TextInput.d.ts +3 -2
- package/dist/node/cli/display/components/TextInput.d.ts.map +1 -1
- package/dist/node/cli/display/tools/BlockList.d.ts +1 -1
- package/dist/node/cli/display/tools/BlockList.d.ts.map +1 -1
- package/dist/node/cli/display/tools/CreateBlock.d.ts +1 -1
- package/dist/node/cli/display/tools/CreateBlock.d.ts.map +1 -1
- package/dist/node/cli/version.d.ts +1 -1
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/dev-server.js +1 -1
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -1
- package/dist/node/compiler/get-vite-config.js +1 -0
- package/dist/node/compiler/vinxi-app.d.ts +1 -1
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -1
- package/dist/node/utils/fetch-wp.d.ts.map +1 -1
- package/dist/node/utils/fetch-wp.js +2 -1
- package/dist/node/utils/fs.d.ts +22 -19
- package/dist/node/utils/fs.d.ts.map +1 -1
- package/package.json +2 -2
- package/skills/eddev/SKILL.md +156 -0
- package/skills/eddev/docs/acf/admin-panel-widgets.mdx +99 -0
- package/skills/eddev/docs/acf/custom-enums.mdx +75 -0
- package/skills/eddev/docs/acf/custom-fields.mdx +131 -0
- package/skills/eddev/docs/acf.mdx +31 -0
- package/skills/eddev/docs/blocks/block-definition.mdx +189 -0
- package/skills/eddev/docs/blocks/core-blocks.mdx +86 -0
- package/skills/eddev/docs/blocks/data-and-editing.mdx +219 -0
- package/skills/eddev/docs/blocks/editor-config.mdx +157 -0
- package/skills/eddev/docs/blocks/nested-blocks.mdx +129 -0
- package/skills/eddev/docs/blocks/overview.mdx +58 -0
- package/skills/eddev/docs/blocks/template-parts.mdx +131 -0
- package/skills/eddev/docs/config.mdx +200 -0
- package/skills/eddev/docs/design/color.mdx +185 -0
- package/skills/eddev/docs/design/favicons.mdx +103 -0
- package/skills/eddev/docs/design/grid.mdx +120 -0
- package/skills/eddev/docs/design/icons.mdx +197 -0
- package/skills/eddev/docs/design/responsive-scaling.mdx +312 -0
- package/skills/eddev/docs/design/type.mdx +125 -0
- package/skills/eddev/docs/devtool/cli.mdx +201 -0
- package/skills/eddev/docs/devtool/overlay.mdx +5 -0
- package/skills/eddev/docs/getting-started.mdx +53 -0
- package/skills/eddev/docs/graphql/extending.mdx +186 -0
- package/skills/eddev/docs/graphql/fragments.mdx +107 -0
- package/skills/eddev/docs/graphql/global-data.mdx +47 -0
- package/skills/eddev/docs/graphql/infinite-queries.mdx +95 -0
- package/skills/eddev/docs/graphql/mutation-hooks.mdx +111 -0
- package/skills/eddev/docs/graphql/query-hooks.mdx +122 -0
- package/skills/eddev/docs/graphql/tooling.mdx +50 -0
- package/skills/eddev/docs/graphql.mdx +97 -0
- package/skills/eddev/docs/guides/color-schemes.mdx +204 -0
- package/skills/eddev/docs/guides/integrations.mdx +3 -0
- package/skills/eddev/docs/guides/page-transitions.mdx +5 -0
- package/skills/eddev/docs/guides/seo.mdx +5 -0
- package/skills/eddev/docs/guides/state-management.mdx +5 -0
- package/skills/eddev/docs/infra/caching.mdx +9 -0
- package/skills/eddev/docs/infra/deployment.mdx +13 -0
- package/skills/eddev/docs/infra/local.mdx +5 -0
- package/skills/eddev/docs/infra/security.mdx +11 -0
- package/skills/eddev/docs/routing/api.mdx +731 -0
- package/skills/eddev/docs/routing/custom.mdx +123 -0
- package/skills/eddev/docs/routing/full-details.mdx +37 -0
- package/skills/eddev/docs/routing/wordpress.mdx +70 -0
- package/skills/eddev/docs/routing.mdx +18 -0
- package/skills/eddev/docs/serverless/functions.mdx +436 -0
- package/skills/eddev/docs/serverless.mdx +202 -0
- package/skills/eddev/docs/snippets/automated-block-layouts.mdx +97 -0
- package/skills/eddev/docs/snippets/custom-routes-and-urls.mdx +91 -0
- package/skills/eddev/docs/snippets/multiple-editable-zones.mdx +87 -0
- package/skills/eddev/docs/snippets/querying-specific-blocks.mdx +164 -0
- package/skills/eddev/docs/snippets/submitting-forms-to-rpc.mdx +91 -0
- package/skills/eddev/docs/snippets/svgs.mdx +38 -0
- package/skills/eddev/docs/snippets/type-safe-acf-dropdowns.mdx +72 -0
- package/skills/eddev/docs/snippets.mdx +19 -0
- package/skills/eddev/docs/software.mdx +19 -0
- package/skills/eddev/docs/stack/how-it-works.mdx +50 -0
- package/skills/eddev/docs/stack/overview.mdx +56 -0
- package/skills/eddev/docs/stack/spa-vs-ssr.mdx +52 -0
- package/skills/eddev/docs/views/app-view.mdx +97 -0
- package/skills/eddev/docs/views/page-templates.mdx +82 -0
- package/skills/eddev/docs/views/queries.mdx +116 -0
- package/skills/eddev/docs/views.mdx +63 -0
- package/skills/eddev/index.mdx +79 -0
- package/tsconfig.app.json +2 -2
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Responsive Scaling (/docs/design/responsive-scaling)
|
|
2
|
+
|
|
3
|
+
**Configure responsive Tailwind tokens with the local helper.**
|
|
4
|
+
|
|
5
|
+
Responsive scaling is configured in `tailwind.config.ts` through the local
|
|
6
|
+
`tailwind-helper`. Current projects still use Tailwind v3, so the helper config
|
|
7
|
+
is the source of truth for Tailwind screens, design token values, and how those
|
|
8
|
+
values move between screens.
|
|
9
|
+
|
|
10
|
+
The usual pattern is to author real design values at `BASE` and one key desktop
|
|
11
|
+
breakpoint, then let the helper fill the intermediate and wide-screen values.
|
|
12
|
+
That keeps components on stable classes such as `p-8`, `gap-grid-gutter`,
|
|
13
|
+
`rounded-lg`, and `type-title-xl`, while the generated CSS adjusts the actual
|
|
14
|
+
size continuously as the viewport changes.
|
|
15
|
+
|
|
16
|
+
## Standard Config [#standard-config]
|
|
17
|
+
|
|
18
|
+
```ts filename="tailwind.config.ts"
|
|
19
|
+
responsiveTheme({
|
|
20
|
+
screens: { sm: 600, md: 900, lg: 1200, xl: 1600, xxl: 2000 },
|
|
21
|
+
breakpoints: ["lg"],
|
|
22
|
+
interpolate: {
|
|
23
|
+
sm: {},
|
|
24
|
+
md: { base: "sm", lerp: true },
|
|
25
|
+
lg: { base: "lg", lerp: true },
|
|
26
|
+
xl: { base: "lg", scale: 1.2, lerp: true },
|
|
27
|
+
xxl: { base: "lg", scale: 1.3 },
|
|
28
|
+
},
|
|
29
|
+
spacing: {
|
|
30
|
+
BASE: {
|
|
31
|
+
4: 12,
|
|
32
|
+
8: 32,
|
|
33
|
+
},
|
|
34
|
+
lg: {
|
|
35
|
+
4: 16,
|
|
36
|
+
8: 56,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`screens` defines the normal Tailwind min-width breakpoints. `BASE` is not a
|
|
43
|
+
Tailwind screen; it is the value before any screen media query applies.
|
|
44
|
+
|
|
45
|
+
`breakpoints` lists the screens that need explicit token maps. With
|
|
46
|
+
`breakpoints: ["lg"]`, token families such as `spacing`, `size`,
|
|
47
|
+
`borderRadius`, and `typography.styles` normally define `BASE` and `lg`. The
|
|
48
|
+
other screens are generated from those anchors.
|
|
49
|
+
|
|
50
|
+
`interpolate` describes how each screen gets its value:
|
|
51
|
+
|
|
52
|
+
| Entry | Meaning |
|
|
53
|
+
| -------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
54
|
+
| `sm: {}` | Carry the current value at `600px`. This is usually still the `BASE` value. |
|
|
55
|
+
| `md: { base: "sm", lerp: true }` | Start a smooth ramp at `900px`, from the `sm` value toward the next screen value. |
|
|
56
|
+
| `lg: { base: "lg", lerp: true }` | Use the authored `lg` value at `1200px`, then ramp toward `xl`. |
|
|
57
|
+
| `xl: { base: "lg", scale: 1.2, lerp: true }` | Use the `lg` value scaled up for `1600px`, then ramp toward `xxl`. |
|
|
58
|
+
| `xxl: { base: "lg", scale: 1.3 }` | Use the `lg` value scaled up for `2000px` and above. |
|
|
59
|
+
|
|
60
|
+
`lerp` applies to the segment that starts at that screen. For example, `md`
|
|
61
|
+
starts the `900px -> 1200px` ramp, and `lg` starts the `1200px -> 1600px`
|
|
62
|
+
ramp.
|
|
63
|
+
|
|
64
|
+
## How Values Are Generated [#how-values-are-generated]
|
|
65
|
+
|
|
66
|
+
For each token, the helper walks the screens in order:
|
|
67
|
+
|
|
68
|
+
1. Read the current screen's `base`.
|
|
69
|
+
2. If that base has an authored token value, use it.
|
|
70
|
+
3. If it does not, carry the previously resolved value.
|
|
71
|
+
4. Apply `scale` when present.
|
|
72
|
+
5. If `lerp` is true, emit a fluid value that reaches the next screen's value at
|
|
73
|
+
the next screen width.
|
|
74
|
+
|
|
75
|
+
Using the `spacing.8` example above, the generated shape is:
|
|
76
|
+
|
|
77
|
+
```css
|
|
78
|
+
:root {
|
|
79
|
+
--spacing-8: 32px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media (min-width: 900px) {
|
|
83
|
+
:root {
|
|
84
|
+
--spacing-8: calc(32px + (100vw - 900px) / 300 * 24);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media (min-width: 1200px) {
|
|
89
|
+
:root {
|
|
90
|
+
--spacing-8: calc(56px + (100vw - 1200px) / 400 * 11.2);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (min-width: 1600px) {
|
|
95
|
+
:root {
|
|
96
|
+
--spacing-8: calc(67.2px + (100vw - 1600px) / 400 * 5.6);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (min-width: 2000px) {
|
|
101
|
+
:root {
|
|
102
|
+
--spacing-8: 72.8px;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
There is no sudden jump at `900px`, `1200px`, or `1600px`: each ramp starts at
|
|
108
|
+
the value already on screen and ends at the value the next media query starts
|
|
109
|
+
with.
|
|
110
|
+
|
|
111
|
+
## Smooth Versus Stepped [#smooth-versus-stepped]
|
|
112
|
+
|
|
113
|
+
Without interpolation, the site keeps one value until the next breakpoint and
|
|
114
|
+
then snaps to the new value. With interpolation, the value changes gradually
|
|
115
|
+
across the viewport range.
|
|
116
|
+
|
|
117
|
+
<figure>
|
|
118
|
+
<svg width="100%" height="320" viewBox="0 0 640 320" role="img" aria-label="Interpolated responsive scaling ramps smoothly between breakpoints while stepped sizing jumps at breakpoints">
|
|
119
|
+
<rect x="38" y="18" width="564" height="238" rx="8" fill="transparent" stroke="#94A3B8" strokeWidth="1" />
|
|
120
|
+
|
|
121
|
+
<line x1="60" y1="230" x2="580" y2="230" stroke="#94A3B8" strokeWidth="1" />
|
|
122
|
+
|
|
123
|
+
<line x1="60" y1="70" x2="60" y2="230" stroke="#94A3B8" strokeWidth="1" />
|
|
124
|
+
|
|
125
|
+
<line x1="216" y1="70" x2="216" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
126
|
+
|
|
127
|
+
<line x1="294" y1="70" x2="294" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
128
|
+
|
|
129
|
+
<line x1="372" y1="70" x2="372" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
130
|
+
|
|
131
|
+
<line x1="476" y1="70" x2="476" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
132
|
+
|
|
133
|
+
<line x1="580" y1="70" x2="580" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
134
|
+
|
|
135
|
+
<path d="M60 230 L294 230 L372 150 L476 102 L580 78" fill="none" stroke="#16A34A" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round" />
|
|
136
|
+
|
|
137
|
+
<path d="M60 230 L372 230 L372 150 L476 150 L476 102 L580 102 L580 78" fill="none" stroke="#64748B" strokeWidth="3" strokeDasharray="8 7" strokeLinecap="round" strokeLinejoin="round" />
|
|
138
|
+
|
|
139
|
+
<circle cx="294" cy="230" r="4" fill="#16A34A" />
|
|
140
|
+
|
|
141
|
+
<circle cx="372" cy="150" r="4" fill="#16A34A" />
|
|
142
|
+
|
|
143
|
+
<circle cx="476" cy="102" r="4" fill="#16A34A" />
|
|
144
|
+
|
|
145
|
+
<circle cx="580" cy="78" r="4" fill="#16A34A" />
|
|
146
|
+
|
|
147
|
+
<text x="60" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
148
|
+
0
|
|
149
|
+
</text>
|
|
150
|
+
|
|
151
|
+
<text x="216" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
152
|
+
sm
|
|
153
|
+
</text>
|
|
154
|
+
|
|
155
|
+
<text x="294" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
156
|
+
md
|
|
157
|
+
</text>
|
|
158
|
+
|
|
159
|
+
<text x="372" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
160
|
+
lg
|
|
161
|
+
</text>
|
|
162
|
+
|
|
163
|
+
<text x="476" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
164
|
+
xl
|
|
165
|
+
</text>
|
|
166
|
+
|
|
167
|
+
<text x="580" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
168
|
+
xxl
|
|
169
|
+
</text>
|
|
170
|
+
|
|
171
|
+
<text x="48" y="234" fontSize="12" textAnchor="end" fill="currentColor">
|
|
172
|
+
base
|
|
173
|
+
</text>
|
|
174
|
+
|
|
175
|
+
<text x="48" y="154" fontSize="12" textAnchor="end" fill="currentColor">
|
|
176
|
+
lg
|
|
177
|
+
</text>
|
|
178
|
+
|
|
179
|
+
<text x="48" y="106" fontSize="12" textAnchor="end" fill="currentColor">
|
|
180
|
+
1.2x
|
|
181
|
+
</text>
|
|
182
|
+
|
|
183
|
+
<text x="48" y="82" fontSize="12" textAnchor="end" fill="currentColor">
|
|
184
|
+
1.3x
|
|
185
|
+
</text>
|
|
186
|
+
|
|
187
|
+
<line x1="80" y1="292" x2="116" y2="292" stroke="#16A34A" strokeWidth="4" strokeLinecap="round" />
|
|
188
|
+
|
|
189
|
+
<text x="124" y="296" fontSize="12" fill="currentColor">
|
|
190
|
+
interpolated
|
|
191
|
+
</text>
|
|
192
|
+
|
|
193
|
+
<line x1="238" y1="292" x2="274" y2="292" stroke="#64748B" strokeWidth="3" strokeDasharray="8 7" strokeLinecap="round" />
|
|
194
|
+
|
|
195
|
+
<text x="282" y="296" fontSize="12" fill="currentColor">
|
|
196
|
+
stepped
|
|
197
|
+
</text>
|
|
198
|
+
</svg>
|
|
199
|
+
|
|
200
|
+
<figcaption>
|
|
201
|
+
The interpolated line reaches the same anchor values as the stepped line,
|
|
202
|
+
but it travels between them instead of snapping at each breakpoint.
|
|
203
|
+
</figcaption>
|
|
204
|
+
</figure>
|
|
205
|
+
|
|
206
|
+
## Why This Works Well [#why-this-works-well]
|
|
207
|
+
|
|
208
|
+
Most designs have a strong mobile composition and a strong desktop composition.
|
|
209
|
+
The awkward part is everything between them. If spacing, control sizes, radii,
|
|
210
|
+
and type all jump at a single breakpoint, the page can feel like it rebuilds
|
|
211
|
+
itself while the browser is being resized.
|
|
212
|
+
|
|
213
|
+
The helper avoids that by treating breakpoints as anchors, not cliffs. The
|
|
214
|
+
`BASE` and `lg` values still preserve the design decisions. The interpolation
|
|
215
|
+
config simply describes how to travel between those decisions, and the wide
|
|
216
|
+
screen `scale` values keep large displays from feeling like the same desktop
|
|
217
|
+
layout stretched across too much space.
|
|
218
|
+
|
|
219
|
+
Because the same interpolation map is used by spacing, size, radius, and
|
|
220
|
+
typography tokens, their relationships stay coordinated. A card's padding, its
|
|
221
|
+
gap, its corner radius, and the heading inside it can all resize through the
|
|
222
|
+
same viewport ranges without each one inventing a separate breakpoint behavior.
|
|
223
|
+
Grid gutters and margins can join the same rhythm by referencing spacing
|
|
224
|
+
variables in the grid config.
|
|
225
|
+
|
|
226
|
+
<figure>
|
|
227
|
+
<svg width="100%" height="320" viewBox="0 0 640 320" role="img" aria-label="Different token values resize continuously through the same breakpoint ranges">
|
|
228
|
+
<rect x="38" y="18" width="564" height="238" rx="8" fill="transparent" stroke="#94A3B8" strokeWidth="1" />
|
|
229
|
+
|
|
230
|
+
<line x1="60" y1="230" x2="580" y2="230" stroke="#94A3B8" strokeWidth="1" />
|
|
231
|
+
|
|
232
|
+
<line x1="60" y1="70" x2="60" y2="230" stroke="#94A3B8" strokeWidth="1" />
|
|
233
|
+
|
|
234
|
+
<line x1="294" y1="70" x2="294" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
235
|
+
|
|
236
|
+
<line x1="372" y1="70" x2="372" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
237
|
+
|
|
238
|
+
<line x1="476" y1="70" x2="476" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
239
|
+
|
|
240
|
+
<line x1="580" y1="70" x2="580" y2="230" stroke="#CBD5E1" strokeWidth="1" strokeDasharray="4 4" />
|
|
241
|
+
|
|
242
|
+
<path d="M60 206 L294 206 L372 198 L476 192 L580 188" fill="none" stroke="#2563EB" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round" />
|
|
243
|
+
|
|
244
|
+
<path d="M60 166 L294 166 L372 118 L476 96 L580 84" fill="none" stroke="#16A34A" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round" />
|
|
245
|
+
|
|
246
|
+
<path d="M60 142 L294 142 L372 110 L476 86 L580 74" fill="none" stroke="#EA580C" strokeWidth="4" strokeLinecap="round" strokeLinejoin="round" />
|
|
247
|
+
|
|
248
|
+
<circle cx="372" cy="198" r="4" fill="#2563EB" />
|
|
249
|
+
|
|
250
|
+
<circle cx="372" cy="118" r="4" fill="#16A34A" />
|
|
251
|
+
|
|
252
|
+
<circle cx="372" cy="110" r="4" fill="#EA580C" />
|
|
253
|
+
|
|
254
|
+
<text x="60" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
255
|
+
BASE
|
|
256
|
+
</text>
|
|
257
|
+
|
|
258
|
+
<text x="294" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
259
|
+
md
|
|
260
|
+
</text>
|
|
261
|
+
|
|
262
|
+
<text x="372" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
263
|
+
lg
|
|
264
|
+
</text>
|
|
265
|
+
|
|
266
|
+
<text x="476" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
267
|
+
xl
|
|
268
|
+
</text>
|
|
269
|
+
|
|
270
|
+
<text x="580" y="262" fontSize="12" textAnchor="middle" fill="currentColor">
|
|
271
|
+
xxl
|
|
272
|
+
</text>
|
|
273
|
+
|
|
274
|
+
<line x1="80" y1="286" x2="116" y2="286" stroke="#2563EB" strokeWidth="4" strokeLinecap="round" />
|
|
275
|
+
|
|
276
|
+
<text x="124" y="290" fontSize="12" fill="currentColor">
|
|
277
|
+
spacing.4
|
|
278
|
+
</text>
|
|
279
|
+
|
|
280
|
+
<line x1="238" y1="286" x2="274" y2="286" stroke="#16A34A" strokeWidth="4" strokeLinecap="round" />
|
|
281
|
+
|
|
282
|
+
<text x="282" y="290" fontSize="12" fill="currentColor">
|
|
283
|
+
spacing.8
|
|
284
|
+
</text>
|
|
285
|
+
|
|
286
|
+
<line x1="406" y1="286" x2="442" y2="286" stroke="#EA580C" strokeWidth="4" strokeLinecap="round" />
|
|
287
|
+
|
|
288
|
+
<text x="450" y="290" fontSize="12" fill="currentColor">
|
|
289
|
+
title size
|
|
290
|
+
</text>
|
|
291
|
+
</svg>
|
|
292
|
+
|
|
293
|
+
<figcaption>
|
|
294
|
+
Different tokens can have different authored values, but they still move
|
|
295
|
+
through the same breakpoint rhythm.
|
|
296
|
+
</figcaption>
|
|
297
|
+
</figure>
|
|
298
|
+
|
|
299
|
+
## Practical Rules [#practical-rules]
|
|
300
|
+
|
|
301
|
+
* Keep `screens` in ascending order and treat names like `md` or `lg` as layout
|
|
302
|
+
ranges, not device names.
|
|
303
|
+
* Keep `breakpoints` short. Most sites only need `BASE` and `lg` token maps.
|
|
304
|
+
* Put actual design decisions in `BASE` and each key breakpoint. Use
|
|
305
|
+
interpolation for the in-between screens.
|
|
306
|
+
* Use `scale` for wide screens when a project should breathe more at `xl` and
|
|
307
|
+
`xxl`; omit it when the desktop composition should stay fixed.
|
|
308
|
+
* For grid gutters and margins, reference spacing variables when they should
|
|
309
|
+
scale with the token system.
|
|
310
|
+
* Prefer token classes in components. If a value should scale with the system,
|
|
311
|
+
add it to `spacing`, `size`, `borderRadius`, or `typography.styles` instead
|
|
312
|
+
of hard-coding a one-off responsive value.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Typography (/docs/design/type)
|
|
2
|
+
|
|
3
|
+
**Configure typography tokens through Tailwind helper classes.**
|
|
4
|
+
|
|
5
|
+
Typography tokens are normal Tailwind classes generated by `tailwind-helper`.
|
|
6
|
+
Define the token names and responsive values in `tailwind.config.ts`, then use
|
|
7
|
+
classes such as `type-title-xl`, `type-body-m`, and `type-ui-s` in views,
|
|
8
|
+
blocks, and shared components.
|
|
9
|
+
|
|
10
|
+
## Configuration [#configuration]
|
|
11
|
+
|
|
12
|
+
```ts filename="tailwind.config.ts"
|
|
13
|
+
responsiveTheme({
|
|
14
|
+
screens: { sm: 600, md: 900, lg: 1200, xl: 1600, xxl: 2000 },
|
|
15
|
+
breakpoints: ["lg"],
|
|
16
|
+
interpolate: {
|
|
17
|
+
sm: {},
|
|
18
|
+
md: { base: "sm", lerp: true },
|
|
19
|
+
lg: { base: "lg", lerp: true },
|
|
20
|
+
xl: { base: "lg", scale: 1.2, lerp: true },
|
|
21
|
+
xxl: { base: "lg", scale: 1.3 },
|
|
22
|
+
},
|
|
23
|
+
typography: {
|
|
24
|
+
fontFamily: {
|
|
25
|
+
body: "'GT-Cinetype', Helvetica, sans-serif",
|
|
26
|
+
heading: "'Agrandir-Wide', Helvetica, sans-serif",
|
|
27
|
+
},
|
|
28
|
+
styles: {
|
|
29
|
+
"title-xl": {
|
|
30
|
+
fontSize: { BASE: "32px", lg: "56px" },
|
|
31
|
+
lineHeight: "100%",
|
|
32
|
+
fontFamily: "heading",
|
|
33
|
+
fontWeight: "400",
|
|
34
|
+
letterSpacing: "-0.03em",
|
|
35
|
+
textTransform: "uppercase",
|
|
36
|
+
},
|
|
37
|
+
"body-m": {
|
|
38
|
+
fontSize: { BASE: "16px", lg: "18px" },
|
|
39
|
+
lineHeight: { BASE: "130%", lg: "140%" },
|
|
40
|
+
fontFamily: "body",
|
|
41
|
+
fontWeight: "400",
|
|
42
|
+
letterSpacing: "normal",
|
|
43
|
+
textTransform: "none",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The helper creates component classes for each style:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<h1 className="type-title-xl text-balance">{props.title}</h1>
|
|
54
|
+
<div className="type-body-m text-fg-secondary">{props.description}</div>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
It also maps `fontFamily` keys into Tailwind's font family theme, so regular
|
|
58
|
+
classes like `font-body` can be used when a full text style is too much.
|
|
59
|
+
|
|
60
|
+
## Responsive Values [#responsive-values]
|
|
61
|
+
|
|
62
|
+
Text styles can use a single value or a breakpoint map. The helper converts
|
|
63
|
+
percentage line heights into pixel values, interpolates `fontSize` and
|
|
64
|
+
`lineHeight` when the interpolation config says to lerp, and emits media-query
|
|
65
|
+
rules for the generated `.type-*` class.
|
|
66
|
+
|
|
67
|
+
```ts filename="tailwind.config.ts"
|
|
68
|
+
"title-l": {
|
|
69
|
+
fontSize: { BASE: "24px", lg: "40px" },
|
|
70
|
+
lineHeight: { BASE: "110%", lg: "100%" },
|
|
71
|
+
fontFamily: "heading",
|
|
72
|
+
fontWeight: "400",
|
|
73
|
+
letterSpacing: "-0.03em",
|
|
74
|
+
textTransform: "uppercase",
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use `BASE` for the mobile/base value. Add only the breakpoints that need a real
|
|
79
|
+
change.
|
|
80
|
+
|
|
81
|
+
## Figma Export [#figma-export]
|
|
82
|
+
|
|
83
|
+
The ED. Web Handoff plugin reads local Figma text styles and can output the
|
|
84
|
+
`typography.styles` object for the Tailwind helper.
|
|
85
|
+
|
|
86
|
+
Artworking rules:
|
|
87
|
+
|
|
88
|
+
1. Create local text styles for the reusable type scale.
|
|
89
|
+
2. Put breakpoint-specific styles at the end of the name, for example
|
|
90
|
+
`Title / XL / Laptop`.
|
|
91
|
+
3. Keep breakpoint names out of the middle of the style name.
|
|
92
|
+
4. Prefix design-only styles with `_`, or place them under a `/_` group, if
|
|
93
|
+
they should be ignored.
|
|
94
|
+
|
|
95
|
+
The plugin uses the configured breakpoint labels. In its default config,
|
|
96
|
+
`Mobile` maps to `BASE`, then `Phablet`, `Tablet`, `Laptop`, `Desktop`, and
|
|
97
|
+
`4K` map to the named breakpoints.
|
|
98
|
+
|
|
99
|
+
The plugin also reports font family/style combinations. Review those warnings
|
|
100
|
+
before copying code, because the generated `fontFamily` token and `fontWeight`
|
|
101
|
+
come from the font configuration or the plugin's weight guess.
|
|
102
|
+
|
|
103
|
+
## Site Styles [#site-styles]
|
|
104
|
+
|
|
105
|
+
Use type classes directly in components. For rich text or WordPress-rendered
|
|
106
|
+
HTML, apply them in CSS with Tailwind's element variants or normal selectors:
|
|
107
|
+
|
|
108
|
+
```css filename="styles/index.css"
|
|
109
|
+
@layer components {
|
|
110
|
+
.wysiwyg {
|
|
111
|
+
@apply type-body-m;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.wysiwyg h2 {
|
|
115
|
+
@apply type-title-l mt-6 mb-4;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wysiwyg a {
|
|
119
|
+
@apply underline underline-offset-[0.15em] decoration-fg/30;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Keep component code on token names, not raw pixel values, unless the value is a
|
|
125
|
+
one-off layout fix.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# eddev CLI (/docs/devtool/cli)
|
|
2
|
+
|
|
3
|
+
**Run development, builds, codegen, and diagnostics through the eddev CLI.**
|
|
4
|
+
|
|
5
|
+
The `eddev` CLI is the main development and build runner for an eddev theme. Run it from the theme root, usually through the project scripts in `package.json`.
|
|
6
|
+
|
|
7
|
+
```json filename="package.json"
|
|
8
|
+
{
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "eddev dev",
|
|
11
|
+
"build": "eddev build"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Most day-to-day work should use `yarn dev --fast`. Fast mode runs the local serverless dev server with hot reloading on port `8080`, plus GraphQL codegen. It skips the admin and frontend SPA bundles, which are only needed when you access the local WordPress frontend directly without the `:8080` dev server port.
|
|
17
|
+
|
|
18
|
+
Production SPA builds use `yarn build`. To check serverless production behavior locally, run `eddev build --serverless` and then `eddev preview`.
|
|
19
|
+
|
|
20
|
+
<Callout type="info">
|
|
21
|
+
The CLI reads `.env`, `ed.config.json`, the Git repo name, WordPress theme files, GraphQL files, and the WordPress origin. If a command behaves strangely, first check that you are running it from the theme root and that `SITE_URL` points to the WordPress origin.
|
|
22
|
+
</Callout>
|
|
23
|
+
|
|
24
|
+
## Commands [#commands]
|
|
25
|
+
|
|
26
|
+
| Command | What It Does |
|
|
27
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| `eddev dev --fast` | Recommended development command. Starts GraphQL codegen and the hot-reloading serverless dev server on port `8080`. |
|
|
29
|
+
| `eddev dev` | Starts every dev mode, including watched admin and frontend SPA bundles. Use this when you need the WordPress-hosted SPA/admin asset builds. |
|
|
30
|
+
| `eddev build` | Builds production frontend and admin bundles for WordPress-hosted SPA mode. This is not the serverless build. |
|
|
31
|
+
| `eddev build --serverless` | Builds the production serverless app. Usually followed by `eddev preview` when testing locally. Vercel uses this path automatically because `VERCEL` is set in the environment. |
|
|
32
|
+
| `eddev preview` | Runs the output from a previous `eddev build --serverless`. Usually used together with that build command. |
|
|
33
|
+
| `eddev analyze` | Generates a frontend bundle analysis in `dist/frontend-analysis/`. |
|
|
34
|
+
| `eddev info` | Prints discovered project, block, and view information. |
|
|
35
|
+
|
|
36
|
+
Some older theme `package.json` files may still include `eddev setup`. That command is not present in the current CLI source; prefer the active commands above.
|
|
37
|
+
|
|
38
|
+
## `eddev dev` [#eddev-dev]
|
|
39
|
+
|
|
40
|
+
Use fast mode for normal development:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
yarn dev --fast
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Fast mode runs:
|
|
47
|
+
|
|
48
|
+
| Mode | What It Does |
|
|
49
|
+
| ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `serverless` | Starts the local serverless dev server on port `8080`. This is the normal local frontend preview, with hot reloading. |
|
|
51
|
+
| `graphql` | Loads the WordPress schema, validates project GraphQL files, generates TypeScript outputs, and optimizes query files for PHP. |
|
|
52
|
+
|
|
53
|
+
The full `eddev dev` command runs every mode:
|
|
54
|
+
|
|
55
|
+
| Mode | What It Does |
|
|
56
|
+
| ------------ | ------------------------------------------------------------ |
|
|
57
|
+
| `serverless` | Starts the local serverless dev server on port `8080`. |
|
|
58
|
+
| `graphql` | Runs GraphQL codegen and optimized query output. |
|
|
59
|
+
| `frontend` | Builds and watches the WordPress-hosted SPA frontend bundle. |
|
|
60
|
+
| `admin` | Builds and watches WordPress admin/editor assets. |
|
|
61
|
+
|
|
62
|
+
Use the full command when you specifically need the local WordPress frontend or admin/editor asset bundles. If you are previewing the site through `https://site.local:8080`, fast mode is usually enough.
|
|
63
|
+
|
|
64
|
+
The terminal UI shows the serverless frontend URL, the WordPress origin URL, and the status of the active services. Press `q` to quit. Press `c` or `k` to clear the visible serverless log.
|
|
65
|
+
|
|
66
|
+
### Dev Options [#dev-options]
|
|
67
|
+
|
|
68
|
+
| Option | What It Does |
|
|
69
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
70
|
+
| `--fast` | Recommended. Shorthand for `--mode graphql,serverless`. Runs the hot-reloading serverless dev server and GraphQL codegen only. |
|
|
71
|
+
| `--https <enabled>` | Enables or disables HTTPS for the serverless dev server. Defaults to `true`. Use `--https false` for plain HTTP. |
|
|
72
|
+
| `--verbose` | Shows extra debugging information in logs. |
|
|
73
|
+
|
|
74
|
+
Examples:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
yarn dev --fast
|
|
78
|
+
yarn dev --https false
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`--mode <modes>` is available for debugging individual services, for example `yarn dev --mode graphql` or `yarn dev --mode frontend,admin`. Prefer `--fast` for normal project work.
|
|
82
|
+
|
|
83
|
+
When HTTPS is enabled, eddev creates a local certificate under `.eddev/certs/`. If macOS does not trust the certificate yet, the CLI prints Keychain instructions.
|
|
84
|
+
|
|
85
|
+
## Generated Files [#generated-files]
|
|
86
|
+
|
|
87
|
+
The CLI writes several generated files during `dev` and `build`.
|
|
88
|
+
|
|
89
|
+
| Output | Source | Purpose |
|
|
90
|
+
| -------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| `ed.dist.json` | Blocks, views, template parts | PHP reads this manifest to register blocks, templates, and related theme metadata. |
|
|
92
|
+
| `types.graphql.ts` | WordPress schema and project GraphQL files | GraphQL operation, fragment, scalar, enum, and schema-derived TypeScript types. |
|
|
93
|
+
| `types.views.ts` | `views/**/*.graphql` and view manifest | The `ViewProps` map used by `defineView`. |
|
|
94
|
+
| `types.blocks.ts` | `blocks/**/*.graphql` and block manifest | The `BlockProps` map used by `defineBlock`. |
|
|
95
|
+
| `types.util.ts` | WordPress info, blocks, views | Utility global types for post types, page templates, core blocks, block tags, flags, and post meta. |
|
|
96
|
+
| `types.api.ts` | `server/routes/**/*` | RPC route and context types used by serverless functions and RPC hooks. |
|
|
97
|
+
| `hooks/queries.ts` | `queries/**/*.graphql` | Runtime query and mutation hooks. |
|
|
98
|
+
| `schema.json` | WordPress GraphQL schema | Local schema file for editor tooling. |
|
|
99
|
+
| `.eddev/queries/**` | Project GraphQL files | Optimized query text and fragments used by the PHP runtime. |
|
|
100
|
+
| `.eddev/dev*` and `.eddev/prod*` | Build codegen | Internal bootstrap files for SPA and serverless builds. |
|
|
101
|
+
|
|
102
|
+
Do not edit generated files directly. Change the source block, view, route, or GraphQL file instead.
|
|
103
|
+
|
|
104
|
+
## GraphQL Codegen [#graphql-codegen]
|
|
105
|
+
|
|
106
|
+
GraphQL codegen is part of `eddev dev` and `eddev build`; there is no separate public command for it.
|
|
107
|
+
|
|
108
|
+
The generator:
|
|
109
|
+
|
|
110
|
+
* loads the GraphQL endpoint from `DEBUG_GRAPHQL_URL`
|
|
111
|
+
* passes `SITE_API_KEY` when origin protection is enabled
|
|
112
|
+
* reads GraphQL files from `views/`, `blocks/`, `queries/`, and `queries/fragments/`
|
|
113
|
+
* validates operations against the WordPress schema
|
|
114
|
+
* writes TypeScript types and generated hooks
|
|
115
|
+
* writes optimized query files into `.eddev/queries/`
|
|
116
|
+
|
|
117
|
+
For file locations and caching comments such as `# ttl: 300` and `# nocache`, see [GraphQL](/docs/graphql).
|
|
118
|
+
|
|
119
|
+
## `eddev build` [#eddev-build]
|
|
120
|
+
|
|
121
|
+
`eddev build` builds the production frontend and admin bundles used by WordPress-hosted SPA mode. It does not build the serverless app.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
yarn build
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This production build:
|
|
128
|
+
|
|
129
|
+
* loads project configuration and manifests
|
|
130
|
+
* writes `ed.dist.json`
|
|
131
|
+
* generates SPA bootstrap files
|
|
132
|
+
* builds the admin bundle into `dist/cms/`
|
|
133
|
+
* builds the frontend bundle into `dist/frontend/`
|
|
134
|
+
* runs GraphQL generation and writes optimized query files
|
|
135
|
+
|
|
136
|
+
Use this when deploying or pushing the theme to WordPress in SPA mode, including the WordPress admin/editor assets.
|
|
137
|
+
|
|
138
|
+
## `eddev build --serverless` [#eddev-build---serverless]
|
|
139
|
+
|
|
140
|
+
`eddev build --serverless` builds the production serverless app. Use it with `eddev preview` to test how the site will behave on production Vercel.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
eddev build --serverless
|
|
144
|
+
eddev preview
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
When Vercel runs the build, eddev takes the serverless path automatically because the `VERCEL` environment variable is set.
|
|
148
|
+
|
|
149
|
+
Serverless builds require `SITE_URL` so eddev knows which WordPress origin to query. If origin protection is enabled, also set `SITE_API_KEY`. Before building, the CLI checks that it can access the origin.
|
|
150
|
+
|
|
151
|
+
See [Serverless](/docs/serverless) for Vercel setup, `SITE_URL`, `SITE_API_KEY`, endpoint mappings, and cache behavior.
|
|
152
|
+
|
|
153
|
+
## `eddev preview` [#eddev-preview]
|
|
154
|
+
|
|
155
|
+
`eddev preview` runs the local production serverless build from `.output/server/index.mjs`. It is mainly useful after `eddev build --serverless`.
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
eddev preview
|
|
159
|
+
eddev preview --port 8081
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
eddev uses the `SITE_URL` hostname when it ends in `.local`; otherwise it falls back to `127.0.0.1`. The command sets up local HTTPS with the same certificate helper used by `eddev dev`.
|
|
163
|
+
|
|
164
|
+
<Callout type="warning">
|
|
165
|
+
The current `preview` command exposes `--host` as a flag rather than a value-taking option, so prefer the default host behavior and only override `--port`.
|
|
166
|
+
</Callout>
|
|
167
|
+
|
|
168
|
+
Run `eddev build --serverless` before using `eddev preview`; either command on its own is rarely useful for day-to-day work.
|
|
169
|
+
|
|
170
|
+
## `eddev analyze` [#eddev-analyze]
|
|
171
|
+
|
|
172
|
+
`eddev analyze` builds a frontend analysis bundle and writes a visualizer report under `dist/frontend-analysis/`.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
eddev analyze
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Use it when a client bundle looks too large or when you need to inspect what is included in the frontend build.
|
|
179
|
+
|
|
180
|
+
## `eddev info` [#eddev-info]
|
|
181
|
+
|
|
182
|
+
`eddev info` prints the discovered project information, block manifest, and view manifest.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
eddev info
|
|
186
|
+
eddev info --verbose
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
This is useful when WordPress is not registering an expected block or page template. It lets you check whether eddev can discover the source files before debugging PHP registration.
|
|
190
|
+
|
|
191
|
+
## Environment Variables [#environment-variables]
|
|
192
|
+
|
|
193
|
+
| Variable | Used By | Notes |
|
|
194
|
+
| ------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
195
|
+
| `SITE_URL` | Project loading, serverless dev/build, preview | WordPress origin URL. Required for serverless work. |
|
|
196
|
+
| `SITE_API_KEY` | GraphQL, runtime query fetches, serverless origin requests | Optional unless the WordPress origin uses eddev Access Control. |
|
|
197
|
+
| `DEBUG_GRAPHQL_URL` | GraphQL codegen | WordPress/PHP normally writes this for local development. Refresh the WordPress admin if it is missing on a new site. |
|
|
198
|
+
|
|
199
|
+
The CLI loads `.env` before it starts. Vercel project environment variables are used for production serverless builds.
|
|
200
|
+
|
|
201
|
+
Variables prefixed with `ED_PUBLIC_` are injected into client and server bundles. Variables prefixed with `ED_` are injected only into non-client bundles.
|