stx-router 0.2.315 → 0.2.316

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.
@@ -74,9 +74,11 @@ export class Router {
74
74
  return bSegments - aSegments;
75
75
  return a.pattern.localeCompare(b.pattern);
76
76
  });
77
- const stxDir = path.resolve(baseDir, config.stateDir || process.env.STX_DIR?.trim() || ".stx");
78
- generateRouteTypes(this.routes, stxDir);
79
- generateRouteManifest(this.routes, stxDir, this.pagesDir);
77
+ if (config.emit !== !1) {
78
+ const stxDir = path.resolve(baseDir, config.stateDir || process.env.STX_DIR?.trim() || ".stx");
79
+ generateRouteTypes(this.routes, stxDir);
80
+ generateRouteManifest(this.routes, stxDir, this.pagesDir);
81
+ }
80
82
  }
81
83
  match(pathname) {
82
84
  const normalizedPath = pathname === "" ? "/" : pathname;
package/dist/types.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare interface RouterConfig {
16
16
  pagesDir?: string
17
17
  pagesDirs?: string[]
18
18
  stateDir?: string
19
+ emit?: boolean
19
20
  extensions?: string[]
20
21
  layouts?: boolean
21
22
  middleware?: boolean
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stx-router",
3
3
  "type": "module",
4
- "version": "0.2.315",
4
+ "version": "0.2.316",
5
5
  "description": "File-based router for STX — .stx template discovery, nested layouts, typed route params, middleware, and client-side SPA navigation.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",