@qwik.dev/router 2.0.0-alpha.9 → 2.0.0-beta.2
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 +1 -1
- package/lib/adapters/azure-swa/vite/index.cjs +3 -3
- package/lib/adapters/azure-swa/vite/index.d.ts +13 -13
- package/lib/adapters/bun-server/vite/index.cjs +3 -3
- package/lib/adapters/bun-server/vite/index.d.ts +14 -14
- package/lib/adapters/cloud-run/vite/index.cjs +3 -3
- package/lib/adapters/cloud-run/vite/index.d.ts +13 -13
- package/lib/adapters/cloudflare-pages/vite/index.cjs +3 -3
- package/lib/adapters/cloudflare-pages/vite/index.d.ts +27 -27
- package/lib/adapters/deno-server/vite/index.cjs +3 -3
- package/lib/adapters/deno-server/vite/index.d.ts +14 -14
- package/lib/adapters/netlify-edge/vite/index.cjs +3 -3
- package/lib/adapters/netlify-edge/vite/index.d.ts +44 -44
- package/lib/adapters/node-server/vite/index.cjs +3 -3
- package/lib/adapters/node-server/vite/index.d.ts +14 -14
- package/lib/adapters/shared/vite/index.cjs +10 -3
- package/lib/adapters/shared/vite/index.d.ts +114 -114
- package/lib/adapters/shared/vite/index.mjs +7 -0
- package/lib/adapters/static/vite/index.cjs +10 -3
- package/lib/adapters/static/vite/index.d.ts +10 -10
- package/lib/adapters/static/vite/index.mjs +7 -0
- package/lib/adapters/vercel-edge/vite/index.cjs +3 -3
- package/lib/adapters/vercel-edge/vite/index.d.ts +45 -45
- package/lib/index.d.ts +878 -810
- package/lib/index.qwik.cjs +110 -48
- package/lib/index.qwik.mjs +112 -50
- package/lib/middleware/aws-lambda/index.d.ts +48 -48
- package/lib/middleware/azure-swa/index.d.ts +28 -28
- package/lib/middleware/bun/index.d.ts +35 -35
- package/lib/middleware/cloudflare-pages/index.d.ts +35 -35
- package/lib/middleware/deno/index.d.ts +47 -47
- package/lib/middleware/firebase/index.d.ts +26 -26
- package/lib/middleware/netlify-edge/index.d.ts +27 -27
- package/lib/middleware/node/index.cjs +3 -3
- package/lib/middleware/node/index.d.ts +64 -64
- package/lib/middleware/request-handler/index.cjs +142 -73
- package/lib/middleware/request-handler/index.d.ts +710 -676
- package/lib/middleware/request-handler/index.mjs +138 -70
- package/lib/middleware/vercel-edge/index.d.ts +26 -26
- package/lib/service-worker.cjs +13 -263
- package/lib/service-worker.d.ts +15 -4
- package/lib/service-worker.mjs +13 -263
- package/lib/static/index.cjs +3 -3
- package/lib/static/index.d.ts +96 -96
- package/lib/static/node.cjs +3 -3
- package/lib/vite/index.cjs +209 -261
- package/lib/vite/index.d.ts +154 -154
- package/lib/vite/index.mjs +207 -259
- package/package.json +7 -7
package/lib/static/index.d.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import type { RenderOptions } from '@qwik.dev/core/server';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Use this function when SSG should be generated from another module, such as a Vite plugin. This
|
|
5
|
-
* function's should be passed the paths of the entry module and Qwik Router Plan.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare function generate(opts: StaticGenerateOptions): Promise<StaticGenerateResult>;
|
|
10
|
-
|
|
11
|
-
/** @public */
|
|
12
|
-
export declare interface StaticGenerateOptions extends StaticGenerateRenderOptions {
|
|
13
|
-
/**
|
|
14
|
-
* Path to the SSR module exporting the default render function. In most cases it'll be
|
|
15
|
-
* `./src/entry.ssr.tsx`.
|
|
16
|
-
*/
|
|
17
|
-
renderModulePath: string;
|
|
18
|
-
/** Path to the Qwik Router Config module exporting the default `@qwik-router-config`. */
|
|
19
|
-
qwikRouterConfigModulePath: string;
|
|
20
|
-
/** @deprecated Use `qwikRouterConfigModulePath` instead. Will be removed in V3 */
|
|
21
|
-
qwikCityPlanModulePath?: string;
|
|
22
|
-
/** Defaults to `/` */
|
|
23
|
-
basePathname?: string;
|
|
24
|
-
rootDir?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** @public */
|
|
28
|
-
export declare interface StaticGenerateRenderOptions extends RenderOptions {
|
|
29
|
-
/** File system directory where the static files should be written. */
|
|
30
|
-
outDir: string;
|
|
31
|
-
/**
|
|
32
|
-
* The URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For
|
|
33
|
-
* example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the
|
|
34
|
-
* `origin` does not include a `pathname`.
|
|
35
|
-
*
|
|
36
|
-
* The `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate
|
|
37
|
-
* a complete URL rather than just the `pathname`. For example, in order to render a correct
|
|
38
|
-
* canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.
|
|
39
|
-
*
|
|
40
|
-
* If the site also starts with a pathname other than `/`, please use the `basePathname` option in
|
|
41
|
-
* the Qwik Router config options.
|
|
42
|
-
*/
|
|
43
|
-
origin: string;
|
|
44
|
-
/**
|
|
45
|
-
* Maximum number of workers to use while generating the static pages. Defaults to the number of
|
|
46
|
-
* CPUs available.
|
|
47
|
-
*/
|
|
48
|
-
maxWorkers?: number;
|
|
49
|
-
/** Maximum number of tasks to be running at one time per worker. Defaults to `20`. */
|
|
50
|
-
maxTasksPerWorker?: number;
|
|
51
|
-
/**
|
|
52
|
-
* File system path to write the `sitemap.xml` to. Defaults to `sitemap.xml` and written to the
|
|
53
|
-
* root of the `outDir`. Setting to `null` will prevent the sitemap from being created.
|
|
54
|
-
*/
|
|
55
|
-
sitemapOutFile?: string | null;
|
|
56
|
-
/** Log level. */
|
|
57
|
-
log?: 'debug';
|
|
58
|
-
/**
|
|
59
|
-
* Set to `false` if the generated static HTML files should not be written to disk. Setting to
|
|
60
|
-
* `false` is useful if the SSG should only write the `q-data.json` files to disk. Defaults to
|
|
61
|
-
* `true`.
|
|
62
|
-
*/
|
|
63
|
-
emitHtml?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Set to `false` if the generated `q-data.json` data files should not be written to disk.
|
|
66
|
-
* Defaults to `true`.
|
|
67
|
-
*/
|
|
68
|
-
emitData?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Set to `false` if the static build should not write custom or default `404.html` pages.
|
|
71
|
-
* Defaults to `true`.
|
|
72
|
-
*/
|
|
73
|
-
emit404Pages?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* Defines file system routes relative to the source `routes` directory that should be static
|
|
76
|
-
* generated. Accepts wildcard behavior. This should not include the "base" pathname. If not
|
|
77
|
-
* provided, all routes will be static generated. `exclude` always takes priority over `include`.
|
|
78
|
-
*/
|
|
79
|
-
include?: string[];
|
|
80
|
-
/**
|
|
81
|
-
* Defines file system routes relative to the source `routes` directory that should not be static
|
|
82
|
-
* generated. Accepts wildcard behavior. This should not include the "base" pathname. `exclude`
|
|
83
|
-
* always takes priority over `include`.
|
|
84
|
-
*/
|
|
85
|
-
exclude?: string[];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** @public */
|
|
89
|
-
export declare interface StaticGenerateResult {
|
|
90
|
-
duration: number;
|
|
91
|
-
rendered: number;
|
|
92
|
-
errors: number;
|
|
93
|
-
staticPaths: string[];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { }
|
|
1
|
+
import type { RenderOptions } from '@qwik.dev/core/server';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Use this function when SSG should be generated from another module, such as a Vite plugin. This
|
|
5
|
+
* function's should be passed the paths of the entry module and Qwik Router Plan.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export declare function generate(opts: StaticGenerateOptions): Promise<StaticGenerateResult>;
|
|
10
|
+
|
|
11
|
+
/** @public */
|
|
12
|
+
export declare interface StaticGenerateOptions extends StaticGenerateRenderOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Path to the SSR module exporting the default render function. In most cases it'll be
|
|
15
|
+
* `./src/entry.ssr.tsx`.
|
|
16
|
+
*/
|
|
17
|
+
renderModulePath: string;
|
|
18
|
+
/** Path to the Qwik Router Config module exporting the default `@qwik-router-config`. */
|
|
19
|
+
qwikRouterConfigModulePath: string;
|
|
20
|
+
/** @deprecated Use `qwikRouterConfigModulePath` instead. Will be removed in V3 */
|
|
21
|
+
qwikCityPlanModulePath?: string;
|
|
22
|
+
/** Defaults to `/` */
|
|
23
|
+
basePathname?: string;
|
|
24
|
+
rootDir?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** @public */
|
|
28
|
+
export declare interface StaticGenerateRenderOptions extends RenderOptions {
|
|
29
|
+
/** File system directory where the static files should be written. */
|
|
30
|
+
outDir: string;
|
|
31
|
+
/**
|
|
32
|
+
* The URL `origin`, which is a combination of the scheme (protocol) and hostname (domain). For
|
|
33
|
+
* example, `https://qwik.dev` has the protocol `https://` and domain `qwik.dev`. However, the
|
|
34
|
+
* `origin` does not include a `pathname`.
|
|
35
|
+
*
|
|
36
|
+
* The `origin` is used to provide a full URL during Static Site Generation (SSG), and to simulate
|
|
37
|
+
* a complete URL rather than just the `pathname`. For example, in order to render a correct
|
|
38
|
+
* canonical tag URL or URLs within the `sitemap.xml`, the `origin` must be provided too.
|
|
39
|
+
*
|
|
40
|
+
* If the site also starts with a pathname other than `/`, please use the `basePathname` option in
|
|
41
|
+
* the Qwik Router config options.
|
|
42
|
+
*/
|
|
43
|
+
origin: string;
|
|
44
|
+
/**
|
|
45
|
+
* Maximum number of workers to use while generating the static pages. Defaults to the number of
|
|
46
|
+
* CPUs available.
|
|
47
|
+
*/
|
|
48
|
+
maxWorkers?: number;
|
|
49
|
+
/** Maximum number of tasks to be running at one time per worker. Defaults to `20`. */
|
|
50
|
+
maxTasksPerWorker?: number;
|
|
51
|
+
/**
|
|
52
|
+
* File system path to write the `sitemap.xml` to. Defaults to `sitemap.xml` and written to the
|
|
53
|
+
* root of the `outDir`. Setting to `null` will prevent the sitemap from being created.
|
|
54
|
+
*/
|
|
55
|
+
sitemapOutFile?: string | null;
|
|
56
|
+
/** Log level. */
|
|
57
|
+
log?: 'debug';
|
|
58
|
+
/**
|
|
59
|
+
* Set to `false` if the generated static HTML files should not be written to disk. Setting to
|
|
60
|
+
* `false` is useful if the SSG should only write the `q-data.json` files to disk. Defaults to
|
|
61
|
+
* `true`.
|
|
62
|
+
*/
|
|
63
|
+
emitHtml?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Set to `false` if the generated `q-data.json` data files should not be written to disk.
|
|
66
|
+
* Defaults to `true`.
|
|
67
|
+
*/
|
|
68
|
+
emitData?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Set to `false` if the static build should not write custom or default `404.html` pages.
|
|
71
|
+
* Defaults to `true`.
|
|
72
|
+
*/
|
|
73
|
+
emit404Pages?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Defines file system routes relative to the source `routes` directory that should be static
|
|
76
|
+
* generated. Accepts wildcard behavior. This should not include the "base" pathname. If not
|
|
77
|
+
* provided, all routes will be static generated. `exclude` always takes priority over `include`.
|
|
78
|
+
*/
|
|
79
|
+
include?: string[];
|
|
80
|
+
/**
|
|
81
|
+
* Defines file system routes relative to the source `routes` directory that should not be static
|
|
82
|
+
* generated. Accepts wildcard behavior. This should not include the "base" pathname. `exclude`
|
|
83
|
+
* always takes priority over `include`.
|
|
84
|
+
*/
|
|
85
|
+
exclude?: string[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @public */
|
|
89
|
+
export declare interface StaticGenerateResult {
|
|
90
|
+
duration: number;
|
|
91
|
+
rendered: number;
|
|
92
|
+
errors: number;
|
|
93
|
+
staticPaths: string[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { }
|
package/lib/static/node.cjs
CHANGED
|
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// packages/qwik-router/src/static/node/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
generate: () => generate
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// packages/qwik-router/src/static/node/node-system.ts
|
|
38
38
|
var import_node_fs2 = __toESM(require("node:fs"), 1);
|