@vyckr/tachyon 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -65,10 +65,12 @@ export default class Yon {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
//
|
|
68
|
+
// Components must be registered before pages/layouts compile so that
|
|
69
|
+
// compMapping is fully populated when import statements are generated.
|
|
70
|
+
await Yon.bundleComponents()
|
|
71
|
+
|
|
69
72
|
await Promise.all([
|
|
70
73
|
Yon.bundleDependencies(),
|
|
71
|
-
Yon.bundleComponents(),
|
|
72
74
|
Yon.bundleLayouts(),
|
|
73
75
|
Yon.bundlePages(),
|
|
74
76
|
Yon.bundleAssets()
|
|
@@ -331,6 +331,12 @@ function syncAttributes(oldEl: Element, newEl: Element) {
|
|
|
331
331
|
|
|
332
332
|
// ── Navigation / Routing ───────────────────────────────────────────────────────
|
|
333
333
|
function navigate(pathname: string) {
|
|
334
|
+
// Normalize trailing slash (e.g. Amplify 301s /docs → /docs/)
|
|
335
|
+
if (pathname !== '/' && pathname.endsWith('/')) {
|
|
336
|
+
pathname = pathname.slice(0, -1);
|
|
337
|
+
history.replaceState({}, '', pathname);
|
|
338
|
+
}
|
|
339
|
+
|
|
334
340
|
let handler: string;
|
|
335
341
|
let pageURL: string;
|
|
336
342
|
|
|
@@ -396,7 +402,7 @@ function resolveHandler(pathname: string): string {
|
|
|
396
402
|
let bestLen = -1;
|
|
397
403
|
|
|
398
404
|
for (const [routeKey] of routes) {
|
|
399
|
-
const routeSegs = routeKey.split('/');
|
|
405
|
+
const routeSegs = routeKey.split('/').slice(1);
|
|
400
406
|
if (routeSegs.length > segments.length) continue;
|
|
401
407
|
|
|
402
408
|
const slugMap = routes.get(routeKey) ?? {};
|