Make .marko-run/routes.d.ts diff-able
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 175
- Forks
- 17
- Avg merge
- 5h 26m
- Merged PRs (30d)
- 5
Description
Some lines of the generated .marko-run/routes.d.ts can be very long. This makes it wrap on small columns, and especially difficult to diff by a human.
Eg:
declare module "../src/routes/+layout.marko" {
export interface Input extends Run.LayoutInput<typeof import("../src/routes/+layout.marko")> {}
namespace MarkoRun {
export { NotHandled, NotMatched, GetPaths, PostPaths, GetablePath, GetableHref, PostablePath, PostableHref, Platform };
export type Route = Run.Routes["/aaaaa" | "/bbbbb" | "/ccccc" | "/ddddd" | "/eeeee" | "/fffff"];
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>;
}
}
Could perhaps be written as:
declare module "../src/routes/+layout.marko" {
export interface Input
extends Run.LayoutInput<typeof import("../src/routes/+layout.marko")> {}
namespace MarkoRun {
export {
NotHandled,
NotMatched,
GetPaths,
PostPaths,
GetablePath,
GetableHref,
PostablePath,
PostableHref,
Platform,
};
export type Route = Run.Routes[
| "/aaaaa"
| "/bbbbb"
| "/ccccc"
| "/ddddd"
| "/eeeee"
| "/fffff"
];
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>;
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the generator that produces .marko-run/routes.d.ts and inspect how route declarations, exported names, and union types are formatted. Compare its output with the diff-friendly example in the issue; done means generated declarations wrap long lines and remain valid TypeScript.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100