@ilha/router 0.6.0 → 0.6.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.
@@ -207,21 +207,17 @@ function buildClientFile(entries, clientFile, opts) {
207
207
  return r.startsWith(".") ? r : `./${r}`;
208
208
  };
209
209
  const clientImport = (abs) => `${rel(abs)}?client`;
210
- const imports = isStatic ? [`import { router as _router } from "@ilha/router";`, `import type { Island } from "ilha";`] : [`import { router, wrapLayout, wrapError } from "@ilha/router";`, `import type { Island } from "ilha";`];
210
+ const imports = isStatic ? [`import { router as _router, wrapLayout, wrapError } from "@ilha/router";`, `import type { Island } from "ilha";`] : [`import { router, wrapLayout, wrapError } from "@ilha/router";`, `import type { Island } from "ilha";`];
211
211
  const wrappedIslandLines = [];
212
212
  const registryLines = [];
213
213
  const routeLines = [];
214
214
  for (const [i, entry] of entries.entries()) {
215
215
  imports.push(`import { default as _page${i} } from ${JSON.stringify(clientImport(entry.file))};`);
216
- if (!isStatic) {
217
- for (const [j, l] of entry.layouts.entries()) imports.push(`import { default as _layout${i}_${j} } from ${JSON.stringify(clientImport(l))};`);
218
- for (const [j, e] of entry.errors.entries()) imports.push(`import { default as _error${i}_${j} } from ${JSON.stringify(clientImport(e))};`);
219
- }
216
+ for (const [j, l] of entry.layouts.entries()) imports.push(`import { default as _layout${i}_${j} } from ${JSON.stringify(clientImport(l))};`);
217
+ for (const [j, e] of entry.errors.entries()) imports.push(`import { default as _error${i}_${j} } from ${JSON.stringify(clientImport(e))};`);
220
218
  let expr = `_page${i}`;
221
- if (!isStatic) {
222
- for (let j = entry.errors.length - 1; j >= 0; j--) expr = `wrapError(_error${i}_${j}, ${expr})`;
223
- for (let j = entry.layouts.length - 1; j >= 0; j--) expr = `wrapLayout(_layout${i}_${j}, ${expr})`;
224
- }
219
+ for (let j = entry.errors.length - 1; j >= 0; j--) expr = `wrapError(_error${i}_${j}, ${expr})`;
220
+ for (let j = entry.layouts.length - 1; j >= 0; j--) expr = `wrapLayout(_layout${i}_${j}, ${expr})`;
225
221
  const wrappedId = `_wrapped${i}`;
226
222
  wrappedIslandLines.push(`const ${wrappedId} = ${expr};`);
227
223
  registryLines.push(` ${JSON.stringify(entry.name)}: ${wrappedId}` + (i < entries.length - 1 ? "," : ""));
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as wrapError, w as wrapLayout } from "./src-BP38YTMC.js";
2
- import { t as ilhaPages } from "./plugin-CJBtP3fl.js";
2
+ import { t as ilhaPages } from "./plugin-Cq0xpVL8.js";
3
3
  //#region src/rolldown.ts
4
4
  /** Rolldown plugin — use via `@ilha/router/rolldown`. */
5
5
  function pages(options = {}) {
package/dist/rspack.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as wrapError, w as wrapLayout } from "./src-BP38YTMC.js";
2
- import { t as ilhaPages } from "./plugin-CJBtP3fl.js";
2
+ import { t as ilhaPages } from "./plugin-Cq0xpVL8.js";
3
3
  //#region src/rspack.ts
4
4
  /** Rspack plugin — use via `@ilha/router/rspack`. */
5
5
  function pages(options = {}) {
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as wrapError, w as wrapLayout } from "./src-BP38YTMC.js";
2
- import { t as ilhaPages } from "./plugin-CJBtP3fl.js";
2
+ import { t as ilhaPages } from "./plugin-Cq0xpVL8.js";
3
3
  //#region src/vite.ts
4
4
  /** Vite plugin — use via `@ilha/router/vite`. */
5
5
  function pages(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilha/router",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "A tiny SPA router for Ilha",
5
5
  "license": "MIT",
6
6
  "author": "Ryuz <ryuzer@proton.me>",