@netrojs/fnetro 0.1.4 → 0.1.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 MD Ashikur Rahman
3
+ Copyright (c) 2026 Netro Solutions
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1191,4 +1191,4 @@ await serve({ app: fnetro, port: 3000, runtime: 'bun' })
1191
1191
 
1192
1192
  ## License
1193
1193
 
1194
- MIT © [MD Ashikur Rahman](https://github.com/netrosolutions)
1194
+ MIT © [Netro Solutions](https://github.com/netrosolutions)
package/dist/server.js CHANGED
@@ -630,13 +630,24 @@ function fnetroVitePlugin(opts = {}) {
630
630
  serverExternal = []
631
631
  } = opts;
632
632
  let isServerBuild = true;
633
- const sharedEsbuild = {
633
+ const jsxTransform = {
634
634
  jsx: "automatic",
635
635
  jsxImportSource: "hono/jsx"
636
636
  };
637
637
  const jsxPlugin = {
638
638
  name: "fnetro:jsx",
639
- config: () => ({ esbuild: sharedEsbuild })
639
+ config: () => ({
640
+ // Vite ≤7 (esbuild transform)
641
+ esbuild: jsxTransform,
642
+ // Vite 8+ (oxc / rolldown transform) — jsx property uses JsxOptions object shape
643
+ oxc: {
644
+ jsx: {
645
+ runtime: "automatic",
646
+ importSource: "hono/jsx"
647
+ }
648
+ }
649
+ // `as any` because JsxOptions typing varies across Vite 8 patch releases
650
+ })
640
651
  };
641
652
  const serverPlugin = {
642
653
  name: "fnetro:server",
@@ -657,7 +668,8 @@ function fnetroVitePlugin(opts = {}) {
657
668
  external: (id) => NODE_BUILTINS.test(id) || id === "@hono/node-server" || serverExternal.includes(id)
658
669
  }
659
670
  },
660
- esbuild: sharedEsbuild
671
+ // Vite ≤7 fallback (oxc is set by jsxPlugin for Vite 8+)
672
+ esbuild: jsxTransform
661
673
  };
662
674
  },
663
675
  async closeBundle() {
@@ -665,7 +677,8 @@ function fnetroVitePlugin(opts = {}) {
665
677
  const { build } = await import("vite");
666
678
  await build({
667
679
  configFile: false,
668
- esbuild: sharedEsbuild,
680
+ // Vite ≤7 fallback (oxc is set by jsxPlugin for Vite 8+)
681
+ esbuild: jsxTransform,
669
682
  build: {
670
683
  outDir: clientOutDir,
671
684
  lib: {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@netrojs/fnetro",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Full-stack Hono framework — SSR, SPA, Vue-like reactivity, route groups, middleware and API routes",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "author": "MD Ashikur Rahman<info@netrosolutions.com>",
7
+ "author": "Netro Solutions<info@netrosolutions.com>",
8
8
  "homepage": "https://github.com/netrosolutions/fnetro",
9
9
  "repository": {
10
10
  "type": "git",
package/server.ts CHANGED
@@ -329,15 +329,31 @@ export function fnetroVitePlugin(opts: FNetroPluginOptions = {}): Plugin[] {
329
329
 
330
330
  let isServerBuild = true // first pass = server
331
331
 
332
- const sharedEsbuild = {
332
+ // JSX transform options.
333
+ // Vite 8 deprecated the `esbuild` transform option in favour of `oxc`.
334
+ // We set both so the plugin works with Vite 5 / 6 / 7 (esbuild) and Vite 8+ (oxc).
335
+ const jsxTransform = {
333
336
  jsx: 'automatic' as const,
334
337
  jsxImportSource: 'hono/jsx',
335
338
  }
336
339
 
337
- // Common JSX transform for all .tsx files
340
+ // Common JSX transform plugin applied to every build (server + client + dev).
341
+ // Vite ≤7 uses esbuild; Vite 8+ uses oxc (rolldown-based). We configure both.
342
+ // OxcOptions.jsx is NOT the same shape as esbuild's — it takes { runtime, importSource }
343
+ // instead of the string 'automatic'. Using the wrong shape emits a deprecation warning.
338
344
  const jsxPlugin: Plugin = {
339
345
  name: 'fnetro:jsx',
340
- config: () => ({ esbuild: sharedEsbuild }),
346
+ config: () => ({
347
+ // Vite ≤7 (esbuild transform)
348
+ esbuild: jsxTransform,
349
+ // Vite 8+ (oxc / rolldown transform) — jsx property uses JsxOptions object shape
350
+ oxc: {
351
+ jsx: {
352
+ runtime: 'automatic',
353
+ importSource: 'hono/jsx',
354
+ },
355
+ } as any, // `as any` because JsxOptions typing varies across Vite 8 patch releases
356
+ }),
341
357
  }
342
358
 
343
359
  // Server build plugin
@@ -366,7 +382,8 @@ export function fnetroVitePlugin(opts: FNetroPluginOptions = {}): Plugin[] {
366
382
  serverExternal.includes(id),
367
383
  },
368
384
  },
369
- esbuild: sharedEsbuild,
385
+ // Vite ≤7 fallback (oxc is set by jsxPlugin for Vite 8+)
386
+ esbuild: jsxTransform,
370
387
  }
371
388
  },
372
389
 
@@ -376,7 +393,8 @@ export function fnetroVitePlugin(opts: FNetroPluginOptions = {}): Plugin[] {
376
393
  const { build } = await import('vite')
377
394
  await build({
378
395
  configFile: false,
379
- esbuild: sharedEsbuild,
396
+ // Vite ≤7 fallback (oxc is set by jsxPlugin for Vite 8+)
397
+ esbuild: jsxTransform,
380
398
  build: {
381
399
  outDir: clientOutDir,
382
400
  lib: {
@@ -412,4 +430,4 @@ export type {
412
430
  AppConfig, PageDef, GroupDef, LayoutDef, ApiRouteDef, MiddlewareDef,
413
431
  Ref, ComputedRef, WritableComputedRef, WatchSource, WatchOptions,
414
432
  LoaderCtx, FNetroMiddleware, AnyJSX,
415
- } from './core'
433
+ } from './core'