@qwik.dev/core 2.0.0-alpha.0 → 2.0.0-alpha.10

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 (105) hide show
  1. package/bindings/qwik.darwin-arm64.node +0 -0
  2. package/bindings/qwik.darwin-x64.node +0 -0
  3. package/bindings/qwik.linux-x64-gnu.node +0 -0
  4. package/bindings/qwik.wasm.cjs +259 -272
  5. package/bindings/qwik.wasm.mjs +259 -272
  6. package/bindings/qwik.win32-x64-msvc.node +0 -0
  7. package/bindings/qwik_wasm_bg.wasm +0 -0
  8. package/dist/build/index.cjs +3 -3
  9. package/dist/build/index.d.ts +22 -22
  10. package/dist/build/package.json +1 -1
  11. package/dist/cli.cjs +1453 -798
  12. package/dist/core-internal.d.ts +4368 -3895
  13. package/dist/core.cjs +6792 -6121
  14. package/dist/core.cjs.map +1 -1
  15. package/dist/core.min.mjs +1 -1
  16. package/dist/core.mjs +6765 -6117
  17. package/dist/core.mjs.map +1 -1
  18. package/dist/core.prod.cjs +3571 -3206
  19. package/dist/core.prod.mjs +3919 -3586
  20. package/dist/insights/index.qwik.cjs +1 -751
  21. package/dist/insights/index.qwik.mjs +62 -741
  22. package/dist/insights/vite/index.cjs +1 -82
  23. package/dist/insights/vite/index.mjs +65 -37
  24. package/dist/insights/vite.d.ts +22 -0
  25. package/dist/{insights/insights.d.ts → insights.d.ts} +33 -22
  26. package/dist/loader/index.cjs +2 -2
  27. package/dist/loader/index.mjs +2 -2
  28. package/dist/loader/package.json +1 -1
  29. package/dist/optimizer.cjs +693 -5851
  30. package/dist/optimizer.d.ts +741 -707
  31. package/dist/optimizer.mjs +679 -6276
  32. package/dist/preloader.cjs +243 -0
  33. package/dist/preloader.mjs +183 -0
  34. package/dist/qwikloader.debug.js +211 -220
  35. package/dist/qwikloader.js +1 -3
  36. package/dist/server.cjs +1371 -7273
  37. package/dist/server.d.ts +467 -402
  38. package/dist/server.mjs +1339 -7224
  39. package/dist/starters/adapters/aws-lambda/serverless.yml +15 -0
  40. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +0 -2
  41. package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +7 -0
  42. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +1 -2
  43. package/dist/starters/adapters/bun/src/entry.bun.ts +3 -2
  44. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
  45. package/dist/starters/adapters/cloudflare-pages/public/_headers +2 -0
  46. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +1 -2
  47. package/dist/starters/adapters/deno/src/entry.deno.ts +3 -2
  48. package/dist/starters/adapters/express/src/entry.express.tsx +5 -2
  49. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +2 -1
  50. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +11 -1
  51. package/dist/starters/adapters/firebase/firebase.json +12 -1
  52. package/dist/starters/adapters/firebase/functions/index.js +2 -3
  53. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +1 -2
  54. package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
  55. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +1 -2
  56. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +3 -2
  57. package/dist/starters/adapters/static/README.md +4 -0
  58. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +1 -2
  59. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  60. package/dist/starters/features/auth/package.json +3 -1
  61. package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +0 -11
  62. package/dist/starters/features/cypress/package.json +1 -1
  63. package/dist/starters/features/drizzle/drizzle/schema.ts +6 -18
  64. package/dist/starters/features/drizzle/drizzle.config.ts +5 -4
  65. package/dist/starters/features/drizzle/package.json +16 -12
  66. package/dist/starters/features/localize/src/entry.ssr.tsx +0 -2
  67. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +1 -1
  68. package/dist/starters/features/pandacss/package.json +1 -1
  69. package/dist/starters/features/partytown/package.json +1 -1
  70. package/dist/starters/features/postcss/package.json +4 -1
  71. package/dist/starters/features/postcss/postcss.config.js +1 -1
  72. package/dist/starters/features/prisma/package.json +3 -2
  73. package/dist/starters/features/react/package.json +1 -1
  74. package/dist/starters/features/service-worker/package.json +13 -0
  75. package/dist/starters/features/service-worker/src/routes/service-worker.ts +14 -0
  76. package/dist/starters/features/storybook/package.json +1 -1
  77. package/dist/starters/features/styled-vanilla-extract/package.json +4 -2
  78. package/dist/starters/features/tailwind/package.json +19 -9
  79. package/dist/starters/features/tailwind/src/global.css +1 -7
  80. package/dist/starters/features/tailwind-v3/package.json +21 -0
  81. package/dist/starters/features/{tailwind → tailwind-v3}/postcss.config.cjs +1 -1
  82. package/dist/starters/features/tailwind-v3/src/global.css +7 -0
  83. package/dist/starters/features/{tailwind → tailwind-v3}/tailwind.config.js +1 -1
  84. package/dist/starters/features/turso/package.json +5 -2
  85. package/dist/starters/features/turso/src/utils/turso.ts +1 -1
  86. package/dist/starters/features/vitest/package.json +1 -1
  87. package/dist/testing/index.cjs +7568 -6858
  88. package/dist/testing/index.d.ts +141 -140
  89. package/dist/testing/index.mjs +7501 -6790
  90. package/dist/testing/package.json +1 -1
  91. package/handlers.mjs +9 -0
  92. package/package.json +32 -20
  93. package/public.d.ts +15 -0
  94. package/server.d.ts +1 -0
  95. package/dist/index.d.ts +0 -2
  96. package/dist/insights/index.d.ts +0 -1
  97. package/dist/insights/vite/index.d.ts +0 -1
  98. package/dist/insights/vite/insights-plugin.d.ts +0 -10
  99. package/dist/prefetch/index.cjs +0 -4
  100. package/dist/prefetch/index.d.ts +0 -2
  101. package/dist/prefetch/index.mjs +0 -3
  102. package/dist/prefetch/package.json +0 -8
  103. package/dist/qwik-prefetch.debug.js +0 -244
  104. package/dist/qwik-prefetch.js +0 -1
  105. /package/dist/starters/features/{tailwind → tailwind-v3}/.vscode/settings.json +0 -0
