@ilha/router 0.3.5 → 0.3.6

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/dist/vite.d.ts CHANGED
@@ -8,6 +8,7 @@ import { EventEmitter } from "node:events";
8
8
  import { Server as Server$1, ServerOptions as ServerOptions$1 } from "node:https";
9
9
  import * as net from "node:net";
10
10
  import { Duplex, DuplexOptions, Stream } from "node:stream";
11
+ import esbuild from "esbuild";
11
12
  import { SecureContextOptions } from "node:tls";
12
13
  import { URL as URL$1 } from "node:url";
13
14
  import { ZlibOptions } from "node:zlib";
@@ -17,7 +18,7 @@ import SassEmbedded from "sass-embedded";
17
18
  import Less from "less";
18
19
  import Stylus from "stylus";
19
20
 
20
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/hmrPayload.d.ts
21
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/hmrPayload.d.ts
21
22
  type HotPayload = ConnectedPayload | PingPayload | UpdatePayload | FullReloadPayload | CustomPayload | ErrorPayload | PrunePayload;
22
23
  interface ConnectedPayload {
23
24
  type: 'connected';
@@ -82,7 +83,7 @@ interface ErrorPayload {
82
83
  };
83
84
  }
84
85
  //#endregion
85
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts
86
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts
86
87
  //#region src/shared/invokeMethods.d.ts
87
88
  interface FetchFunctionOptions {
88
89
  cached?: boolean;
@@ -135,7 +136,7 @@ interface ViteFetchResult {
135
136
  invalidate: boolean;
136
137
  }
137
138
  //#endregion
138
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/customEvent.d.ts
139
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/customEvent.d.ts
139
140
  interface CustomEventMap {
140
141
  // client events
141
142
  'vite:beforeUpdate': UpdatePayload;
@@ -151,6 +152,7 @@ interface CustomEventMap {
151
152
  /** @internal */
152
153
  'vite:module-loaded': {
153
154
  modules: string[];
155
+ clientId: string;
154
156
  }; // server events
155
157
  'vite:client:connect': undefined;
156
158
  'vite:client:disconnect': undefined;
@@ -196,7 +198,7 @@ type ForwardConsolePayload = {
196
198
  */
197
199
  type InferCustomEventPayload<T extends string> = T extends keyof CustomEventMap ? CustomEventMap[T] : any;
198
200
  //#endregion
199
- //#region ../../node_modules/.bun/rolldown@1.0.0/node_modules/rolldown/dist/shared/logging-C6h4g8dA.d.mts
201
+ //#region ../../node_modules/.bun/rolldown@1.0.2/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts
200
202
  //#region src/log/logging.d.ts
201
203
  /** @inline */
202
204
  type LogLevel$1 = "info" | "debug" | "warn";
@@ -246,7 +248,7 @@ interface RolldownError extends RolldownLog {
246
248
  }
247
249
  type LogOrStringHandler = (level: LogLevelWithError, log: RolldownLogWithString) => void; //#endregion
248
250
  //#endregion
249
- //#region ../../node_modules/.bun/@oxc-project+types@0.129.0/node_modules/@oxc-project/types/types.d.ts
251
+ //#region ../../node_modules/.bun/@oxc-project+types@0.132.0/node_modules/@oxc-project/types/types.d.ts
250
252
  // Auto-generated code, DO NOT EDIT DIRECTLY!
251
253
  // To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`.
252
254
  interface Program extends Span {
@@ -1545,7 +1547,7 @@ type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
1545
1547
  type UpdateOperator = "++" | "--";
1546
1548
  type Node$1 = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function$1 | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern;
1547
1549
  //#endregion
1548
- //#region ../../node_modules/.bun/rolldown@1.0.0/node_modules/rolldown/dist/shared/binding-zH1vcmbM.d.mts
1550
+ //#region ../../node_modules/.bun/rolldown@1.0.2/node_modules/rolldown/dist/shared/binding-DktDDYoY.d.mts
1549
1551
  interface CodegenOptions {
1550
1552
  /**
1551
1553
  * Remove whitespace.
@@ -2649,7 +2651,7 @@ declare class Exclude$1 {
2649
2651
  constructor(expr: FilterExpression);
2650
2652
  }
2651
2653
  //#endregion
2652
- //#region ../../node_modules/.bun/rolldown@1.0.0/node_modules/rolldown/dist/shared/define-config-5HJ1b9vG.d.mts
2654
+ //#region ../../node_modules/.bun/rolldown@1.0.2/node_modules/rolldown/dist/shared/define-config-Bo24xyUK.d.mts
2653
2655
  //#region src/types/misc.d.ts
2654
2656
  /** @inline */
2655
2657
  type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
@@ -3502,8 +3504,6 @@ interface OutputOptions {
3502
3504
  *
3503
3505
  * When both `legalComments` and `comments.legal` are set, `comments.legal` takes priority.
3504
3506
  *
3505
- *
3506
- *
3507
3507
  * @default true
3508
3508
  */
3509
3509
  comments?: boolean | CommentsOptions;
@@ -3547,9 +3547,18 @@ interface OutputOptions {
3547
3547
  */
3548
3548
  preserveModulesRoot?: string;
3549
3549
  /**
3550
- * Whether to use `var` declarations at the top level scope instead of function / class / let / const expressions.
3550
+ * Whether to convert top-level `let` and `const` declarations into `var` declarations.
3551
+ *
3552
+ * Enabling this option can improve runtime performance of the generated code in
3553
+ * certain environments by avoiding Temporal Dead Zone (TDZ) checks. Only declarations
3554
+ * in the module's top-level scope are rewritten — declarations inside nested scopes
3555
+ * (functions, blocks, etc.) are left as-is.
3551
3556
  *
3552
- * Enabling this option can improve runtime performance of the generated code in certain environments.
3557
+ * Note:
3558
+ * - Top-level `class X {}` declarations are always emitted as `var X = class {}` so
3559
+ * rolldown can hoist them alongside other top-level bindings; this transform is
3560
+ * independent of `topLevelVar`.
3561
+ * - Top-level `function` declarations are never rewritten.
3553
3562
  *
3554
3563
  * @default false
3555
3564
  *
@@ -4000,6 +4009,15 @@ interface ChecksOptions {
4000
4009
  * */
4001
4010
  missingNameOptionForIifeExport?: boolean;
4002
4011
  /**
4012
+ * Whether to emit warnings when a `#__PURE__` / `@__PURE__` annotation has no effect due to its position.
4013
+ *
4014
+ * Annotations placed where they cannot annotate a call expression (e.g. before a non-call expression,
4015
+ * before a statement declaration, or between an identifier and `=` in a variable declarator) are
4016
+ * ignored by the parser. Matches Rollup's `INVALID_ANNOTATION` log code.
4017
+ * @default true
4018
+ * */
4019
+ invalidAnnotation?: boolean;
4020
+ /**
4003
4021
  * Whether to emit warnings when the way to export values is ambiguous.
4004
4022
  *
4005
4023
  * See [`output.exports`](https://rolldown.rs/reference/OutputOptions.exports).
@@ -4107,6 +4125,15 @@ interface ChecksOptions {
4107
4125
  * @default true
4108
4126
  * */
4109
4127
  ineffectiveDynamicImport?: boolean;
4128
+ /**
4129
+ * Whether to emit info logs when a barrel module has a very large number of re-exports (more than 5000).
4130
+ *
4131
+ * Such modules can significantly slow down module resolution. Consider using
4132
+ * [`@rolldown/plugin-transform-imports`](https://github.com/rolldown/plugins/tree/main/packages/transform-imports)
4133
+ * to rewrite barrel imports at the source level so the barrel file is never loaded.
4134
+ * @default true
4135
+ * */
4136
+ largeBarrelModules?: boolean;
4110
4137
  } //#endregion
4111
4138
  //#region src/options/transform-options.d.ts
4112
4139
  interface TransformOptions$2 extends Omit<TransformOptions$3, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
@@ -5508,6 +5535,28 @@ type InputOption = string | string[] | Record<string, string>;
5508
5535
  type ExternalOptionFunction = (id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>;
5509
5536
  /** @inline */
5510
5537
  type ExternalOption = StringOrRegExp | StringOrRegExp[] | ExternalOptionFunction;
5538
+ interface ChunkOptimizationOptions {
5539
+ /**
5540
+ * Merge common chunks into existing entry chunks when it is safe.
5541
+ *
5542
+ * This can reduce the number of emitted chunks by moving shared/common modules
5543
+ * into an entry chunk that already depends on them. Rolldown only applies the
5544
+ * merge when it does not create a circular chunk dependency or change strict
5545
+ * entry export signatures. This pass also covers safe empty-facade cleanup.
5546
+ *
5547
+ * @default true
5548
+ */
5549
+ mergeCommonChunks?: boolean;
5550
+ /**
5551
+ * Avoid emitting redundant chunk loads for dynamic entries.
5552
+ *
5553
+ * This pass can reduce dynamic-entry dependent chunks when the shared modules
5554
+ * are guaranteed to be loaded by every importer of that dynamic entry.
5555
+ *
5556
+ * @default true
5557
+ */
5558
+ avoidRedundantChunkLoads?: boolean;
5559
+ }
5511
5560
  type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset" | "copy">;
5512
5561
  interface WatcherFileWatcherOptions {
5513
5562
  /**
@@ -6111,18 +6160,18 @@ interface InputOptions {
6111
6160
  */
6112
6161
  nativeMagicString?: boolean;
6113
6162
  /**
6114
- * Control whether to optimize chunks by allowing entry chunks to have different exports than the underlying entry module.
6115
- * This optimization can reduce the number of generated chunks.
6163
+ * Control chunk optimizations.
6116
6164
  *
6117
- * When enabled, rolldown will try to insert common modules directly into existing chunks rather than creating
6118
- * separate chunks for them, which can result in fewer output files and better performance.
6165
+ * `true` enables both common-chunk merging and redundant dynamic chunk-load avoidance.
6166
+ * `false` disables all chunk optimizations. Use the object form to control
6167
+ * `mergeCommonChunks` and `avoidRedundantChunkLoads` separately.
6119
6168
  *
6120
- * This optimization is automatically disabled when any module uses top-level await (TLA) or contains TLA dependencies,
6121
- * as it could affect execution order guarantees.
6169
+ * These optimizations are automatically disabled when any module uses top-level await (TLA) or contains TLA dependencies,
6170
+ * as they could affect execution order guarantees.
6122
6171
  *
6123
6172
  * @default true
6124
6173
  */
6125
- chunkOptimization?: boolean;
6174
+ chunkOptimization?: boolean | ChunkOptimizationOptions;
6126
6175
  /**
6127
6176
  * Control whether to enable lazy barrel optimization.
6128
6177
  *
@@ -6177,6 +6226,11 @@ interface InputOptions {
6177
6226
  makeAbsoluteExternalsRelative?: MakeAbsoluteExternalsRelative;
6178
6227
  /**
6179
6228
  * Devtools integration options.
6229
+ *
6230
+ * When enabled, Rolldown writes JSON-lines devtools output under
6231
+ * `node_modules/.rolldown/{session_id}/`. Consumers can parse the output with
6232
+ * `@rolldown/debug` after `await bundle.close()` resolves.
6233
+ *
6180
6234
  * @experimental
6181
6235
  */
6182
6236
  devtools?: {
@@ -6228,7 +6282,7 @@ interface RolldownOptions extends InputOptions {
6228
6282
  * @category Config
6229
6283
  */
6230
6284
  //#endregion
6231
- //#region ../../node_modules/.bun/rolldown@1.0.0/node_modules/rolldown/dist/shared/transform-DgZ3paSD.d.mts
6285
+ //#region ../../node_modules/.bun/rolldown@1.0.2/node_modules/rolldown/dist/shared/transform-BpeSEA-X.d.mts
6232
6286
  //#endregion
6233
6287
  //#region src/utils/transform.d.ts
6234
6288
  /**
@@ -6243,34 +6297,13 @@ interface TransformOptions$1 extends BindingEnhancedTransformOptions {}
6243
6297
  * @category Utilities
6244
6298
  */
6245
6299
  //#endregion
6246
- //#region ../../node_modules/.bun/esbuild@0.27.7/node_modules/esbuild/lib/main.d.ts
6247
- // Note: These declarations exist to avoid type errors when you omit "dom" from
6248
- // "lib" in your "tsconfig.json" file. TypeScript confusingly declares the
6249
- // global "WebAssembly" type in "lib.dom.d.ts" even though it has nothing to do
6250
- // with the browser DOM and is present in many non-browser JavaScript runtimes
6251
- // (e.g. node and deno). Declaring it here allows esbuild's API to be used in
6252
- // these scenarios.
6253
- //
6254
- // There's an open issue about getting this problem corrected (although these
6255
- // declarations will need to remain even if this is fixed for backward
6256
- // compatibility with older TypeScript versions):
6257
- //
6258
- // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826
6259
- //
6260
- declare global {
6261
- namespace WebAssembly {
6262
- interface Module {}
6263
- }
6264
- interface URL {}
6265
- }
6266
- //#endregion
6267
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/internal/esbuildOptions.d.ts
6300
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/internal/esbuildOptions.d.ts
6268
6301
  /* eslint-enable @typescript-eslint/ban-ts-comment */
6269
6302
  type EsbuildTarget = string | string[];
6270
6303
  type EsbuildTransformOptions = esbuild.TransformOptions;
6271
6304
  type DepsOptimizerEsbuildOptions = Omit<esbuild.BuildOptions, 'bundle' | 'entryPoints' | 'external' | 'write' | 'watch' | 'outdir' | 'outfile' | 'outbase' | 'outExtension' | 'metafile'>;
6272
6305
  //#endregion
6273
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/metadata.d.ts
6306
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/metadata.d.ts
6274
6307
  interface AssetMetadata {
6275
6308
  importedAssets: Set<string>;
6276
6309
  importedCss: Set<string>;
@@ -6313,16 +6346,16 @@ declare module 'rolldown' {
6313
6346
  }
6314
6347
  }
6315
6348
  //#endregion
6316
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/internal/terserOptions.d.ts
6349
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/internal/terserOptions.d.ts
6317
6350
  /* eslint-enable @typescript-eslint/ban-ts-comment */
6318
6351
  type TerserMinifyOptions = Terser.MinifyOptions;
6319
6352
  //#endregion
6320
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/internal/lightningcssOptions.d.ts
6353
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/internal/lightningcssOptions.d.ts
6321
6354
  /* eslint-enable @typescript-eslint/ban-ts-comment */
6322
6355
  type LightningCSSOptions = Omit<Lightningcss.BundleAsyncOptions<Lightningcss.CustomAtRules>, 'filename' | 'resolver' | 'minify' | 'sourceMap' | 'analyzeDependencies' // properties not overridden by Vite, but does not make sense to set by end users
6323
6356
  | 'inputSourceMap' | 'projectRoot'>;
6324
6357
  //#endregion
6325
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts
6358
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts
6326
6359
  /* eslint-enable @typescript-eslint/ban-ts-comment */
6327
6360
  // https://github.com/type-challenges/type-challenges/issues/29285
6328
6361
  type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
@@ -6341,7 +6374,7 @@ declare global {
6341
6374
  interface HTMLLinkElement {}
6342
6375
  }
6343
6376
  //#endregion
6344
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/types/importGlob.d.ts
6377
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/types/importGlob.d.ts
6345
6378
  /**
6346
6379
  * Declare Worker in case DOM is not added to the tsconfig lib causing
6347
6380
  * Worker interface is not defined. For developers with DOM lib added,
@@ -6352,10 +6385,10 @@ declare global {
6352
6385
  interface Worker {}
6353
6386
  }
6354
6387
  //#endregion
6355
- //#region ../../node_modules/.bun/vite@8.0.12+9357385a17cbd143/node_modules/vite/dist/node/index.d.ts
6388
+ //#region ../../node_modules/.bun/vite@8.0.14+1472ca47ea14e560/node_modules/vite/dist/node/index.d.ts
6356
6389
  //#region \0rolldown/runtime.js
6357
6390
  //#endregion
6358
- //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.21_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
6391
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.24_typescript@6.0.3_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
6359
6392
  //#region src/node/cli-commands.d.ts
6360
6393
  interface StartOptions {
6361
6394
  root?: string;
@@ -6364,7 +6397,7 @@ interface StartOptions {
6364
6397
  port?: string | number;
6365
6398
  open?: boolean;
6366
6399
  } //#endregion
6367
- //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.21_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
6400
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.24_typescript@6.0.3_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
6368
6401
  //#region src/node/config.d.ts
6369
6402
  interface DevToolsConfig extends Partial<StartOptions> {
6370
6403
  enabled: boolean;
@@ -9506,6 +9539,17 @@ interface SharedEnvironmentOptions {
9506
9539
  * Optimize deps config
9507
9540
  */
9508
9541
  optimizeDeps?: DepOptimizationOptions;
9542
+ /**
9543
+ * Whether this environment produces a bundled output.
9544
+ *
9545
+ * During `build`, this defaults to `true` for every environment.
9546
+ * During `serve`, this defaults to `true` only for the client environment
9547
+ * when `experimental.bundledDev` is enabled, and `false` otherwise.
9548
+ * Setting this explicitly on an environment always overrides the default.
9549
+ *
9550
+ * @experimental
9551
+ */
9552
+ isBundled?: boolean;
9509
9553
  }
9510
9554
  interface EnvironmentOptions extends SharedEnvironmentOptions {
9511
9555
  /**
@@ -9526,6 +9570,7 @@ type ResolvedEnvironmentOptions = {
9526
9570
  optimizeDeps: DepOptimizationOptions;
9527
9571
  dev: ResolvedDevEnvironmentOptions;
9528
9572
  build: ResolvedBuildEnvironmentOptions;
9573
+ isBundled: boolean;
9529
9574
  plugins: readonly Plugin[];
9530
9575
  };
9531
9576
  type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve" | "keepProcessEnv"> & {
@@ -9750,7 +9795,11 @@ interface ExperimentalOptions {
9750
9795
  */
9751
9796
  hmrPartialAccept?: boolean;
9752
9797
  /**
9753
- * Enable full bundle mode.
9798
+ * Enable full bundle mode during `serve`.
9799
+ *
9800
+ * This seeds the default for the client environment's `isBundled` option.
9801
+ * Other environments default to `false` during `serve`. Any environment
9802
+ * can override its `isBundled` value via `environments[name].isBundled`.
9754
9803
  *
9755
9804
  * This is highly experimental.
9756
9805
  *
@@ -9810,8 +9859,7 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
9810
9859
  publicDir: string;
9811
9860
  cacheDir: string;
9812
9861
  command: "build" | "serve";
9813
- mode: string; /** `true` when build or full-bundle mode dev */
9814
- isBundled: boolean;
9862
+ mode: string;
9815
9863
  isWorker: boolean;
9816
9864
  isProduction: boolean;
9817
9865
  envDir: string | false;
package/dist/vite.js CHANGED
@@ -59,7 +59,15 @@ function sortEntries(entries) {
59
59
  function chainForFile(pagesDir, file, all, sentinel) {
60
60
  const relDir = relative(pagesDir, dirname(file));
61
61
  const parts = relDir === "" ? [] : relDir.split("/");
62
- return [pagesDir, ...parts.map((_, i) => join(pagesDir, ...parts.slice(0, i + 1)))].map((dir) => join(dir, sentinel)).filter((candidate) => all.has(candidate));
62
+ const dirs = [pagesDir, ...parts.map((_, i) => join(pagesDir, ...parts.slice(0, i + 1)))];
63
+ const candidatesFor = (dir) => {
64
+ const tsx = `${join(dir, sentinel)}.tsx`;
65
+ if (all.has(tsx)) return [tsx];
66
+ const ts = `${join(dir, sentinel)}.ts`;
67
+ if (all.has(ts)) return [ts];
68
+ return [];
69
+ };
70
+ return dirs.flatMap(candidatesFor);
63
71
  }
64
72
  const MAX_SCAN_DEPTH = 20;
65
73
  async function collectFiles(dir, depth = 0) {
@@ -90,8 +98,8 @@ async function scanPages(pagesDir) {
90
98
  };
91
99
  return Promise.all(pages.map(async (file) => {
92
100
  const pattern = fileToPattern(pagesDir, file);
93
- const layouts = chainForFile(pagesDir, file, allSet, "+layout.ts");
94
- const errors = chainForFile(pagesDir, file, allSet, "+error.ts");
101
+ const layouts = chainForFile(pagesDir, file, allSet, "+layout");
102
+ const errors = chainForFile(pagesDir, file, allSet, "+error");
95
103
  const [pageHasLoader, ...layoutFlags] = await Promise.all([hasLoaderExport(file), ...layouts.map(getLayoutHasLoader)]);
96
104
  const loaderLayouts = layouts.filter((_, i) => layoutFlags[i]);
97
105
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilha/router",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "A tiny SPA router for Ilha",
5
5
  "license": "MIT",
6
6
  "author": "Ryuz <ryuzer@proton.me>",
@@ -30,10 +30,10 @@
30
30
  "test": "bun test"
31
31
  },
32
32
  "dependencies": {
33
- "ilha": "0.5.0",
33
+ "ilha": "0.6.0",
34
34
  "rou3": "0.8.1"
35
35
  },
36
36
  "devDependencies": {
37
- "vite": "^8.0.12"
37
+ "vite": "^8.0.14"
38
38
  }
39
39
  }