@qwik.dev/router 2.0.0-alpha.8 → 2.0.0-beta.1

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/lib/adapters/azure-swa/vite/index.cjs +3 -3
  3. package/lib/adapters/azure-swa/vite/index.d.ts +13 -13
  4. package/lib/adapters/bun-server/vite/index.cjs +3 -3
  5. package/lib/adapters/bun-server/vite/index.d.ts +14 -14
  6. package/lib/adapters/cloud-run/vite/index.cjs +3 -3
  7. package/lib/adapters/cloud-run/vite/index.d.ts +13 -13
  8. package/lib/adapters/cloudflare-pages/vite/index.cjs +3 -3
  9. package/lib/adapters/cloudflare-pages/vite/index.d.ts +27 -27
  10. package/lib/adapters/deno-server/vite/index.cjs +3 -3
  11. package/lib/adapters/deno-server/vite/index.d.ts +14 -14
  12. package/lib/adapters/netlify-edge/vite/index.cjs +3 -3
  13. package/lib/adapters/netlify-edge/vite/index.d.ts +44 -44
  14. package/lib/adapters/node-server/vite/index.cjs +3 -3
  15. package/lib/adapters/node-server/vite/index.d.ts +14 -14
  16. package/lib/adapters/shared/vite/index.cjs +10 -3
  17. package/lib/adapters/shared/vite/index.d.ts +114 -114
  18. package/lib/adapters/shared/vite/index.mjs +7 -0
  19. package/lib/adapters/static/vite/index.cjs +10 -3
  20. package/lib/adapters/static/vite/index.d.ts +10 -10
  21. package/lib/adapters/static/vite/index.mjs +7 -0
  22. package/lib/adapters/vercel-edge/vite/index.cjs +3 -3
  23. package/lib/adapters/vercel-edge/vite/index.d.ts +45 -45
  24. package/lib/index.d.ts +878 -801
  25. package/lib/index.qwik.cjs +127 -51
  26. package/lib/index.qwik.mjs +130 -54
  27. package/lib/middleware/aws-lambda/index.d.ts +48 -50
  28. package/lib/middleware/azure-swa/index.d.ts +28 -28
  29. package/lib/middleware/bun/index.d.ts +35 -35
  30. package/lib/middleware/cloudflare-pages/index.d.ts +35 -35
  31. package/lib/middleware/deno/index.d.ts +47 -47
  32. package/lib/middleware/firebase/index.d.ts +26 -26
  33. package/lib/middleware/netlify-edge/index.d.ts +27 -27
  34. package/lib/middleware/node/index.cjs +3 -3
  35. package/lib/middleware/node/index.d.ts +64 -66
  36. package/lib/middleware/request-handler/index.cjs +133 -75
  37. package/lib/middleware/request-handler/index.d.ts +710 -681
  38. package/lib/middleware/request-handler/index.mjs +129 -72
  39. package/lib/middleware/vercel-edge/index.d.ts +26 -26
  40. package/lib/service-worker.cjs +13 -263
  41. package/lib/service-worker.d.ts +15 -4
  42. package/lib/service-worker.mjs +13 -263
  43. package/lib/static/index.cjs +3 -3
  44. package/lib/static/index.d.ts +96 -98
  45. package/lib/static/node.cjs +3 -3
  46. package/lib/vite/index.cjs +199 -262
  47. package/lib/vite/index.d.ts +154 -154
  48. package/lib/vite/index.mjs +197 -260
  49. package/package.json +8 -8
