-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: generated files with flat routes overwriting eachother
- Loading branch information
Showing
11 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@marko/run": patch | ||
--- | ||
|
||
Fix nested flat routes with layouts being shared |
58 changes: 58 additions & 0 deletions
58
packages/run/src/__tests__/fixtures/basic-nested-page/.marko-run/routes.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
WARNING: This file is automatically generated and any changes made to it will be overwritten without warning. | ||
Do NOT manually edit this file or your changes will be lost. | ||
*/ | ||
|
||
import { NotHandled, NotMatched, GetPaths, PostPaths, GetablePath, GetableHref, PostablePath, PostableHref, Platform } from "@marko/run/namespace"; | ||
import type * as Run from "@marko/run"; | ||
|
||
|
||
declare module "@marko/run" { | ||
interface AppData extends Run.DefineApp<{ | ||
routes: { | ||
"/foo": Routes["/foo"]; | ||
"/foo/bar": Routes["/foo/bar"]; | ||
} | ||
}> {} | ||
} | ||
|
||
declare module "../src/routes/foo/+page.marko" { | ||
namespace MarkoRun { | ||
export { NotHandled, NotMatched, GetPaths, PostPaths, GetablePath, GetableHref, PostablePath, PostableHref, Platform }; | ||
export type Route = Run.Routes["/foo"]; | ||
export type Context = Run.MultiRouteContext<Route> & Marko.Global; | ||
export type Handler = Run.HandlerLike<Route>; | ||
/** @deprecated use `((context, next) => { ... }) satisfies MarkoRun.Handler` instead */ | ||
export const route: Run.HandlerTypeFn<Route>; | ||
} | ||
} | ||
|
||
declare module "../src/routes/foo/bar+page.marko" { | ||
namespace MarkoRun { | ||
export { NotHandled, NotMatched, GetPaths, PostPaths, GetablePath, GetableHref, PostablePath, PostableHref, Platform }; | ||
export type Route = Run.Routes["/foo/bar"]; | ||
export type Context = Run.MultiRouteContext<Route> & Marko.Global; | ||
export type Handler = Run.HandlerLike<Route>; | ||
/** @deprecated use `((context, next) => { ... }) satisfies MarkoRun.Handler` instead */ | ||
export const route: Run.HandlerTypeFn<Route>; | ||
} | ||
} | ||
|
||
declare module "../src/routes/+layout.marko" { | ||
export interface Input { | ||
renderBody: Marko.Body; | ||
} | ||
namespace MarkoRun { | ||
export { NotHandled, NotMatched, GetPaths, PostPaths, GetablePath, GetableHref, PostablePath, PostableHref, Platform }; | ||
export type Route = Run.Routes["/foo" | "/foo/bar"]; | ||
export type Context = Run.MultiRouteContext<Route> & Marko.Global; | ||
export type Handler = Run.HandlerLike<Route>; | ||
/** @deprecated use `((context, next) => { ... }) satisfies MarkoRun.Handler` instead */ | ||
export const route: Run.HandlerTypeFn<Route>; | ||
} | ||
} | ||
|
||
type Routes = { | ||
"/foo": { verb: "get"; }; | ||
"/foo/bar": { verb: "get"; }; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ages/run/src/__tests__/fixtures/basic-nested-page/__snapshots__/dev.expected.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Loading | ||
|
||
```html | ||
/foo/bar page rendered | ||
``` | ||
|
6 changes: 6 additions & 0 deletions
6
.../run/src/__tests__/fixtures/basic-nested-page/__snapshots__/preview.expected.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Loading | ||
|
||
```html | ||
/foo/bar page rendered | ||
``` | ||
|
12 changes: 12 additions & 0 deletions
12
packages/run/src/__tests__/fixtures/basic-nested-page/src/routes/+layout.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>@marko/run Test Fixture</title> | ||
</head> | ||
<body> | ||
<div#app> | ||
<${input.renderBody}/> | ||
</div> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
packages/run/src/__tests__/fixtures/basic-nested-page/src/routes/foo/+page.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- /foo page rendered |
1 change: 1 addition & 0 deletions
1
packages/run/src/__tests__/fixtures/basic-nested-page/src/routes/foo/bar+page.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- /foo/bar page rendered |
1 change: 1 addition & 0 deletions
1
packages/run/src/__tests__/fixtures/basic-nested-page/test.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const path = '/foo/bar' |
4 changes: 4 additions & 0 deletions
4
packages/run/src/__tests__/fixtures/basic-nested-page/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../../tsconfig-base.json", | ||
"include": ["src/**/*", ".marko-run/*"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters