@openelement/create 1.0.0-alpha.13 → 1.0.0-alpha.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/README.md CHANGED
@@ -52,7 +52,7 @@ verified to serve. The 1.0 line is a new baseline — not a 0.x upgrade, with no
52
52
  migration path from 0.x. Pin an exact version when reproducibility matters:
53
53
 
54
54
  ```bash
55
- npm create @openelement@<version> my-app
55
+ npm create @openelement@1.0.0-alpha.13 my-app
56
56
  ```
57
57
 
58
58
  The generated starter depends on `@openelement/*` through caret ranges over
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openelement/create",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.14",
4
4
  "type": "module",
5
5
  "main": "./src/cli.js",
6
6
  "types": "./src/cli.d.ts",
@@ -40,6 +40,7 @@ const TEMPLATE_FILES = [
40
40
  ["package.json.tmpl", "package.json"],
41
41
  ["tsconfig.json.tmpl", "tsconfig.json"],
42
42
  ["vite.config.ts.tmpl", "vite.config.ts"],
43
+ ["pnpm-workspace.yaml.tmpl", "pnpm-workspace.yaml"],
43
44
  ["openelement.config.ts.tmpl", "openelement.config.ts"],
44
45
  ["app/styles/theme.css", "app/styles/theme.css"],
45
46
  ["app/styles/recipes.css", "app/styles/recipes.css"],
@@ -59,7 +60,8 @@ const TEMPLATE_FILES = [
59
60
  ["app/islands/my-counter.tsx.tmpl", "app/islands/my-counter.tsx"],
60
61
  ["app/islands/my-counter.css", "app/islands/my-counter.css"],
61
62
  ["app/islands/live-timer.tsx.tmpl", "app/islands/live-timer.tsx"],
62
- ["app/islands/live-timer.css", "app/islands/live-timer.css"]
63
+ ["app/islands/live-timer.css", "app/islands/live-timer.css"],
64
+ ["app/islands/app-shell.tsx.tmpl", "app/islands/app-shell.tsx"]
63
65
  ];
64
66
  function versionTokens(v) {
65
67
  return {
package/src/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region src/version.ts
2
2
  /** The published CLI version, embedded so packed npm installs are self-contained. */
3
- const CREATE_VERSION = "1.0.0-alpha.13";
3
+ const CREATE_VERSION = "1.0.0-alpha.14";
4
4
  /**
5
5
  * The Vite release pinned into the generated starter's package.json (the
6
6
  * `${v.vite}` scaffold token in the npm/pnpm starter). Embedded for the same
@@ -22,13 +22,13 @@ without editing this file.
22
22
 
23
23
  ## The JS cost map
24
24
 
25
- | Surface | Ships JavaScript? | Why |
26
- | --- | --- | --- |
27
- | `/` hero + architecture sections | no | prerendered markup, styled with CSS |
28
- | `/` counter island (`my-counter`) | yes, hydrates on idle | the one interactive piece |
29
- | `/` live timer island (`live-timer`) | yes, client-only | a live clock has nothing to prerender |
30
- | `/about` | no islands at all | fully static SSG output |
31
- | `/api/ping` | no (server) | a plain `Request → Response` handler |
25
+ | Surface | Ships JavaScript? | Why |
26
+ | ------------------------------------ | --------------------- | ------------------------------------- |
27
+ | `/` hero + architecture sections | no | prerendered markup, styled with CSS |
28
+ | `/` counter island (`my-counter`) | yes, hydrates on idle | the one interactive piece |
29
+ | `/` live timer island (`live-timer`) | yes, client-only | a live clock has nothing to prerender |
30
+ | `/about` | no islands at all | fully static SSG output |
31
+ | `/api/ping` | no (server) | a plain `Request → Response` handler |
32
32
 
33
33
  The badge classes (`badge-static`, `badge-island`) live in
34
34
  `app/components/badges.css` — copy them onto new sections and keep the
@@ -48,12 +48,13 @@ Framework options have exactly one home: `openelement.config.ts`. It is
48
48
  optional and nearly empty — every option it omits comes from a file
49
49
  convention:
50
50
 
51
- | Option | Convention |
52
- | --- | --- |
53
- | design tokens | `app/styles/theme.css` (the @theme role sheet) |
54
- | document head content | `app/head.tsx` (meta tags, preloads, inline CSS) |
55
- | site title | the `name` field of `package.json` |
56
- | static-shape recipes | `app/styles/recipes.css` (zero-interaction badge/callout/card/tabs shapes as plain HTML+CSS — the @openelement/ui components retired to these recipes in #1557) |
51
+ | Option | Convention |
52
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
53
+ | design tokens | `app/styles/theme.css` (the @theme role sheet) |
54
+ | app shell | `app/islands/app-shell.tsx` (the shared site chrome every page renders inside) |
55
+ | document head content | `app/head.tsx` (meta tags, preloads, inline CSS) |
56
+ | site title | the `name` field of `package.json` |
57
+ | static-shape recipes | `app/styles/recipes.css` (zero-interaction badge/callout/card/tabs shapes as plain HTML+CSS — the @openelement/ui components retired to these recipes in #1557) |
57
58
 
58
59
  Passing framework options inline to `openElement()` while the config file
59
60
  carries options is a hard error, and an unknown key fails the build with the
@@ -68,7 +69,16 @@ accepted-key list. `vite.config.ts` stays Vite-only: `plugins: [...openElement()
68
69
  array them in `static styles`, sharing `site-chrome.css`/`badges.css`).
69
70
  - `app/islands/` — client islands, the only code that ships JavaScript. Each
70
71
  island declares its hydration strategy (`idle`, `load`, `visible`,
71
- client-only) through `defineIslandConfig`.
72
+ client-only) through `defineIslandConfig`. The directory also hosts
73
+ `app-shell.tsx` — not an island itself, but the auto-registered application
74
+ shell (see below).
75
+ - `app/islands/app-shell.tsx` — the site chrome every page renders inside:
76
+ the header, the `main` content region, and the footer live here exactly
77
+ once instead of being copied onto each page. The build registers the shell
78
+ automatically and projects each page's render into its default slot, so a
79
+ page module carries only its own content. The shell is a convention: delete
80
+ the file and pages still render (carrying their own chrome again), or opt
81
+ out explicitly with `appShell: false` in `openelement.config.ts`.
72
82
  - `app/styles/theme.css` — the @theme role sheet: Tailwind-ON roles, the starter palette aliases, dark and forced-colors pairs. Dev serves it directly; the build compiles it through the router's Tailwind preset.
73
83
  Dark values ride `prefers-color-scheme`; no theme runtime.
74
84
  - `app/styles/recipes.css` — documented plain HTML+CSS recipes for the
@@ -79,29 +89,41 @@ accepted-key list. `vite.config.ts` stays Vite-only: `plugins: [...openElement()
79
89
 
80
90
  ## Scripts
81
91
 
82
- - `pnpm dev` — start the Vite dev server.
83
- - `pnpm check` — type-check every route/component file. The check covers the
84
- whole `app/` directory (`tsconfig.json`), so new files are picked up
85
- automatically.
92
+ The starter runs on the Vite+ toolchain (`vite-plus`, the `vp` command):
93
+
94
+ - `pnpm dev` — start the dev server (`vp dev`).
95
+ - `pnpm fmt` — format the sources (`vp fmt`).
96
+ - `pnpm lint` — lint the sources (`vp lint`).
97
+ - `pnpm typecheck` — type-check every route/component file (`tsc --noEmit`).
98
+ The check covers the whole `app/` directory (`tsconfig.json`), so new files
99
+ are picked up automatically.
86
100
  - `pnpm test` — run Node's built-in test runner (the starter ships none).
87
101
  - `pnpm build` — production build into `dist/`: prerendered HTML for every
88
102
  static route, plus the request-time server when the app has one.
89
103
  - `pnpm start` — serve the production build.
90
104
 
91
- `build` and `start` run the `openelement` bin from the `@openelement/router`
92
- dependency (`openelement build` / `openelement start`); the router's CLI also
93
- carries a static-only `openelement start --mode=preview`, which refuses a
94
- build that has a request-time server.
105
+ `build` and `start` run the router CLI's short `oe` bin from the
106
+ `@openelement/router` dependency (`oe build` / `oe start`; the same entry is
107
+ installed as `openelement`, so both spellings work). The CLI also carries a
108
+ static-only `oe start --mode=preview`, which refuses a build that has a
109
+ request-time server.
110
+
111
+ The Vite tree itself is catalog-managed: `pnpm-workspace.yaml` points `vite`
112
+ at the Vite+ core (`@voidzero-dev/vite-plus-core`) through a catalog entry
113
+ and a `vite@*` override, so every peer that asks for vite resolves the same
114
+ Vite+ build — there is no direct `vite` devDependency to pin.
95
115
 
96
116
  ## Styling ownership
97
117
 
98
118
  Global design tokens and the document baseline (`body`, `::selection`) live
99
- in `app/styles/theme.css`. Pages use light roots and own their rules in
100
- `static styles`, arrayed from imported `.css` files (#1558 — the one style
101
- authoring form): the server inlines each page's sheets into the SSR output as
102
- a `@scope(<page-tag>)` style block, so pages are fully styled with zero
103
- client JavaScript. Islands carry their own `.css` sheets the same way; in
104
- island chunks those ride the style-asset protocol as real `.css` assets.
119
+ in `app/styles/theme.css`. The app shell owns the shared chrome sheet
120
+ (`app/components/site-chrome.css`), arrayed in its `static styles`. Pages use
121
+ light roots and own their rules in `static styles`, arrayed from imported
122
+ `.css` files (#1558 — the one style authoring form): the server inlines each
123
+ page's sheets into the SSR output as a `@scope(<page-tag>)` style block, so
124
+ pages are fully styled with zero client JavaScript. Islands carry their own
125
+ `.css` sheets the same way; in island chunks those ride the style-asset
126
+ protocol as real `.css` assets.
105
127
 
106
128
  ## Brand assets
107
129
 
@@ -112,11 +134,13 @@ unused.
112
134
  ## Dependency notes
113
135
 
114
136
  `@openelement/element` and `@openelement/router` are the runtime dependencies
115
- your app imports. `@hono/vite-dev-server` and `hono` ride devDependencies:
116
- the Vite dev server needs the former (and the latter as its own node-adapter
117
- peer), it is loaded lazily, and `build`/`start` never resolve either — so
118
- `npm install --omit=dev` in a production image installs only the runtime pair.
119
- The generated server entry itself imports no
137
+ your app imports. Everything else rides devDependencies: `vite-plus` (the
138
+ `vp` toolchain the scripts run through; the Vite tree itself resolves through
139
+ the `pnpm-workspace.yaml` catalog), the Tailwind-ON build-time pins, the
140
+ dev-server pair — `@hono/vite-dev-server` (loaded lazily by the dev server)
141
+ and its `hono` peer — and the `typescript` pin. None of them resolve under a
142
+ production install: `npm install --omit=dev` in a production image installs
143
+ only the runtime pair. The generated server entry itself imports no
120
144
  HTTP framework — it composes on the internal WinterCG layer (#1560); `hono`
121
145
  is an optional peer of `@openelement/router`, and `@openelement/router/hono`
122
146
  (`createHonoAdapter`) is the one opt-in if you ever want to mount the built
@@ -124,9 +148,10 @@ handler inside your own Hono app. For Nitro deployments, the built handler
124
148
  bridges through the `@openelement/router/nitro-mount` subpath of the one
125
149
  `@openelement/router` dependency. Do not remove them.
126
150
 
127
- pnpm manages a `pnpm-workspace.yaml` for this project. That file is pnpm's own
128
- bookkeeping, not starter output: it carries workspace membership and the
129
- package-manager settings that apply here — including `minimumReleaseAge`, the
130
- supply-chain window that withholds freshly published versions, and any
131
- exemptions pnpm records when you approve a package inside that window. Keep
132
- the file (pnpm rewrites it), and review the exemptions it lists.
151
+ `pnpm-workspace.yaml` ships with the scaffold and is pnpm's own bookkeeping:
152
+ it carries the Vite+ catalog and override pair, and `minimumReleaseAge` — the
153
+ supply-chain window that withholds freshly published versions — with the
154
+ exemptions this project starts with (the `@openelement` packages at the
155
+ version it was generated from, plus `vite-plus`). pnpm rewrites the file when
156
+ you approve more packages inside that window; keep it and review the
157
+ exemptions it lists.
@@ -1,5 +1,24 @@
1
-
2
- .badge { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface); }
3
- .badge-static { border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, transparent); }
4
- .badge-island { border-color: color-mix(in srgb, var(--brand) 40%, transparent); color: var(--brand); background: var(--brand-soft); }
5
-
1
+ .badge {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ gap: 0.4em;
5
+ padding: 0.2rem 0.65rem;
6
+ border-radius: 999px;
7
+ font-size: 0.72rem;
8
+ font-weight: 600;
9
+ letter-spacing: 0.04em;
10
+ text-transform: uppercase;
11
+ border: 1px solid var(--line);
12
+ color: var(--ink-soft);
13
+ background: var(--surface);
14
+ }
15
+ .badge-static {
16
+ border-color: color-mix(in srgb, var(--ok) 35%, transparent);
17
+ color: var(--ok);
18
+ background: color-mix(in srgb, var(--ok) 8%, transparent);
19
+ }
20
+ .badge-island {
21
+ border-color: color-mix(in srgb, var(--brand) 40%, transparent);
22
+ color: var(--brand);
23
+ background: var(--brand-soft);
24
+ }
@@ -1,7 +1,21 @@
1
-
2
- :host { display: block; }
3
- h1 { font-size: 2.4rem; letter-spacing: -0.02em; margin: 0.75rem 0 0.5rem; font-weight: 700; }
4
- p { color: var(--ink-soft); line-height: 1.6; }
5
- a { color: var(--brand); font-weight: 600; text-decoration: none; }
6
- a:hover { text-decoration: underline; }
7
-
1
+ :host {
2
+ display: block;
3
+ }
4
+ h1 {
5
+ font-size: 2.4rem;
6
+ letter-spacing: -0.02em;
7
+ margin: 0.75rem 0 0.5rem;
8
+ font-weight: 700;
9
+ }
10
+ p {
11
+ color: var(--ink-soft);
12
+ line-height: 1.6;
13
+ }
14
+ a {
15
+ color: var(--brand);
16
+ font-weight: 600;
17
+ text-decoration: none;
18
+ }
19
+ a:hover {
20
+ text-decoration: underline;
21
+ }
@@ -2,46 +2,26 @@
2
2
  * Styled 404 page element (#923): the request-time server renders this page
3
3
  * with a 404 status for unmatched paths; a build with no request-time route
4
4
  * prerenders the route (see ./../routes/404.tsx) to dist/404.html instead.
5
- * The path-derived tag is 'el-404'. Light root: the page owns its
6
- * rules via `static styles` (the imported .css sheets), inlined into SSR as
7
- * @scope(el-404). The site chrome sheet (./site-chrome.css) is shared
5
+ * The path-derived tag is 'el-404'. Light root: the page owns its rules via
6
+ * `static styles` (the imported .css sheets), inlined into SSR as
7
+ * @scope(el-404). Like every page it renders inside the app shell
8
+ * (app/islands/app-shell.tsx), which owns the header and footer.
8
9
  */
9
- import { element, OpenElement } from '@openelement/element';
10
- import notFoundPageStyles from './page-404.css';
11
- import siteChromeStyles from './site-chrome.css';
10
+ import { element, OpenElement } from "@openelement/element";
11
+ import notFoundPageStyles from "./page-404.css";
12
12
 
13
- @element('el-404', { root: 'light' })
13
+ @element("el-404", { root: "light" })
14
14
  export default class NotFoundPage extends OpenElement {
15
- static override styles = [notFoundPageStyles, siteChromeStyles];
15
+ static override styles = [notFoundPageStyles];
16
16
 
17
17
  render() {
18
18
  return (
19
- <div class='page-body'>
20
- <header class='site-head'>
21
- <div class='bar'>
22
- <a class='site-brand' href='/'>
23
- openElement
24
- </a>
25
- <nav>
26
- <a href='/'>Home</a>
27
- <a href='/about'>About</a>
28
- <a href='/api/ping'>API</a>
29
- </nav>
30
- </div>
31
- </header>
32
- <main>
33
- <h1>404</h1>
34
- <p>The page you are looking for does not exist.</p>
35
- <p>
36
- <a href='/'>Back to the homepage</a>
37
- </p>
38
- </main>
39
- <footer class='site-foot'>
40
- <div class='bar'>
41
- <span>Generated by @openelement/create.</span>
42
- <a href='https://openelement.org'>openelement.org</a>
43
- </div>
44
- </footer>
19
+ <div class="page-content">
20
+ <h1>404</h1>
21
+ <p>The page you are looking for does not exist.</p>
22
+ <p>
23
+ <a href="/">Back to the homepage</a>
24
+ </p>
45
25
  </div>
46
26
  );
47
27
  }
@@ -1,15 +1,72 @@
1
-
2
- :host { display: block; }
3
- .eyebrow { color: var(--brand); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0; }
4
- h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0.75rem 0 1rem; font-weight: 700; }
5
- .lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 58ch; margin: 0 0 2rem; }
6
- h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 2.25rem 0 0.6rem; }
7
- p { margin: 0.6rem 0; max-width: 62ch; }
8
- p code, li code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0.08em 0.35em; }
9
- .conventions { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
10
- .conventions li { display: flex; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
11
- .conventions code { font-family: var(--font-mono); font-size: 0.85rem; color: var(--brand); min-width: 15rem; }
12
- .conventions span { color: var(--ink-soft); font-size: 0.92rem; }
13
- a { color: var(--brand); text-decoration: none; }
14
- a:hover { text-decoration: underline; }
15
-
1
+ :host {
2
+ display: block;
3
+ }
4
+ .eyebrow {
5
+ color: var(--brand);
6
+ font-weight: 600;
7
+ font-size: 0.78rem;
8
+ letter-spacing: 0.14em;
9
+ text-transform: uppercase;
10
+ margin: 0;
11
+ }
12
+ h1 {
13
+ font-size: clamp(1.9rem, 5vw, 2.6rem);
14
+ line-height: 1.15;
15
+ letter-spacing: -0.02em;
16
+ margin: 0.75rem 0 1rem;
17
+ font-weight: 700;
18
+ }
19
+ .lede {
20
+ font-size: 1.08rem;
21
+ color: var(--ink-soft);
22
+ max-width: 58ch;
23
+ margin: 0 0 2rem;
24
+ }
25
+ h2 {
26
+ font-size: 1.25rem;
27
+ letter-spacing: -0.01em;
28
+ margin: 2.25rem 0 0.6rem;
29
+ }
30
+ p {
31
+ margin: 0.6rem 0;
32
+ max-width: 62ch;
33
+ }
34
+ p code,
35
+ li code {
36
+ font-family: var(--font-mono);
37
+ font-size: 0.85em;
38
+ background: var(--surface);
39
+ border: 1px solid var(--line);
40
+ border-radius: 5px;
41
+ padding: 0.08em 0.35em;
42
+ }
43
+ .conventions {
44
+ list-style: none;
45
+ margin: 1rem 0 0;
46
+ padding: 0;
47
+ border-top: 1px solid var(--line);
48
+ }
49
+ .conventions li {
50
+ display: flex;
51
+ gap: 1rem;
52
+ padding: 0.7rem 0;
53
+ border-bottom: 1px solid var(--line);
54
+ flex-wrap: wrap;
55
+ }
56
+ .conventions code {
57
+ font-family: var(--font-mono);
58
+ font-size: 0.85rem;
59
+ color: var(--brand);
60
+ min-width: 15rem;
61
+ }
62
+ .conventions span {
63
+ color: var(--ink-soft);
64
+ font-size: 0.92rem;
65
+ }
66
+ a {
67
+ color: var(--brand);
68
+ text-decoration: none;
69
+ }
70
+ a:hover {
71
+ text-decoration: underline;
72
+ }
@@ -3,90 +3,74 @@
3
3
  *
4
4
  * Compiled page with the default static renderIntent: prerendered to HTML at
5
5
  * build time (SSG). There are NO islands on this page — everything below is
6
- * prerendered markup and CSS. The header, footer and badges come from the
7
- * shared sheets in ./site-chrome.css and ./badges.css (light root, inlined
8
- * into SSR as @scope(about-page)).
6
+ * prerendered markup and CSS. The page renders inside the auto-registered
7
+ * app shell (app/islands/app-shell.tsx), which owns the header, main region
8
+ * and footer; the badges come from ./badges.css (light root, inlined into
9
+ * SSR as @scope(about-page)). The compiled grammar lowers one root per
10
+ * render, so the page returns a single content wrapper.
9
11
  */
10
- import { element, OpenElement } from '@openelement/element';
11
- import aboutPageStyles from './page-about.css';
12
- import badgeStyles from './badges.css';
13
- import siteChromeStyles from './site-chrome.css';
12
+ import { element, OpenElement } from "@openelement/element";
13
+ import aboutPageStyles from "./page-about.css";
14
+ import badgeStyles from "./badges.css";
14
15
 
15
- @element('about-page', { root: 'light' })
16
+ @element("about-page", { root: "light" })
16
17
  export default class AboutPage extends OpenElement {
17
- static override styles = [aboutPageStyles, badgeStyles, siteChromeStyles];
18
+ static override styles = [aboutPageStyles, badgeStyles];
18
19
 
19
20
  render() {
20
21
  return (
21
- <div class='page-body'>
22
- <header class='site-head'>
23
- <div class='bar'>
24
- <a class='site-brand' href='/'>
25
- openElement
26
- </a>
27
- <nav>
28
- <a href='/'>Home</a>
29
- <a href='/about'>About</a>
30
- <a href='/api/ping'>API</a>
31
- </nav>
32
- </div>
33
- </header>
34
- <main>
35
- <span class='badge badge-static'>static · no islands on this page</span>
36
- <p class='eyebrow'>About</p>
37
- <h1>Static first, interactive where it counts</h1>
38
- <p class='lede'>
39
- openElement prerenders pages to plain HTML and CSS at build time and
40
- hydrates compiled islands only where a page needs interactivity. This
41
- page is the first half of that story: it ships no islands at all.
42
- </p>
43
- <h2>What happened when you opened this page</h2>
44
- <p>
45
- The server sent HTML — prerendered at build time by SSG — plus one
46
- inlined stylesheet per page scope. No framework runtime executed to
47
- produce what you are reading; the markup is the artifact.
48
- </p>
49
- <h2>Where things live</h2>
50
- <ul class='conventions'>
51
- <li>
52
- <code>app/routes/</code>
53
- <span>page routes — one file per URL, prerendered by default</span>
54
- </li>
55
- <li>
56
- <code>app/routes/api/</code>
57
- <span>request-time server routes — plain Request → Response handlers</span>
58
- </li>
59
- <li>
60
- <code>app/components/</code>
61
- <span>compiled page elements and shared style sheets</span>
62
- </li>
63
- <li>
64
- <code>app/islands/</code>
65
- <span>client islands — the only code that ships JavaScript</span>
66
- </li>
67
- <li>
68
- <code>app/styles/theme.css</code>
69
- <span>design tokens, inlined into every document head</span>
70
- </li>
71
- <li>
72
- <code>app/head.tsx</code>
73
- <span>structural document-head content (meta tags, preloads)</span>
74
- </li>
75
- </ul>
76
- <h2>See it working</h2>
77
- <p>
78
- The <a href='/'>home page</a> carries the interactive half: a counter
79
- island that hydrates on idle and a client-only live timer. Open your
80
- browser's DevTools on both pages and compare the network panels — the
81
- badge on each section names what it costs.
82
- </p>
83
- </main>
84
- <footer class='site-foot'>
85
- <div class='bar'>
86
- <span>Generated by @openelement/create.</span>
87
- <a href='https://openelement.org'>openelement.org</a>
88
- </div>
89
- </footer>
22
+ <div class="page-content">
23
+ <span class="badge badge-static">static · no islands on this page</span>
24
+ <p class="eyebrow">About</p>
25
+ <h1>Static first, interactive where it counts</h1>
26
+ <p class="lede">
27
+ openElement prerenders pages to plain HTML and CSS at build time and hydrates compiled
28
+ islands only where a page needs interactivity. This page is the first half of that story:
29
+ it ships no islands at all.
30
+ </p>
31
+ <h2>What happened when you opened this page</h2>
32
+ <p>
33
+ The server sent HTML — prerendered at build time by SSG — plus one inlined stylesheet per
34
+ page scope. No framework runtime executed to produce what you are reading; the markup is
35
+ the artifact.
36
+ </p>
37
+ <h2>Where things live</h2>
38
+ <ul class="conventions">
39
+ <li>
40
+ <code>app/routes/</code>
41
+ <span>page routes — one file per URL, prerendered by default</span>
42
+ </li>
43
+ <li>
44
+ <code>app/routes/api/</code>
45
+ <span>request-time server routes — plain Request → Response handlers</span>
46
+ </li>
47
+ <li>
48
+ <code>app/components/</code>
49
+ <span>compiled page elements and shared style sheets</span>
50
+ </li>
51
+ <li>
52
+ <code>app/islands/</code>
53
+ <span>client islands — the only code that ships JavaScript</span>
54
+ </li>
55
+ <li>
56
+ <code>app/islands/app-shell.tsx</code>
57
+ <span>the shared site chrome wrapped around every page</span>
58
+ </li>
59
+ <li>
60
+ <code>app/styles/theme.css</code>
61
+ <span>design tokens, inlined into every document head</span>
62
+ </li>
63
+ <li>
64
+ <code>app/head.tsx</code>
65
+ <span>structural document-head content (meta tags, preloads)</span>
66
+ </li>
67
+ </ul>
68
+ <h2>See it working</h2>
69
+ <p>
70
+ The <a href="/">home page</a> carries the interactive half: a counter island that hydrates
71
+ on idle and a client-only live timer. Open the browser DevTools on both pages and compare
72
+ the network panels — the badge on each section names what it costs.
73
+ </p>
90
74
  </div>
91
75
  );
92
76
  }