@jay-framework/stack-route-scanner 0.22.1 → 0.23.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/dist/index.d.mts +5 -1
- package/dist/index.mjs +3 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,8 @@ type JayRoute = {
|
|
|
23
23
|
* e.g., /products/ceramic-flower-vase declares { slug: 'ceramic-flower-vase' }.
|
|
24
24
|
*/
|
|
25
25
|
inferredParams?: Record<string, string>;
|
|
26
|
+
/** When true, dev-server tooling route — consumers may filter from page navigation. */
|
|
27
|
+
devOnly?: boolean;
|
|
26
28
|
};
|
|
27
29
|
type JayRoutes = JayRoute[];
|
|
28
30
|
interface ScanFilesOptions {
|
|
@@ -43,7 +45,9 @@ declare function parseRouteSegments(routePath: string): JayRouteSegment[];
|
|
|
43
45
|
* Create a JayRoute from explicit path and file locations (DL#130).
|
|
44
46
|
* Used for plugin-provided routes where the path is declared, not inferred from the filesystem.
|
|
45
47
|
*/
|
|
46
|
-
declare function createRoute(routePath: string, jayHtmlPath: string, compPath: string, componentExport?: string
|
|
48
|
+
declare function createRoute(routePath: string, jayHtmlPath: string, compPath: string, componentExport?: string, options?: {
|
|
49
|
+
devOnly?: boolean;
|
|
50
|
+
}): JayRoute;
|
|
47
51
|
declare function scanRoutes(baseDir: string, options: ScanFilesOptions): Promise<JayRoutes>;
|
|
48
52
|
|
|
49
53
|
declare function routeToExpressRoute(route: JayRoute): string;
|
package/dist/index.mjs
CHANGED
|
@@ -172,13 +172,14 @@ function parseRouteSegments(routePath) {
|
|
|
172
172
|
};
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
function createRoute(routePath, jayHtmlPath, compPath, componentExport) {
|
|
175
|
+
function createRoute(routePath, jayHtmlPath, compPath, componentExport, options) {
|
|
176
176
|
return {
|
|
177
177
|
segments: parseRouteSegments(routePath),
|
|
178
178
|
rawRoute: routePath,
|
|
179
179
|
jayHtmlPath,
|
|
180
180
|
compPath,
|
|
181
|
-
...componentExport && { componentExport }
|
|
181
|
+
...componentExport && { componentExport },
|
|
182
|
+
...options?.devOnly && { devOnly: true }
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
185
|
async function scanRoutes(baseDir, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/stack-route-scanner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"readme.md"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@jay-framework/logger": "^0.
|
|
12
|
+
"@jay-framework/logger": "^0.23.0",
|
|
13
13
|
"node-html-parser": "^6.1.12",
|
|
14
14
|
"yaml": "^2.3.4"
|
|
15
15
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test:watch": "vitest"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@jay-framework/dev-environment": "^0.
|
|
28
|
+
"@jay-framework/dev-environment": "^0.23.0",
|
|
29
29
|
"@types/node": "^20.11.5",
|
|
30
30
|
"nodemon": "^3.0.3",
|
|
31
31
|
"replace-in-file": "^7.1.0",
|