@canonical/summon-application 0.43.0 → 0.46.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/README.md +57 -11
- package/dist/esm/application/react/index.js +175 -21
- package/dist/esm/application/react/index.js.map +1 -1
- package/dist/esm/application/react/templates/README.md.ejs +33 -1
- package/dist/esm/application/react/templates/package.json.ejs +25 -18
- package/dist/esm/application/react/templates/src/client/entry.tsx.ejs +10 -16
- package/dist/esm/application/react/templates/src/domains/catalog/CatalogPage.tsx.ejs +5 -5
- package/dist/esm/application/react/templates/src/domains/dashboard/DashboardBreadcrumbs.tsx.ejs +35 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/DashboardLayout.tsx.ejs +39 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/InstancesPage.test.tsx.ejs +144 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/InstancesPage.tsx.ejs +281 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/OverviewPage.test.tsx.ejs +76 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/OverviewPage.tsx.ejs +224 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/SettingsPage.test.tsx.ejs +64 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/SettingsPage.tsx.ejs +142 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/constants.ts.ejs +229 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/hooks/index.ts +2 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/hooks/types.ts +13 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/hooks/useDashboardNavigation.ts.ejs +94 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/projectBreadcrumbs.test.ts +78 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/projectBreadcrumbs.ts +48 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/routes.ts +21 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/selectRelativeTime.test.ts +19 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/selectRelativeTime.ts +24 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/styles.css +98 -0
- package/dist/esm/application/react/templates/src/domains/dashboard/types.ts.ejs +61 -0
- package/dist/esm/application/react/templates/src/domains/marketing/HomePage.tsx.ejs +14 -9
- package/dist/esm/application/react/templates/src/i18n/ar.ts.ejs +173 -0
- package/dist/esm/application/react/templates/src/i18n/en.ts.ejs +172 -0
- package/dist/esm/application/react/templates/src/i18n/fr.ts.ejs +170 -0
- package/dist/esm/application/react/templates/src/lib/ApplicationShell/ApplicationShell.stories.tsx +91 -0
- package/dist/esm/application/react/templates/src/lib/ApplicationShell/ApplicationShell.test.tsx.ejs +139 -0
- package/dist/esm/application/react/templates/src/lib/ApplicationShell/ApplicationShell.tsx.ejs +78 -0
- package/dist/esm/application/react/templates/src/lib/ApplicationShell/index.ts +2 -0
- package/dist/esm/application/react/templates/src/lib/ApplicationShell/styles.css +43 -0
- package/dist/esm/application/react/templates/src/lib/ApplicationShell/types.ts +20 -0
- package/dist/esm/application/react/templates/src/lib/CanonicalLogo/CanonicalLogo.tsx.ejs +51 -0
- package/dist/esm/application/react/templates/src/lib/CanonicalLogo/index.ts +2 -0
- package/dist/esm/application/react/templates/src/lib/CanonicalLogo/styles.css +31 -0
- package/dist/esm/application/react/templates/src/lib/CanonicalLogo/types.ts +11 -0
- package/dist/esm/application/react/templates/src/lib/CodeMessage/CodeMessage.test.tsx +33 -0
- package/dist/esm/application/react/templates/src/lib/CodeMessage/CodeMessage.tsx +33 -0
- package/dist/esm/application/react/templates/src/lib/CodeMessage/index.ts +2 -0
- package/dist/esm/application/react/templates/src/lib/CodeMessage/types.ts +16 -0
- package/dist/esm/application/react/templates/src/lib/ExampleComponent/styles.css +1 -1
- package/dist/esm/application/react/templates/src/lib/LazyComponent/{LazyComponent.tsx → LazyComponent.tsx.ejs} +26 -0
- package/dist/esm/application/react/templates/src/lib/LoadingMessage/LoadingMessage.test.tsx.ejs +20 -0
- package/dist/esm/application/react/templates/src/lib/LoadingMessage/LoadingMessage.tsx.ejs +21 -0
- package/dist/esm/application/react/templates/src/lib/LoadingMessage/index.ts +1 -0
- package/dist/esm/application/react/templates/src/lib/LocaleSelector/{LocaleSelector.tsx → LocaleSelector.tsx.ejs} +23 -0
- package/dist/esm/application/react/templates/src/lib/Navigation/Navigation.test.tsx.ejs +87 -0
- package/dist/esm/application/react/templates/src/lib/Navigation/Navigation.tsx.ejs +3 -0
- package/dist/esm/application/react/templates/src/lib/RouterLink/RouterLink.test.tsx +98 -0
- package/dist/esm/application/react/templates/src/lib/RouterLink/RouterLink.tsx +65 -0
- package/dist/esm/application/react/templates/src/lib/RouterLink/index.ts +1 -0
- package/dist/esm/application/react/templates/src/lib/ThemeSelector/ThemeSelector.tsx.ejs +29 -14
- package/dist/esm/application/react/templates/src/lib/TopBar/TopBar.stories.tsx.ejs +29 -0
- package/dist/esm/application/react/templates/src/lib/TopBar/TopBar.test.tsx.ejs +113 -0
- package/dist/esm/application/react/templates/src/lib/TopBar/TopBar.tsx.ejs +45 -0
- package/dist/esm/application/react/templates/src/lib/TopBar/index.ts +2 -0
- package/dist/esm/application/react/templates/src/lib/TopBar/styles.css +49 -0
- package/dist/esm/application/react/templates/src/lib/TopBar/types.ts +8 -0
- package/dist/esm/application/react/templates/src/lib/index.ts.ejs +10 -0
- package/dist/esm/application/react/templates/src/routes.tsx.ejs +70 -20
- package/dist/esm/application/react/templates/src/server/entry.tsx.ejs +6 -7
- package/dist/esm/application/react/templates/src/sitemap/getSitemapItems.ts.ejs +5 -0
- package/dist/esm/application/react/templates/src/styles/app.css +25 -12
- package/dist/esm/application/react/templates/src/testing/browserStubs.ts +57 -0
- package/dist/esm/application/react/templates/src/testing/fixtures.ts.ejs +29 -0
- package/dist/esm/application/react/templates/src/testing/renderWithProviders.tsx.ejs +64 -0
- package/dist/esm/application/react/templates/test/e2e/servers.e2e.ts.ejs +37 -1
- package/dist/esm/application/react/templates/vite-plugin-ds-icons.ts +7 -2
- package/dist/esm/application/react/templates/vitest.config.ts +6 -2
- package/dist/esm/application/react/textHelpers.js +9 -0
- package/dist/esm/application/react/textHelpers.js.map +1 -0
- package/dist/esm/shared/versions.js +35 -21
- package/dist/esm/shared/versions.js.map +1 -1
- package/dist/types/application/react/index.d.ts +1 -0
- package/dist/types/application/react/index.d.ts.map +1 -1
- package/dist/types/application/react/textHelpers.d.ts +18 -0
- package/dist/types/application/react/textHelpers.d.ts.map +1 -0
- package/dist/types/shared/versions.d.ts +41 -4
- package/dist/types/shared/versions.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/esm/application/react/templates/src/i18n/ar.ts +0 -73
- package/dist/esm/application/react/templates/src/i18n/en.ts +0 -72
- package/dist/esm/application/react/templates/src/i18n/fr.ts +0 -69
- /package/dist/esm/application/react/templates/src/domains/catalog/{ErrorBoundary.tests.tsx.ejs → ErrorBoundary.test.tsx.ejs} +0 -0
- /package/dist/esm/application/react/templates/src/domains/catalog/{ProductList.tests.tsx.ejs → ProductList.test.tsx.ejs} +0 -0
- /package/dist/esm/application/react/templates/src/i18n/{negotiation.tests.ts → negotiation.test.ts} +0 -0
- /package/dist/esm/application/react/templates/src/lib/ClientOnly/{ClientOnly.tests.tsx → ClientOnly.test.tsx} +0 -0
- /package/dist/esm/application/react/templates/src/lib/ExampleComponent/{ExampleComponent.tests.tsx → ExampleComponent.test.tsx} +0 -0
- /package/dist/esm/application/react/templates/src/lib/LocaleSelector/{LocaleSelector.tests.tsx → LocaleSelector.test.tsx} +0 -0
- /package/dist/esm/application/react/templates/src/relay/{environment.tests.ts → environment.test.ts} +0 -0
- /package/dist/esm/application/react/templates/src/relay/{schema.tests.ts → schema.test.ts} +0 -0
|
@@ -13,11 +13,13 @@ import {
|
|
|
13
13
|
wrapper,
|
|
14
14
|
} from "@canonical/router-core";
|
|
15
15
|
import type { ReactElement, ReactNode } from "react";
|
|
16
|
-
import accountRoutes from "#domains/account/routes.js";
|
|
17
16
|
<%# getRequest and the ProductList pair exist only for serverQueries and -%>
|
|
18
17
|
<%# resolveRelayPayloads, which the SPA arm omits; catalogRoutes is always used. -%>
|
|
19
18
|
<% if (relay && !spa) { -%>
|
|
20
19
|
import { getRequest } from "relay-runtime";
|
|
20
|
+
<% } -%>
|
|
21
|
+
import accountRoutes from "#domains/account/routes.js";
|
|
22
|
+
<% if (relay && !spa) { -%>
|
|
21
23
|
import { PAGE_SIZE, productListQuery } from "#domains/catalog/ProductList.js";
|
|
22
24
|
<% } -%>
|
|
23
25
|
<% if (relay) { -%>
|
|
@@ -26,8 +28,12 @@ import catalogRoutes from "#domains/catalog/routes.js";
|
|
|
26
28
|
<% if (forms) { -%>
|
|
27
29
|
import contactRoutes from "#domains/contact/routes.js";
|
|
28
30
|
<% } -%>
|
|
31
|
+
<% if (appShell) { -%>
|
|
32
|
+
import DashboardLayout from "#domains/dashboard/DashboardLayout.js";
|
|
33
|
+
import dashboardRoutes from "#domains/dashboard/routes.js";
|
|
34
|
+
<% } -%>
|
|
29
35
|
import marketingRoutes from "#domains/marketing/routes.js";
|
|
30
|
-
import
|
|
36
|
+
import TopBar from "#lib/TopBar/index.js";
|
|
31
37
|
<% if (relay && !spa) { -%>
|
|
32
38
|
import type { RelaySeedPayload } from "#relay/environment.js";
|
|
33
39
|
<% } -%>
|
|
@@ -94,24 +100,46 @@ export function withAuth(loginPath: string): RouteMiddleware {
|
|
|
94
100
|
};
|
|
95
101
|
}
|
|
96
102
|
|
|
103
|
+
/**
|
|
104
|
+
* The outer frame of every page except the 404: the top bar, then whichever
|
|
105
|
+
* page layout the route's group adds inside it.
|
|
106
|
+
*/
|
|
107
|
+
const topBarLayout = wrapper<ReactElement>({
|
|
108
|
+
id: "top-bar-layout",
|
|
109
|
+
component: ({ children }: { children: ReactNode }) => (
|
|
110
|
+
<div className="page-frame">
|
|
111
|
+
<TopBar />
|
|
112
|
+
{children}
|
|
113
|
+
</div>
|
|
114
|
+
),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The public pages' layout: one constrained column under the top bar. It is a
|
|
119
|
+
* `.surface`, the context the design system's components read their colours
|
|
120
|
+
* from.
|
|
121
|
+
*/
|
|
97
122
|
const publicLayout = wrapper<ReactElement>({
|
|
98
123
|
id: "public-layout",
|
|
99
124
|
component: ({ children }: { children: ReactNode }) => (
|
|
100
|
-
<
|
|
101
|
-
<header className="subgrid shell-header">
|
|
102
|
-
<Navigation />
|
|
103
|
-
</header>
|
|
104
|
-
<main className="subgrid">{children}</main>
|
|
105
|
-
</div>
|
|
125
|
+
<main className="subgrid public-content surface">{children}</main>
|
|
106
126
|
),
|
|
107
127
|
});
|
|
128
|
+
<% if (appShell) { -%>
|
|
129
|
+
|
|
130
|
+
/** The dashboard's layout: the application shell and its side navigation. */
|
|
131
|
+
const applicationLayout = wrapper<ReactElement>({
|
|
132
|
+
id: "application-layout",
|
|
133
|
+
component: DashboardLayout,
|
|
134
|
+
});
|
|
135
|
+
<% } -%>
|
|
108
136
|
|
|
109
137
|
<% if (intl) { -%>
|
|
110
138
|
function NotFoundPage(): ReactElement {
|
|
111
139
|
const { t } = useTranslation();
|
|
112
140
|
|
|
113
141
|
return (
|
|
114
|
-
<section>
|
|
142
|
+
<section className="surface">
|
|
115
143
|
<Head title={t("notFound.heading")} />
|
|
116
144
|
<h1>{t("notFound.heading")}</h1>
|
|
117
145
|
<p>{t("notFound.body")}</p>
|
|
@@ -126,7 +154,7 @@ const notFoundRoute = route({
|
|
|
126
154
|
content: NotFoundPage,
|
|
127
155
|
<% } else { -%>
|
|
128
156
|
content: () => (
|
|
129
|
-
<section>
|
|
157
|
+
<section className="surface">
|
|
130
158
|
<Head title="Page not found" />
|
|
131
159
|
<h1>Page not found</h1>
|
|
132
160
|
<p>The page you are looking for does not exist.</p>
|
|
@@ -135,22 +163,39 @@ const notFoundRoute = route({
|
|
|
135
163
|
<% } -%>
|
|
136
164
|
});
|
|
137
165
|
|
|
138
|
-
const [guide, home] = group(
|
|
139
|
-
|
|
140
|
-
marketingRoutes.home,
|
|
141
|
-
|
|
166
|
+
const [guide, home] = group(
|
|
167
|
+
topBarLayout,
|
|
168
|
+
group(publicLayout, [marketingRoutes.guide, marketingRoutes.home] as const),
|
|
169
|
+
);
|
|
142
170
|
|
|
143
|
-
const [account, login] = group(
|
|
144
|
-
|
|
145
|
-
accountRoutes.login,
|
|
146
|
-
|
|
171
|
+
const [account, login] = group(
|
|
172
|
+
topBarLayout,
|
|
173
|
+
group(publicLayout, [accountRoutes.account, accountRoutes.login] as const),
|
|
174
|
+
);
|
|
147
175
|
|
|
148
176
|
<% if (forms) { -%>
|
|
149
|
-
const [contact] = group(
|
|
177
|
+
const [contact] = group(
|
|
178
|
+
topBarLayout,
|
|
179
|
+
group(publicLayout, [contactRoutes.contact] as const),
|
|
180
|
+
);
|
|
150
181
|
|
|
151
182
|
<% } -%>
|
|
152
183
|
<% if (relay) { -%>
|
|
153
|
-
const [catalog] = group(
|
|
184
|
+
const [catalog] = group(
|
|
185
|
+
topBarLayout,
|
|
186
|
+
group(publicLayout, [catalogRoutes.catalog] as const),
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
<% } -%>
|
|
190
|
+
<% if (appShell) { -%>
|
|
191
|
+
const [dashboard, dashboardInstances, dashboardSettings] = group(
|
|
192
|
+
topBarLayout,
|
|
193
|
+
group(applicationLayout, [
|
|
194
|
+
dashboardRoutes.dashboard,
|
|
195
|
+
dashboardRoutes.dashboardInstances,
|
|
196
|
+
dashboardRoutes.dashboardSettings,
|
|
197
|
+
] as const),
|
|
198
|
+
);
|
|
154
199
|
|
|
155
200
|
<% } -%>
|
|
156
201
|
<% if (spa) { -%>
|
|
@@ -181,6 +226,11 @@ const appRoutes = {
|
|
|
181
226
|
<% if (relay) { -%>
|
|
182
227
|
catalog,
|
|
183
228
|
<% } -%>
|
|
229
|
+
<% if (appShell) { -%>
|
|
230
|
+
dashboard,
|
|
231
|
+
dashboardInstances,
|
|
232
|
+
dashboardSettings,
|
|
233
|
+
<% } -%>
|
|
184
234
|
} as const;
|
|
185
235
|
|
|
186
236
|
export type AppRoutes = typeof appRoutes;
|
|
@@ -22,6 +22,7 @@ import { fetchQuery, RelayEnvironmentProvider } from "react-relay";
|
|
|
22
22
|
<% if (intl) { -%>
|
|
23
23
|
import { catalogs, i18nConfig } from "#i18n/index.js";
|
|
24
24
|
<% } -%>
|
|
25
|
+
import LoadingMessage from "#lib/LoadingMessage/index.js";
|
|
25
26
|
<% if (relay) { -%>
|
|
26
27
|
import { createEnvironment } from "#relay/environment.js";
|
|
27
28
|
<% } -%>
|
|
@@ -188,9 +189,7 @@ export async function prefetchRouteData(
|
|
|
188
189
|
const timer = setTimeout(() => {
|
|
189
190
|
subscription.unsubscribe();
|
|
190
191
|
reject(
|
|
191
|
-
new Error(
|
|
192
|
-
`SSR data prefetch exceeded ${SSR_PREFETCH_TIMEOUT_MS}ms`,
|
|
193
|
-
),
|
|
192
|
+
new Error(`SSR data prefetch exceeded ${SSR_PREFETCH_TIMEOUT_MS}ms`),
|
|
194
193
|
);
|
|
195
194
|
}, SSR_PREFETCH_TIMEOUT_MS);
|
|
196
195
|
const subscription = fetchQuery(
|
|
@@ -329,7 +328,7 @@ export default function EntryServer(props: ServerEntrypointProps<InitialData>) {
|
|
|
329
328
|
<HeadProvider titleTemplate={formatDocumentTitle}>
|
|
330
329
|
<RelayEnvironmentProvider environment={relayEnvironment}>
|
|
331
330
|
<RouterProvider router={router}>
|
|
332
|
-
<Outlet fallback={<
|
|
331
|
+
<Outlet fallback={<LoadingMessage />} />
|
|
333
332
|
</RouterProvider>
|
|
334
333
|
</RelayEnvironmentProvider>
|
|
335
334
|
</HeadProvider>
|
|
@@ -338,7 +337,7 @@ export default function EntryServer(props: ServerEntrypointProps<InitialData>) {
|
|
|
338
337
|
<HeadProvider titleTemplate={formatDocumentTitle}>
|
|
339
338
|
<RelayEnvironmentProvider environment={relayEnvironment}>
|
|
340
339
|
<RouterProvider router={router}>
|
|
341
|
-
<Outlet fallback={<
|
|
340
|
+
<Outlet fallback={<LoadingMessage />} />
|
|
342
341
|
</RouterProvider>
|
|
343
342
|
</RelayEnvironmentProvider>
|
|
344
343
|
</HeadProvider>
|
|
@@ -376,14 +375,14 @@ export default function EntryServer(props: ServerEntrypointProps<InitialData>) {
|
|
|
376
375
|
<I18nProvider config={i18nConfig} catalogs={catalogs} locale={locale}>
|
|
377
376
|
<HeadProvider titleTemplate={formatDocumentTitle}>
|
|
378
377
|
<RouterProvider router={router}>
|
|
379
|
-
<Outlet fallback={<
|
|
378
|
+
<Outlet fallback={<LoadingMessage />} />
|
|
380
379
|
</RouterProvider>
|
|
381
380
|
</HeadProvider>
|
|
382
381
|
</I18nProvider>
|
|
383
382
|
<% } else { -%>
|
|
384
383
|
<HeadProvider titleTemplate={formatDocumentTitle}>
|
|
385
384
|
<RouterProvider router={router}>
|
|
386
|
-
<Outlet fallback={<
|
|
385
|
+
<Outlet fallback={<LoadingMessage />} />
|
|
387
386
|
</RouterProvider>
|
|
388
387
|
</HeadProvider>
|
|
389
388
|
<% } -%>
|
|
@@ -27,6 +27,11 @@ export default async function getSitemapItems(): Promise<SitemapItem[]> {
|
|
|
27
27
|
<% } -%>
|
|
28
28
|
<% if (forms) { -%>
|
|
29
29
|
{ loc: "/contact", changefreq: "monthly", priority: 0.7 },
|
|
30
|
+
<% } -%>
|
|
31
|
+
<% if (appShell) { -%>
|
|
32
|
+
{ loc: "/dashboard", changefreq: "weekly", priority: 0.6 },
|
|
33
|
+
{ loc: "/dashboard/instances", changefreq: "weekly", priority: 0.5 },
|
|
34
|
+
{ loc: "/dashboard/settings", changefreq: "monthly", priority: 0.4 },
|
|
30
35
|
<% } -%>
|
|
31
36
|
{ loc: "/account", changefreq: "monthly", priority: 0.5 },
|
|
32
37
|
{ loc: "/login", changefreq: "yearly", priority: 0.3 },
|
|
@@ -3,24 +3,37 @@
|
|
|
3
3
|
* by accident rather than by intent. `app` sorts above the design system's
|
|
4
4
|
* own layers only while the entry imports `#styles/index.css`, and with it
|
|
5
5
|
* `@canonical/styles`' order statement, before anything that pulls this file
|
|
6
|
-
* in; that is what canonical/pragma#1122 puts in the generated entry, and
|
|
6
|
+
* in; that is what canonical/pragma-web#1122 puts in the generated entry, and
|
|
7
7
|
* this file lands after it. Keep that import first. */
|
|
8
8
|
|
|
9
9
|
@layer app {
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
/* Every page: the top bar, then the area a page layout fills. */
|
|
11
|
+
.page-frame {
|
|
12
|
+
/* The top bar's height, shared with the application shell so the side
|
|
13
|
+
panels it opens start below the bar rather than over it. Twelve
|
|
14
|
+
baseline units: the selectors' 40px chrome plus the bar's padding. */
|
|
15
|
+
--top-bar-block-size: calc(var(--space-baseline) * 12);
|
|
16
|
+
--application-shell-overlay-inset-block-start: var(--top-bar-block-size);
|
|
17
|
+
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-rows: auto 1fr;
|
|
20
|
+
min-block-size: 100dvh;
|
|
15
21
|
}
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
/* Under an application shell the page is exactly the viewport's height:
|
|
24
|
+
the side navigation and the page scroll inside the shell, not the
|
|
25
|
+
document. */
|
|
26
|
+
.page-frame:has(> .ds.application-shell) {
|
|
27
|
+
block-size: 100dvh;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
/* The public pages: one constrained column. */
|
|
31
|
+
.public-content {
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
inline-size: 100%;
|
|
34
|
+
max-width: 1280px;
|
|
35
|
+
margin: 0 auto;
|
|
36
|
+
padding-inline: var(--grid-margin);
|
|
37
|
+
padding-block: var(--container-gap-loose);
|
|
25
38
|
}
|
|
26
39
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* jsdom implements no `matchMedia`. `usePreferredTheme` queries it, and the
|
|
5
|
+
* side navigation does after mounting; this answers every query with no
|
|
6
|
+
* match, as a wide screen with no preferences would.
|
|
7
|
+
*/
|
|
8
|
+
export function installMatchMedia(): void {
|
|
9
|
+
Object.defineProperty(window, "matchMedia", {
|
|
10
|
+
writable: true,
|
|
11
|
+
value: vi.fn().mockImplementation((query: string) => ({
|
|
12
|
+
matches: false,
|
|
13
|
+
media: query,
|
|
14
|
+
onchange: null,
|
|
15
|
+
addEventListener: vi.fn(),
|
|
16
|
+
removeEventListener: vi.fn(),
|
|
17
|
+
dispatchEvent: vi.fn(),
|
|
18
|
+
})),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* jsdom implements no part of the dialog API: `show`, `showModal` and `close`
|
|
24
|
+
* are undefined. These stubs are the minimum the side panel and the modal
|
|
25
|
+
* need: reflect the `open` attribute, and dispatch `close` as the platform
|
|
26
|
+
* does, so every close goes through the dialog's `close` event.
|
|
27
|
+
*/
|
|
28
|
+
export function installDialogStubs(): void {
|
|
29
|
+
HTMLDialogElement.prototype.show = function show(this: HTMLDialogElement) {
|
|
30
|
+
this.toggleAttribute("open", true);
|
|
31
|
+
};
|
|
32
|
+
HTMLDialogElement.prototype.showModal = function showModal(
|
|
33
|
+
this: HTMLDialogElement,
|
|
34
|
+
) {
|
|
35
|
+
this.toggleAttribute("open", true);
|
|
36
|
+
};
|
|
37
|
+
HTMLDialogElement.prototype.close = function close(this: HTMLDialogElement) {
|
|
38
|
+
if (!this.hasAttribute("open")) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.toggleAttribute("open", false);
|
|
42
|
+
this.dispatchEvent(new Event("close"));
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* jsdom implements no `ResizeObserver`. The design system's tooltips observe
|
|
48
|
+
* their target's size; this observer never reports, as an element that never
|
|
49
|
+
* resizes would not.
|
|
50
|
+
*/
|
|
51
|
+
export function installResizeObserver(): void {
|
|
52
|
+
globalThis.ResizeObserver = class ResizeObserver {
|
|
53
|
+
observe(): void {}
|
|
54
|
+
unobserve(): void {}
|
|
55
|
+
disconnect(): void {}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { route } from "@canonical/router-core";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The app's route names and URL shapes, with no page content: chrome and page
|
|
5
|
+
* tests render under a router that knows every name the app links to, without
|
|
6
|
+
* importing the real route map and, with it, every domain page.
|
|
7
|
+
*/
|
|
8
|
+
export const stubRoutes = {
|
|
9
|
+
home: route({ url: "/", content: () => null }),
|
|
10
|
+
guide: route({ url: "/guides/:slug", content: () => null }),
|
|
11
|
+
<% if (relay) { -%>
|
|
12
|
+
catalog: route({ url: "/catalog", content: () => null }),
|
|
13
|
+
<% } -%>
|
|
14
|
+
<% if (forms) { -%>
|
|
15
|
+
contact: route({ url: "/contact", content: () => null }),
|
|
16
|
+
<% } -%>
|
|
17
|
+
account: route({ url: "/account", content: () => null }),
|
|
18
|
+
<% if (appShell) { -%>
|
|
19
|
+
dashboard: route({ url: "/dashboard", content: () => null }),
|
|
20
|
+
dashboardInstances: route({
|
|
21
|
+
url: "/dashboard/instances",
|
|
22
|
+
content: () => null,
|
|
23
|
+
}),
|
|
24
|
+
dashboardSettings: route({
|
|
25
|
+
url: "/dashboard/settings",
|
|
26
|
+
content: () => null,
|
|
27
|
+
}),
|
|
28
|
+
<% } -%>
|
|
29
|
+
} as const;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<% if (intl) { -%>
|
|
2
|
+
import { I18nProvider } from "@canonical/i18n-react";
|
|
3
|
+
<% } -%>
|
|
4
|
+
import { HeadProvider } from "@canonical/react-head";
|
|
5
|
+
import { createMemoryAdapter, createRouter } from "@canonical/router-core";
|
|
6
|
+
import { RouterProvider } from "@canonical/router-react";
|
|
7
|
+
import { render } from "@testing-library/react";
|
|
8
|
+
import type { ReactElement } from "react";
|
|
9
|
+
import formatDocumentTitle from "../formatDocumentTitle.js";
|
|
10
|
+
<% if (intl) { -%>
|
|
11
|
+
import { catalogs, i18nConfig } from "../i18n/index.js";
|
|
12
|
+
<% } -%>
|
|
13
|
+
import { stubRoutes } from "./fixtures.js";
|
|
14
|
+
|
|
15
|
+
<% if (intl) { -%>
|
|
16
|
+
/**
|
|
17
|
+
* Renders `ui` under the providers both entries mount — i18n, head and the
|
|
18
|
+
* router — with the router at `path` and the catalogs in `locale`, so
|
|
19
|
+
* components that read the current location or translate their labels render
|
|
20
|
+
* as they do in the app.
|
|
21
|
+
*
|
|
22
|
+
* Returns the render result and the router, for asserting navigation.
|
|
23
|
+
*/
|
|
24
|
+
export default function renderWithProviders(
|
|
25
|
+
ui: ReactElement,
|
|
26
|
+
path = "/",
|
|
27
|
+
locale = "en",
|
|
28
|
+
) {
|
|
29
|
+
const router = createRouter(stubRoutes, {
|
|
30
|
+
adapter: createMemoryAdapter(path),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const result = render(
|
|
34
|
+
<I18nProvider catalogs={catalogs} config={i18nConfig} locale={locale}>
|
|
35
|
+
<HeadProvider titleTemplate={formatDocumentTitle}>
|
|
36
|
+
<RouterProvider router={router}>{ui}</RouterProvider>
|
|
37
|
+
</HeadProvider>
|
|
38
|
+
</I18nProvider>,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return { ...result, router };
|
|
42
|
+
}
|
|
43
|
+
<% } else { -%>
|
|
44
|
+
/**
|
|
45
|
+
* Renders `ui` under the providers both entries mount — head and the router —
|
|
46
|
+
* with the router at `path`, so components that read the current location
|
|
47
|
+
* render as they do in the app.
|
|
48
|
+
*
|
|
49
|
+
* Returns the render result and the router, for asserting navigation.
|
|
50
|
+
*/
|
|
51
|
+
export default function renderWithProviders(ui: ReactElement, path = "/") {
|
|
52
|
+
const router = createRouter(stubRoutes, {
|
|
53
|
+
adapter: createMemoryAdapter(path),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const result = render(
|
|
57
|
+
<HeadProvider titleTemplate={formatDocumentTitle}>
|
|
58
|
+
<RouterProvider router={router}>{ui}</RouterProvider>
|
|
59
|
+
</HeadProvider>,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return { ...result, router };
|
|
63
|
+
}
|
|
64
|
+
<% } -%>
|
|
@@ -38,6 +38,9 @@ const CWD = process.cwd();
|
|
|
38
38
|
// Readiness budgets: dev* boots straight away; preview* builds the client +
|
|
39
39
|
// renderer before serving, so it needs a larger budget.
|
|
40
40
|
<% } -%>
|
|
41
|
+
/** The application's name, which every page title ends with. */
|
|
42
|
+
const APP_NAME = "<%= name %>";
|
|
43
|
+
|
|
41
44
|
const DEV_READY_MS = 20_000;
|
|
42
45
|
const PREVIEW_READY_MS = 90_000;
|
|
43
46
|
const TEST_TIMEOUT_MS = PREVIEW_READY_MS + 30_000;
|
|
@@ -124,7 +127,7 @@ describe("server matrix (2×3) serves correctly", () => {
|
|
|
124
127
|
const head = html.slice(0, html.indexOf("</head>"));
|
|
125
128
|
|
|
126
129
|
expect(head.match(/<title>/g)?.length ?? 0).toBe(1);
|
|
127
|
-
expect(head).toContain(
|
|
130
|
+
expect(head).toContain(`<title>Home — ${APP_NAME}</title>`);
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
// 5. SSR cells render /sitemap.xml as XML from the sitemap renderer —
|
|
@@ -242,6 +245,39 @@ describe("server matrix (2×3) serves correctly", () => {
|
|
|
242
245
|
const home = await fetch(`${server.base}/`);
|
|
243
246
|
expect(await home.text()).not.toContain("relayPayloads");
|
|
244
247
|
}
|
|
248
|
+
<% } -%>
|
|
249
|
+
<% if (appShell && !spa) { -%>
|
|
250
|
+
|
|
251
|
+
// SSR cells render the dashboard under the top bar, inside the
|
|
252
|
+
// application shell, each a surface: its own title in <head>, the
|
|
253
|
+
// side navigation with the current page marked, and the design
|
|
254
|
+
// system's icons served at /icons, which its items reference.
|
|
255
|
+
if (cell.ssr) {
|
|
256
|
+
const dashboard = await fetch(`${server.base}/dashboard`);
|
|
257
|
+
expect(dashboard.status).toBe(200);
|
|
258
|
+
const dashboardHtml = await dashboard.text();
|
|
259
|
+
const dashboardHead = dashboardHtml.slice(
|
|
260
|
+
0,
|
|
261
|
+
dashboardHtml.indexOf("</head>"),
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
expect(dashboardHead.match(/<title>/g)?.length ?? 0).toBe(1);
|
|
265
|
+
expect(dashboardHead).toContain(
|
|
266
|
+
`<title>Dashboard — ${APP_NAME}</title>`,
|
|
267
|
+
);
|
|
268
|
+
expect(dashboardHtml).toContain('class="ds top-bar surface"');
|
|
269
|
+
expect(dashboardHtml).toContain(
|
|
270
|
+
'class="ds application-shell surface"',
|
|
271
|
+
);
|
|
272
|
+
expect(dashboardHtml).toContain('class="ds side-navigation"');
|
|
273
|
+
expect(dashboardHtml).toContain(
|
|
274
|
+
'aria-current="page" class="row" href="/dashboard"',
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
const icon = await fetch(`${server.base}/icons/containers.svg`);
|
|
278
|
+
expect(icon.status).toBe(200);
|
|
279
|
+
expect(icon.headers.get("content-type")).toMatch(/svg/);
|
|
280
|
+
}
|
|
245
281
|
<% } -%>
|
|
246
282
|
} finally {
|
|
247
283
|
await server.stop();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createReadStream, existsSync } from "node:fs";
|
|
2
2
|
import { cp, mkdir } from "node:fs/promises";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import { dirname, join } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
5
|
import type { Plugin, ResolvedConfig } from "vite";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -18,7 +18,12 @@ import type { Plugin, ResolvedConfig } from "vite";
|
|
|
18
18
|
const iconsDir = () =>
|
|
19
19
|
join(
|
|
20
20
|
dirname(
|
|
21
|
-
|
|
21
|
+
// `require.resolve` rather than `import.meta.resolve`: Vite bundles this
|
|
22
|
+
// file with the config, and under the Bun dev server the bundled config
|
|
23
|
+
// cannot resolve `import.meta.resolve`, so every icon answered 404.
|
|
24
|
+
createRequire(import.meta.url).resolve(
|
|
25
|
+
"@canonical/ds-assets/package.json",
|
|
26
|
+
),
|
|
22
27
|
),
|
|
23
28
|
"icons",
|
|
24
29
|
);
|
|
@@ -6,6 +6,10 @@ import viteConfig from "./vite.config.js";
|
|
|
6
6
|
export default mergeConfig(
|
|
7
7
|
viteConfig({ command: "serve", mode: "test" }),
|
|
8
8
|
defineConfig({
|
|
9
|
+
// Some @canonical packages declare only a "module" entry, with no "main"
|
|
10
|
+
// or "exports" (react-ds-app, react-ds-global-form). The test
|
|
11
|
+
// environment's resolver reads no "module" field by default, so name it.
|
|
12
|
+
resolve: { mainFields: ["module", "jsnext:main", "jsnext"] },
|
|
9
13
|
test: {
|
|
10
14
|
// Browser-like environment for component tests
|
|
11
15
|
environment: "jsdom",
|
|
@@ -13,8 +17,8 @@ export default mergeConfig(
|
|
|
13
17
|
globals: true,
|
|
14
18
|
// Extend matchers and clean up the DOM between tests
|
|
15
19
|
setupFiles: ["./vitest.setup.ts"],
|
|
16
|
-
//
|
|
17
|
-
include: ["src/**/*.
|
|
20
|
+
// Unit and component tests are colocated and named *.test.ts(x)
|
|
21
|
+
include: ["src/**/*.test.ts", "src/**/*.test.tsx"],
|
|
18
22
|
coverage: {
|
|
19
23
|
provider: "v8",
|
|
20
24
|
// Thresholds start at 0 — coverage is reported but does not gate.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function textHelpers(intl) {
|
|
2
|
+
const call = (key) => `t(${JSON.stringify(key)})`;
|
|
3
|
+
return {
|
|
4
|
+
msg: (key, english) => (intl ? `{${call(key)}}` : english),
|
|
5
|
+
attr: (key, english) => (intl ? `{${call(key)}}` : JSON.stringify(english)),
|
|
6
|
+
str: (key, english) => (intl ? call(key) : JSON.stringify(english)),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=textHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textHelpers.js","sourceRoot":"","sources":["../../../../src/application/react/textHelpers.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC;IAE1D,OAAO;QACL,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1D,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC3E,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KACpE,CAAC;AACJ,CAAC"}
|
|
@@ -3,11 +3,17 @@ import * as path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { info, map } from "@canonical/task";
|
|
5
5
|
/**
|
|
6
|
-
* Resolve the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* Resolve the version ranges that a generated app pins for the @canonical/*
|
|
7
|
+
* packages it depends on directly. Those packages come from two repositories,
|
|
8
|
+
* each released on its own version line:
|
|
9
|
+
*
|
|
10
|
+
* - **pragma-web** — everything that renders and runs in the app:
|
|
11
|
+
* react-ds-global(-form), react-ds-app, react-head, react-hooks, react-ssr,
|
|
12
|
+
* router-core, router-react, i18n-*, ds-*, styles, storybook-*,
|
|
13
|
+
* typescript-config-react. Pinned to `PRAGMA_WEB_VERSION`.
|
|
14
|
+
* - **pragma-core** — the toolchain this generator ships with, of which the app
|
|
15
|
+
* depends only on biome-config. Pinned to this generator's own version, since
|
|
16
|
+
* summon-application is released in lockstep with the rest of pragma-core.
|
|
11
17
|
*
|
|
12
18
|
* Scope notes:
|
|
13
19
|
* - Third-party deps (react, express, vite…) keep their own ranges.
|
|
@@ -15,12 +21,18 @@ import { info, map } from "@canonical/task";
|
|
|
15
21
|
* it reaches the app transitively via `@canonical/styles`, which owns its range.
|
|
16
22
|
*
|
|
17
23
|
* Resolution is fully offline, by design: `pragma create` performs no network
|
|
18
|
-
* calls
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
24
|
+
* calls, and two scaffolds of the same generator are byte-identical (a registry
|
|
25
|
+
* lookup here once made concurrent scaffolds race the network and diverge).
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The pragma-web release the templates are written against. The templates
|
|
29
|
+
* import from these packages (the application shell's `SelectInput`, say), so
|
|
30
|
+
* this is the oldest release they build with, and the caret range keeps a
|
|
31
|
+
* generated app on that minor line. Renovate tracks it through
|
|
32
|
+
* `@canonical/react-ds-global`, one of the packages released at this version;
|
|
33
|
+
* a bump is reviewed against the templates rather than merged on sight.
|
|
23
34
|
*/
|
|
35
|
+
export const PRAGMA_WEB_VERSION = "0.45.0";
|
|
24
36
|
const OWN_PACKAGE = "@canonical/summon-application";
|
|
25
37
|
/**
|
|
26
38
|
* Walk up from `from` until a `package.json` names `packageName`, and return
|
|
@@ -91,24 +103,26 @@ export function ownVersion() {
|
|
|
91
103
|
return cachedOwnVersion;
|
|
92
104
|
}
|
|
93
105
|
/**
|
|
94
|
-
* The generator's own release-line version, used as the
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* "latest" escape survives only as a last resort for a mangled installation.
|
|
106
|
+
* The generator's own release-line version, used as the range for the
|
|
107
|
+
* pragma-core packages. The module always sits inside its own package, so the
|
|
108
|
+
* walk cannot miss in practice; the "latest" escape survives only as a last
|
|
109
|
+
* resort for a mangled installation.
|
|
99
110
|
*/
|
|
100
|
-
function
|
|
111
|
+
function coreRange() {
|
|
101
112
|
const own = ownVersion();
|
|
102
113
|
return own === "unknown" ? "latest" : `^${own}`;
|
|
103
114
|
}
|
|
104
115
|
/**
|
|
105
|
-
* Resolve the version
|
|
106
|
-
* generator pipeline (dry-run included). Deterministic and offline
|
|
107
|
-
* comes from the installed generator's own release line.
|
|
116
|
+
* Resolve the version ranges as a Task so the decision is visible in the
|
|
117
|
+
* generator pipeline (dry-run included). Deterministic and offline.
|
|
108
118
|
*/
|
|
109
119
|
export function resolvePragmaVersion() {
|
|
110
|
-
const
|
|
111
|
-
|
|
120
|
+
const ranges = {
|
|
121
|
+
core: coreRange(),
|
|
122
|
+
web: `^${PRAGMA_WEB_VERSION}`,
|
|
123
|
+
};
|
|
124
|
+
return map(info(`Pinning @canonical/* packages: pragma-web to ${ranges.web}, ` +
|
|
125
|
+
`pragma-core to ${ranges.core} (the installed generator's release line).`), () => ranges);
|
|
112
126
|
}
|
|
113
127
|
/**
|
|
114
128
|
* Print a version table for the current generator run.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../src/shared/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../src/shared/versions.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,6 +2,7 @@ import type { GeneratorDefinition } from "@canonical/summon-core";
|
|
|
2
2
|
export interface ApplicationReactAnswers {
|
|
3
3
|
readonly appPath: string;
|
|
4
4
|
readonly forms: boolean;
|
|
5
|
+
readonly appShell: boolean;
|
|
5
6
|
readonly intl: boolean;
|
|
6
7
|
readonly rendering: "ssr" | "spa";
|
|
7
8
|
readonly relay: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/application/react/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EAGpB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/application/react/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EAGpB,MAAM,wBAAwB,CAAC;AAyBhC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAyGD,eAAO,MAAM,SAAS,EAAE,mBAAmB,CAAC,uBAAuB,CA6vBlE,CAAC;eAEa,SAAS"}
|