@madojs/mado 0.10.1 → 0.11.1

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.
Files changed (219) hide show
  1. package/AGENTS.md +24 -26
  2. package/CHANGELOG.md +95 -0
  3. package/README.md +22 -47
  4. package/TODO.md +52 -48
  5. package/dist/src/component.d.ts +2 -1
  6. package/dist/src/component.js +5 -2
  7. package/dist/src/component.js.map +1 -1
  8. package/dist/src/each.d.ts +1 -1
  9. package/dist/src/each.js +1 -1
  10. package/dist/src/each.js.map +1 -1
  11. package/dist/src/html/bindings.js +3 -3
  12. package/dist/src/html/bindings.js.map +1 -1
  13. package/dist/src/index.d.ts +11 -6
  14. package/dist/src/index.js +5 -3
  15. package/dist/src/index.js.map +1 -1
  16. package/dist/src/lazy.d.ts +1 -1
  17. package/dist/src/lazy.js +1 -1
  18. package/dist/src/lazy.js.map +1 -1
  19. package/dist/src/page.d.ts +17 -21
  20. package/dist/src/page.js +7 -12
  21. package/dist/src/page.js.map +1 -1
  22. package/dist/src/router/manifest.d.ts +1 -1
  23. package/dist/src/router/manifest.js +21 -13
  24. package/dist/src/router/manifest.js.map +1 -1
  25. package/dist/src/router/match.d.ts +2 -2
  26. package/dist/src/router/match.js +3 -3
  27. package/dist/src/router/match.js.map +1 -1
  28. package/dist/src/router/navigation.js +1 -1
  29. package/dist/src/router/navigation.js.map +1 -1
  30. package/dist/src/vite/index.d.ts +10 -0
  31. package/dist/src/vite/index.js +33 -0
  32. package/dist/src/vite/index.js.map +1 -0
  33. package/docs/en/00-the-mado-way.md +25 -12
  34. package/docs/en/01-routing.md +90 -142
  35. package/docs/en/02-project-layout.md +59 -53
  36. package/docs/en/03-static-bake.md +5 -6
  37. package/docs/en/05-why-mado.md +6 -6
  38. package/docs/en/06-for-backenders.md +18 -22
  39. package/docs/en/08-llm-zero-history-test.md +9 -14
  40. package/docs/en/09-shadow-vs-light-dom.md +28 -36
  41. package/docs/en/10-app-architecture.md +158 -96
  42. package/docs/en/11-layouts.md +22 -24
  43. package/docs/en/12-auth-and-api.md +89 -182
  44. package/docs/en/13-deployment.md +18 -22
  45. package/docs/en/14-testing.md +4 -4
  46. package/docs/en/16-bake-cookbook.md +11 -12
  47. package/docs/en/18-api-freeze-map.md +6 -4
  48. package/docs/en/20-v1-stability.md +1 -1
  49. package/docs/fr/00-the-mado-way.md +55 -90
  50. package/docs/fr/01-routing.md +70 -152
  51. package/docs/fr/02-project-layout.md +61 -42
  52. package/docs/fr/03-static-bake.md +1 -1
  53. package/docs/fr/05-why-mado.md +6 -6
  54. package/docs/fr/06-for-backenders.md +7 -7
  55. package/docs/fr/08-llm-zero-history-test.md +21 -48
  56. package/docs/fr/09-shadow-vs-light-dom.md +43 -162
  57. package/docs/fr/10-app-architecture.md +110 -33
  58. package/docs/fr/11-layouts.md +24 -12
  59. package/docs/fr/12-auth-and-api.md +63 -22
  60. package/docs/fr/13-deployment.md +7 -10
  61. package/docs/fr/14-testing.md +1 -1
  62. package/docs/fr/16-bake-cookbook.md +2 -2
  63. package/docs/fr/18-api-freeze-map.md +1 -1
  64. package/docs/fr/20-v1-stability.md +1 -1
  65. package/docs/recipes/nginx/README.md +13 -0
  66. package/docs/ru/00-the-mado-way.md +53 -75
  67. package/docs/ru/01-routing.md +68 -143
  68. package/docs/ru/02-project-layout.md +61 -41
  69. package/docs/ru/03-static-bake.md +2 -2
  70. package/docs/ru/05-why-mado.md +6 -6
  71. package/docs/ru/06-for-backenders.md +7 -7
  72. package/docs/ru/08-llm-zero-history-test.md +9 -14
  73. package/docs/ru/09-shadow-vs-light-dom.md +43 -178
  74. package/docs/ru/10-app-architecture.md +115 -63
  75. package/docs/ru/11-layouts.md +24 -24
  76. package/docs/ru/12-auth-and-api.md +57 -35
  77. package/docs/ru/13-deployment.md +7 -11
  78. package/docs/ru/14-testing.md +1 -1
  79. package/docs/ru/16-bake-cookbook.md +12 -6
  80. package/docs/ru/18-api-freeze-map.md +5 -3
  81. package/docs/ru/20-v1-stability.md +1 -1
  82. package/docs/uk/00-the-mado-way.md +70 -44
  83. package/docs/uk/01-routing.md +41 -47
  84. package/docs/uk/02-project-layout.md +68 -41
  85. package/docs/uk/03-static-bake.md +1 -2
  86. package/docs/uk/06-for-backenders.md +3 -3
  87. package/docs/uk/08-llm-zero-history-test.md +22 -24
  88. package/docs/uk/09-shadow-vs-light-dom.md +37 -86
  89. package/docs/uk/10-app-architecture.md +72 -31
  90. package/docs/uk/11-layouts.md +25 -12
  91. package/docs/uk/12-auth-and-api.md +58 -22
  92. package/docs/uk/13-deployment.md +4 -3
  93. package/docs/uk/14-testing.md +1 -1
  94. package/docs/uk/18-api-freeze-map.md +1 -1
  95. package/docs/uk/20-v1-stability.md +1 -1
  96. package/llms.txt +14 -15
  97. package/package.json +18 -11
  98. package/scripts/_config.mjs +15 -161
  99. package/scripts/bake.mjs +74 -63
  100. package/scripts/cli/generate.mjs +348 -0
  101. package/scripts/cli/help.mjs +27 -0
  102. package/scripts/cli/index.mjs +79 -0
  103. package/scripts/cli/init.mjs +153 -0
  104. package/scripts/cli/release.mjs +152 -0
  105. package/scripts/cli/run.mjs +96 -0
  106. package/scripts/cli.mjs +2 -621
  107. package/scripts/package-smoke.mjs +4 -1
  108. package/scripts/preview.mjs +13 -37
  109. package/scripts/size-budget.mjs +5 -2
  110. package/scripts/vite.default.mjs +11 -0
  111. package/starters/default/.editorconfig +12 -0
  112. package/starters/default/README.md +74 -0
  113. package/starters/default/eslint.config.mjs +256 -0
  114. package/starters/default/index.html +13 -0
  115. package/starters/default/package.json +30 -0
  116. package/starters/default/public/favicon.svg +4 -0
  117. package/starters/default/src/app.routes.ts +39 -0
  118. package/starters/default/src/layouts/app-shell.layout.ts +35 -0
  119. package/starters/default/src/layouts/auth-shell.layout.ts +17 -0
  120. package/starters/default/src/main.ts +16 -0
  121. package/starters/default/src/modules/auth/_contracts/auth-api.types.ts +17 -0
  122. package/starters/default/src/modules/auth/auth.connector.ts +45 -0
  123. package/starters/default/src/modules/auth/auth.guard.ts +22 -0
  124. package/starters/default/src/modules/auth/auth.public.ts +9 -0
  125. package/starters/default/src/modules/auth/auth.routes.ts +8 -0
  126. package/starters/default/src/modules/auth/auth.service.ts +71 -0
  127. package/starters/default/src/modules/auth/auth.types.ts +15 -0
  128. package/starters/default/src/modules/auth/login.page.ts +62 -0
  129. package/starters/default/src/modules/billing/_contracts/stripe.types.ts +17 -0
  130. package/starters/default/src/modules/billing/api/stripe.connector.ts +71 -0
  131. package/starters/default/src/modules/billing/billing.public.ts +5 -0
  132. package/starters/default/src/modules/billing/billing.routes.ts +9 -0
  133. package/starters/default/src/modules/billing/billing.types.ts +15 -0
  134. package/starters/default/src/modules/billing/components/invoice-status-badge.component.ts +43 -0
  135. package/starters/default/src/modules/billing/data/invoices.resource.ts +35 -0
  136. package/starters/default/src/modules/billing/pages/invoice-detail.page.ts +70 -0
  137. package/starters/default/src/modules/billing/pages/invoices-list.page.ts +73 -0
  138. package/starters/default/src/modules/home/home.page.ts +34 -0
  139. package/starters/default/src/modules/home/not-found.page.ts +11 -0
  140. package/starters/default/src/shared/http/http-client.ts +86 -0
  141. package/starters/default/src/shared/http/http-error.ts +37 -0
  142. package/starters/default/src/shared/http/interceptors.ts +59 -0
  143. package/starters/default/src/shared/lib/format-date.ts +19 -0
  144. package/starters/default/src/shared/styles/content.css +70 -0
  145. package/starters/default/src/shared/styles/reset.css +32 -0
  146. package/starters/default/src/shared/styles/shell.css +57 -0
  147. package/starters/default/src/shared/styles/tokens.css +44 -0
  148. package/starters/default/src/shared/ui/x-button.component.ts +49 -0
  149. package/starters/default/src/shared/ui/x-spinner.component.ts +22 -0
  150. package/starters/default/src/styles.d.ts +1 -0
  151. package/starters/default/src/vite-env.d.ts +1 -0
  152. package/starters/default/tsconfig.json +24 -0
  153. package/starters/default/vite.config.ts +9 -0
  154. package/MADO_V1_PLAN.md +0 -179
  155. package/ROADMAP.md +0 -178
  156. package/dist/src/html.d.ts +0 -18
  157. package/dist/src/html.js +0 -17
  158. package/dist/src/html.js.map +0 -1
  159. package/dist/src/router.d.ts +0 -13
  160. package/dist/src/router.js +0 -13
  161. package/dist/src/router.js.map +0 -1
  162. package/scripts/bundle.mjs +0 -212
  163. package/scripts/llm-zero-history-smoke.mjs +0 -93
  164. package/scripts/new.mjs +0 -80
  165. package/scripts/showcase-regression.mjs +0 -392
  166. package/server/serve.mjs +0 -455
  167. package/starters/admin/README.md +0 -63
  168. package/starters/admin/index.html +0 -28
  169. package/starters/admin/mado.config.json +0 -22
  170. package/starters/admin/package.json +0 -24
  171. package/starters/admin/public/favicon.svg +0 -4
  172. package/starters/admin/src/components/x-button.ts +0 -82
  173. package/starters/admin/src/components/x-input.ts +0 -105
  174. package/starters/admin/src/layouts/app.ts +0 -101
  175. package/starters/admin/src/layouts/auth.ts +0 -41
  176. package/starters/admin/src/lib/api.ts +0 -184
  177. package/starters/admin/src/lib/auth.ts +0 -83
  178. package/starters/admin/src/main.ts +0 -15
  179. package/starters/admin/src/pages/admin/dashboard.ts +0 -48
  180. package/starters/admin/src/pages/admin/order-detail.ts +0 -80
  181. package/starters/admin/src/pages/admin/orders.ts +0 -117
  182. package/starters/admin/src/pages/home.ts +0 -34
  183. package/starters/admin/src/pages/login.ts +0 -70
  184. package/starters/admin/src/pages/not-found.ts +0 -12
  185. package/starters/admin/src/routes.ts +0 -40
  186. package/starters/admin/src/styles/global.ts +0 -86
  187. package/starters/admin/tsconfig.json +0 -15
  188. package/starters/crud/README.md +0 -33
  189. package/starters/crud/index.html +0 -28
  190. package/starters/crud/mado.config.json +0 -20
  191. package/starters/crud/package.json +0 -24
  192. package/starters/crud/src/components/app-shell.ts +0 -56
  193. package/starters/crud/src/components/ticket-detail.ts +0 -33
  194. package/starters/crud/src/components/ticket-form.ts +0 -69
  195. package/starters/crud/src/components/ticket-list.ts +0 -66
  196. package/starters/crud/src/lib/api.ts +0 -76
  197. package/starters/crud/src/main.ts +0 -9
  198. package/starters/crud/src/pages/home.ts +0 -34
  199. package/starters/crud/src/pages/not-found.ts +0 -12
  200. package/starters/crud/src/pages/ticket-detail.ts +0 -7
  201. package/starters/crud/src/pages/ticket-new.ts +0 -7
  202. package/starters/crud/src/pages/tickets.ts +0 -7
  203. package/starters/crud/src/routes.ts +0 -11
  204. package/starters/crud/src/styles/global.ts +0 -155
  205. package/starters/crud/tsconfig.json +0 -15
  206. package/starters/minimal/README.md +0 -21
  207. package/starters/minimal/index.html +0 -28
  208. package/starters/minimal/mado.config.json +0 -20
  209. package/starters/minimal/package.json +0 -24
  210. package/starters/minimal/src/components/app-counter.ts +0 -31
  211. package/starters/minimal/src/main.ts +0 -9
  212. package/starters/minimal/src/pages/home.ts +0 -35
  213. package/starters/minimal/src/pages/not-found.ts +0 -14
  214. package/starters/minimal/src/routes.ts +0 -8
  215. package/starters/minimal/src/styles/global.ts +0 -60
  216. package/starters/minimal/tsconfig.json +0 -15
  217. package/templates/page-detail.ts +0 -63
  218. package/templates/page-form.ts +0 -94
  219. package/templates/page-list.ts +0 -79
