@madojs/mado 0.10.1 → 0.11.0
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/AGENTS.md +24 -26
- package/CHANGELOG.md +68 -0
- package/README.md +18 -45
- package/TODO.md +52 -48
- package/dist/src/component.d.ts +2 -1
- package/dist/src/component.js +5 -2
- package/dist/src/component.js.map +1 -1
- package/dist/src/each.d.ts +1 -1
- package/dist/src/each.js +1 -1
- package/dist/src/each.js.map +1 -1
- package/dist/src/index.d.ts +11 -6
- package/dist/src/index.js +5 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/lazy.d.ts +1 -1
- package/dist/src/lazy.js +1 -1
- package/dist/src/lazy.js.map +1 -1
- package/dist/src/page.d.ts +17 -21
- package/dist/src/page.js +7 -12
- package/dist/src/page.js.map +1 -1
- package/dist/src/router/manifest.d.ts +1 -1
- package/dist/src/router/manifest.js +21 -13
- package/dist/src/router/manifest.js.map +1 -1
- package/dist/src/router/match.d.ts +2 -2
- package/dist/src/router/match.js +3 -3
- package/dist/src/router/match.js.map +1 -1
- package/dist/src/router/navigation.js +1 -1
- package/dist/src/router/navigation.js.map +1 -1
- package/dist/src/vite/index.d.ts +10 -0
- package/dist/src/vite/index.js +33 -0
- package/dist/src/vite/index.js.map +1 -0
- package/docs/en/00-the-mado-way.md +25 -12
- package/docs/en/01-routing.md +90 -142
- package/docs/en/02-project-layout.md +59 -53
- package/docs/en/03-static-bake.md +5 -6
- package/docs/en/05-why-mado.md +6 -6
- package/docs/en/06-for-backenders.md +18 -22
- package/docs/en/08-llm-zero-history-test.md +9 -14
- package/docs/en/09-shadow-vs-light-dom.md +28 -36
- package/docs/en/10-app-architecture.md +158 -96
- package/docs/en/11-layouts.md +22 -24
- package/docs/en/12-auth-and-api.md +89 -182
- package/docs/en/13-deployment.md +18 -22
- package/docs/en/14-testing.md +4 -4
- package/docs/en/16-bake-cookbook.md +11 -12
- package/docs/en/18-api-freeze-map.md +6 -4
- package/docs/en/20-v1-stability.md +1 -1
- package/docs/fr/00-the-mado-way.md +55 -90
- package/docs/fr/01-routing.md +70 -152
- package/docs/fr/02-project-layout.md +61 -42
- package/docs/fr/03-static-bake.md +1 -1
- package/docs/fr/05-why-mado.md +6 -6
- package/docs/fr/06-for-backenders.md +7 -7
- package/docs/fr/08-llm-zero-history-test.md +21 -48
- package/docs/fr/09-shadow-vs-light-dom.md +43 -162
- package/docs/fr/10-app-architecture.md +110 -33
- package/docs/fr/11-layouts.md +24 -12
- package/docs/fr/12-auth-and-api.md +63 -22
- package/docs/fr/13-deployment.md +7 -10
- package/docs/fr/14-testing.md +1 -1
- package/docs/fr/16-bake-cookbook.md +2 -2
- package/docs/fr/18-api-freeze-map.md +1 -1
- package/docs/fr/20-v1-stability.md +1 -1
- package/docs/recipes/nginx/README.md +13 -0
- package/docs/ru/00-the-mado-way.md +53 -75
- package/docs/ru/01-routing.md +68 -143
- package/docs/ru/02-project-layout.md +61 -41
- package/docs/ru/03-static-bake.md +2 -2
- package/docs/ru/05-why-mado.md +6 -6
- package/docs/ru/06-for-backenders.md +7 -7
- package/docs/ru/08-llm-zero-history-test.md +9 -14
- package/docs/ru/09-shadow-vs-light-dom.md +43 -178
- package/docs/ru/10-app-architecture.md +115 -63
- package/docs/ru/11-layouts.md +24 -24
- package/docs/ru/12-auth-and-api.md +57 -35
- package/docs/ru/13-deployment.md +7 -11
- package/docs/ru/14-testing.md +1 -1
- package/docs/ru/16-bake-cookbook.md +12 -6
- package/docs/ru/18-api-freeze-map.md +5 -3
- package/docs/ru/20-v1-stability.md +1 -1
- package/docs/uk/00-the-mado-way.md +70 -44
- package/docs/uk/01-routing.md +41 -47
- package/docs/uk/02-project-layout.md +68 -41
- package/docs/uk/03-static-bake.md +1 -2
- package/docs/uk/06-for-backenders.md +3 -3
- package/docs/uk/08-llm-zero-history-test.md +22 -24
- package/docs/uk/09-shadow-vs-light-dom.md +37 -86
- package/docs/uk/10-app-architecture.md +72 -31
- package/docs/uk/11-layouts.md +25 -12
- package/docs/uk/12-auth-and-api.md +58 -22
- package/docs/uk/13-deployment.md +4 -3
- package/docs/uk/14-testing.md +1 -1
- package/docs/uk/18-api-freeze-map.md +1 -1
- package/docs/uk/20-v1-stability.md +1 -1
- package/llms.txt +14 -15
- package/package.json +18 -11
- package/scripts/_config.mjs +15 -161
- package/scripts/bake.mjs +67 -57
- package/scripts/cli/generate.mjs +348 -0
- package/scripts/cli/help.mjs +27 -0
- package/scripts/cli/index.mjs +79 -0
- package/scripts/cli/init.mjs +153 -0
- package/scripts/cli/release.mjs +152 -0
- package/scripts/cli/run.mjs +96 -0
- package/scripts/cli.mjs +2 -621
- package/scripts/package-smoke.mjs +4 -1
- package/scripts/preview.mjs +13 -37
- package/scripts/size-budget.mjs +5 -2
- package/scripts/vite.default.mjs +11 -0
- package/starters/default/.editorconfig +12 -0
- package/starters/default/README.md +74 -0
- package/starters/default/eslint.config.mjs +256 -0
- package/starters/default/index.html +13 -0
- package/starters/default/package.json +30 -0
- package/starters/default/public/favicon.svg +4 -0
- package/starters/default/src/app.routes.ts +39 -0
- package/starters/default/src/layouts/app-shell.layout.ts +35 -0
- package/starters/default/src/layouts/auth-shell.layout.ts +17 -0
- package/starters/default/src/main.ts +16 -0
- package/starters/default/src/modules/auth/_contracts/auth-api.types.ts +17 -0
- package/starters/default/src/modules/auth/auth.connector.ts +45 -0
- package/starters/default/src/modules/auth/auth.guard.ts +22 -0
- package/starters/default/src/modules/auth/auth.public.ts +9 -0
- package/starters/default/src/modules/auth/auth.routes.ts +8 -0
- package/starters/default/src/modules/auth/auth.service.ts +71 -0
- package/starters/default/src/modules/auth/auth.types.ts +15 -0
- package/starters/default/src/modules/auth/login.page.ts +62 -0
- package/starters/default/src/modules/billing/_contracts/stripe.types.ts +17 -0
- package/starters/default/src/modules/billing/api/stripe.connector.ts +71 -0
- package/starters/default/src/modules/billing/billing.public.ts +5 -0
- package/starters/default/src/modules/billing/billing.routes.ts +9 -0
- package/starters/default/src/modules/billing/billing.types.ts +15 -0
- package/starters/default/src/modules/billing/components/invoice-status-badge.component.ts +43 -0
- package/starters/default/src/modules/billing/data/invoices.resource.ts +35 -0
- package/starters/default/src/modules/billing/pages/invoice-detail.page.ts +70 -0
- package/starters/default/src/modules/billing/pages/invoices-list.page.ts +73 -0
- package/starters/default/src/modules/home/home.page.ts +34 -0
- package/starters/default/src/modules/home/not-found.page.ts +11 -0
- package/starters/default/src/shared/http/http-client.ts +86 -0
- package/starters/default/src/shared/http/http-error.ts +37 -0
- package/starters/default/src/shared/http/interceptors.ts +59 -0
- package/starters/default/src/shared/lib/format-date.ts +19 -0
- package/starters/default/src/shared/styles/content.css +70 -0
- package/starters/default/src/shared/styles/reset.css +32 -0
- package/starters/default/src/shared/styles/shell.css +57 -0
- package/starters/default/src/shared/styles/tokens.css +44 -0
- package/starters/default/src/shared/ui/x-button.component.ts +49 -0
- package/starters/default/src/shared/ui/x-spinner.component.ts +22 -0
- package/starters/default/src/styles.d.ts +1 -0
- package/starters/default/src/vite-env.d.ts +1 -0
- package/starters/default/tsconfig.json +24 -0
- package/starters/default/vite.config.ts +9 -0
- package/MADO_V1_PLAN.md +0 -179
- package/ROADMAP.md +0 -178
- package/dist/src/html.d.ts +0 -18
- package/dist/src/html.js +0 -17
- package/dist/src/html.js.map +0 -1
- package/dist/src/router.d.ts +0 -13
- package/dist/src/router.js +0 -13
- package/dist/src/router.js.map +0 -1
- package/scripts/bundle.mjs +0 -212
- package/scripts/llm-zero-history-smoke.mjs +0 -93
- package/scripts/new.mjs +0 -80
- package/scripts/showcase-regression.mjs +0 -392
- package/server/serve.mjs +0 -455
- package/starters/admin/README.md +0 -63
- package/starters/admin/index.html +0 -28
- package/starters/admin/mado.config.json +0 -22
- package/starters/admin/package.json +0 -24
- package/starters/admin/public/favicon.svg +0 -4
- package/starters/admin/src/components/x-button.ts +0 -82
- package/starters/admin/src/components/x-input.ts +0 -105
- package/starters/admin/src/layouts/app.ts +0 -101
- package/starters/admin/src/layouts/auth.ts +0 -41
- package/starters/admin/src/lib/api.ts +0 -184
- package/starters/admin/src/lib/auth.ts +0 -83
- package/starters/admin/src/main.ts +0 -15
- package/starters/admin/src/pages/admin/dashboard.ts +0 -48
- package/starters/admin/src/pages/admin/order-detail.ts +0 -80
- package/starters/admin/src/pages/admin/orders.ts +0 -117
- package/starters/admin/src/pages/home.ts +0 -34
- package/starters/admin/src/pages/login.ts +0 -70
- package/starters/admin/src/pages/not-found.ts +0 -12
- package/starters/admin/src/routes.ts +0 -40
- package/starters/admin/src/styles/global.ts +0 -86
- package/starters/admin/tsconfig.json +0 -15
- package/starters/crud/README.md +0 -33
- package/starters/crud/index.html +0 -28
- package/starters/crud/mado.config.json +0 -20
- package/starters/crud/package.json +0 -24
- package/starters/crud/src/components/app-shell.ts +0 -56
- package/starters/crud/src/components/ticket-detail.ts +0 -33
- package/starters/crud/src/components/ticket-form.ts +0 -69
- package/starters/crud/src/components/ticket-list.ts +0 -66
- package/starters/crud/src/lib/api.ts +0 -76
- package/starters/crud/src/main.ts +0 -9
- package/starters/crud/src/pages/home.ts +0 -34
- package/starters/crud/src/pages/not-found.ts +0 -12
- package/starters/crud/src/pages/ticket-detail.ts +0 -7
- package/starters/crud/src/pages/ticket-new.ts +0 -7
- package/starters/crud/src/pages/tickets.ts +0 -7
- package/starters/crud/src/routes.ts +0 -11
- package/starters/crud/src/styles/global.ts +0 -155
- package/starters/crud/tsconfig.json +0 -15
- package/starters/minimal/README.md +0 -21
- package/starters/minimal/index.html +0 -28
- package/starters/minimal/mado.config.json +0 -20
- package/starters/minimal/package.json +0 -24
- package/starters/minimal/src/components/app-counter.ts +0 -31
- package/starters/minimal/src/main.ts +0 -9
- package/starters/minimal/src/pages/home.ts +0 -35
- package/starters/minimal/src/pages/not-found.ts +0 -14
- package/starters/minimal/src/routes.ts +0 -8
- package/starters/minimal/src/styles/global.ts +0 -60
- package/starters/minimal/tsconfig.json +0 -15
- package/templates/page-detail.ts +0 -63
- package/templates/page-form.ts +0 -94
- package/templates/page-list.ts +0 -79
package/AGENTS.md
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
> This file is read by AI agents in IDEs (Cursor, Cline, Copilot, Continue, etc.).
|
|
4
4
|
> Goal: prevent them from generating React-like code where Mado should be used.
|
|
5
5
|
>
|
|
6
|
-
> The v0.6 product-surface push is archived in
|
|
7
|
-
> [`MADO_V1_PLAN.md`](./MADO_V1_PLAN.md). New work should follow `ROADMAP.md`
|
|
8
6
|
> / `TODO.md` unless the user explicitly resumes that tracker.
|
|
9
7
|
|
|
10
8
|
## Project at a glance
|
|
@@ -12,7 +10,7 @@
|
|
|
12
10
|
- **Mado** — a calm browser-native SPA framework for internal tools, admin panels and business apps.
|
|
13
11
|
- Built on Web Components + signals + tagged-template `html`.
|
|
14
12
|
- Zero runtime dependencies. Generated apps use dev tooling (`typescript`,
|
|
15
|
-
|
|
13
|
+
`vite`, `linkedom`) for dev/build/bake/release.
|
|
16
14
|
- Small TypeScript core in `src/`; production size budgets are enforced in CI.
|
|
17
15
|
|
|
18
16
|
## HARD RULES — violation = bug
|
|
@@ -210,13 +208,14 @@ or `<title>`. Keep SVG internals in one `<svg>...</svg>` template.
|
|
|
210
208
|
### 8. Routing — `routes()` + `page()`
|
|
211
209
|
|
|
212
210
|
```ts
|
|
213
|
-
// routes.ts — manifest
|
|
211
|
+
// app.routes.ts — app manifest
|
|
214
212
|
import { routes } from "@madojs/mado";
|
|
215
|
-
export
|
|
216
|
-
"/": () => import("./
|
|
217
|
-
"/users/:id": () => import("./pages/user.js"),
|
|
218
|
-
"*": () => import("./
|
|
219
|
-
}
|
|
213
|
+
export const manifest = {
|
|
214
|
+
"/": () => import("./modules/home/home.page.js"),
|
|
215
|
+
"/users/:id": () => import("./modules/users/pages/user.page.js"),
|
|
216
|
+
"*": () => import("./modules/home/not-found.page.js"),
|
|
217
|
+
};
|
|
218
|
+
export default routes(manifest);
|
|
220
219
|
|
|
221
220
|
// page file
|
|
222
221
|
import { page, html } from "@madojs/mado";
|
|
@@ -226,8 +225,8 @@ export default page<{ id: string }>({
|
|
|
226
225
|
});
|
|
227
226
|
```
|
|
228
227
|
|
|
229
|
-
- Each page is a **separate file**
|
|
230
|
-
- Import via `() => import("./pages/foo.js")` — this enables code-splitting via ESM.
|
|
228
|
+
- Each page is a **separate file** under `src/modules/<module>/` with `export default page({...})`.
|
|
229
|
+
- Import via `() => import("./modules/<module>/pages/foo.page.js")` — this enables code-splitting via ESM.
|
|
231
230
|
- Programmatic navigation: `import { navigate } from "@madojs/mado"; navigate("/users/42")`.
|
|
232
231
|
- Layouts are declared in the route manifest via `layout()`. Treat
|
|
233
232
|
`layout.view({ child })` as a stateless wrapper around `${child}` and shared
|
|
@@ -399,7 +398,8 @@ not SSR with hydration and not a Next-style SSG runtime.
|
|
|
399
398
|
## SOFT GUIDELINES — recommended, but not critical
|
|
400
399
|
|
|
401
400
|
- **TypeScript strict.** Use `noUncheckedIndexedAccess`-aware code (with `!` or a type guard).
|
|
402
|
-
- **
|
|
401
|
+
- **Imports:** generated Vite apps may use extensionless local imports. Browser-native
|
|
402
|
+
package examples that run without Vite should use `.js` specifiers.
|
|
403
403
|
- **Public imports only.** App code imports from `@madojs/mado` and, when
|
|
404
404
|
needed, side-effect `@madojs/mado/devtools.js`. Other package subpaths and
|
|
405
405
|
`dist/src/*` are internal.
|
|
@@ -411,40 +411,38 @@ not SSR with hydration and not a Next-style SSG runtime.
|
|
|
411
411
|
|
|
412
412
|
```
|
|
413
413
|
src/
|
|
414
|
-
├── routes.ts ← route manifest, ONE file
|
|
415
414
|
├── main.ts ← entry: mount to #app
|
|
416
|
-
├──
|
|
417
|
-
├──
|
|
418
|
-
├──
|
|
419
|
-
└──
|
|
415
|
+
├── app.routes.ts ← app map, exports `manifest` + default routes(...)
|
|
416
|
+
├── layouts/ ← app-zone layout modules (`page({ child })`)
|
|
417
|
+
├── shared/ ← ui, http, lib, styles
|
|
418
|
+
└── modules/ ← bounded contexts with pages/data/api/services
|
|
420
419
|
```
|
|
421
420
|
|
|
422
421
|
## App architecture for LLM
|
|
423
422
|
|
|
424
423
|
When generating an app, prefer the blessed production shape from
|
|
425
|
-
`docs/en/10-app-architecture.md` and the `starters/
|
|
424
|
+
`docs/en/10-app-architecture.md` and the `starters/default/` example:
|
|
426
425
|
|
|
427
426
|
- `src/main.ts` mounts `routesApi.view` and imports only global styles,
|
|
428
427
|
providers, and tiny shared components.
|
|
429
|
-
- `src/routes.ts` exports both `manifest` and `default routes(manifest, ...)`.
|
|
428
|
+
- `src/app.routes.ts` exports both `manifest` and `default routes(manifest, ...)`.
|
|
430
429
|
- Put route wrappers in `src/layouts/` via `layout()`, not ad-hoc shell logic
|
|
431
430
|
inside every page.
|
|
432
|
-
- Put backend access in
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
components it renders.
|
|
431
|
+
- Put backend access in module `*.connector.ts` files over `shared/http`.
|
|
432
|
+
- Put one page per file under the starter's module/page convention; a page imports
|
|
433
|
+
the feature components it renders.
|
|
436
434
|
- Use `resource()` for reads, `mutation(..., { invalidates })` for writes,
|
|
437
435
|
and `useForm()` for form state/validation.
|
|
438
436
|
- Use `mado release` as the production path. `out/` is the only deploy
|
|
439
|
-
artifact;
|
|
437
|
+
artifact for apps; framework package tests still build `dist/src`.
|
|
440
438
|
|
|
441
439
|
## Where to find specific answers
|
|
442
440
|
|
|
443
441
|
| Question | File |
|
|
444
442
|
| -------------------------------- | -------------------------------- |
|
|
445
443
|
| How does reactivity work? | `src/signal.ts` (283 lines) |
|
|
446
|
-
| How are templates parsed? | `src/html
|
|
447
|
-
| How does the router work? | `src/router
|
|
444
|
+
| How are templates parsed? | `src/html/` |
|
|
445
|
+
| How does the router work? | `src/router/` |
|
|
448
446
|
| How does resource + cache work? | `src/resource.ts` (297 lines) |
|
|
449
447
|
| How do forms work? | `src/forms.ts` (212 lines) |
|
|
450
448
|
| How should an app be structured? | `docs/en/10-app-architecture.md` |
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,74 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.11.0 - 2026-06-21
|
|
6
|
+
|
|
7
|
+
Vite-era release. Mado keeps the browser-native runtime, but generated apps now
|
|
8
|
+
use Vite for dev/build/release instead of Mado maintaining its own app bundler.
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Vite plugin subpath.** `@madojs/mado/vite` exports `mado()`, the canonical
|
|
13
|
+
Vite plugin for app projects. It provides Mado defaults for app builds while
|
|
14
|
+
leaving runtime code dependency-free.
|
|
15
|
+
|
|
16
|
+
- **Canonical default starter.** `mado init` now scaffolds the single official
|
|
17
|
+
starter from `starters/default`: Vite config, `public/`, module-oriented app
|
|
18
|
+
structure, Shadow DOM-friendly CSS, CLI generator conventions, and no old
|
|
19
|
+
importmap/dist entry paths.
|
|
20
|
+
|
|
21
|
+
- **`mado new` generators.** The CLI can scaffold modules, pages, connectors,
|
|
22
|
+
resources, services, forms, components, guards, and layouts using the default
|
|
23
|
+
starter conventions.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **`mado dev` runs Vite.** Development now uses Vite's dev server instead of a
|
|
28
|
+
custom Mado dev server. Mado-specific HMR is intentionally simple full reload.
|
|
29
|
+
|
|
30
|
+
- **`mado release` is Vite-first.** Release now cleans `out/`, typechecks, runs
|
|
31
|
+
Vite build, bakes route HTML from the production `out/index.html`, writes
|
|
32
|
+
static host files, and precompresses assets.
|
|
33
|
+
|
|
34
|
+
- **Bake uses Vite module loading.** Route manifests are loaded through Vite's
|
|
35
|
+
module/SSR loader, so TypeScript, aliases, env handling, and plugin resolution
|
|
36
|
+
match the app build path.
|
|
37
|
+
|
|
38
|
+
- **Baked route HTML is written directly into `out/<route>/index.html`.**
|
|
39
|
+
`out/baked/` is no longer part of the default deploy artifact. Use
|
|
40
|
+
`mado release --keep-bake-dir` only when a debug copy is useful.
|
|
41
|
+
|
|
42
|
+
- **CLI internals were split into `scripts/cli/`.** The public `mado` binary is
|
|
43
|
+
unchanged, but command implementation is no longer one large script.
|
|
44
|
+
|
|
45
|
+
- **Tests are grouped by context.** Test files now live under `test/bake`,
|
|
46
|
+
`test/cli`, `test/html`, `test/package`, `test/router`, and `test/runtime`.
|
|
47
|
+
|
|
48
|
+
### Removed
|
|
49
|
+
|
|
50
|
+
- **Legacy app bundler and server code.** The custom bundle/server path and
|
|
51
|
+
config-loader compatibility layer were removed in favor of Vite.
|
|
52
|
+
|
|
53
|
+
- **Bundled examples and old starters.** Large examples were extracted out of
|
|
54
|
+
the package repository. `starters/admin`, `starters/crud`, and
|
|
55
|
+
`starters/minimal` were replaced by `starters/default`.
|
|
56
|
+
|
|
57
|
+
- **Legacy root artifacts.** The Docker/nginx deployment sample moved to
|
|
58
|
+
`docs/recipes/nginx/`, and archived v1 planning documents were removed from
|
|
59
|
+
the active repository surface.
|
|
60
|
+
|
|
61
|
+
- **Core compatibility aliases.** Legacy `src/html.ts` and `src/router.ts`
|
|
62
|
+
alias files were removed now that the pre-stable public surface has been
|
|
63
|
+
cleaned up.
|
|
64
|
+
|
|
65
|
+
### Docs
|
|
66
|
+
|
|
67
|
+
- Rewrote EN/RU/FR/UK docs around the new model: `index.html` is the Vite
|
|
68
|
+
entry, `public/` is static copy input, and `out/` is the deploy artifact.
|
|
69
|
+
- Updated architecture, routing, bake, deployment, testing, Shadow DOM/style,
|
|
70
|
+
LLM guidance, and starter docs to point at the canonical default starter.
|
|
71
|
+
- Synced `TODO.md` into a small backlog instead of a stale roadmap-style list.
|
|
72
|
+
|
|
5
73
|
## 0.10.1 - 2026-06-12
|
|
6
74
|
|
|
7
75
|
Patch release for the production bake/preview path.
|
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
[](https://github.com/madojs/mado/actions/workflows/ci.yml)
|
|
24
24
|
[](https://github.com/madojs/mado/actions/workflows/browser.yml)
|
|
25
25
|
[](./LICENSE)
|
|
26
|
+
[](https://www.paypal.com/paypalme/tsekhmister)
|
|
26
27
|
|
|
27
28
|
Mado is a browser-native SPA framework for teams that want routing, forms,
|
|
28
29
|
data fetching and state management — without turning their frontend into an
|
|
@@ -85,8 +86,8 @@ Mado stays useful by saying no. These are intentionally out of scope:
|
|
|
85
86
|
|
|
86
87
|
- **vs Lit** — Lit is better for design systems. Mado is for whole apps:
|
|
87
88
|
router, data, forms and prerender in one package, no assembly required.
|
|
88
|
-
- **vs Solid** — Solid is faster and more mature.
|
|
89
|
-
|
|
89
|
+
- **vs Solid** — Solid is faster and more mature. Mado keeps a smaller runtime
|
|
90
|
+
and uses Vite only as the development/build transport layer.
|
|
90
91
|
- **vs htmx** — htmx is excellent when your backend owns HTML. Mado is for
|
|
91
92
|
cases where you want a real SPA: local state, optimistic updates, cached
|
|
92
93
|
resources, lazy modules and persisted UI state.
|
|
@@ -96,8 +97,8 @@ Mado stays useful by saying no. These are intentionally out of scope:
|
|
|
96
97
|
Routing, forms, state, data fetching and prerendering — without ecosystem tax:
|
|
97
98
|
|
|
98
99
|
- No runtime dependencies to audit, update or break
|
|
99
|
-
-
|
|
100
|
-
- Fewer moving parts to debug
|
|
100
|
+
- Vite-powered dev/build without a framework-specific bundler to maintain
|
|
101
|
+
- Fewer Mado-specific moving parts to debug
|
|
101
102
|
- Compact API surface you can learn in a day
|
|
102
103
|
- Lower long-term cognitive load
|
|
103
104
|
|
|
@@ -105,7 +106,7 @@ Routing, forms, state, data fetching and prerendering — without ecosystem tax:
|
|
|
105
106
|
Runtime budget:
|
|
106
107
|
enforced in CI with npm run size
|
|
107
108
|
Runtime dependencies: 0
|
|
108
|
-
Required dev dependencies: typescript,
|
|
109
|
+
Required dev dependencies: typescript, vite, linkedom
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
## Quick Start
|
|
@@ -119,34 +120,10 @@ npm install
|
|
|
119
120
|
npm run dev
|
|
120
121
|
```
|
|
121
122
|
|
|
122
|
-
The
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
npm exec --package @madojs/mado@latest -- mado init dashboard --starter admin
|
|
127
|
-
cd dashboard
|
|
128
|
-
npm install
|
|
129
|
-
npm run dev
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
The CRUD starter is a compact resource/mutation/forms example:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
npm exec --package @madojs/mado@latest -- mado init my-app --starter crud
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Try the flagship example
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
git clone https://github.com/madojs/mado.git
|
|
142
|
-
cd mado
|
|
143
|
-
npm install
|
|
144
|
-
npm run build
|
|
145
|
-
npm run serve -- showcase
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
The showcase is a CRM-shaped pressure app with auth, tables, filters, nested
|
|
149
|
-
routes, context services, forms and real data patterns.
|
|
123
|
+
The default starter is the blessed production shape: app-zone layouts, guards,
|
|
124
|
+
module boundaries, API connectors, resources, forms and a small admin shell.
|
|
125
|
+
Larger demos live outside this package in the separate `madojs-examples`
|
|
126
|
+
workspace/repository.
|
|
150
127
|
|
|
151
128
|
## How it works
|
|
152
129
|
|
|
@@ -204,7 +181,7 @@ export default routes({
|
|
|
204
181
|
});
|
|
205
182
|
```
|
|
206
183
|
|
|
207
|
-
Lazy loading,
|
|
184
|
+
Lazy loading, layout groups, query params, guards, hover prefetch, scroll
|
|
208
185
|
restoration, error boundary, View Transitions.
|
|
209
186
|
|
|
210
187
|
### Data — resource + mutation
|
|
@@ -266,13 +243,12 @@ mado release
|
|
|
266
243
|
```
|
|
267
244
|
|
|
268
245
|
Build-time prerender of routes into static HTML with meta tags and JSON-LD.
|
|
269
|
-
No hydration runtime.
|
|
270
|
-
PoC in [`examples/cloudflare`](./examples/cloudflare/).
|
|
246
|
+
No hydration runtime. Keep personalized or real-time content in the client SPA.
|
|
271
247
|
|
|
272
248
|
## Production
|
|
273
249
|
|
|
274
250
|
```bash
|
|
275
|
-
mado release # typecheck + build +
|
|
251
|
+
mado release # typecheck + vite build + bake + static deploy files -> out/
|
|
276
252
|
mado preview # serve out/ like a static host
|
|
277
253
|
```
|
|
278
254
|
|
|
@@ -283,11 +259,11 @@ any static CDN.
|
|
|
283
259
|
|
|
284
260
|
```bash
|
|
285
261
|
mado init my-app # scaffold new app
|
|
286
|
-
mado
|
|
287
|
-
mado
|
|
288
|
-
mado build # tsc compile
|
|
262
|
+
mado dev # Vite dev server
|
|
263
|
+
mado build # tsc compile (framework/package work)
|
|
289
264
|
mado typecheck # type check without emit
|
|
290
265
|
mado test # run test suite
|
|
266
|
+
mado new module billing # scaffold canonical app files
|
|
291
267
|
mado release # full production build
|
|
292
268
|
mado preview # serve production build locally
|
|
293
269
|
```
|
|
@@ -313,11 +289,8 @@ AI-agent entrypoints: [AGENTS.md](./AGENTS.md) · [llms.txt](./llms.txt)
|
|
|
313
289
|
|
|
314
290
|
## Examples
|
|
315
291
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
- [`examples/tickets`](./examples/tickets/) — CRUD validation app.
|
|
319
|
-
- [`examples/basic`](./examples/basic/) — minimal API tour.
|
|
320
|
-
- [`examples/cloudflare`](./examples/cloudflare/) — edge prerender PoC.
|
|
292
|
+
The large examples are kept outside the framework package in `madojs-examples`
|
|
293
|
+
so the core repo stays focused on runtime, tooling, starter and tests.
|
|
321
294
|
|
|
322
295
|
## Known Limits
|
|
323
296
|
|
package/TODO.md
CHANGED
|
@@ -1,75 +1,79 @@
|
|
|
1
1
|
# TODO
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
Backlog, not a roadmap. Keep this file small and honest: ideas stay here only
|
|
4
|
+
while they are plausible next work. Promote concrete work to issues or release
|
|
5
|
+
notes when it becomes real.
|
|
6
|
+
|
|
7
|
+
## Before Public Demo / Release
|
|
8
|
+
|
|
9
|
+
- [ ] Run the default starter as a real demo app and feed every friction point
|
|
10
|
+
back into docs, CLI generators, or starter structure.
|
|
11
|
+
- [ ] Add focused tests for every `mado new` generator template.
|
|
12
|
+
- [ ] Audit EN/RU/FR docs after each tooling/runtime change; no old `dist/`,
|
|
13
|
+
`tsc-only`, custom-bundler, or legacy example wording should remain.
|
|
14
|
+
- [ ] Keep `mado preview` boring and reliable inside generated apps.
|
|
15
|
+
- [ ] Add a short maintainer-only release checklist if manual npm publish stays
|
|
16
|
+
in use.
|
|
17
|
+
|
|
18
|
+
## CLI / DX
|
|
19
|
+
|
|
20
|
+
- [ ] Decide whether `npx mado create my-app` is worth adding after package
|
|
21
|
+
naming and install friction are clear.
|
|
22
|
+
- [ ] Consider short aliases over `mado new` only after real usage shows they
|
|
23
|
+
save enough typing (`mado page`, `mado component`, etc.).
|
|
24
|
+
- [ ] Split preview/static-server internals only if `scripts/preview.mjs` grows.
|
|
23
25
|
- [ ] Typed navigation inferred from route patterns.
|
|
24
|
-
- [ ]
|
|
26
|
+
- [ ] Editor highlighting docs should prefer existing tooling first; build a
|
|
27
|
+
Mado-specific VS Code extension only if current HTML/CSS template support is
|
|
28
|
+
not enough.
|
|
25
29
|
|
|
26
|
-
## Runtime
|
|
30
|
+
## Runtime / App API
|
|
27
31
|
|
|
28
|
-
- [ ]
|
|
29
|
-
- [ ] `<x-async>`
|
|
30
|
-
- [ ] `liveResource()` over SSE / WebSocket.
|
|
32
|
+
- [ ] Mutation rollback helper on top of `resource().mutate()` and `mutation()`.
|
|
33
|
+
- [ ] Document loading/error shell patterns before adding an `<x-async>` API.
|
|
34
|
+
- [ ] `liveResource()` over SSE / WebSocket after a real app needs live data.
|
|
31
35
|
- [ ] i18n helper once browser-native message formatting is realistic.
|
|
32
36
|
- [ ] Accessibility helpers: focus trap, live region, click outside.
|
|
33
37
|
|
|
34
38
|
## Styling
|
|
35
39
|
|
|
36
40
|
- [ ] Docs for `::part`, `::slotted()` and `:host-context()`.
|
|
37
|
-
- [ ]
|
|
41
|
+
- [ ] Document Vite CSS options, including `css.transformer: "lightningcss"`,
|
|
42
|
+
for apps that want Lightning CSS.
|
|
43
|
+
- [ ] Optional tiny utilities stylesheet only if the starter/demo repeats the
|
|
44
|
+
same small classes often enough to justify it.
|
|
45
|
+
- [ ] CSP-friendly style mode.
|
|
46
|
+
|
|
47
|
+
## Bake / Smart Static
|
|
48
|
+
|
|
49
|
+
- [ ] Add bake regression coverage for layout groups, dynamic params, sitemap,
|
|
50
|
+
and hard-refresh deploy paths.
|
|
51
|
+
- [ ] Incremental bake cache after a real content-heavy app needs it.
|
|
52
|
+
- [ ] Webhook re-bake endpoint only after incremental bake has a concrete use.
|
|
53
|
+
- [ ] RSS / Atom feed generator for docs/blog/demo content.
|
|
38
54
|
|
|
39
55
|
## Operations
|
|
40
56
|
|
|
41
57
|
- [ ] Benchmark against Lit / Solid / Preact.
|
|
42
|
-
- [ ] `eslint-plugin-mado` rules for common mistakes.
|
|
43
|
-
- [ ] CSP-friendly style mode.
|
|
44
|
-
- [ ] PWA scaffold.
|
|
45
|
-
- [ ] Schema validation hook for resources.
|
|
46
|
-
- [ ] Timeout / retry options for resource fetchers.
|
|
47
58
|
- [ ] Source-map notes and a minimal dev error overlay.
|
|
59
|
+
- [ ] `eslint-plugin-mado` rules only if docs/starter conventions are not enough
|
|
60
|
+
to prevent recurring mistakes.
|
|
61
|
+
- [ ] Timeout / retry options for resource fetchers after real API friction.
|
|
62
|
+
- [ ] Schema validation hook for resources after choosing a dependency-free
|
|
63
|
+
story or a clearly optional integration.
|
|
64
|
+
- [ ] PWA scaffold only if the public demo or a real app needs offline behavior.
|
|
48
65
|
|
|
49
|
-
|
|
50
|
-
## Bake / Smart Static
|
|
51
|
-
|
|
52
|
-
- [ ] Webhook re-bake endpoint.
|
|
53
|
-
- [ ] Incremental bake cache.
|
|
54
|
-
- [ ] RSS / Atom feed generator.
|
|
55
|
-
- [ ] Nested-route bake support.
|
|
56
|
-
|
|
57
|
-
## Community
|
|
66
|
+
## Community / GitHub
|
|
58
67
|
|
|
59
68
|
- [ ] Minimal landing site built with Mado.
|
|
60
|
-
- [ ] Case study: real React page → Mado + bake.
|
|
61
69
|
- [ ] Public live demo: CRUD starter and showcase hosted from Mado itself.
|
|
70
|
+
- [ ] Case study: real React page -> Mado + bake.
|
|
62
71
|
- [ ] Convert contribution-ready TODO items into GitHub issues with labels
|
|
63
72
|
(`good first issue`, `help wanted`, `docs`, `cli`, `ci`) after the first
|
|
64
73
|
public feedback round.
|
|
65
|
-
|
|
66
|
-
## Release / GitHub
|
|
67
|
-
|
|
68
74
|
- [ ] Configure npm Trusted Publishing for GitHub Actions after verifying the
|
|
69
75
|
first manual publishes.
|
|
70
76
|
- [ ] Decide the release flow: continue manual npm publish for patch releases or
|
|
71
77
|
publish from signed `v*` tags through `.github/workflows/release.yml`.
|
|
72
|
-
- [ ] Improve generated release notes
|
|
73
|
-
|
|
74
|
-
- [ ] Add a short maintainer-only release checklist outside public docs if the
|
|
75
|
-
manual flow stays in use.
|
|
78
|
+
- [ ] Improve generated release notes with PR links/authors when releases start
|
|
79
|
+
going through pull requests.
|
package/dist/src/component.d.ts
CHANGED
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* styles will be scoped via @scope (or a tag-prefix fallback).
|
|
17
17
|
*/
|
|
18
18
|
import { type Signal, type Disposer } from "./signal.js";
|
|
19
|
-
import { html
|
|
19
|
+
import { html } from "./html/template.js";
|
|
20
|
+
import type { TemplateResult } from "./html/template-types.js";
|
|
20
21
|
import { type CSSResult } from "./css.js";
|
|
21
22
|
export interface ComponentContext {
|
|
22
23
|
host: HTMLElement;
|
package/dist/src/component.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* styles will be scoped via @scope (or a tag-prefix fallback).
|
|
17
17
|
*/
|
|
18
18
|
import { signal, effect } from "./signal.js";
|
|
19
|
-
import { html, render } from "./html.js";
|
|
19
|
+
import { html, render } from "./html/template.js";
|
|
20
20
|
import { adopt, scopeStyles } from "./css.js";
|
|
21
21
|
import { createLifecycle, runInLifecycle, } from "./lifecycle.js";
|
|
22
22
|
import { warnOnce } from "./diagnostics.js";
|
|
@@ -49,6 +49,7 @@ export function component(tagName, setup, options = {}) {
|
|
|
49
49
|
// re-inserted in the same tick (a keyed move via insertBefore).
|
|
50
50
|
#teardownQueued = false;
|
|
51
51
|
#attrSignals = new Map();
|
|
52
|
+
#attrDefaults = new Map();
|
|
52
53
|
constructor() {
|
|
53
54
|
super();
|
|
54
55
|
this.#root = useShadow ? this.attachShadow({ mode: "open" }) : this;
|
|
@@ -85,6 +86,7 @@ export function component(tagName, setup, options = {}) {
|
|
|
85
86
|
attr(name, defaultValue = "") {
|
|
86
87
|
let s = host.#attrSignals.get(name);
|
|
87
88
|
if (!s) {
|
|
89
|
+
host.#attrDefaults.set(name, defaultValue);
|
|
88
90
|
s = signal(host.getAttribute(name) ?? defaultValue);
|
|
89
91
|
host.#attrSignals.set(name, s);
|
|
90
92
|
}
|
|
@@ -99,8 +101,9 @@ export function component(tagName, setup, options = {}) {
|
|
|
99
101
|
const obs = new MutationObserver((mutations) => {
|
|
100
102
|
for (const m of mutations) {
|
|
101
103
|
const s = this.#attrSignals.get(m.attributeName);
|
|
104
|
+
const fallback = this.#attrDefaults.get(m.attributeName) ?? "";
|
|
102
105
|
if (s)
|
|
103
|
-
s.set(this.getAttribute(m.attributeName) ??
|
|
106
|
+
s.set(this.getAttribute(m.attributeName) ?? fallback);
|
|
104
107
|
}
|
|
105
108
|
});
|
|
106
109
|
obs.observe(this, { attributes: true, attributeFilter: attrNames });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/component.ts"],"names":[],"mappings":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AAS,mBAAmB,CAAC,MAAmB;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC/B,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,GAAG,KAAK,CAAC,CAAC;AAC3E,CAAC;AAED,yBAAyB;AACzB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/src/each.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Template usage:
|
|
19
19
|
* html`<ul>${() => each(items(), t => t.id, t => html`<li>${t.text}</li>`)}</ul>`
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
21
|
+
import type { TemplateResult } from "./html/template-types.js";
|
|
22
22
|
export type EachKey = string | number;
|
|
23
23
|
/**
|
|
24
24
|
* Marker recognised by the html binder.
|
package/dist/src/each.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* Template usage:
|
|
19
19
|
* html`<ul>${() => each(items(), t => t.id, t => html`<li>${t.text}</li>`)}</ul>`
|
|
20
20
|
*/
|
|
21
|
-
import { html } from "./html.js";
|
|
21
|
+
import { html } from "./html/template.js";
|
|
22
22
|
export const isEachResult = (v) => typeof v === "object" &&
|
|
23
23
|
v !== null &&
|
|
24
24
|
v._madoEach === true;
|
package/dist/src/each.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"each.js","sourceRoot":"","sources":["../../src/each.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"each.js","sourceRoot":"","sources":["../../src/each.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAgB1C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAU,EAAmB,EAAE,CAC1D,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,KAAK,IAAI;IACT,CAAgB,CAAC,SAAS,KAAK,IAAI,CAAC;AAEvC,MAAM,UAAU,IAAI,CAClB,KAAmB,EACnB,KAA0C,EAC1C,MAAkD;IAElD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAClB,KAAmB,EACnB,KAA0C,EAC1C,MAAkD;IAElD,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;AAC7C,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,17 +9,22 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { signal, computed, effect, untracked, batch, flushSync, } from "./signal.js";
|
|
11
11
|
export type { Signal, Computed, ComputedOptions, Disposer } from "./signal.js";
|
|
12
|
-
export { html, render,
|
|
13
|
-
export
|
|
12
|
+
export { html, render, instantiate } from "./html/template.js";
|
|
13
|
+
export { unsafeHTML, ref, classMap, styleMap, isHtmlDirective, } from "./html/bindings.js";
|
|
14
|
+
export type { TemplateResult } from "./html/template-types.js";
|
|
15
|
+
export type { HtmlDirective, UnsafeHTMLDirective, RefCallback, RefDirective, ClassMap, ClassMapDirective, StyleMap, StyleMapDirective, } from "./html/bindings.js";
|
|
14
16
|
export { each, list } from "./each.js";
|
|
15
17
|
export { component } from "./component.js";
|
|
16
18
|
export type { ComponentContext, ComponentOptions, SetupFn, StyleInput, } from "./component.js";
|
|
17
19
|
export { css, cssVars, adopt, scopeStyles } from "./css.js";
|
|
18
20
|
export type { CSSResult } from "./css.js";
|
|
19
|
-
export { router,
|
|
20
|
-
export
|
|
21
|
-
export {
|
|
22
|
-
export type {
|
|
21
|
+
export { router, queryParam, navigate, } from "./router/navigation.js";
|
|
22
|
+
export { routes, prefetchPath } from "./router/manifest.js";
|
|
23
|
+
export type { RouterApi, QueryParam, QuerySignal, } from "./router/navigation.js";
|
|
24
|
+
export type { RouteHandler, RouteParams, Routes, RoutesMap, } from "./router/match.js";
|
|
25
|
+
export type { RoutesOptions } from "./router/manifest.js";
|
|
26
|
+
export { page, layout, isPage, isLayoutGroup } from "./page.js";
|
|
27
|
+
export type { Page, PageContext, PageData, RouteEntry, LayoutRoutes, HeadMeta, BakeConfig, Guard, GuardResult, } from "./page.js";
|
|
23
28
|
export { applyHead } from "./head.js";
|
|
24
29
|
export { resource, mutation, invalidate, jsonFetcher, HttpError, } from "./resource.js";
|
|
25
30
|
export type { Resource, ResourceOptions, Mutation, MutationOptions, } from "./resource.js";
|
package/dist/src/index.js
CHANGED
|
@@ -10,15 +10,17 @@
|
|
|
10
10
|
// --- core ---
|
|
11
11
|
export { signal, computed, effect, untracked, batch, flushSync, } from "./signal.js";
|
|
12
12
|
// --- rendering ---
|
|
13
|
-
export { html, render,
|
|
13
|
+
export { html, render, instantiate } from "./html/template.js";
|
|
14
|
+
export { unsafeHTML, ref, classMap, styleMap, isHtmlDirective, } from "./html/bindings.js";
|
|
14
15
|
export { each, list } from "./each.js";
|
|
15
16
|
// --- components ---
|
|
16
17
|
export { component } from "./component.js";
|
|
17
18
|
// --- styles ---
|
|
18
19
|
export { css, cssVars, adopt, scopeStyles } from "./css.js";
|
|
19
20
|
// --- routing ---
|
|
20
|
-
export { router,
|
|
21
|
-
export {
|
|
21
|
+
export { router, queryParam, navigate, } from "./router/navigation.js";
|
|
22
|
+
export { routes, prefetchPath } from "./router/manifest.js";
|
|
23
|
+
export { page, layout, isPage, isLayoutGroup } from "./page.js";
|
|
22
24
|
export { applyHead } from "./head.js";
|
|
23
25
|
// --- data ---
|
|
24
26
|
export { resource, mutation, invalidate, jsonFetcher, HttpError, } from "./resource.js";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAe;AACf,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,SAAS,GACV,MAAM,aAAa,CAAC;AAGrB,oBAAoB;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAe;AACf,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,SAAS,GACV,MAAM,aAAa,CAAC;AAGrB,oBAAoB;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAa5B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAqB;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAQ3C,iBAAiB;AACjB,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5D,kBAAkB;AAClB,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAc5D,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAahE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,eAAe;AACf,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AAQvB,gBAAgB;AAChB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAcrC,aAAa;AACb,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG9D,sBAAsB;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,eAAe;AACf,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,mCAAmC;AACnC,EAAE;AACF,4EAA4E;AAC5E,8DAA8D;AAC9D,2DAA2D;AAC3D,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
|
package/dist/src/lazy.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Loading is cached (one import() per loader reference).
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import type { TemplateResult } from "./html/template-types.js";
|
|
21
21
|
export interface LazyOptions<P> {
|
|
22
22
|
/** What to show while the module is loading. */
|
|
23
23
|
fallback?: (props: P) => TemplateResult;
|
package/dist/src/lazy.js
CHANGED