@marko/run 0.6.5 → 0.7.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/README.md +70 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapter/index.cjs +15 -17
- package/dist/adapter/index.js +15 -17
- package/dist/cli/index.mjs +414 -405
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/internal.cjs +55 -28
- package/dist/runtime/internal.d.ts +2 -3
- package/dist/runtime/internal.js +55 -27
- package/dist/runtime/types.d.ts +17 -7
- package/dist/vite/codegen/index.d.ts +5 -6
- package/dist/vite/index.cjs +417 -414
- package/dist/vite/index.js +399 -393
- package/dist/vite/plugin.d.ts +1 -1
- package/dist/vite/routes/builder.d.ts +3 -4
- package/dist/vite/routes/vdir.d.ts +0 -1
- package/dist/vite/routes/walk.d.ts +1 -1
- package/dist/vite/types.d.ts +21 -8
- package/dist/vite/utils/fs.d.ts +1 -0
- package/dist/vite/utils/route.d.ts +1 -0
- package/package.json +3 -2
package/dist/vite/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Plugin, type ResolvedConfig } from "vite";
|
|
2
2
|
import type { Adapter, Options, PackageData } from "./types";
|
|
3
3
|
export declare const defaultPort: number;
|
|
4
4
|
export default function markoRun(opts?: Options): Plugin[];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { BuiltRoutes, RoutableFileType
|
|
1
|
+
import type { BuiltRoutes, RoutableFileType } from "../types";
|
|
2
2
|
import type { Walker } from "./walk";
|
|
3
3
|
export declare function isRoutableFile(filename: string): boolean;
|
|
4
4
|
export declare function matchRoutableFile(filename: string): RoutableFileType | null;
|
|
5
|
-
export declare function isSpecialType(type: RoutableFileType): type is keyof SpecialRoutes;
|
|
6
5
|
export interface RouteSource {
|
|
7
6
|
walker: Walker;
|
|
8
|
-
importPrefix?: string;
|
|
9
7
|
basePath?: string;
|
|
10
8
|
}
|
|
11
|
-
export declare function buildRoutes(sources: RouteSource | RouteSource[]): Promise<BuiltRoutes>;
|
|
9
|
+
export declare function buildRoutes(sources: RouteSource | RouteSource[], outDir: string): Promise<BuiltRoutes>;
|
|
10
|
+
export declare function replaceInvalidFilenameChars(str: string): string;
|
|
@@ -11,4 +11,4 @@ export interface WalkOptions {
|
|
|
11
11
|
export type Walker = (options: WalkOptions) => Promise<void>;
|
|
12
12
|
export declare function createFSWalker(dir: string): Walker;
|
|
13
13
|
export type TestFileTree = [string, (string | TestFileTree)[]];
|
|
14
|
-
export declare function createTestWalker(dir: TestFileTree): Walker;
|
|
14
|
+
export declare function createTestWalker(dir: TestFileTree, root: string): Walker;
|
package/dist/vite/types.d.ts
CHANGED
|
@@ -27,11 +27,27 @@ export interface Adapter {
|
|
|
27
27
|
pluginOptions?(options: Options): Promise<Options> | Options | undefined;
|
|
28
28
|
viteConfig?(config: UserConfig): Promise<UserConfig> | UserConfig | undefined;
|
|
29
29
|
getEntryFile?(): Promise<string> | string;
|
|
30
|
-
startDev?(
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
startDev?(event: {
|
|
31
|
+
entry: string | undefined;
|
|
32
|
+
config: InlineConfig;
|
|
33
|
+
options: StartDevOptions;
|
|
34
|
+
}): Promise<SpawnedServer> | SpawnedServer;
|
|
35
|
+
startPreview?(event: {
|
|
36
|
+
entry: string | undefined;
|
|
37
|
+
options: StartPreviewOptions;
|
|
38
|
+
}): Promise<SpawnedServer> | SpawnedServer;
|
|
39
|
+
buildEnd?(event: {
|
|
40
|
+
config: ResolvedConfig;
|
|
41
|
+
routes: BuiltRoutes;
|
|
42
|
+
builtEntries: string[];
|
|
43
|
+
sourceEntries: string[];
|
|
44
|
+
}): Promise<void> | void;
|
|
33
45
|
typeInfo?(writer: (data: string) => void): Promise<string> | string;
|
|
34
|
-
routesGenerated?(
|
|
46
|
+
routesGenerated?(event: {
|
|
47
|
+
routes: BuiltRoutes;
|
|
48
|
+
virtualFiles: Map<string, string>;
|
|
49
|
+
meta: RouteGenerationData;
|
|
50
|
+
}): Promise<void> | void;
|
|
35
51
|
}
|
|
36
52
|
export interface RouterOptions {
|
|
37
53
|
trailingSlashes: "Ignore" | "RedirectWithout" | "RedirectWith" | "RewriteWithout" | "RewriteWith";
|
|
@@ -45,14 +61,13 @@ export type Options = MarkoRunOptions & MarkoViteOptions;
|
|
|
45
61
|
export interface Route {
|
|
46
62
|
key: string;
|
|
47
63
|
index: number;
|
|
48
|
-
|
|
64
|
+
path: PathInfo;
|
|
49
65
|
layouts: RoutableFile[];
|
|
50
66
|
middleware: RoutableFile[];
|
|
51
67
|
meta?: RoutableFile;
|
|
52
68
|
handler?: RoutableFile;
|
|
53
69
|
page?: RoutableFile;
|
|
54
70
|
templateFilePath?: string;
|
|
55
|
-
entryName: string;
|
|
56
71
|
}
|
|
57
72
|
export interface PathInfo {
|
|
58
73
|
id: string;
|
|
@@ -70,8 +85,6 @@ export interface RoutableFile {
|
|
|
70
85
|
name: string;
|
|
71
86
|
type: RoutableFileType;
|
|
72
87
|
filePath: string;
|
|
73
|
-
relativePath: string;
|
|
74
|
-
importPath: string;
|
|
75
88
|
verbs?: HttpVerb[];
|
|
76
89
|
}
|
|
77
90
|
export type BuiltRoutes = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizePath: (id: string) => string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { HttpVerb, Route } from "../types";
|
|
2
2
|
export declare function getVerbs(route: Route, noAutoHead?: boolean): HttpVerb[];
|
|
3
3
|
export declare function hasVerb(route: Route, verb: HttpVerb): boolean;
|
|
4
|
+
export declare function getRouteVirtualFileName(route: Route): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/run",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "The Marko application framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"marko"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"build": "rm -rf ./dist && tsc -b && tsx scripts/build.ts"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@marko/run-explorer": "^
|
|
57
|
+
"@marko/run-explorer": "^2.0.0",
|
|
58
58
|
"@marko/vite": "^5.1.1",
|
|
59
59
|
"browserslist": "^4.24.4",
|
|
60
60
|
"cli-table3": "^0.6.5",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"@babel/types": "^7.26.0",
|
|
78
78
|
"@marko/fixture-snapshots": "^2.2.1",
|
|
79
79
|
"@marko/testing-library": "^6.2.0",
|
|
80
|
+
"@micro-frame/marko": "^1.10.4",
|
|
80
81
|
"@types/debug": "^4.1.12",
|
|
81
82
|
"@types/diff": "^7.0.0",
|
|
82
83
|
"@types/glob": "^8.1.0",
|