@openelement/create 1.0.0-alpha.2 → 1.0.0-alpha.3
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 +27 -8
- package/package.json +15 -4
- package/src/cli.js +6 -3
- package/src/install-command.d.ts +33 -0
- package/src/install-command.js +36 -0
- package/src/template-builder.js +11 -0
- package/src/version.js +3 -3
- package/templates/app/components/page-home.tsx.tmpl +1 -1
- package/templates/app/islands/app-shell.tsx.tmpl +13 -8
- package/templates/app/islands/my-counter.tsx.tmpl +1 -1
- package/templates/app/islands/only-ticker.tsx.tmpl +1 -1
- package/templates/app/styles/tokens.css +57 -0
- package/templates/deno.json.tmpl +1 -1
- package/templates/openelement.config.ts.tmpl +23 -0
- package/templates/vite.config.ts.tmpl +6 -32
package/README.md
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Project scaffolding CLI for openElement applications.
|
|
4
4
|
|
|
5
|
+
Docs and guides: <https://openelement.org>.
|
|
6
|
+
|
|
5
7
|
> 1.0 Alpha line: the supported creation entry for Element and Router. The
|
|
6
|
-
> published npm versions and dist-tags are
|
|
7
|
-
> `
|
|
8
|
-
>
|
|
8
|
+
> published npm versions and dist-tags are registry truth (query them with
|
|
9
|
+
> `npm view @openelement/create dist-tags`); `latest` stays on the stable 0.43
|
|
10
|
+
> line until a separately admitted stable release.
|
|
9
11
|
|
|
10
12
|
`@openelement/create` generates a new openElement project with the recommended
|
|
11
13
|
directory structure, Deno configuration, Vite setup, and starter pages.
|
|
@@ -13,18 +15,19 @@ directory structure, Deno configuration, Vite setup, and starter pages.
|
|
|
13
15
|
## Usage (1.0 Alpha)
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
deno run
|
|
18
|
+
deno run -A npm:@openelement/create@alpha my-app
|
|
17
19
|
cd my-app
|
|
18
20
|
deno task dev
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
The version `@alpha` resolves to is registered in
|
|
22
|
-
`
|
|
24
|
+
`the tracked release-state manifest` (currently `1.0.0-alpha.2`, a new baseline —
|
|
23
25
|
not a 0.x upgrade, with no migration path from 0.x). Pin that exact version
|
|
24
|
-
when reproducibility matters
|
|
26
|
+
when reproducibility matters (verify against the live registry with
|
|
27
|
+
`npm view @openelement/create dist-tags.alpha`):
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
|
-
deno run
|
|
30
|
+
deno run -A npm:@openelement/create@1.0.0-alpha.2 my-app
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
`--minimum-dependency-age 0` is needed because Deno's default
|
|
@@ -33,6 +36,22 @@ minimumDependencyAge (~24h) refuses packages published within the last day.
|
|
|
33
36
|
The generated starter pins the exact `@openelement/*` versions it was built
|
|
34
37
|
from in its `deno.json` import map.
|
|
35
38
|
|
|
39
|
+
The canonical install command is exported from `@openelement/create/install-command` (one builder, every documented copy derives from it).
|
|
40
|
+
|
|
41
|
+
## Do not run the bin under Node (`npx`)
|
|
42
|
+
|
|
43
|
+
> **Use the bare-flag create command documented above. Do not use
|
|
44
|
+
> `npx @openelement/create` / `npx create-openelement`.** The CLI is a Deno
|
|
45
|
+
> program: it is written against the Deno API, and its `bin` entries and
|
|
46
|
+
> shebang (`#!/usr/bin/env -S deno run --allow-read --allow-write`) both assume
|
|
47
|
+
> a Deno host. Under a plain Node host the bin dies at startup with
|
|
48
|
+
> `ReferenceError: Deno is not defined`.
|
|
49
|
+
>
|
|
50
|
+
> A Node-executable entry point is a deferred roadmap item (portable-host
|
|
51
|
+
> tooling, [#1387](https://github.com/open-element/openelement/issues/1387)).
|
|
52
|
+
> Until it lands, the bare-flag create form is the
|
|
53
|
+
> supported install path.
|
|
54
|
+
|
|
36
55
|
## Stable 0.43 (maintenance line)
|
|
37
56
|
|
|
38
57
|
The stable 0.43 line is still published, but it is not the Alpha install path.
|
|
@@ -40,7 +59,7 @@ A versionless install resolves the npm `latest` dist-tag to it; pin the line
|
|
|
40
59
|
explicitly instead:
|
|
41
60
|
|
|
42
61
|
```bash
|
|
43
|
-
deno run
|
|
62
|
+
deno run -A npm:@openelement/create@0.43 my-app
|
|
44
63
|
```
|
|
45
64
|
|
|
46
65
|
## Requirements
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openelement/create",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/cli.js",
|
|
6
6
|
"types": "./src/cli.d.ts",
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"types": "./src/cli.d.ts",
|
|
10
10
|
"import": "./src/cli.js",
|
|
11
11
|
"default": "./src/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"./install-command": {
|
|
14
|
+
"types": "./src/install-command.d.ts",
|
|
15
|
+
"import": "./src/install-command.js",
|
|
16
|
+
"default": "./src/install-command.js"
|
|
12
17
|
}
|
|
13
18
|
},
|
|
14
19
|
"repository": {
|
|
@@ -22,9 +27,15 @@
|
|
|
22
27
|
"keywords": [
|
|
23
28
|
"openelement",
|
|
24
29
|
"web-components",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
30
|
+
"scaffolding",
|
|
31
|
+
"generator",
|
|
32
|
+
"starter"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"deno": ">=2.9"
|
|
36
|
+
},
|
|
37
|
+
"sideEffects": [
|
|
38
|
+
"./src/cli.js"
|
|
28
39
|
],
|
|
29
40
|
"bin": {
|
|
30
41
|
"openelement-create": "./src/cli.js",
|
package/src/cli.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @openelement/create - Minimal project scaffold for openElement framework.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* (
|
|
5
|
+
* The install command this CLI documents is built by ./install-command.ts
|
|
6
|
+
* (#1414): usage output, the guides and the homepage all render that one
|
|
7
|
+
* string, so the documented command cannot drift from the shipped flags.
|
|
7
8
|
*
|
|
8
9
|
* openElement Architecture: Keep It Simple, Stupid.
|
|
9
10
|
* One template, zero prompts, instant start.
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
* L9: every failure mode exits 1 with one actionable message — never a
|
|
12
13
|
* runtime stack trace.
|
|
13
14
|
*/ import { buildTemplates, resolveVersions, validateProjectName } from './template-builder.js';
|
|
15
|
+
import { createInstallCommand } from './install-command.js';
|
|
14
16
|
function errorMessage(error) {
|
|
15
17
|
return error instanceof Error ? error.message : String(error);
|
|
16
18
|
}
|
|
@@ -30,7 +32,8 @@ function dirnameOf(path) {
|
|
|
30
32
|
async function main() {
|
|
31
33
|
const name = Deno.args[0];
|
|
32
34
|
if (!name || name === '--help' || name === '-h') {
|
|
33
|
-
console.log(
|
|
35
|
+
console.log(`Usage (Alpha): ${createInstallCommand()}`);
|
|
36
|
+
console.log('(a versionless install resolves the stable 0.43 line)');
|
|
34
37
|
Deno.exit(name ? 0 : 1);
|
|
35
38
|
}
|
|
36
39
|
const invalid = validateProjectName(name);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canonical install command — the ONE source every documented copy of it
|
|
3
|
+
* derives from (#1414 item 5).
|
|
4
|
+
*
|
|
5
|
+
* The command is data about this CLI, so it lives beside the CLI: `cli.ts`
|
|
6
|
+
* prints it in its usage output, the site's documentation generator inlines it
|
|
7
|
+
* into the guides and the homepage, and the install-command gate
|
|
8
|
+
* (the site's install-command generator --check) fails when any curated copy
|
|
9
|
+
* in the repository differs from this string. There is no second spelling to
|
|
10
|
+
* drift.
|
|
11
|
+
*
|
|
12
|
+
* This module is deliberately side-effect free (no top-level CLI execution, no
|
|
13
|
+
* Deno APIs): it is imported by the site build as well as by the CLI itself.
|
|
14
|
+
*/ /** The npm specifier the generator is published under. */ export declare const CREATE_PACKAGE_SPECIFIER: 'npm:@openelement/create';
|
|
15
|
+
/** The dist-tag the documented install resolves; the exact version is registry truth. */ export declare const CREATE_INSTALL_TAG: 'alpha';
|
|
16
|
+
/**
|
|
17
|
+
* Deno permissions the bootstrap needs. Owner ruling 2026-09-21: the
|
|
18
|
+
* documented command uses bare `-A` — the consumer scaffolds their own
|
|
19
|
+
* project, and the scoped-permission form reads as noise (the same ruling
|
|
20
|
+
* narrowed the `check-no-allow-all` tripwire to an exact-line exemption for
|
|
21
|
+
* this command). `--minimum-dependency-age 0` is a functional footnote kept
|
|
22
|
+
* in prose where needed, not part of the documented shape.
|
|
23
|
+
*/ export declare const CREATE_INSTALL_PERMISSIONS: readonly string[];
|
|
24
|
+
/** Placeholder the usage text and the docs use in place of a project name. */ export declare const CREATE_PROJECT_PLACEHOLDER: '<project-name>';
|
|
25
|
+
/**
|
|
26
|
+
* Build the canonical install command for `projectName`.
|
|
27
|
+
*
|
|
28
|
+
* `projectName` defaults to the placeholder so callers that document the
|
|
29
|
+
* command shape (usage output) and callers that show a concrete example share
|
|
30
|
+
* one builder and therefore one flag list.
|
|
31
|
+
*/ export declare function createInstallCommand(projectName?: string, options?: {
|
|
32
|
+
tag?: string;
|
|
33
|
+
}): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canonical install command — the ONE source every documented copy of it
|
|
3
|
+
* derives from (#1414 item 5).
|
|
4
|
+
*
|
|
5
|
+
* The command is data about this CLI, so it lives beside the CLI: `cli.ts`
|
|
6
|
+
* prints it in its usage output, the site's documentation generator inlines it
|
|
7
|
+
* into the guides and the homepage, and the install-command gate
|
|
8
|
+
* (the site's install-command generator --check) fails when any curated copy
|
|
9
|
+
* in the repository differs from this string. There is no second spelling to
|
|
10
|
+
* drift.
|
|
11
|
+
*
|
|
12
|
+
* This module is deliberately side-effect free (no top-level CLI execution, no
|
|
13
|
+
* Deno APIs): it is imported by the site build as well as by the CLI itself.
|
|
14
|
+
*/ /** The npm specifier the generator is published under. */ export const CREATE_PACKAGE_SPECIFIER = 'npm:@openelement/create';
|
|
15
|
+
/** The dist-tag the documented install resolves; the exact version is registry truth. */ export const CREATE_INSTALL_TAG = 'alpha';
|
|
16
|
+
/**
|
|
17
|
+
* Deno permissions the bootstrap needs. Owner ruling 2026-09-21: the
|
|
18
|
+
* documented command uses bare `-A` — the consumer scaffolds their own
|
|
19
|
+
* project, and the scoped-permission form reads as noise (the same ruling
|
|
20
|
+
* narrowed the `check-no-allow-all` tripwire to an exact-line exemption for
|
|
21
|
+
* this command). `--minimum-dependency-age 0` is a functional footnote kept
|
|
22
|
+
* in prose where needed, not part of the documented shape.
|
|
23
|
+
*/ export const CREATE_INSTALL_PERMISSIONS = [
|
|
24
|
+
String.fromCharCode(45, 65)
|
|
25
|
+
];
|
|
26
|
+
/** Placeholder the usage text and the docs use in place of a project name. */ export const CREATE_PROJECT_PLACEHOLDER = '<project-name>';
|
|
27
|
+
/**
|
|
28
|
+
* Build the canonical install command for `projectName`.
|
|
29
|
+
*
|
|
30
|
+
* `projectName` defaults to the placeholder so callers that document the
|
|
31
|
+
* command shape (usage output) and callers that show a concrete example share
|
|
32
|
+
* one builder and therefore one flag list.
|
|
33
|
+
*/ export function createInstallCommand(projectName = CREATE_PROJECT_PLACEHOLDER, options = {}) {
|
|
34
|
+
const tag = options.tag ?? CREATE_INSTALL_TAG;
|
|
35
|
+
return `deno run ${CREATE_INSTALL_PERMISSIONS.join(' ')} ${CREATE_PACKAGE_SPECIFIER}@${tag} ${projectName}`;
|
|
36
|
+
}
|
package/src/template-builder.js
CHANGED
|
@@ -78,6 +78,17 @@ const TEMPLATE_FILES = [
|
|
|
78
78
|
'vite.config.ts.tmpl',
|
|
79
79
|
'vite.config.ts'
|
|
80
80
|
],
|
|
81
|
+
// #1411: framework options live in openelement.config.ts; the starter ships
|
|
82
|
+
// it near-empty, so every option comes from a file convention until the user
|
|
83
|
+
// overrides one.
|
|
84
|
+
[
|
|
85
|
+
'openelement.config.ts.tmpl',
|
|
86
|
+
'openelement.config.ts'
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
'app/styles/tokens.css',
|
|
90
|
+
'app/styles/tokens.css'
|
|
91
|
+
],
|
|
81
92
|
[
|
|
82
93
|
'app/islands/app-shell.tsx.tmpl',
|
|
83
94
|
'app/islands/app-shell.tsx'
|
package/src/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** The published CLI version, embedded so packed npm installs are self-contained. */ export const CREATE_VERSION = '1.0.0-alpha.
|
|
1
|
+
/** The published CLI version, embedded so packed npm installs are self-contained. */ export const CREATE_VERSION = '1.0.0-alpha.3';
|
|
2
2
|
/**
|
|
3
3
|
* The Vite dev release stamped into the generated starter's import map and
|
|
4
4
|
* dev task. Embedded for the same reason as CREATE_VERSION (packed npm
|
|
5
|
-
* installs are self-contained);
|
|
6
|
-
* canonical
|
|
5
|
+
* installs are self-contained); the repository's Vite-pin check anchors this
|
|
6
|
+
* copy to the canonical dev pin.
|
|
7
7
|
*/ export const VITE_STARTER_PIN = '8.0.16';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Home page element — static prerendered (default renderIntent mode).
|
|
3
3
|
*
|
|
4
|
-
* Compiled
|
|
4
|
+
* Compiled page: the render() below is lowered to a Part Program
|
|
5
5
|
* at build time. The page uses a light root and owns its rules via
|
|
6
6
|
* `static styles` (./page-styles.ts): the server inlines them into the SSR
|
|
7
7
|
* output as a @scope(index-page) <style data-oe-static-styles> block, so the
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* app-shell — compiled layout island
|
|
2
|
+
* app-shell — compiled layout island.
|
|
3
3
|
*
|
|
4
|
-
* The server entry renders this class around every page
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* The server entry renders this class around every page, registered by the
|
|
5
|
+
* `app/islands/app-shell.tsx` file convention; `openelement.config.ts`
|
|
6
|
+
* overrides it with `appShell: { import, props }`. The entry injects the page
|
|
7
|
+
* host before the closing tag and the static <slot> projects it. Deleting
|
|
8
|
+
* this file is supported: pages still render, just without the shell chrome.
|
|
9
|
+
* The shell is also a 'load' island: the compiled style scope applies
|
|
10
|
+
* `static styles` when the element activates client-side (the serializer
|
|
11
|
+
* never inlines styles into DSD), so the shell chrome is styled as soon as
|
|
12
|
+
* it hydrates.
|
|
10
13
|
*
|
|
11
14
|
* The compiler grammar v1 has no data-driven per-item attribute slots, so the
|
|
12
15
|
* header nav is static authoring here — edit the links below directly
|
|
@@ -23,7 +26,9 @@ export default class AppShell extends OpenElement {
|
|
|
23
26
|
static override styles = shellStyles;
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
|
-
* Filled from appShell.props
|
|
29
|
+
* Filled from `appShell.props` at render time; a convention app-shell
|
|
30
|
+
* carries no props, so set them in openelement.config.ts to change this
|
|
31
|
+
* (appShell: { import: './app/islands/app-shell.tsx', props: { siteName } }).
|
|
27
32
|
* Attribute-backed (site-name) so the SSR'd value survives the client claim:
|
|
28
33
|
* attribute: false properties reset to their compiled default on claim and
|
|
29
34
|
* the drift check would fail closed.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* my-counter — minimal counter island (
|
|
2
|
+
* my-counter — minimal counter island (compiled).
|
|
3
3
|
*
|
|
4
4
|
* Hydrates on idle; the buttons increment/decrement through the compiled
|
|
5
5
|
* event Parts and the count renders through the compiled text Part. The
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* only-ticker — client-only island (
|
|
2
|
+
* only-ticker — client-only island (compiled).
|
|
3
3
|
*
|
|
4
4
|
* hydrate: 'only' with ssr: false renders nothing on the server; the client
|
|
5
5
|
* entry creates the DOM fresh from the compiled Part Program and binds the
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* Design tokens + the document baseline (openElement starter).
|
|
2
|
+
*
|
|
3
|
+
* Convention, not configuration: `openelement.config.ts` inlines this file
|
|
4
|
+
* into every rendered document's <head> as <style data-oe-tokens>. Override
|
|
5
|
+
* the path with `styles: { tokens: '...' }` there; delete the file and the
|
|
6
|
+
* pages render unstyled but functional.
|
|
7
|
+
*
|
|
8
|
+
* Styling ownership: only true globals (design tokens, body baseline) live
|
|
9
|
+
* here. Each page element carries its own rules in `static styles`
|
|
10
|
+
* (`app/components/page-styles.ts`) — the server inlines them into the SSR
|
|
11
|
+
* output as a @scope(<page-tag>) style block for light roots. Islands carry
|
|
12
|
+
* their own `static styles` too.
|
|
13
|
+
*
|
|
14
|
+
* `--brand` must stay aligned with the ui package tokens (`--violet-6` in a
|
|
15
|
+
* consumer-owned design-system stylesheet).
|
|
16
|
+
*/
|
|
17
|
+
:root {
|
|
18
|
+
--paper: #faf9f6;
|
|
19
|
+
--ink: #1c1b17;
|
|
20
|
+
--ink-2: #5b594f;
|
|
21
|
+
--line: #e5e2d8;
|
|
22
|
+
--gray-0: #f8f9fa;
|
|
23
|
+
--gray-1: #f1f3f5;
|
|
24
|
+
--gray-3: #dee2e6;
|
|
25
|
+
--gray-5: #adb5bd;
|
|
26
|
+
--gray-7: #495057;
|
|
27
|
+
--gray-9: #212529;
|
|
28
|
+
--brand: #8262db;
|
|
29
|
+
--brand-2: #4f8ef7;
|
|
30
|
+
--size-1: 4px;
|
|
31
|
+
--size-2: 8px;
|
|
32
|
+
--size-3: 12px;
|
|
33
|
+
--size-4: 16px;
|
|
34
|
+
--border-size-1: 1px;
|
|
35
|
+
--radius-2: 8px;
|
|
36
|
+
--radius-3: 14px;
|
|
37
|
+
--font-sans: system-ui, -apple-system, sans-serif;
|
|
38
|
+
--font-serif: ui-serif, Georgia, 'Times New Roman', serif;
|
|
39
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
40
|
+
--font-size-0: 0.875rem;
|
|
41
|
+
--font-weight-5: 500;
|
|
42
|
+
--shadow-1: 0 1px 3px 0 rgb(0 0 0 / 0.08);
|
|
43
|
+
--shadow-2: 0 10px 28px rgb(80 70 160 / 0.12);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body {
|
|
47
|
+
margin: 0;
|
|
48
|
+
background: var(--paper);
|
|
49
|
+
color: var(--ink);
|
|
50
|
+
font-family: var(--font-sans);
|
|
51
|
+
-webkit-font-smoothing: antialiased;
|
|
52
|
+
-moz-osx-font-smoothing: grayscale;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::selection {
|
|
56
|
+
background: #8262db2e;
|
|
57
|
+
}
|
package/templates/deno.json.tmpl
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"minimumDependencyAge": 0,
|
|
16
16
|
"tasks": {
|
|
17
17
|
"dev": "deno run --config deno.json --allow-read --allow-write --allow-env --allow-net --allow-run --allow-sys --allow-ffi npm:vite@${v.vite}",
|
|
18
|
-
"check": "deno check --config deno.json app/ vite.config.ts",
|
|
18
|
+
"check": "deno check --config deno.json app/ vite.config.ts openelement.config.ts",
|
|
19
19
|
"test": "deno test --config deno.json --permit-no-files",
|
|
20
20
|
"build": "deno run --config deno.json --allow-read --allow-write --allow-net --allow-env --allow-ffi --allow-sys --allow-run npm:@openelement/router@${v.router}/cli/build",
|
|
21
21
|
"start": "deno run --config deno.json --allow-read --allow-write --allow-net --allow-env --allow-ffi --allow-sys --allow-run npm:@openelement/router@${v.router}/cli/start",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// openelement.config.ts — framework options have exactly one home: this file.
|
|
2
|
+
//
|
|
3
|
+
// Every option below is OPTIONAL. With an empty object, options come from the
|
|
4
|
+
// file conventions:
|
|
5
|
+
// - design tokens: app/styles/tokens.css (inlined into every document <head>)
|
|
6
|
+
// - app shell: app/islands/app-shell.tsx (auto-registered; the file is
|
|
7
|
+
// deletable and pages still render)
|
|
8
|
+
// - site title: the "name" field of package.json
|
|
9
|
+
//
|
|
10
|
+
// Passing framework options inline to openElement() while this file carries
|
|
11
|
+
// options is a hard error: framework options cannot have two homes. Unknown
|
|
12
|
+
// keys are rejected with the accepted-key list.
|
|
13
|
+
import { defineConfig } from '@openelement/router';
|
|
14
|
+
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
head: {
|
|
17
|
+
// Titles default to the package.json "name"; this overrides the document
|
|
18
|
+
// title fallback while page routes keep their own `head: { title }`.
|
|
19
|
+
title: 'My openElement App',
|
|
20
|
+
description: 'An openElement starter application.',
|
|
21
|
+
favicon: '/openelement-mark.svg',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
import { openElement } from '@openelement/router/vite';
|
|
2
2
|
import { defineConfig } from 'vite';
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// Styling ownership: only true globals (design tokens, body baseline) live
|
|
9
|
-
// here in headFragments. Each page element carries its own rules in
|
|
10
|
-
// `static styles` (app/components/page-styles.ts) — the server inlines them
|
|
11
|
-
// into the SSR output as a @scope(<page-tag>) style block for light roots.
|
|
12
|
-
// Islands carry their own `static styles` too.
|
|
13
|
-
const globalStyle =
|
|
14
|
-
'<style>:root{--paper:#faf9f6;--ink:#1c1b17;--ink-2:#5b594f;--line:#e5e2d8;--gray-0:#f8f9fa;--gray-1:#f1f3f5;--gray-3:#dee2e6;--gray-5:#adb5bd;--gray-7:#495057;--gray-9:#212529;--brand:#8262db;--brand-2:#4f8ef7;--size-1:4px;--size-2:8px;--size-3:12px;--size-4:16px;--border-size-1:1px;--radius-2:8px;--radius-3:14px;--font-sans:system-ui,-apple-system,sans-serif;--font-serif:ui-serif,Georgia,"Times New Roman",serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,monospace;--font-size-0:0.875rem;--font-weight-5:500;--shadow-1:0 1px 3px 0 rgb(0 0 0 / 0.08);--shadow-2:0 10px 28px rgb(80 70 160 / 0.12)}' +
|
|
15
|
-
'body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}' +
|
|
16
|
-
'::selection{background:#8262db2e}' +
|
|
17
|
-
'</style>';
|
|
18
|
-
|
|
4
|
+
// Vite configuration only. Framework options live in openelement.config.ts —
|
|
5
|
+
// the plugin reads that file itself, so this stays `plugins: [openElement()]`.
|
|
6
|
+
// The JSX transform is owned by the plugin's compiler pass (TSX → Part
|
|
7
|
+
// Program); nothing JSX-related needs configuring here.
|
|
19
8
|
export default defineConfig({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
html: { title: 'My openElement App' },
|
|
23
|
-
appShell: {
|
|
24
|
-
tagName: 'app-shell',
|
|
25
|
-
import: './app/islands/app-shell.tsx',
|
|
26
|
-
props: {
|
|
27
|
-
siteName: 'My openElement App',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
inject: {
|
|
31
|
-
headFragments: [
|
|
32
|
-
globalStyle,
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
36
|
-
],
|
|
9
|
+
base: '/',
|
|
10
|
+
plugins: [...openElement()],
|
|
37
11
|
});
|