@vyckr/tachyon 1.3.2 → 1.3.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyckr/tachyon",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "A polyglot, file-system-routed full-stack framework for Bun",
5
5
  "author": "Chidelma",
6
6
  "license": "MIT",
@@ -65,10 +65,12 @@ export default class Yon {
65
65
  }
66
66
  }
67
67
 
68
- // Bundle all client assets in parallel
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) ?? {};
@@ -1,3 +1,4 @@
1
+ import { existsSync } from 'fs'
1
2
  import Router from "./route-handler.js"
2
3
 
3
4
  /** A Bun subprocess with all three stdio channels opened as pipes. */
@@ -43,7 +44,8 @@ export default class Pool {
43
44
  for (const [route, methods] of Router.allRoutes) {
44
45
  for (const method of methods) {
45
46
  if (method === 'HTML' || method === 'OPTIONS') continue
46
- Pool.prewarmHandler(`${Router.routesPath}${route}/${method}`)
47
+ const handler = `${Router.routesPath}${route === '/' ? '' : route}/${method}`
48
+ if (existsSync(handler)) Pool.prewarmHandler(handler)
47
49
  }
48
50
  }
49
51
  }