@@ -1,707 +1,741 @@
1
- import type { Plugin as Plugin_2 } from 'vite';
2
-
3
- /** @public */
4
- export declare interface ComponentEntryStrategy {
5
- type: 'component';
6
- manual?: Record<string, string>;
7
- }
8
-
9
- /** @public */
10
- export declare const createOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;
11
-
12
- declare function createSymbolMapper(base: string): SymbolMapperFn;
13
-
14
- /** @public */
15
- export declare interface Diagnostic {
16
- scope: string;
17
- category: DiagnosticCategory;
18
- code: string | null;
19
- file: string;
20
- message: string;
21
- highlights: SourceLocation[];
22
- suggestions: string[] | null;
23
- }
24
-
25
- /** @public */
26
- export declare type DiagnosticCategory = 'error' | 'warning' | 'sourceError';
27
-
28
- /** @public */
29
- declare type EmitMode = 'dev' | 'prod' | 'lib';
30
-
31
- /** @public */
32
- export declare type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy_2 | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;
33
-
34
- /**
35
- * Use `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or
36
- * `false` via an exact string replacement.
37
- *
38
- * Add experimental features to this enum definition.
39
- *
40
- * @public
41
- */
42
- export declare enum ExperimentalFeatures {
43
- /** Enable the usePreventNavigate hook */
44
- preventNavigate = "preventNavigate",
45
- /** Enable the Valibot form validation */
46
- valibot = "valibot",
47
- /** Disable SPA navigation handler in Qwik Router */
48
- noSPA = "noSPA",
49
- /** Enable worker$ */
50
- webWorker = "webWorker",
51
- /** Enable the ability to use the Qwik Insights vite plugin and <Insights/> component */
52
- insights = "insights"
53
- }
54
-
55
- /** @public */
56
- export declare interface GlobalInjections {
57
- tag: string;
58
- attributes?: {
59
- [key: string]: string;
60
- };
61
- location: 'head' | 'body';
62
- }
63
-
64
- /** @public */
65
- declare interface HoistEntryStrategy {
66
- type: 'hoist';
67
- }
68
-
69
- /** @deprecated Use SegmentStrategy instead */
70
- declare interface HookEntryStrategy_2 {
71
- type: 'hook';
72
- manual?: Record<string, string>;
73
- }
74
-
75
- /** @public */
76
- export declare interface InlineEntryStrategy {
77
- type: 'inline';
78
- }
79
-
80
- /** @public */
81
- export declare interface InsightManifest {
82
- type: 'smart';
83
- manual: Record<string, string>;
84
- prefetch: {
85
- route: string;
86
- symbols: string[];
87
- }[];
88
- }
89
-
90
- /** @public */
91
- export declare type MinifyMode = 'simplify' | 'none';
92
-
93
- declare interface NormalizedQwikPluginOptions extends Omit<Required<QwikPluginOptions>, 'vendorRoots' | 'experimental'> {
94
- input: string[] | {
95
- [entry: string]: string;
96
- };
97
- experimental?: Record<keyof typeof ExperimentalFeatures, boolean>;
98
- }
99
-
100
- /** @public */
101
- export declare interface Optimizer {
102
- /** Transforms the input code string, does not access the file system. */
103
- transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;
104
- /** Optimizer system use. This can be updated with a custom file system. */
105
- sys: OptimizerSystem;
106
- }
107
-
108
- /** @public */
109
- export declare interface OptimizerOptions {
110
- sys?: OptimizerSystem;
111
- binding?: any;
112
- /** Inline the global styles if they're smaller than this */
113
- inlineStylesUpToBytes?: number;
114
- /** Enable sourcemaps */
115
- sourcemap?: boolean;
116
- }
117
-
118
- /** @public */
119
- export declare interface OptimizerSystem {
120
- cwd: () => string;
121
- env: SystemEnvironment;
122
- os: string;
123
- dynamicImport: (path: string) => Promise<any>;
124
- strictDynamicImport: (path: string) => Promise<any>;
125
- getInputFiles?: (rootDir: string) => Promise<TransformModuleInput[]>;
126
- path: Path;
127
- }
128
-
129
- /**
130
- * Workaround to make the api be defined in the type.
131
- *
132
- * @internal
133
- */
134
- declare type P<T> = Plugin_2<T> & {
135
- api: T;
136
- config: Extract<Plugin_2<T>['config'], Function>;
137
- };
138
-
139
- /** @public */
140
- export declare interface Path {
141
- resolve(...paths: string[]): string;
142
- normalize(path: string): string;
143
- isAbsolute(path: string): boolean;
144
- join(...paths: string[]): string;
145
- relative(from: string, to: string): string;
146
- dirname(path: string): string;
147
- basename(path: string, ext?: string): string;
148
- extname(path: string): string;
149
- format(pathObject: {
150
- root: string;
151
- dir: string;
152
- base: string;
153
- ext: string;
154
- name: string;
155
- }): string;
156
- parse(path: string): {
157
- root: string;
158
- dir: string;
159
- base: string;
160
- ext: string;
161
- name: string;
162
- };
163
- readonly sep: string;
164
- readonly delimiter: string;
165
- readonly win32: null;
166
- readonly posix: Path;
167
- }
168
-
169
- /** @public */
170
- export declare type QwikBuildMode = 'production' | 'development';
171
-
172
- /** @public */
173
- export declare type QwikBuildTarget = 'client' | 'ssr' | 'lib' | 'test';
174
-
175
- /** @public */
176
- export declare interface QwikBundle {
177
- size: number;
178
- /** Not precise, but an indication of whether this import may be a task */
179
- isTask?: boolean;
180
- symbols?: string[];
181
- imports?: string[];
182
- dynamicImports?: string[];
183
- origins?: string[];
184
- }
185
-
186
- /**
187
- * The metadata of the build. One of its uses is storing where QRL symbols are located.
188
- *
189
- * @public
190
- */
191
- export declare interface QwikManifest {
192
- /** Content hash of the manifest, if this changes, the code changed */
193
- manifestHash: string;
194
- /** QRL symbols */
195
- symbols: {
196
- [symbolName: string]: QwikSymbol;
197
- };
198
- /** Where QRLs are located */
199
- mapping: {
200
- [symbolName: string]: string;
201
- };
202
- /** All code bundles, used to know the import graph */
203
- bundles: {
204
- [fileName: string]: QwikBundle;
205
- };
206
- /** CSS etc to inject in the document head */
207
- injections?: GlobalInjections[];
208
- version: string;
209
- options?: {
210
- target?: string;
211
- buildMode?: string;
212
- entryStrategy?: {
213
- [key: string]: any;
214
- };
215
- };
216
- platform?: {
217
- [name: string]: string;
218
- };
219
- }
220
-
221
- declare interface QwikPluginDevTools {
222
- imageDevTools?: boolean | true;
223
- clickToSource?: string[] | false;
224
- }
225
-
226
- declare interface QwikPluginOptions {
227
- csr?: boolean;
228
- buildMode?: QwikBuildMode;
229
- debug?: boolean;
230
- entryStrategy?: EntryStrategy;
231
- rootDir?: string;
232
- tsconfigFileNames?: string[];
233
- /** @deprecated No longer used */
234
- vendorRoots?: string[];
235
- manifestOutput?: ((manifest: QwikManifest) => Promise<void> | void) | null;
236
- manifestInput?: QwikManifest | null;
237
- insightsManifest?: InsightManifest | null;
238
- input?: string[] | string | {
239
- [entry: string]: string;
240
- };
241
- outDir?: string;
242
- assetsDir?: string;
243
- srcDir?: string | null;
244
- scope?: string | null;
245
- srcInputs?: TransformModuleInput[] | null;
246
- sourcemap?: boolean;
247
- resolveQwikBuild?: boolean;
248
- target?: QwikBuildTarget;
249
- transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
250
- devTools?: QwikPluginDevTools;
251
- /**
252
- * Inline styles up to a certain size (in bytes) instead of using a separate file.
253
- *
254
- * Default: 20kb (20,000bytes)
255
- */
256
- inlineStylesUpToBytes?: number;
257
- /**
258
- * Run eslint on the source files for the ssr build or dev server. This can slow down startup on
259
- * large projects. Defaults to `true`
260
- */
261
- lint?: boolean;
262
- /**
263
- * Experimental features. These can come and go in patch releases, and their API is not guaranteed
264
- * to be stable between releases.
265
- */
266
- experimental?: (keyof typeof ExperimentalFeatures)[];
267
- }
268
-
269
- /** @public */
270
- export declare function qwikRollup(qwikRollupOpts?: QwikRollupPluginOptions): any;
271
-
272
- /** @public */
273
- export declare interface QwikRollupPluginOptions {
274
- csr?: boolean;
275
- /**
276
- * Build `production` or `development`.
277
- *
278
- * Default `development`
279
- */
280
- buildMode?: QwikBuildMode;
281
- /**
282
- * Target `client` or `ssr`.
283
- *
284
- * Default `client`
285
- */
286
- target?: QwikBuildTarget;
287
- /**
288
- * Prints verbose Qwik plugin debug logs.
289
- *
290
- * Default `false`
291
- */
292
- debug?: boolean;
293
- /**
294
- * The Qwik entry strategy to use while building for production. During development the type is
295
- * always `segment`.
296
- *
297
- * Default `{ type: "smart" }`)
298
- */
299
- entryStrategy?: EntryStrategy;
300
- /**
301
- * The source directory to find all the Qwik components. Since Qwik does not have a single input,
302
- * the `srcDir` is used to recursively find Qwik files.
303
- *
304
- * Default `src`
305
- */
306
- srcDir?: string;
307
- /**
308
- * Alternative to `srcDir`, where `srcInputs` is able to provide the files manually. This option
309
- * is useful for an environment without a file system, such as a webworker.
310
- *
311
- * Default: `null`
312
- */
313
- srcInputs?: TransformModuleInput[] | null;
314
- /**
315
- * The root of the application, which is commonly the same directory as `package.json` and
316
- * `rollup.config.js`.
317
- *
318
- * Default `process.cwd()`
319
- */
320
- rootDir?: string;
321
- /**
322
- * The client build will create a manifest and this hook is called with the generated build data.
323
- *
324
- * Default `undefined`
325
- */
326
- manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
327
- /**
328
- * The SSR build requires the manifest generated during the client build. The `manifestInput`
329
- * option can be used to manually provide a manifest.
330
- *
331
- * Default `undefined`
332
- */
333
- manifestInput?: QwikManifest;
334
- optimizerOptions?: OptimizerOptions;
335
- /**
336
- * Hook that's called after the build and provides all of the transformed modules that were used
337
- * before bundling.
338
- */
339
- transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
340
- /**
341
- * Run eslint on the source files for the ssr build or dev server. This can slow down startup on
342
- * large projects. Defaults to `true`
343
- */
344
- lint?: boolean;
345
- /**
346
- * Experimental features. These can come and go in patch releases, and their API is not guaranteed
347
- * to be stable between releases.
348
- */
349
- experimental?: (keyof typeof ExperimentalFeatures)[];
350
- }
351
-
352
- /** @public */
353
- export declare interface QwikSymbol {
354
- origin: string;
355
- displayName: string;
356
- hash: string;
357
- canonicalFilename: string;
358
- ctxKind: 'function' | 'event';
359
- ctxName: string;
360
- captures: boolean;
361
- parent: string | null;
362
- loc: [number, number];
363
- }
364
-
365
- /**
366
- * The types for Vite/Rollup don't allow us to be too specific about the return type. The correct
367
- * return type is `[QwikVitePlugin, VitePlugin<never>]`, and if you search the plugin by name you'll
368
- * get the `QwikVitePlugin`.
369
- *
370
- * @public
371
- */
372
- export declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;
373
-
374
- /** @public */
375
- export declare interface QwikViteDevResponse {
376
- _qwikEnvData?: Record<string, any>;
377
- _qwikRenderResolve?: () => void;
378
- }
379
-
380
- /**
381
- * This is the type of the "pre" Qwik Vite plugin. `qwikVite` actually returns a tuple of two
382
- * plugins, but after Vite flattens them, you can find the plugin by name.
383
- *
384
- * @public
385
- */
386
- export declare type QwikVitePlugin = P<QwikVitePluginApi> & {
387
- name: 'vite-plugin-qwik';
388
- };
389
-
390
- /** @public */
391
- export declare interface QwikVitePluginApi {
392
- getOptimizer: () => Optimizer | null;
393
- getOptions: () => NormalizedQwikPluginOptions;
394
- getManifest: () => QwikManifest | null;
395
- getInsightsManifest: (clientOutDir?: string | null) => Promise<InsightManifest | null>;
396
- getRootDir: () => string | null;
397
- getClientOutDir: () => string | null;
398
- getClientPublicOutDir: () => string | null;
399
- getAssetsDir: () => string | undefined;
400
- }
401
-
402
- declare interface QwikVitePluginCommonOptions {
403
- /**
404
- * Prints verbose Qwik plugin debug logs.
405
- *
406
- * Default `false`
407
- */
408
- debug?: boolean;
409
- /**
410
- * The Qwik entry strategy to use while building for production. During development the type is
411
- * always `segment`.
412
- *
413
- * Default `{ type: "smart" }`)
414
- */
415
- entryStrategy?: EntryStrategy;
416
- /**
417
- * The source directory to find all the Qwik components. Since Qwik does not have a single input,
418
- * the `srcDir` is used to recursively find Qwik files.
419
- *
420
- * Default `src`
421
- */
422
- srcDir?: string;
423
- /**
424
- * List of tsconfig.json files to use for ESLint warnings during development.
425
- *
426
- * Default `['tsconfig.json']`
427
- */
428
- tsconfigFileNames?: string[];
429
- /**
430
- * List of directories to recursively search for Qwik components or Vendors.
431
- *
432
- * Default `[]`
433
- *
434
- * @deprecated No longer used. Instead, any imported file with `.qwik.` in the name is processed.
435
- */
436
- vendorRoots?: string[];
437
- /**
438
- * Disables the automatic vendor roots scan. This is useful when you want to manually specify the
439
- * vendor roots.
440
- */
441
- disableVendorScan?: boolean;
442
- /**
443
- * Options for the Qwik optimizer.
444
- *
445
- * Default `undefined`
446
- */
447
- optimizerOptions?: OptimizerOptions;
448
- /**
449
- * Hook that's called after the build and provides all of the transformed modules that were used
450
- * before bundling.
451
- */
452
- transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
453
- devTools?: {
454
- /**
455
- * Validates image sizes for CLS issues during development. In case of issues, provides you with
456
- * a correct image size resolutions. If set to `false`, image dev tool will be disabled.
457
- *
458
- * Default `true`
459
- */
460
- imageDevTools?: boolean | true;
461
- /**
462
- * Press-hold the defined keys to enable qwik dev inspector. By default the behavior is
463
- * activated by pressing the left or right `Alt` key. If set to `false`, qwik dev inspector will
464
- * be disabled.
465
- *
466
- * Valid values are `KeyboardEvent.code` values. Please note that the 'Left' and 'Right'
467
- * suffixes are ignored.
468
- */
469
- clickToSource?: string[] | false;
470
- };
471
- /**
472
- * Predicate function to filter out files from the optimizer. hook for resolveId, load, and
473
- * transform
474
- */
475
- fileFilter?: (id: string, hook: string) => boolean;
476
- /**
477
- * Run eslint on the source files for the ssr build or dev server. This can slow down startup on
478
- * large projects. Defaults to `true`
479
- */
480
- lint?: boolean;
481
- /**
482
- * Experimental features. These can come and go in patch releases, and their API is not guaranteed
483
- * to be stable between releases
484
- */
485
- experimental?: (keyof typeof ExperimentalFeatures)[];
486
- }
487
-
488
- declare interface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {
489
- /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
490
- csr: true;
491
- client?: never;
492
- devSsrServer?: never;
493
- ssr?: never;
494
- }
495
-
496
- declare interface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {
497
- /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
498
- csr: true;
499
- }
500
-
501
- /** @public */
502
- export declare type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;
503
-
504
- declare interface QwikVitePluginSSROptions extends QwikVitePluginCommonOptions {
505
- /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
506
- csr?: false | undefined;
507
- client?: {
508
- /**
509
- * The entry point for the client builds. This would be the application's root component
510
- * typically.
511
- *
512
- * Default `src/components/app/app.tsx`
513
- */
514
- input?: string[] | string;
515
- /**
516
- * Entry input for client-side only development with hot-module reloading. This is for Vite
517
- * development only and does not use SSR.
518
- *
519
- * Default `src/entry.dev.tsx`
520
- */
521
- devInput?: string;
522
- /**
523
- * Output directory for the client build.
524
- *
525
- * Default `dist`
526
- */
527
- outDir?: string;
528
- /**
529
- * The client build will create a manifest and this hook is called with the generated build
530
- * data.
531
- *
532
- * Default `undefined`
533
- */
534
- manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
535
- };
536
- /**
537
- * Qwik is SSR first framework. This means that Qwik requires either SSR or SSG. In dev mode the
538
- * dev SSR server is responsible for rendering and pausing the application on the server.
539
- *
540
- * Under normal circumstances this should be on, unless you have your own SSR server which you
541
- * would like to use instead and wish to disable this one.
542
- *
543
- * Default: true
544
- */
545
- devSsrServer?: boolean;
546
- /** Controls the SSR behavior. */
547
- ssr?: {
548
- /**
549
- * The entry point for the SSR renderer. This file should export a `render()` function. This
550
- * entry point and `render()` export function is also used for Vite's SSR development and
551
- * Node.js debug mode.
552
- *
553
- * Default `src/entry.ssr.tsx`
554
- */
555
- input?: string;
556
- /**
557
- * Output directory for the server build.
558
- *
559
- * Default `server`
560
- */
561
- outDir?: string;
562
- /**
563
- * The SSR build requires the manifest generated during the client build. By default, this
564
- * plugin will wire the client manifest to the ssr build. However, the `manifestInput` option
565
- * can be used to manually provide a manifest.
566
- *
567
- * Default `undefined`
568
- */
569
- manifestInput?: QwikManifest;
570
- };
571
- }
572
-
573
- /** @public */
574
- export declare interface ResolvedManifest {
575
- mapper: SymbolMapper;
576
- manifest: QwikManifest;
577
- }
578
-
579
- /** @public */
580
- declare interface SegmentAnalysis {
581
- origin: string;
582
- name: string;
583
- entry: string | null;
584
- displayName: string;
585
- hash: string;
586
- canonicalFilename: string;
587
- extension: string;
588
- parent: string | null;
589
- ctxKind: 'event' | 'function';
590
- ctxName: string;
591
- captures: boolean;
592
- loc: [number, number];
593
- }
594
- export { SegmentAnalysis as HookAnalysis }
595
- export { SegmentAnalysis }
596
-
597
- /** @public */
598
- declare interface SegmentEntryStrategy {
599
- type: 'segment';
600
- manual?: Record<string, string>;
601
- }
602
- export { SegmentEntryStrategy as HookEntryStrategy }
603
- export { SegmentEntryStrategy }
604
-
605
- /** @public */
606
- export declare interface SingleEntryStrategy {
607
- type: 'single';
608
- manual?: Record<string, string>;
609
- }
610
-
611
- /** @public */
612
- export declare interface SmartEntryStrategy {
613
- type: 'smart';
614
- manual?: Record<string, string>;
615
- }
616
-
617
- /** @public */
618
- export declare interface SourceLocation {
619
- hi: number;
620
- lo: number;
621
- startLine: number;
622
- startCol: number;
623
- endLine: number;
624
- endCol: number;
625
- }
626
-
627
- /** @public */
628
- export declare type SourceMapsOption = 'external' | 'inline' | undefined | null;
629
-
630
- /** @public */
631
- export declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
632
-
633
- /**
634
- * @beta
635
- * For a given symbol (QRL such as `onKeydown$`) the server needs to know which bundle the symbol is in.
636
- *
637
- * Normally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.
638
- *
639
- * This would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.
640
- */
641
- export declare let symbolMapper: ReturnType<typeof createSymbolMapper>;
642
-
643
- /** @public */
644
- export declare type SymbolMapperFn = (symbolName: string, mapper: SymbolMapper | undefined, parent?: string) => readonly [symbol: string, chunk: string] | undefined;
645
-
646
- /** @public */
647
- export declare type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';
648
-
649
- /** @public */
650
- export declare interface TransformModule {
651
- path: string;
652
- isEntry: boolean;
653
- code: string;
654
- map: string | null;
655
- segment: SegmentAnalysis | null;
656
- origPath: string | null;
657
- }
658
-
659
- /** @public */
660
- export declare interface TransformModuleInput {
661
- path: string;
662
- devPath?: string;
663
- code: string;
664
- }
665
-
666
- /** @public */
667
- export declare interface TransformModulesOptions extends TransformOptions {
668
- input: TransformModuleInput[];
669
- }
670
-
671
- /** @public */
672
- export declare interface TransformOptions {
673
- srcDir: string;
674
- rootDir?: string;
675
- entryStrategy?: EntryStrategy;
676
- minify?: MinifyMode;
677
- sourceMaps?: boolean;
678
- transpileTs?: boolean;
679
- transpileJsx?: boolean;
680
- preserveFilenames?: boolean;
681
- explicitExtensions?: boolean;
682
- mode?: EmitMode;
683
- scope?: string;
684
- stripExports?: string[];
685
- regCtxName?: string[];
686
- stripCtxName?: string[];
687
- stripEventHandlers?: boolean;
688
- isServer?: boolean;
689
- }
690
-
691
- /** @public */
692
- export declare interface TransformOutput {
693
- modules: TransformModule[];
694
- diagnostics: Diagnostic[];
695
- isTypeScript: boolean;
696
- isJsx: boolean;
697
- }
698
-
699
- /** @public */
700
- export declare type TranspileOption = boolean | undefined | null;
701
-
702
- /** @public */
703
- export declare const versions: {
704
- qwik: string;
705
- };
706
-
707
- export { }
1
+ import type { Plugin as Plugin_2 } from 'vite';
2
+
3
+ /**
4
+ * A function that returns a map of bundle names to their dependencies.
5
+ *
6
+ * @public
7
+ */
8
+ export declare type BundleGraphAdder = (manifest: QwikManifest) => Record<string, {
9
+ imports?: string[];
10
+ dynamicImports?: string[];
11
+ }>;
12
+
13
+ /** @public */
14
+ export declare interface ComponentEntryStrategy {
15
+ type: 'component';
16
+ manual?: Record<string, string>;
17
+ }
18
+
19
+ /** @public */
20
+ export declare const createOptimizer: (optimizerOptions?: OptimizerOptions) => Promise<Optimizer>;
21
+
22
+ declare function createSymbolMapper(base: string): SymbolMapperFn;
23
+
24
+ /** @public */
25
+ export declare interface Diagnostic {
26
+ scope: string;
27
+ category: DiagnosticCategory;
28
+ code: string | null;
29
+ file: string;
30
+ message: string;
31
+ highlights: SourceLocation[] | null;
32
+ suggestions: string[] | null;
33
+ }
34
+
35
+ /** @public */
36
+ export declare type DiagnosticCategory = 'error' | 'warning' | 'sourceError';
37
+
38
+ /** @public */
39
+ declare type EmitMode = 'dev' | 'prod' | 'lib';
40
+
41
+ /** @public */
42
+ export declare type EntryStrategy = InlineEntryStrategy | HoistEntryStrategy | SingleEntryStrategy | HookEntryStrategy_2 | SegmentEntryStrategy | ComponentEntryStrategy | SmartEntryStrategy;
43
+
44
+ /**
45
+ * Use `__EXPERIMENTAL__.x` to check if feature `x` is enabled. It will be replaced with `true` or
46
+ * `false` via an exact string replacement.
47
+ *
48
+ * Add experimental features to this enum definition.
49
+ *
50
+ * @public
51
+ */
52
+ export declare enum ExperimentalFeatures {
53
+ /** Enable the usePreventNavigate hook */
54
+ preventNavigate = "preventNavigate",
55
+ /** Enable the Valibot form validation */
56
+ valibot = "valibot",
57
+ /** Disable SPA navigation handler in Qwik Router */
58
+ noSPA = "noSPA",
59
+ /** Enable worker$ */
60
+ webWorker = "webWorker",
61
+ /** Enable the ability to use the Qwik Insights vite plugin and <Insights/> component */
62
+ insights = "insights"
63
+ }
64
+
65
+ /** @public */
66
+ export declare interface GlobalInjections {
67
+ tag: string;
68
+ attributes?: {
69
+ [key: string]: string;
70
+ };
71
+ location: 'head' | 'body';
72
+ }
73
+
74
+ /** @public */
75
+ declare interface HoistEntryStrategy {
76
+ type: 'hoist';
77
+ }
78
+
79
+ /** @deprecated Use SegmentStrategy instead */
80
+ declare interface HookEntryStrategy_2 {
81
+ type: 'hook';
82
+ manual?: Record<string, string>;
83
+ }
84
+
85
+ /** @public */
86
+ export declare interface InlineEntryStrategy {
87
+ type: 'inline';
88
+ }
89
+
90
+ /** @public */
91
+ export declare type MinifyMode = 'simplify' | 'none';
92
+
93
+ declare interface NormalizedQwikPluginOptions extends Omit<Required<QwikPluginOptions>, 'vendorRoots' | 'experimental'> {
94
+ input: string[] | {
95
+ [entry: string]: string;
96
+ };
97
+ experimental?: Record<keyof typeof ExperimentalFeatures, boolean>;
98
+ }
99
+
100
+ /** @public */
101
+ export declare interface Optimizer {
102
+ /** Transforms the input code string, does not access the file system. */
103
+ transformModules(opts: TransformModulesOptions): Promise<TransformOutput>;
104
+ /** Optimizer system use. This can be updated with a custom file system. */
105
+ sys: OptimizerSystem;
106
+ }
107
+
108
+ /** @public */
109
+ export declare interface OptimizerOptions {
110
+ sys?: OptimizerSystem;
111
+ binding?: any;
112
+ /** Inline the global styles if they're smaller than this */
113
+ inlineStylesUpToBytes?: number;
114
+ /** Enable sourcemaps */
115
+ sourcemap?: boolean;
116
+ }
117
+
118
+ /** @public */
119
+ export declare interface OptimizerSystem {
120
+ cwd: () => string;
121
+ env: SystemEnvironment;
122
+ os: string;
123
+ dynamicImport: (path: string) => Promise<any>;
124
+ strictDynamicImport: (path: string) => Promise<any>;
125
+ getInputFiles?: (rootDir: string) => Promise<TransformModuleInput[]>;
126
+ path: Path;
127
+ }
128
+
129
+ /**
130
+ * Workaround to make the api be defined in the type.
131
+ *
132
+ * @internal
133
+ */
134
+ declare type P<T> = Plugin_2<T> & {
135
+ api: T;
136
+ config: Extract<Plugin_2<T>['config'], Function>;
137
+ };
138
+
139
+ /** @public */
140
+ export declare interface Path {
141
+ resolve(...paths: string[]): string;
142
+ normalize(path: string): string;
143
+ isAbsolute(path: string): boolean;
144
+ join(...paths: string[]): string;
145
+ relative(from: string, to: string): string;
146
+ dirname(path: string): string;
147
+ basename(path: string, ext?: string): string;
148
+ extname(path: string): string;
149
+ format(pathObject: {
150
+ root: string;
151
+ dir: string;
152
+ base: string;
153
+ ext: string;
154
+ name: string;
155
+ }): string;
156
+ parse(path: string): {
157
+ root: string;
158
+ dir: string;
159
+ base: string;
160
+ ext: string;
161
+ name: string;
162
+ };
163
+ readonly sep: string;
164
+ readonly delimiter: string;
165
+ readonly win32: null;
166
+ readonly posix: Path;
167
+ }
168
+
169
+ /** @public */
170
+ export declare type QwikBuildMode = 'production' | 'development';
171
+
172
+ /** @public */
173
+ export declare type QwikBuildTarget = 'client' | 'ssr' | 'lib' | 'test';
174
+
175
+ /** @public */
176
+ export declare interface QwikBundle {
177
+ /** Size of the bundle */
178
+ size: number;
179
+ /** Total size of this bundle's static import graph */
180
+ total: number;
181
+ /** Interactivity score of the bundle */
182
+ interactivity?: number;
183
+ /** Symbols in the bundle */
184
+ symbols?: string[];
185
+ /** Direct imports */
186
+ imports?: string[];
187
+ /** Dynamic imports */
188
+ dynamicImports?: string[];
189
+ /** Source files of the bundle */
190
+ origins?: string[];
191
+ }
192
+
193
+ /**
194
+ * Bundle graph.
195
+ *
196
+ * Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, //
197
+ * Depends on 'bundle-c.js' 'bundle-c.js', ]
198
+ *
199
+ * @public
200
+ */
201
+ export declare type QwikBundleGraph = Array<string | number>;
202
+
203
+ /**
204
+ * The metadata of the build. One of its uses is storing where QRL symbols are located.
205
+ *
206
+ * @public
207
+ */
208
+ export declare interface QwikManifest {
209
+ /** Content hash of the manifest, if this changes, the code changed */
210
+ manifestHash: string;
211
+ /** QRL symbols */
212
+ symbols: {
213
+ [symbolName: string]: QwikSymbol;
214
+ };
215
+ /** Where QRLs are located */
216
+ mapping: {
217
+ [symbolName: string]: string;
218
+ };
219
+ /** All code bundles, used to know the import graph */
220
+ bundles: {
221
+ [fileName: string]: QwikBundle;
222
+ };
223
+ /** All bundles in a compact graph format with probabilities */
224
+ bundleGraph?: QwikBundleGraph;
225
+ /** The preloader bundle fileName */
226
+ preloader?: string;
227
+ /** CSS etc to inject in the document head */
228
+ injections?: GlobalInjections[];
229
+ /** The version of the manifest */
230
+ version: string;
231
+ /** The options used to build the manifest */
232
+ options?: {
233
+ target?: string;
234
+ buildMode?: string;
235
+ entryStrategy?: {
236
+ type: EntryStrategy['type'];
237
+ };
238
+ };
239
+ /** The platform used to build the manifest */
240
+ platform?: {
241
+ [name: string]: string;
242
+ };
243
+ }
244
+
245
+ declare interface QwikPluginDevTools {
246
+ imageDevTools?: boolean | true;
247
+ clickToSource?: string[] | false;
248
+ }
249
+
250
+ declare interface QwikPluginOptions {
251
+ csr?: boolean;
252
+ buildMode?: QwikBuildMode;
253
+ debug?: boolean;
254
+ entryStrategy?: EntryStrategy;
255
+ rootDir?: string;
256
+ tsconfigFileNames?: string[];
257
+ /** @deprecated No longer used */
258
+ vendorRoots?: string[];
259
+ manifestOutput?: ((manifest: QwikManifest) => Promise<void> | void) | null;
260
+ manifestInput?: QwikManifest | null;
261
+ input?: string[] | string | {
262
+ [entry: string]: string;
263
+ };
264
+ outDir?: string;
265
+ assetsDir?: string;
266
+ srcDir?: string | null;
267
+ scope?: string | null;
268
+ srcInputs?: TransformModuleInput[] | null;
269
+ sourcemap?: boolean;
270
+ resolveQwikBuild?: boolean;
271
+ target?: QwikBuildTarget;
272
+ transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
273
+ devTools?: QwikPluginDevTools;
274
+ /**
275
+ * Inline styles up to a certain size (in bytes) instead of using a separate file.
276
+ *
277
+ * Default: 20kb (20,000bytes)
278
+ */
279
+ inlineStylesUpToBytes?: number;
280
+ /**
281
+ * Run eslint on the source files for the ssr build or dev server. This can slow down startup on
282
+ * large projects. Defaults to `true`
283
+ */
284
+ lint?: boolean;
285
+ /**
286
+ * Experimental features. These can come and go in patch releases, and their API is not guaranteed
287
+ * to be stable between releases.
288
+ */
289
+ experimental?: (keyof typeof ExperimentalFeatures)[];
290
+ }
291
+
292
+ /** @public */
293
+ export declare function qwikRollup(qwikRollupOpts?: QwikRollupPluginOptions): any;
294
+
295
+ /** @public */
296
+ export declare interface QwikRollupPluginOptions {
297
+ csr?: boolean;
298
+ /**
299
+ * Build `production` or `development`.
300
+ *
301
+ * Default `development`
302
+ */
303
+ buildMode?: QwikBuildMode;
304
+ /**
305
+ * Target `client` or `ssr`.
306
+ *
307
+ * Default `client`
308
+ */
309
+ target?: QwikBuildTarget;
310
+ /**
311
+ * Prints verbose Qwik plugin debug logs.
312
+ *
313
+ * Default `false`
314
+ */
315
+ debug?: boolean;
316
+ /**
317
+ * The Qwik entry strategy to use while building for production. During development the type is
318
+ * always `segment`.
319
+ *
320
+ * Default `{ type: "smart" }`)
321
+ */
322
+ entryStrategy?: EntryStrategy;
323
+ /**
324
+ * The source directory to find all the Qwik components. Since Qwik does not have a single input,
325
+ * the `srcDir` is used to recursively find Qwik files.
326
+ *
327
+ * Default `src`
328
+ */
329
+ srcDir?: string;
330
+ /**
331
+ * Alternative to `srcDir`, where `srcInputs` is able to provide the files manually. This option
332
+ * is useful for an environment without a file system, such as a webworker.
333
+ *
334
+ * Default: `null`
335
+ */
336
+ srcInputs?: TransformModuleInput[] | null;
337
+ /**
338
+ * The root of the application, which is commonly the same directory as `package.json` and
339
+ * `rollup.config.js`.
340
+ *
341
+ * Default `process.cwd()`
342
+ */
343
+ rootDir?: string;
344
+ /**
345
+ * The client build will create a manifest and this hook is called with the generated build data.
346
+ *
347
+ * Default `undefined`
348
+ */
349
+ manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
350
+ /**
351
+ * The SSR build requires the manifest generated during the client build. The `manifestInput`
352
+ * option can be used to manually provide a manifest.
353
+ *
354
+ * Default `undefined`
355
+ */
356
+ manifestInput?: QwikManifest;
357
+ optimizerOptions?: OptimizerOptions;
358
+ /**
359
+ * Hook that's called after the build and provides all of the transformed modules that were used
360
+ * before bundling.
361
+ */
362
+ transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
363
+ /**
364
+ * Run eslint on the source files for the ssr build or dev server. This can slow down startup on
365
+ * large projects. Defaults to `true`
366
+ */
367
+ lint?: boolean;
368
+ /**
369
+ * Experimental features. These can come and go in patch releases, and their API is not guaranteed
370
+ * to be stable between releases.
371
+ */
372
+ experimental?: (keyof typeof ExperimentalFeatures)[];
373
+ }
374
+
375
+ /** @public */
376
+ export declare interface QwikSymbol {
377
+ origin: string;
378
+ displayName: string;
379
+ hash: string;
380
+ canonicalFilename: string;
381
+ ctxKind: 'function' | 'eventHandler';
382
+ ctxName: string;
383
+ /** Whether the symbol captures a variable */
384
+ captures: boolean;
385
+ parent: string | null;
386
+ loc: [number, number];
387
+ /** The parameter names if it's a function with parameters */
388
+ paramNames?: string[];
389
+ /** The transformed names of scoped variables, if any */
390
+ captureNames?: string[];
391
+ }
392
+
393
+ /**
394
+ * The types for Vite/Rollup don't allow us to be too specific about the return type. The correct
395
+ * return type is `[QwikVitePlugin, VitePlugin<never>]`, and if you search the plugin by name you'll
396
+ * get the `QwikVitePlugin`.
397
+ *
398
+ * @public
399
+ */
400
+ export declare function qwikVite(qwikViteOpts?: QwikVitePluginOptions): any;
401
+
402
+ /** @public */
403
+ export declare interface QwikViteDevResponse {
404
+ _qwikEnvData?: Record<string, any>;
405
+ _qwikRenderResolve?: () => void;
406
+ }
407
+
408
+ /**
409
+ * This is the type of the "pre" Qwik Vite plugin. `qwikVite` actually returns a tuple of two
410
+ * plugins, but after Vite flattens them, you can find the plugin by name.
411
+ *
412
+ * @public
413
+ */
414
+ export declare type QwikVitePlugin = P<QwikVitePluginApi> & {
415
+ name: 'vite-plugin-qwik';
416
+ };
417
+
418
+ /** @public */
419
+ export declare interface QwikVitePluginApi {
420
+ getOptimizer: () => Optimizer | null;
421
+ getOptions: () => NormalizedQwikPluginOptions;
422
+ getManifest: () => QwikManifest | null;
423
+ getRootDir: () => string | null;
424
+ getClientOutDir: () => string | null;
425
+ getClientPublicOutDir: () => string | null;
426
+ getAssetsDir: () => string | undefined;
427
+ registerBundleGraphAdder: (adder: BundleGraphAdder) => void;
428
+ }
429
+
430
+ declare interface QwikVitePluginCommonOptions {
431
+ /**
432
+ * Prints verbose Qwik plugin debug logs.
433
+ *
434
+ * Default `false`
435
+ */
436
+ debug?: boolean;
437
+ /**
438
+ * The Qwik entry strategy to use while building for production. During development the type is
439
+ * always `segment`.
440
+ *
441
+ * Default `{ type: "smart" }`)
442
+ */
443
+ entryStrategy?: EntryStrategy;
444
+ /**
445
+ * The source directory to find all the Qwik components. Since Qwik does not have a single input,
446
+ * the `srcDir` is used to recursively find Qwik files.
447
+ *
448
+ * Default `src`
449
+ */
450
+ srcDir?: string;
451
+ /**
452
+ * List of tsconfig.json files to use for ESLint warnings during development.
453
+ *
454
+ * Default `['tsconfig.json']`
455
+ */
456
+ tsconfigFileNames?: string[];
457
+ /**
458
+ * List of directories to recursively search for Qwik components or Vendors.
459
+ *
460
+ * Default `[]`
461
+ *
462
+ * @deprecated No longer used. Instead, any imported file with `.qwik.` in the name is processed.
463
+ */
464
+ vendorRoots?: string[];
465
+ /**
466
+ * Disables the automatic vendor roots scan. This is useful when you want to manually specify the
467
+ * vendor roots.
468
+ */
469
+ disableVendorScan?: boolean;
470
+ /**
471
+ * Options for the Qwik optimizer.
472
+ *
473
+ * Default `undefined`
474
+ */
475
+ optimizerOptions?: OptimizerOptions;
476
+ /**
477
+ * Hook that's called after the build and provides all of the transformed modules that were used
478
+ * before bundling.
479
+ */
480
+ transformedModuleOutput?: ((transformedModules: TransformModule[]) => Promise<void> | void) | null;
481
+ devTools?: {
482
+ /**
483
+ * Validates image sizes for CLS issues during development. In case of issues, provides you with
484
+ * a correct image size resolutions. If set to `false`, image dev tool will be disabled.
485
+ *
486
+ * Default `true`
487
+ */
488
+ imageDevTools?: boolean | true;
489
+ /**
490
+ * Press-hold the defined keys to enable qwik dev inspector. By default the behavior is
491
+ * activated by pressing the left or right `Alt` key. If set to `false`, qwik dev inspector will
492
+ * be disabled.
493
+ *
494
+ * Valid values are `KeyboardEvent.code` values. Please note that the 'Left' and 'Right'
495
+ * suffixes are ignored.
496
+ */
497
+ clickToSource?: string[] | false;
498
+ };
499
+ /**
500
+ * Predicate function to filter out files from the optimizer. hook for resolveId, load, and
501
+ * transform
502
+ */
503
+ fileFilter?: (id: string, hook: string) => boolean;
504
+ /**
505
+ * Run eslint on the source files for the ssr build or dev server. This can slow down startup on
506
+ * large projects. Defaults to `true`
507
+ */
508
+ lint?: boolean;
509
+ /**
510
+ * Experimental features. These can come and go in patch releases, and their API is not guaranteed
511
+ * to be stable between releases
512
+ */
513
+ experimental?: (keyof typeof ExperimentalFeatures)[];
514
+ }
515
+
516
+ declare interface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {
517
+ /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
518
+ csr: true;
519
+ client?: never;
520
+ devSsrServer?: never;
521
+ ssr?: never;
522
+ }
523
+
524
+ declare interface QwikVitePluginCSROptions extends QwikVitePluginCommonOptions {
525
+ /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
526
+ csr: true;
527
+ }
528
+
529
+ /** @public */
530
+ export declare type QwikVitePluginOptions = QwikVitePluginCSROptions | QwikVitePluginSSROptions;
531
+
532
+ declare interface QwikVitePluginSSROptions extends QwikVitePluginCommonOptions {
533
+ /** Client Side Rendering (CSR) mode. It will not support SSR, default to Vite's `index.html` file. */
534
+ csr?: false | undefined;
535
+ client?: {
536
+ /**
537
+ * The entry point for the client builds. This would be the application's root component
538
+ * typically.
539
+ *
540
+ * Default `src/components/app/app.tsx`
541
+ */
542
+ input?: string[] | string;
543
+ /**
544
+ * Entry input for client-side only development with hot-module reloading. This is for Vite
545
+ * development only and does not use SSR.
546
+ *
547
+ * Default `src/entry.dev.tsx`
548
+ */
549
+ devInput?: string;
550
+ /**
551
+ * Output directory for the client build.
552
+ *
553
+ * Default `dist`
554
+ */
555
+ outDir?: string;
556
+ /**
557
+ * The client build will create a manifest and this hook is called with the generated build
558
+ * data.
559
+ *
560
+ * Default `undefined`
561
+ */
562
+ manifestOutput?: (manifest: QwikManifest) => Promise<void> | void;
563
+ };
564
+ /**
565
+ * Qwik is SSR first framework. This means that Qwik requires either SSR or SSG. In dev mode the
566
+ * dev SSR server is responsible for rendering and pausing the application on the server.
567
+ *
568
+ * Under normal circumstances this should be on, unless you have your own SSR server which you
569
+ * would like to use instead and wish to disable this one.
570
+ *
571
+ * Default: true
572
+ */
573
+ devSsrServer?: boolean;
574
+ /** Controls the SSR behavior. */
575
+ ssr?: {
576
+ /**
577
+ * The entry point for the SSR renderer. This file should export a `render()` function. This
578
+ * entry point and `render()` export function is also used for Vite's SSR development and
579
+ * Node.js debug mode.
580
+ *
581
+ * Default `src/entry.ssr.tsx`
582
+ */
583
+ input?: string;
584
+ /**
585
+ * Output directory for the server build.
586
+ *
587
+ * Default `server`
588
+ */
589
+ outDir?: string;
590
+ /**
591
+ * The SSR build requires the manifest generated during the client build. By default, this
592
+ * plugin will wire the client manifest to the ssr build. However, the `manifestInput` option
593
+ * can be used to manually provide a manifest.
594
+ *
595
+ * Default `undefined`
596
+ */
597
+ manifestInput?: QwikManifest;
598
+ };
599
+ }
600
+
601
+ /** @public */
602
+ export declare interface ResolvedManifest {
603
+ mapper: SymbolMapper;
604
+ manifest: QwikManifest;
605
+ injections?: GlobalInjections[];
606
+ bundleGraph?: QwikBundleGraph;
607
+ }
608
+
609
+ /** @public */
610
+ declare interface SegmentAnalysis {
611
+ origin: string;
612
+ name: string;
613
+ entry: string | null;
614
+ displayName: string;
615
+ hash: string;
616
+ canonicalFilename: string;
617
+ extension: string;
618
+ parent: string | null;
619
+ ctxKind: 'eventHandler' | 'function';
620
+ ctxName: string;
621
+ captures: boolean;
622
+ loc: [number, number];
623
+ /** The parameter names if it's a function with parameters */
624
+ paramNames?: string[];
625
+ /** The transformed names of scoped variables, if any */
626
+ captureNames?: string[];
627
+ }
628
+ export { SegmentAnalysis as HookAnalysis }
629
+ export { SegmentAnalysis }
630
+
631
+ /** @public */
632
+ declare interface SegmentEntryStrategy {
633
+ type: 'segment';
634
+ manual?: Record<string, string>;
635
+ }
636
+ export { SegmentEntryStrategy as HookEntryStrategy }
637
+ export { SegmentEntryStrategy }
638
+
639
+ /** @public */
640
+ export declare interface SingleEntryStrategy {
641
+ type: 'single';
642
+ manual?: Record<string, string>;
643
+ }
644
+
645
+ /** @public */
646
+ export declare interface SmartEntryStrategy {
647
+ type: 'smart';
648
+ manual?: Record<string, string>;
649
+ }
650
+
651
+ /** @public */
652
+ export declare interface SourceLocation {
653
+ hi: number;
654
+ lo: number;
655
+ startLine: number;
656
+ startCol: number;
657
+ endLine: number;
658
+ endCol: number;
659
+ }
660
+
661
+ /** @public */
662
+ export declare type SourceMapsOption = 'external' | 'inline' | undefined | null;
663
+
664
+ /** @public */
665
+ export declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
666
+
667
+ /**
668
+ * @beta
669
+ * For a given symbol (QRL such as `onKeydown$`) the server needs to know which bundle the symbol is in.
670
+ *
671
+ * Normally this is provided by Qwik's `q-manifest` . But `q-manifest` only exists after a full client build.
672
+ *
673
+ * This would be a problem in dev mode. So in dev mode the symbol is mapped to the expected URL using the symbolMapper function below. For Vite the given path is fixed for a given symbol.
674
+ */
675
+ export declare let symbolMapper: ReturnType<typeof createSymbolMapper>;
676
+
677
+ /** @public */
678
+ export declare type SymbolMapperFn = (symbolName: string, mapper: SymbolMapper | undefined, parent?: string) => readonly [symbol: string, chunk: string] | undefined;
679
+
680
+ /** @public */
681
+ export declare type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';
682
+
683
+ /** @public */
684
+ export declare interface TransformModule {
685
+ path: string;
686
+ isEntry: boolean;
687
+ code: string;
688
+ map: string | null;
689
+ segment: SegmentAnalysis | null;
690
+ origPath: string | null;
691
+ }
692
+
693
+ /** @public */
694
+ export declare interface TransformModuleInput {
695
+ path: string;
696
+ devPath?: string;
697
+ code: string;
698
+ }
699
+
700
+ /** @public */
701
+ export declare interface TransformModulesOptions extends TransformOptions {
702
+ input: TransformModuleInput[];
703
+ }
704
+
705
+ /** @public */
706
+ export declare interface TransformOptions {
707
+ srcDir: string;
708
+ rootDir?: string;
709
+ entryStrategy?: EntryStrategy;
710
+ minify?: MinifyMode;
711
+ sourceMaps?: boolean;
712
+ transpileTs?: boolean;
713
+ transpileJsx?: boolean;
714
+ preserveFilenames?: boolean;
715
+ explicitExtensions?: boolean;
716
+ mode?: EmitMode;
717
+ scope?: string;
718
+ stripExports?: string[];
719
+ regCtxName?: string[];
720
+ stripCtxName?: string[];
721
+ stripEventHandlers?: boolean;
722
+ isServer?: boolean;
723
+ }
724
+
725
+ /** @public */
726
+ export declare interface TransformOutput {
727
+ modules: TransformModule[];
728
+ diagnostics: Diagnostic[];
729
+ isTypeScript: boolean;
730
+ isJsx: boolean;
731
+ }
732
+
733
+ /** @public */
734
+ export declare type TranspileOption = boolean | undefined | null;
735
+
736
+ /** @public */
737
+ export declare const versions: {
738
+ qwik: string;
739
+ };
740
+
741
+ export { }