@@ -1,66 +0,0 @@
1
- import { component, computed, each, html, queryParam, resource } from "@madojs/mado";
2
- import { api, type Ticket } from "../lib/api.js";
3
-
4
- component("ticket-list", () => {
5
- const search = queryParam("search", "");
6
- const status = queryParam("status", "all");
7
- const tickets = resource(
8
- () => `tickets?search=${search()}&status=${status()}`,
9
- () => api.listTickets({ search: search(), status: status() }),
10
- );
11
- const openCount = computed(() => (tickets.data() ?? []).filter((ticket) => ticket.status === "open").length);
12
-
13
- const row = (ticket: Ticket) => html`
14
- <tr>
15
- <td><a href=${`/tickets/${ticket.id}`} data-link>${ticket.title}</a></td>
16
- <td>${ticket.customer}</td>
17
- <td><span class=${`badge ${ticket.status}`}>${ticket.status}</span></td>
18
- <td>${ticket.priority}</td>
19
- </tr>
20
- `;
21
-
22
- return () => html`
23
- <section class="page">
24
- <div class="toolbar">
25
- <div>
26
- <h1>Tickets</h1>
27
- <p>${() => openCount()} open tickets</p>
28
- </div>
29
- <a class="button" href="/tickets/new" data-link>New ticket</a>
30
- </div>
31
-
32
- <div class="filters">
33
- <input
34
- type="search"
35
- placeholder="Search tickets"
36
- .value=${search}
37
- @input=${(event: Event) => search.set((event.target as HTMLInputElement).value)}
38
- >
39
- <select
40
- .value=${status}
41
- @change=${(event: Event) => status.set((event.target as HTMLSelectElement).value)}
42
- >
43
- <option value="all">All statuses</option>
44
- <option value="open">Open</option>
45
- <option value="pending">Pending</option>
46
- <option value="closed">Closed</option>
47
- </select>
48
- </div>
49
-
50
- ${() => tickets.loading()
51
- ? html`<p>Loading...</p>`
52
- : tickets.error()
53
- ? html`<p class="error">${tickets.error()?.message}</p>`
54
- : html`
55
- <table>
56
- <thead>
57
- <tr><th>Title</th><th>Customer</th><th>Status</th><th>Priority</th></tr>
58
- </thead>
59
- <tbody>
60
- ${each(tickets.data() ?? [], (ticket) => ticket.id, row)}
61
- </tbody>
62
- </table>
63
- `}
64
- </section>
65
- `;
66
- }, { shadow: false });
@@ -1,76 +0,0 @@
1
- export type TicketStatus = "open" | "pending" | "closed";
2
-
3
- export type Ticket = {
4
- id: string;
5
- title: string;
6
- customer: string;
7
- status: TicketStatus;
8
- priority: "low" | "normal" | "high";
9
- notes: string;
10
- };
11
-
12
- export type TicketInput = Omit<Ticket, "id">;
13
-
14
- const delay = (ms = 180) => new Promise((resolve) => setTimeout(resolve, ms));
15
-
16
- let tickets: Ticket[] = [
17
- {
18
- id: "101",
19
- title: "Invoice export is missing VAT",
20
- customer: "Northwind",
21
- status: "open",
22
- priority: "high",
23
- notes: "Finance team needs the export before Monday.",
24
- },
25
- {
26
- id: "102",
27
- title: "Invite email copy update",
28
- customer: "Acme",
29
- status: "pending",
30
- priority: "normal",
31
- notes: "Waiting for legal approval.",
32
- },
33
- {
34
- id: "103",
35
- title: "Archive old workspace",
36
- customer: "Globex",
37
- status: "closed",
38
- priority: "low",
39
- notes: "Done after customer confirmation.",
40
- },
41
- ];
42
-
43
- export const api = {
44
- async listTickets(params: { search?: string; status?: string }) {
45
- await delay();
46
- const search = (params.search ?? "").trim().toLowerCase();
47
- return tickets.filter((ticket) => {
48
- const matchesSearch = !search
49
- || ticket.title.toLowerCase().includes(search)
50
- || ticket.customer.toLowerCase().includes(search);
51
- const matchesStatus = !params.status || params.status === "all" || ticket.status === params.status;
52
- return matchesSearch && matchesStatus;
53
- });
54
- },
55
-
56
- async getTicket(id: string) {
57
- await delay();
58
- const ticket = tickets.find((item) => item.id === id);
59
- if (!ticket) throw new Error("Ticket not found");
60
- return ticket;
61
- },
62
-
63
- async createTicket(input: TicketInput) {
64
- await delay();
65
- const ticket = { ...input, id: String(Date.now()) };
66
- tickets = [ticket, ...tickets];
67
- return ticket;
68
- },
69
-
70
- async updateTicket(id: string, input: TicketInput) {
71
- await delay();
72
- const next = { ...input, id };
73
- tickets = tickets.map((ticket) => ticket.id === id ? next : ticket);
74
- return next;
75
- },
76
- };
@@ -1,9 +0,0 @@
1
- import { html, render } from "@madojs/mado";
2
- import "./styles/global.js";
3
- import "./components/app-shell.js";
4
- import router from "./routes.js";
5
-
6
- const app = document.getElementById("app");
7
- if (!app) throw new Error("#app not found");
8
-
9
- render(html`<x-app-shell>${router.view}</x-app-shell>`, app);
@@ -1,34 +0,0 @@
1
- // Public landing page. `bake` is declared so that `mado bake` (and
2
- // `mado release`) actually prerender at least one SEO-friendly HTML page
3
- // out of the box. Without it the build output ships only the SPA shell.
4
-
5
- import { html, page } from "@madojs/mado";
6
-
7
- export default page({
8
- title: "__APP_NAME__",
9
- head: () => ({
10
- description: "A CRUD scaffold built with Mado.",
11
- og: {
12
- title: "__APP_NAME__",
13
- description: "A CRUD scaffold built with Mado.",
14
- type: "website",
15
- },
16
- }),
17
- bake: {
18
- paths: () => [{}],
19
- data: () => ({}),
20
- },
21
- view: () => html`
22
- <section class="page">
23
- <div class="hero">
24
- <p class="eyebrow">Mado CRUD starter</p>
25
- <h1>Small admin apps without frontend ceremony.</h1>
26
- <p>
27
- This starter shows routes, resources, mutations, forms, query params
28
- and keyed lists in a compact ticket admin.
29
- </p>
30
- <a class="button" href="/tickets" data-link>Open tickets</a>
31
- </div>
32
- </section>
33
- `,
34
- });
@@ -1,12 +0,0 @@
1
- import { html, page } from "@madojs/mado";
2
-
3
- export default page({
4
- title: "Not found",
5
- view: () => html`
6
- <section class="page">
7
- <h1>Not found</h1>
8
- <p>The page does not exist.</p>
9
- <a href="/" data-link>Back home</a>
10
- </section>
11
- `,
12
- });
@@ -1,7 +0,0 @@
1
- import { html, page } from "@madojs/mado";
2
- import "../components/ticket-detail.js";
3
-
4
- export default page<{ id: string }>({
5
- title: ({ id }) => `Ticket ${id}`,
6
- view: ({ params }) => html`<ticket-detail ticket-id=${params.id}></ticket-detail>`,
7
- });
@@ -1,7 +0,0 @@
1
- import { html, page } from "@madojs/mado";
2
- import "../components/ticket-form.js";
3
-
4
- export default page({
5
- title: "New ticket",
6
- view: () => html`<ticket-form></ticket-form>`,
7
- });
@@ -1,7 +0,0 @@
1
- import { html, page } from "@madojs/mado";
2
- import "../components/ticket-list.js";
3
-
4
- export default page({
5
- title: "Tickets",
6
- view: () => html`<ticket-list></ticket-list>`,
7
- });
@@ -1,11 +0,0 @@
1
- import { routes } from "@madojs/mado";
2
-
3
- export const manifest = {
4
- "/": () => import("./pages/home.js"),
5
- "/tickets": () => import("./pages/tickets.js"),
6
- "/tickets/new": () => import("./pages/ticket-new.js"),
7
- "/tickets/:id": () => import("./pages/ticket-detail.js"),
8
- "*": () => import("./pages/not-found.js"),
9
- };
10
-
11
- export default routes(manifest);
@@ -1,155 +0,0 @@
1
- import { css } from "@madojs/mado";
2
-
3
- const sheet = css`
4
- :root {
5
- --bg: #f6f7f9;
6
- --panel: #ffffff;
7
- --text: #172033;
8
- --muted: #64748b;
9
- --line: #d9dee8;
10
- --accent: #2563eb;
11
- font-family:
12
- Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
13
- "Segoe UI", sans-serif;
14
- color: var(--text);
15
- background: var(--bg);
16
- }
17
-
18
- body {
19
- margin: 0;
20
- }
21
-
22
- .page {
23
- width: min(100% - 2rem, 72rem);
24
- margin: 0 auto;
25
- padding: 2rem 0;
26
- }
27
-
28
- .narrow {
29
- width: min(100% - 2rem, 42rem);
30
- }
31
-
32
- .hero,
33
- form,
34
- table,
35
- dl {
36
- border: 1px solid var(--line);
37
- border-radius: 8px;
38
- background: var(--panel);
39
- }
40
-
41
- .hero,
42
- form,
43
- dl {
44
- padding: 1.25rem;
45
- }
46
-
47
- h1 {
48
- margin: 0 0 0.5rem;
49
- letter-spacing: 0;
50
- }
51
-
52
- .eyebrow,
53
- p {
54
- color: var(--muted);
55
- }
56
-
57
- .toolbar,
58
- .filters,
59
- .actions {
60
- display: flex;
61
- align-items: center;
62
- justify-content: space-between;
63
- gap: 1rem;
64
- flex-wrap: wrap;
65
- }
66
-
67
- .filters {
68
- margin: 1rem 0;
69
- }
70
-
71
- input,
72
- select,
73
- textarea,
74
- button,
75
- .button {
76
- border: 1px solid var(--line);
77
- border-radius: 6px;
78
- padding: 0.6rem 0.75rem;
79
- font: inherit;
80
- }
81
-
82
- input,
83
- select,
84
- textarea {
85
- box-sizing: border-box;
86
- width: 100%;
87
- background: white;
88
- }
89
-
90
- label {
91
- display: grid;
92
- gap: 0.35rem;
93
- margin-bottom: 1rem;
94
- font-weight: 700;
95
- }
96
-
97
- small,
98
- .error {
99
- color: #dc2626;
100
- }
101
-
102
- button,
103
- .button {
104
- display: inline-flex;
105
- align-items: center;
106
- background: var(--accent);
107
- color: white;
108
- text-decoration: none;
109
- cursor: pointer;
110
- }
111
-
112
- button:disabled {
113
- opacity: 0.55;
114
- cursor: not-allowed;
115
- }
116
-
117
- table {
118
- width: 100%;
119
- border-collapse: collapse;
120
- overflow: hidden;
121
- }
122
-
123
- th,
124
- td {
125
- border-bottom: 1px solid var(--line);
126
- padding: 0.75rem;
127
- text-align: left;
128
- }
129
-
130
- .badge {
131
- border-radius: 999px;
132
- padding: 0.2rem 0.55rem;
133
- background: #e2e8f0;
134
- color: #334155;
135
- font-size: 0.8rem;
136
- font-weight: 800;
137
- }
138
-
139
- .badge.open {
140
- background: #dbeafe;
141
- color: #1d4ed8;
142
- }
143
-
144
- .badge.pending {
145
- background: #fef3c7;
146
- color: #92400e;
147
- }
148
-
149
- .badge.closed {
150
- background: #dcfce7;
151
- color: #166534;
152
- }
153
- `;
154
-
155
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "lib": ["ES2022", "DOM"],
7
- "strict": true,
8
- "skipLibCheck": true,
9
- "outDir": "dist",
10
- "rootDir": "src",
11
- "declaration": false,
12
- "sourceMap": true
13
- },
14
- "include": ["src/**/*.ts"]
15
- }
@@ -1,21 +0,0 @@
1
- # __APP_NAME__
2
-
3
- Generated with Mado __MADO_VERSION__.
4
-
5
- ```bash
6
- npm install
7
- npm run dev
8
- ```
9
-
10
- Open http://localhost:5173.
11
-
12
- Use `npm run build` for a production TypeScript build and `npm run serve` to
13
- serve an already-built app.
14
-
15
- ## Files
16
-
17
- - `src/main.ts` mounts the router into `#app`.
18
- - `src/routes.ts` defines lazy page routes.
19
- - `src/pages/` contains route pages.
20
- - `src/components/` contains Web Components.
21
- - `src/styles/global.ts` contains global styles.
@@ -1,28 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>__APP_NAME__</title>
7
- <link rel="icon" type="image/svg+xml" href="/favicon.svg">
8
- <!--
9
- Paths below MUST be root-absolute (start with "/"), not "./...".
10
- Mado is an SPA: hard-refreshing any nested route still serves this same
11
- index.html, and the browser resolves "./dist/main.js" against the
12
- current URL → /some/nested/dist/main.js → 404 → blank page.
13
- Root-absolute paths always resolve to /dist/main.js regardless of route.
14
- -->
15
- <script type="importmap">
16
- {
17
- "imports": {
18
- "@madojs/mado": "/node_modules/@madojs/mado/dist/src/index.js",
19
- "@madojs/mado/": "/node_modules/@madojs/mado/dist/src/"
20
- }
21
- }
22
- </script>
23
- </head>
24
- <body>
25
- <div id="app"></div>
26
- <script type="module" src="/dist/main.js"></script>
27
- </body>
28
- </html>
@@ -1,20 +0,0 @@
1
- {
2
- "dev": {
3
- "port": 5173,
4
- "proxy": {}
5
- },
6
- "build": {
7
- "out": "out",
8
- "dist": "dist",
9
- "publicDir": "public"
10
- },
11
- "bake": {
12
- "entry": "src/routes.ts",
13
- "template": "index.html",
14
- "baseUrl": "https://example.com"
15
- },
16
- "bundle": {
17
- "splitting": true,
18
- "compress": ["gz", "br"]
19
- }
20
- }
@@ -1,24 +0,0 @@
1
- {
2
- "name": "__PACKAGE_NAME__",
3
- "version": "0.1.0",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "build": "mado build",
8
- "typecheck": "mado typecheck",
9
- "dev": "mado dev",
10
- "serve": "mado serve",
11
- "bundle": "mado bundle",
12
- "bake": "mado bake",
13
- "release": "mado release",
14
- "preview": "mado preview"
15
- },
16
- "dependencies": {
17
- "@madojs/mado": "__MADOJS_VERSION__"
18
- },
19
- "devDependencies": {
20
- "esbuild": "^0.28.0",
21
- "linkedom": "^0.18.12",
22
- "typescript": "^6.0.3"
23
- }
24
- }
@@ -1,31 +0,0 @@
1
- import { component, css, html, signal } from "@madojs/mado";
2
-
3
- component(
4
- "x-app-counter",
5
- () => {
6
- const count = signal(0);
7
- return () => html`
8
- <button @click=${() => count.update((n) => n + 1)}>
9
- Count: ${count}
10
- </button>
11
- `;
12
- },
13
- {
14
- styles: css`
15
- :host {
16
- display: inline-block;
17
- margin-top: 1rem;
18
- }
19
-
20
- button {
21
- border: 1px solid #1f2937;
22
- border-radius: 6px;
23
- background: #111827;
24
- color: white;
25
- padding: 0.65rem 0.9rem;
26
- font: inherit;
27
- cursor: pointer;
28
- }
29
- `,
30
- },
31
- );
@@ -1,9 +0,0 @@
1
- import { html, render } from "@madojs/mado";
2
- import "./styles/global.js";
3
- import router from "./routes.js";
4
- import "./components/app-counter.js";
5
-
6
- const app = document.getElementById("app");
7
- if (!app) throw new Error("#app not found");
8
-
9
- render(html`${router.view}`, app);
@@ -1,35 +0,0 @@
1
- // Public landing page. `bake` is declared so that `mado bake` (and
2
- // `mado release`) actually prerender a static HTML page out of the box.
3
- // Without it the build output ships only the SPA shell — bots that hit
4
- // "/" see an empty <body> instead of the welcome content.
5
-
6
- import { html, page } from "@madojs/mado";
7
-
8
- export default page({
9
- title: "__APP_NAME__",
10
- head: () => ({
11
- description: "A minimal Mado starter app.",
12
- og: {
13
- title: "__APP_NAME__",
14
- description: "A minimal Mado starter app.",
15
- type: "website",
16
- },
17
- }),
18
- bake: {
19
- paths: () => [{}],
20
- data: () => ({}),
21
- },
22
- view: () => html`
23
- <main class="shell">
24
- <section class="panel">
25
- <p class="eyebrow">Mado starter</p>
26
- <h1>__APP_NAME__</h1>
27
- <p>
28
- A tiny native-web app with browser ESM, Web Components, signals and
29
- tagged-template HTML.
30
- </p>
31
- <x-app-counter></x-app-counter>
32
- </section>
33
- </main>
34
- `,
35
- });
@@ -1,14 +0,0 @@
1
- import { html, page } from "@madojs/mado";
2
-
3
- export default page({
4
- title: "Not found",
5
- view: () => html`
6
- <main class="shell">
7
- <section class="panel">
8
- <h1>Not found</h1>
9
- <p>The page does not exist.</p>
10
- <a href="/" data-link>Back home</a>
11
- </section>
12
- </main>
13
- `,
14
- });
@@ -1,8 +0,0 @@
1
- import { routes } from "@madojs/mado";
2
-
3
- export const manifest = {
4
- "/": () => import("./pages/home.js"),
5
- "*": () => import("./pages/not-found.js"),
6
- };
7
-
8
- export default routes(manifest);
@@ -1,60 +0,0 @@
1
- import { css } from "@madojs/mado";
2
-
3
- const sheet = css`
4
- :root {
5
- color-scheme: light;
6
- font-family:
7
- Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
8
- "Segoe UI", sans-serif;
9
- color: #172033;
10
- background: #f6f7f9;
11
- }
12
-
13
- body {
14
- margin: 0;
15
- }
16
-
17
- a {
18
- color: #2563eb;
19
- }
20
-
21
- .shell {
22
- min-height: 100vh;
23
- display: grid;
24
- place-items: center;
25
- padding: 2rem;
26
- box-sizing: border-box;
27
- }
28
-
29
- .panel {
30
- width: min(100%, 44rem);
31
- border: 1px solid #d9dee8;
32
- border-radius: 8px;
33
- background: white;
34
- padding: 2rem;
35
- box-shadow: 0 16px 40px rgb(17 24 39 / 0.08);
36
- }
37
-
38
- .eyebrow {
39
- margin: 0 0 0.5rem;
40
- color: #64748b;
41
- font-size: 0.8rem;
42
- font-weight: 700;
43
- letter-spacing: 0.08em;
44
- text-transform: uppercase;
45
- }
46
-
47
- h1 {
48
- margin: 0 0 0.75rem;
49
- font-size: clamp(2rem, 6vw, 4rem);
50
- line-height: 1;
51
- letter-spacing: 0;
52
- }
53
-
54
- p {
55
- max-width: 34rem;
56
- line-height: 1.6;
57
- }
58
- `;
59
-
60
- document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "lib": ["ES2022", "DOM"],
7
- "strict": true,
8
- "skipLibCheck": true,
9
- "outDir": "dist",
10
- "rootDir": "src",
11
- "declaration": false,
12
- "sourceMap": true
13
- },
14
- "include": ["src/**/*.ts"]
15
- }