@@ -1,154 +1,154 @@
1
- import type { BuiltinsWithOptionalParams } from 'svgo/plugins/plugins-types';
2
- import type { CompileOptions } from '@mdx-js/mdx';
3
- import type { Config } from 'svgo';
4
- import { ConfigEnv } from 'vite';
5
- import type { Plugin as Plugin_2 } from 'vite';
6
- import type { PluginOption } from 'vite';
7
- import { UserConfigExport } from 'vite';
8
-
9
- declare interface BuildEntry extends ParsedPathname {
10
- id: string;
11
- chunkFileName: string;
12
- filePath: string;
13
- }
14
-
15
- declare interface BuildLayout {
16
- filePath: string;
17
- dirPath: string;
18
- id: string;
19
- layoutType: 'top' | 'nested';
20
- layoutName: string;
21
- }
22
-
23
- declare interface BuildRoute extends ParsedPathname {
24
- /** Unique id built from its relative file system path */
25
- id: string;
26
- /** Local file system path */
27
- filePath: string;
28
- ext: string;
29
- /** URL Pathname */
30
- pathname: string;
31
- layouts: BuildLayout[];
32
- }
33
-
34
- /** @public */
35
- export declare function extendConfig(baseConfigExport: UserConfigExport, serverConfigExport: UserConfigExport): (env: ConfigEnv) => Promise<Record<string, any>>;
36
-
37
- /** @public */
38
- declare interface ImageOptimizationOptions {
39
- jsxDirectives?: {
40
- quality?: `${number}`;
41
- format?: 'webp' | 'avif' | 'png';
42
- w?: string;
43
- h?: string;
44
- [key: string]: string | undefined;
45
- };
46
- svgo?: Pick<Config, 'floatPrecision' | 'multipass' | 'plugins'> & {
47
- defaultPresetOverrides?: BuiltinsWithOptionalParams['preset-default']['overrides'];
48
- prefixIds?: BuiltinsWithOptionalParams['prefixIds'] | false;
49
- };
50
- enabled?: boolean | 'only-production';
51
- }
52
-
53
- /** @public */
54
- export declare type MdxOptions = CompileOptions;
55
-
56
- declare interface MdxPlugins {
57
- remarkGfm: boolean;
58
- rehypeSyntaxHighlight: boolean;
59
- rehypeAutolinkHeadings: boolean;
60
- }
61
-
62
- declare type P<T> = Plugin_2<T> & {
63
- api: T;
64
- };
65
-
66
- declare interface ParsedPathname {
67
- routeName: string;
68
- pattern: RegExp;
69
- paramNames: string[];
70
- segments: PathnameSegment[];
71
- }
72
-
73
- declare type PathnameSegment = PathnameSegmentPart[];
74
-
75
- declare interface PathnameSegmentPart {
76
- content: string;
77
- dynamic: boolean;
78
- rest: boolean;
79
- }
80
-
81
- /** @public */
82
- declare interface PluginOptions {
83
- /** Directory of the `routes`. Defaults to `src/routes`. */
84
- routesDir?: string;
85
- /** Directory of the `server plugins`. Defaults to `src/server-plugins`. */
86
- serverPluginsDir?: string;
87
- /**
88
- * The base pathname is used to create absolute URL paths up to the `hostname`, and must always
89
- * start and end with a `/`. Defaults to `/`.
90
- */
91
- basePathname?: string;
92
- /**
93
- * Ensure a trailing slash ends page urls. Defaults to `true`. (Note: Previous versions defaulted
94
- * to `false`).
95
- */
96
- trailingSlash?: boolean;
97
- /** Enable or disable MDX plugins included by default in qwik-router. */
98
- mdxPlugins?: MdxPlugins;
99
- /** MDX Options https://mdxjs.com/ */
100
- mdx?: any;
101
- /** The platform object which can be used to mock the Cloudflare bindings. */
102
- platform?: Record<string, unknown>;
103
- /** Configuration to rewrite url paths */
104
- rewriteRoutes?: RewriteRouteOption[];
105
- }
106
-
107
- /**
108
- * @deprecated Use `qwikRouter` instead. Will be removed in V3
109
- * @public
110
- */
111
- export declare function qwikCity(userOpts?: QwikCityVitePluginOptions): PluginOption[];
112
-
113
- /**
114
- * @deprecated Use `QwikRouterPlugin` instead. Will be removed in V3
115
- * @public
116
- */
117
- export declare type QwikCityPlugin = QwikRouterPlugin;
118
-
119
- /**
120
- * @deprecated Use `QwikRouterVitePluginOptions` instead. Will be removed in V3
121
- * @public
122
- */
123
- export declare type QwikCityVitePluginOptions = QwikRouterVitePluginOptions;
124
-
125
- /** @public */
126
- export declare function qwikRouter(userOpts?: QwikRouterVitePluginOptions): PluginOption[];
127
-
128
- /** @public */
129
- export declare interface QwikRouterPlugin extends P<QwikRouterPluginApi> {
130
- name: 'vite-plugin-qwik-router';
131
- }
132
-
133
- /** @public */
134
- declare interface QwikRouterPluginApi {
135
- getBasePathname: () => string;
136
- getRoutes: () => BuildRoute[];
137
- getServiceWorkers: () => BuildEntry[];
138
- }
139
-
140
- /** @public */
141
- export declare interface QwikRouterVitePluginOptions extends Omit<PluginOptions, 'basePathname'> {
142
- mdxPlugins?: MdxPlugins;
143
- mdx?: MdxOptions;
144
- platform?: Record<string, unknown>;
145
- imageOptimization?: ImageOptimizationOptions;
146
- }
147
-
148
- /** @public */
149
- declare interface RewriteRouteOption {
150
- prefix?: string;
151
- paths: Record<string, string>;
152
- }
153
-
154
- export { }
1
+ import type { BuiltinsWithOptionalParams } from 'svgo/plugins/plugins-types';
2
+ import type { CompileOptions } from '@mdx-js/mdx';
3
+ import type { Config } from 'svgo';
4
+ import { ConfigEnv } from 'vite';
5
+ import type { Plugin as Plugin_2 } from 'vite';
6
+ import type { PluginOption } from 'vite';
7
+ import { UserConfigExport } from 'vite';
8
+
9
+ declare interface BuildEntry extends ParsedPathname {
10
+ id: string;
11
+ chunkFileName: string;
12
+ filePath: string;
13
+ }
14
+
15
+ declare interface BuildLayout {
16
+ filePath: string;
17
+ dirPath: string;
18
+ id: string;
19
+ layoutType: 'top' | 'nested';
20
+ layoutName: string;
21
+ }
22
+
23
+ declare interface BuildRoute extends ParsedPathname {
24
+ /** Unique id built from its relative file system path */
25
+ id: string;
26
+ /** Local file system path */
27
+ filePath: string;
28
+ ext: string;
29
+ /** URL Pathname */
30
+ pathname: string;
31
+ layouts: BuildLayout[];
32
+ }
33
+
34
+ /** @public */
35
+ export declare function extendConfig(baseConfigExport: UserConfigExport, serverConfigExport: UserConfigExport): (env: ConfigEnv) => Promise<Record<string, any>>;
36
+
37
+ /** @public */
38
+ declare interface ImageOptimizationOptions {
39
+ jsxDirectives?: {
40
+ quality?: `${number}`;
41
+ format?: 'webp' | 'avif' | 'png';
42
+ w?: string;
43
+ h?: string;
44
+ [key: string]: string | undefined;
45
+ };
46
+ svgo?: Pick<Config, 'floatPrecision' | 'multipass' | 'plugins'> & {
47
+ defaultPresetOverrides?: BuiltinsWithOptionalParams['preset-default']['overrides'];
48
+ prefixIds?: BuiltinsWithOptionalParams['prefixIds'] | false;
49
+ };
50
+ enabled?: boolean | 'only-production';
51
+ }
52
+
53
+ /** @public */
54
+ export declare type MdxOptions = CompileOptions;
55
+
56
+ declare interface MdxPlugins {
57
+ remarkGfm: boolean;
58
+ rehypeSyntaxHighlight: boolean;
59
+ rehypeAutolinkHeadings: boolean;
60
+ }
61
+
62
+ declare type P<T> = Plugin_2<T> & {
63
+ api: T;
64
+ };
65
+
66
+ declare interface ParsedPathname {
67
+ routeName: string;
68
+ pattern: RegExp;
69
+ paramNames: string[];
70
+ segments: PathnameSegment[];
71
+ }
72
+
73
+ declare type PathnameSegment = PathnameSegmentPart[];
74
+
75
+ declare interface PathnameSegmentPart {
76
+ content: string;
77
+ dynamic: boolean;
78
+ rest: boolean;
79
+ }
80
+
81
+ /** @public */
82
+ declare interface PluginOptions {
83
+ /** Directory of the `routes`. Defaults to `src/routes`. */
84
+ routesDir?: string;
85
+ /** Directory of the `server plugins`. Defaults to `src/server-plugins`. */
86
+ serverPluginsDir?: string;
87
+ /**
88
+ * The base pathname is used to create absolute URL paths up to the `hostname`, and must always
89
+ * start and end with a `/`. Defaults to `/`.
90
+ */
91
+ basePathname?: string;
92
+ /**
93
+ * Ensure a trailing slash ends page urls. Defaults to `true`. (Note: Previous versions defaulted
94
+ * to `false`).
95
+ */
96
+ trailingSlash?: boolean;
97
+ /** Enable or disable MDX plugins included by default in qwik-router. */
98
+ mdxPlugins?: MdxPlugins;
99
+ /** MDX Options https://mdxjs.com/ */
100
+ mdx?: any;
101
+ /** The platform object which can be used to mock the Cloudflare bindings. */
102
+ platform?: Record<string, unknown>;
103
+ /** Configuration to rewrite url paths */
104
+ rewriteRoutes?: RewriteRouteOption[];
105
+ }
106
+
107
+ /**
108
+ * @deprecated Use `qwikRouter` instead. Will be removed in V3
109
+ * @public
110
+ */
111
+ export declare function qwikCity(userOpts?: QwikCityVitePluginOptions): PluginOption[];
112
+
113
+ /**
114
+ * @deprecated Use `QwikRouterPlugin` instead. Will be removed in V3
115
+ * @public
116
+ */
117
+ export declare type QwikCityPlugin = QwikRouterPlugin;
118
+
119
+ /**
120
+ * @deprecated Use `QwikRouterVitePluginOptions` instead. Will be removed in V3
121
+ * @public
122
+ */
123
+ export declare type QwikCityVitePluginOptions = QwikRouterVitePluginOptions;
124
+
125
+ /** @public */
126
+ export declare function qwikRouter(userOpts?: QwikRouterVitePluginOptions): PluginOption[];
127
+
128
+ /** @public */
129
+ export declare interface QwikRouterPlugin extends P<QwikRouterPluginApi> {
130
+ name: 'vite-plugin-qwik-router';
131
+ }
132
+
133
+ /** @public */
134
+ declare interface QwikRouterPluginApi {
135
+ getBasePathname: () => string;
136
+ getRoutes: () => BuildRoute[];
137
+ getServiceWorkers: () => BuildEntry[];
138
+ }
139
+
140
+ /** @public */
141
+ export declare interface QwikRouterVitePluginOptions extends Omit<PluginOptions, 'basePathname'> {
142
+ mdxPlugins?: MdxPlugins;
143
+ mdx?: MdxOptions;
144
+ platform?: Record<string, unknown>;
145
+ imageOptimization?: ImageOptimizationOptions;
146
+ }
147
+
148
+ /** @public */
149
+ declare interface RewriteRouteOption {
150
+ prefix?: string;
151
+ paths: Record<string, string>;
152
+ }
153
+
154
+ export { }